|
|
@@ -1,18 +1,21 @@ |
|
|
|
// material-ui |
|
|
|
import * as React from 'react'; |
|
|
|
import { |
|
|
|
Grid, |
|
|
|
Typography, |
|
|
|
Button, |
|
|
|
Box |
|
|
|
} from '@mui/material'; |
|
|
|
import * as DateUtils from "utils/DateUtils"; |
|
|
|
import * as FormatUtils from "utils/FormatUtils"; |
|
|
|
import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; |
|
|
|
import { useNavigate } from "react-router-dom"; |
|
|
|
import { FiDataGrid } from "components/FiDataGrid"; |
|
|
|
// ==============================|| EVENT TABLE ||============================== // |
|
|
|
|
|
|
|
export default function SearchPublicNoticeTable({ recordList }) { |
|
|
|
export default function SeaarchDemandNote({ recordList }) { |
|
|
|
|
|
|
|
const [rows, setRows] = React.useState(recordList); |
|
|
|
const [selectedRowItems, setSelectedRowItems] = React.useState([]); |
|
|
|
const navigate = useNavigate() |
|
|
|
|
|
|
|
React.useEffect(() => { |
|
|
@@ -23,6 +26,37 @@ export default function SearchPublicNoticeTable({ recordList }) { |
|
|
|
navigate('/application/' + params.id); |
|
|
|
}; |
|
|
|
|
|
|
|
const onDownloadClick = (params) => () => { |
|
|
|
HttpUtils.fileDownload({ |
|
|
|
fileId: params.row.fileId, |
|
|
|
skey: params.row.skey, |
|
|
|
filename: params.row.filename, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const onSendClick = ()=>{ |
|
|
|
let appIdList = []; |
|
|
|
const datas = rows?.filter((row) => |
|
|
|
selectedRowItems.includes(row.id) |
|
|
|
); |
|
|
|
for (var i = 0; i < datas?.length; i++) { |
|
|
|
appIdList.push(datas[i].appId); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const onExportClick = () => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const markPaid = ()=>{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function handleRowDoubleClick(params) { |
|
|
|
// handleEditClick(params) |
|
|
|
navigate('/application/' + params.id); |
|
|
|
} |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
@@ -34,28 +68,10 @@ export default function SearchPublicNoticeTable({ recordList }) { |
|
|
|
return <Button onClick={handleEditClick(params)}><u>{params.row.appNo}</u></Button>; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 'status', |
|
|
|
field: 'status', |
|
|
|
headerName: 'Status', |
|
|
|
width: 175, |
|
|
|
renderCell: (params) => { |
|
|
|
return [StatusUtils.getStatusEng(params)] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 'created', |
|
|
|
field: 'created', |
|
|
|
headerName: 'Submit Date', |
|
|
|
flex: 1, |
|
|
|
valueGetter: (params) => { |
|
|
|
return DateUtils.datetimeStr(params?.value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 'contactPerson', |
|
|
|
field: 'contactPerson', |
|
|
|
headerName: 'Contact Person', |
|
|
|
headerName: 'Client', |
|
|
|
flex: 2, |
|
|
|
renderCell: (params) => { |
|
|
|
let company = params.row.enCompanyName != null ? " (" + (params.row.enCompanyName) + ")" : ""; |
|
|
@@ -81,42 +97,107 @@ export default function SearchPublicNoticeTable({ recordList }) { |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 'groupNo', |
|
|
|
field: 'groupNo', |
|
|
|
headerName: 'Gazette Group', |
|
|
|
id: 'dnNo', |
|
|
|
field: 'dnNo', |
|
|
|
headerName: 'DN No.', |
|
|
|
width: 175, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
id: 'issueDate', |
|
|
|
field: 'issueDate', |
|
|
|
headerName: 'Submit Date', |
|
|
|
flex: 1, |
|
|
|
valueGetter: (params) => { |
|
|
|
return (params?.value) ? (params?.value) : ""; |
|
|
|
return DateUtils.dateStr(params?.value); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
id: 'status', |
|
|
|
field: 'status', |
|
|
|
headerName: 'Status', |
|
|
|
width: 175, |
|
|
|
renderCell: (params) => { |
|
|
|
return [StatusUtils.getStatusEng(params)] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 'issueId', |
|
|
|
field: 'issueId', |
|
|
|
headerName: 'Issue No', |
|
|
|
id: 'sentDate', |
|
|
|
field: 'sentDate', |
|
|
|
headerName: 'DN Sent Date', |
|
|
|
flex: 1, |
|
|
|
valueGetter: (params) => { |
|
|
|
return params.row.issueYear |
|
|
|
+ " Vol. " + FormatUtils.zeroPad(params.row.issueVolume, 3) |
|
|
|
+ ", No. " + FormatUtils.zeroPad(params.row.issueNo, 2) |
|
|
|
+ ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); |
|
|
|
return DateUtils.datetimeStr(params?.value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 'filename', |
|
|
|
field: 'filename', |
|
|
|
headerName: 'DN File', |
|
|
|
flex: 1, |
|
|
|
renderCell: (params) => { |
|
|
|
return <Button onClick={onDownloadClick(params)}><u>{params.row.filename}</u></Button>; |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
function handleRowDoubleClick(params) { |
|
|
|
// handleEditClick(params) |
|
|
|
navigate('/application/' + params.id); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<div style={{ height: '100%', width: '100%' }}> |
|
|
|
<Grid container maxWidth justifyContent="flex-start"> |
|
|
|
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> |
|
|
|
<Button |
|
|
|
size="large" |
|
|
|
variant="contained" |
|
|
|
onClick={onSendClick} |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end' |
|
|
|
}}> |
|
|
|
<Typography variant="h5">Send DN</Typography> |
|
|
|
</Button> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> |
|
|
|
<Button |
|
|
|
size="large" |
|
|
|
variant="contained" |
|
|
|
onClick={onExportClick} |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end' |
|
|
|
}}> |
|
|
|
<Typography variant="h5">Export</Typography> |
|
|
|
</Button> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> |
|
|
|
<Button |
|
|
|
size="large" |
|
|
|
variant="contained" |
|
|
|
onClick={markPaid} |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end' |
|
|
|
}}> |
|
|
|
<Typography variant="h5">Mark as Paid</Typography> |
|
|
|
</Button> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Box sx={{ backgroundColor: "#fff", ml: 2 }} width="98%"> |
|
|
|
<FiDataGrid |
|
|
|
checkboxSelection |
|
|
|
disableRowSelectionOnClick |
|
|
|
onRowSelectionModelChange={(newSelection) => { |
|
|
|
setSelectedRowItems(newSelection); |
|
|
|
}} |
|
|
|
rows={rows} |
|
|
|
columns={columns} |
|
|
|
initialState={{ |
|
|
|
pagination: { |
|
|
|
paginationModel: { page: 0, pageSize: 5 }, |
|
|
|
paginationModel: { page: 0, pageSize: 100 }, |
|
|
|
}, |
|
|
|
}} |
|
|
|
getRowHeight={() => 'auto'} |
|
|
|