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