| @@ -107,10 +107,10 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
| url: _doLoad.url, | |||
| params: _doLoad.params, | |||
| onSuccess: function (responseData) { | |||
| set_rows(responseData.records); | |||
| setRowCount(responseData.count); | |||
| set_rows(responseData?.records); | |||
| setRowCount(responseData?.count); | |||
| if(_doLoad.callback != null){ | |||
| _doLoad.callback(responseData.records); | |||
| _doLoad.callback(responseData?.records); | |||
| } | |||
| } | |||
| }); | |||
| @@ -122,9 +122,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
| {...props} | |||
| rows={_rows} | |||
| columns={_columns} | |||
| paginationMode="server" | |||
| disableColumnMenu | |||
| rowModesModel={_rowModesModel} | |||
| pageSizeOptions={_pageSizeOptions} | |||
| @@ -137,12 +135,12 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
| noRowsOverlay: CustomNoRowsOverlay, | |||
| Pagination: () => ( | |||
| <TablePagination | |||
| count={rowCount?rowCount:_rows.length} | |||
| count={rowCount?rowCount:0} | |||
| page={page} | |||
| rowsPerPage={pageSize} | |||
| rowsPerPageOptions={_pageSizeOptions} | |||
| labelDisplayedRows={({count }) => | |||
| `${page*pageSize+1}-${page*pageSize+_rows.length} ${intl.formatMessage({ id: "of" })} ${count}` | |||
| labelDisplayedRows={() => | |||
| `${page*pageSize+1}-${page*pageSize+(_rows?.length??0)} ${intl.formatMessage({ id: "of" })} ${rowCount}` | |||
| } | |||
| labelRowsPerPage={intl.formatMessage({ id: "rowsPerPage" }) + ":"} | |||
| onPageChange={handleChangePage} | |||
| @@ -1,6 +1,7 @@ | |||
| // material-ui | |||
| import * as React from 'react'; | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| import {PAYMENT_LIST} from "utils/ApiPathConst"; | |||
| import * as FormatUtils from "utils/FormatUtils" | |||
| import * as PaymentStatus from "utils/statusUtils/PaymentStatus" | |||
| import { useNavigate } from "react-router-dom"; | |||
| @@ -8,8 +9,8 @@ import { FiDataGrid } from "components/FiDataGrid"; | |||
| import { clickableLink } from 'utils/CommonFunction'; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function SearchPublicNoticeTable({ recordList }) { | |||
| const [rows, setRows] = React.useState(recordList); | |||
| export default function SearchPublicNoticeTable({ searchCriteria }) { | |||
| const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||
| const navigate = useNavigate() | |||
| const _sx = { | |||
| @@ -92,10 +93,15 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
| <FiDataGrid | |||
| sx={_sx} | |||
| rowHeight={80} | |||
| rows={rows} | |||
| columns={columns} | |||
| customPageSize={5} | |||
| onRowDoubleClick={handleEditClick} | |||
| doLoad={{ | |||
| url:PAYMENT_LIST, | |||
| params:_searchCriteria, | |||
| callback: function(){ | |||
| } | |||
| }} | |||
| /> | |||
| </div> | |||
| ); | |||
| @@ -3,18 +3,21 @@ import * as React from 'react'; | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| import * as FormatUtils from "utils/FormatUtils" | |||
| import * as ProofStatus from "utils/statusUtils/ProofStatus"; | |||
| import { LIST_PROOF } from "utils/ApiPathConst"; | |||
| import { useNavigate } from "react-router-dom"; | |||
| import { FiDataGrid } from "components/FiDataGrid"; | |||
| import { clickableLink } from 'utils/CommonFunction'; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function SearchPublicNoticeTable({ recordList }) { | |||
| const [rows, setRows] = React.useState(recordList); | |||
| export default function SearchPublicNoticeTable({searchCriteria}) { | |||
| const [_searchCriteria, set_searchCriteria] = React.useState({}); | |||
| const navigate = useNavigate() | |||
| React.useEffect(() => { | |||
| setRows(recordList); | |||
| }, [recordList]); | |||
| set_searchCriteria(searchCriteria); | |||
| }, [searchCriteria]); | |||
| const columns = [ | |||
| { | |||
| @@ -80,23 +83,6 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
| renderCell: (params) => { | |||
| let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName; | |||
| company = company != null ? company : ""; | |||
| /* | |||
| let phone = JSON.parse(params.row.contactTelNo); | |||
| let faxNo = JSON.parse(params.row.contactFaxNo); | |||
| let contact = ""; | |||
| if (phone) { | |||
| contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber | |||
| } | |||
| if (faxNo && faxNo?.faxNumber) { | |||
| if (contact != "") | |||
| contact = contact + ", " | |||
| contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber | |||
| } | |||
| */ | |||
| return (<> | |||
| {params?.value}<br />{company} | |||
| </>); | |||
| @@ -131,11 +117,14 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
| return ( | |||
| <div style={{ width: '100%' }}> | |||
| <FiDataGrid | |||
| rows={rows} | |||
| columns={columns} | |||
| customPageSize={10} | |||
| onRowDoubleClick={handleRowDoubleClick} | |||
| getRowHeight={() => 'auto'} | |||
| doLoad={{ | |||
| url: LIST_PROOF, | |||
| params: _searchCriteria, | |||
| }} | |||
| /> | |||
| </div> | |||
| ); | |||
| @@ -5,10 +5,11 @@ import { | |||
| Stack | |||
| } from '@mui/material'; | |||
| import MainCard from "components/MainCard"; | |||
| import * as UrlUtils from "utils/ApiPathConst"; | |||
| import * as React from "react"; | |||
| import * as HttpUtils from "utils/HttpUtils"; | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| import {GET_ORG_COMBO, GET_ISSUE_COMBO} from "utils/ApiPathConst"; | |||
| import Loadable from 'components/Loadable'; | |||
| const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
| @@ -29,8 +30,6 @@ const BackgroundHead = { | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const UserSearchPage_Individual = () => { | |||
| const [record, setRecord] = React.useState([]); | |||
| const [orgCombo, setOrgCombo] = React.useState([]); | |||
| const [issueCombo, setIssueCombo] = React.useState([]); | |||
| const [searchCriteria, setSearchCriteria] = React.useState({ | |||
| @@ -40,32 +39,18 @@ const UserSearchPage_Individual = () => { | |||
| const [onReady, setOnReady] = React.useState(false); | |||
| React.useEffect(() => { | |||
| getUserList(); | |||
| getOrgCombo(); | |||
| getIssueCombo(); | |||
| }, []); | |||
| React.useEffect(() => { | |||
| setOnReady(true); | |||
| }, [record]); | |||
| React.useEffect(() => { | |||
| getUserList(); | |||
| }, [searchCriteria]); | |||
| function getUserList() { | |||
| HttpUtils.get({ | |||
| url: UrlUtils.LIST_PROOF, | |||
| params: searchCriteria, | |||
| onSuccess: function (responseData) { | |||
| setRecord(responseData); | |||
| } | |||
| }); | |||
| } | |||
| function getOrgCombo() { | |||
| HttpUtils.get({ | |||
| url: UrlUtils.GET_ORG_COMBO, | |||
| url: GET_ORG_COMBO, | |||
| onSuccess: function (responseData) { | |||
| let combo = responseData; | |||
| setOrgCombo(combo); | |||
| @@ -75,7 +60,7 @@ const UserSearchPage_Individual = () => { | |||
| function getIssueCombo() { | |||
| HttpUtils.get({ | |||
| url: UrlUtils.GET_ISSUE_COMBO, | |||
| url: GET_ISSUE_COMBO, | |||
| onSuccess: function (responseData) { | |||
| let combo = responseData; | |||
| setIssueCombo(combo); | |||
| @@ -83,7 +68,6 @@ const UserSearchPage_Individual = () => { | |||
| }); | |||
| } | |||
| function applySearch(input) { | |||
| setSearchCriteria(input); | |||
| } | |||
| @@ -122,7 +106,7 @@ const UserSearchPage_Individual = () => { | |||
| sx={{backgroundColor:"#fff"}} | |||
| > | |||
| <EventTable | |||
| recordList={record} | |||
| searchCriteria={searchCriteria} | |||
| /> | |||
| </MainCard> | |||
| </Grid> | |||
| @@ -100,37 +100,11 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { | |||
| let company = params.row.enCompanyName != null ? params.row.enCompanyName : params.row.chCompanyName; | |||
| company = company != null ? company : ""; | |||
| /* | |||
| let phone = JSON.parse(params.row.contactTelNo); | |||
| let faxNo = JSON.parse(params.row.contactFaxNo); | |||
| let contact = ""; | |||
| if (phone) { | |||
| contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber | |||
| } | |||
| if (faxNo && faxNo?.faxNumber) { | |||
| if (contact != "") | |||
| contact = contact + ", " | |||
| contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber | |||
| } | |||
| */ | |||
| return (<> | |||
| {params?.value}<br />{company} | |||
| </>); | |||
| } | |||
| }, | |||
| // { | |||
| // id: 'groupNo', | |||
| // field: 'groupNo', | |||
| // headerName: 'Gazette Code', | |||
| // flex: 0.5, | |||
| // minWidth: 150, | |||
| // valueGetter: (params) => { | |||
| // return (params?.value) ? (params?.value) : ""; | |||
| // } | |||
| // }, | |||
| { | |||
| id: 'issueNoAndCode', | |||
| field: 'issueNoAndCode', | |||