diff --git a/src/pages/DemandNote/Search/DataGrid.js b/src/pages/DemandNote/Search/DataGrid.js index d0bd26d..6c31900 100644 --- a/src/pages/DemandNote/Search/DataGrid.js +++ b/src/pages/DemandNote/Search/DataGrid.js @@ -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 ; }, }, - { - 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 ; + }, + }, ]; - function handleRowDoubleClick(params) { - // handleEditClick(params) - navigate('/application/' + params.id); - } + return (
+ + + + + + + + + + + + + { + setSelectedRowItems(newSelection); + }} rows={rows} columns={columns} initialState={{ pagination: { - paginationModel: { page: 0, pageSize: 5 }, + paginationModel: { page: 0, pageSize: 100 }, }, }} getRowHeight={() => 'auto'} diff --git a/src/pages/DemandNote/Search/SearchForm.js b/src/pages/DemandNote/Search/SearchForm.js index 76f25ad..1ce63fe 100644 --- a/src/pages/DemandNote/Search/SearchForm.js +++ b/src/pages/DemandNote/Search/SearchForm.js @@ -46,7 +46,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue dnNo: data.dnNo, dateFrom: data.dateFrom, dateTo: data.dateTo, - status: (data.status === '' || data.status.includes("all")) ? "" : data.status, + status: (data.status === '' || data.status.includes("all")) ? "" : data.status, }; applySearch(temp); }; @@ -258,6 +258,19 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue {/*last row*/} + + + +