@@ -1,19 +1,11 @@ | |||||
import React, { createContext, useState, useEffect } from 'react'; | import React, { createContext, useState, useEffect } from 'react'; | ||||
import {useNavigate} from "react-router-dom"; | import {useNavigate} from "react-router-dom"; | ||||
//import axios from "axios"; | |||||
// import {getUserData} from "auth/utils"; | |||||
// import {isObjEmpty} from "../utils/Utils"; | |||||
import {useIdleTimer} from "react-idle-timer"; | import {useIdleTimer} from "react-idle-timer"; | ||||
import { handleLogoutFunction } from 'auth/index'; | import { handleLogoutFunction } from 'auth/index'; | ||||
import { useDispatch } from "react-redux"; | import { useDispatch } from "react-redux"; | ||||
import { | import { | ||||
isUserLoggedIn, | isUserLoggedIn, | ||||
isGLDLoggedIn, | isGLDLoggedIn, | ||||
// isPrimaryLoggedIn, | |||||
// isCreditorLoggedIn, | |||||
// isINDLoggedIn, | |||||
// isORGLoggedIn, | |||||
// getUserId | |||||
} from "utils/Utils"; | } from "utils/Utils"; | ||||
const TimerContext = createContext(); | const TimerContext = createContext(); | ||||
@@ -101,6 +101,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||||
function getDataList() { | function getDataList() { | ||||
if(_doLoad.url == null) return; | if(_doLoad.url == null) return; | ||||
if(_doLoad.params == null) _doLoad.params = {}; | |||||
_doLoad.params.start = page*pageSize; | _doLoad.params.start = page*pageSize; | ||||
_doLoad.params.limit = pageSize; | _doLoad.params.limit = pageSize; | ||||
HttpUtils.get({ | HttpUtils.get({ | ||||
@@ -140,7 +141,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||||
rowsPerPage={pageSize} | rowsPerPage={pageSize} | ||||
rowsPerPageOptions={_pageSizeOptions} | rowsPerPageOptions={_pageSizeOptions} | ||||
labelDisplayedRows={() => | labelDisplayedRows={() => | ||||
`${page*pageSize+1}-${page*pageSize+(_rows?.length??0)} ${intl.formatMessage({ id: "of" })} ${rowCount}` | |||||
`${(_rows?.length?page*pageSize+1:0)}-${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,15 +1,13 @@ | |||||
// material-ui | // material-ui | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
// import { | |||||
// Button | |||||
// } from '@mui/material'; | |||||
import * as FormatUtils from "utils/FormatUtils" | import * as FormatUtils from "utils/FormatUtils" | ||||
import {GFIMIS_LIST} 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"; | ||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function SearchPublicNoticeTable({ recordList }) { | |||||
const [rows, setRows] = React.useState(recordList); | |||||
export default function SearchTable({ searchCriteria }) { | |||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const _sx = { | const _sx = { | ||||
@@ -29,8 +27,8 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
} | } | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
setRows(recordList); | |||||
}, [recordList]); | |||||
set_searchCriteria(searchCriteria); | |||||
}, [searchCriteria]); | |||||
const handleEditClick = (params) => () => { | const handleEditClick = (params) => () => { | ||||
navigate('/paymentPage/details/' + params.row.id); | navigate('/paymentPage/details/' + params.row.id); | ||||
@@ -65,10 +63,15 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
sx={_sx} | sx={_sx} | ||||
rowHeight={80} | rowHeight={80} | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={10} | customPageSize={10} | ||||
onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
doLoad={{ | |||||
url:GFIMIS_LIST, | |||||
params:_searchCriteria, | |||||
callback: function(){ | |||||
} | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -5,7 +5,7 @@ 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 {GEN_GFMIS_XML} 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"; | ||||
@@ -30,7 +30,6 @@ const BackgroundHead = { | |||||
const Index = () => { | const Index = () => { | ||||
const [record,setRecord] = React.useState([]); | |||||
const [searchCriteria, setSearchCriteria] = React.useState({ | const [searchCriteria, setSearchCriteria] = React.useState({ | ||||
dateFrom: DateUtils.dateValue(new Date()), | dateFrom: DateUtils.dateValue(new Date()), | ||||
// dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), | // dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), | ||||
@@ -39,27 +38,13 @@ const Index = () => { | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
setOnReady(true); | setOnReady(true); | ||||
}, [record]); | |||||
React.useEffect(() => { | |||||
// console.log(searchCriteria) | |||||
loadGrid(); | |||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
function loadGrid(){ | |||||
HttpUtils.get({ | |||||
url: UrlUtils.GFIMIS_LIST, | |||||
params: searchCriteria, | |||||
onSuccess: function(responseData){ | |||||
setRecord(responseData); | |||||
} | |||||
}); | |||||
} | |||||
function downloadXML(input) { | function downloadXML(input) { | ||||
// console.log(input) | // console.log(input) | ||||
HttpUtils.get({ | HttpUtils.get({ | ||||
url: UrlUtils.GEN_GFMIS_XML + "/today", | |||||
url: GEN_GFMIS_XML + "/today", | |||||
params:{ | params:{ | ||||
// dateTo: input.dateTo, | // dateTo: input.dateTo, | ||||
dateFrom: input.dateFrom, | dateFrom: input.dateFrom, | ||||
@@ -149,7 +134,7 @@ const Index = () => { | |||||
sx={{width: "-webkit-fill-available"}} | sx={{width: "-webkit-fill-available"}} | ||||
> | > | ||||
<EventTable | <EventTable | ||||
recordList={record} | |||||
searchCriteria={searchCriteria} | |||||
/> | /> | ||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -9,7 +9,7 @@ import { FiDataGrid } from "components/FiDataGrid"; | |||||
import { clickableLink } from 'utils/CommonFunction'; | import { clickableLink } from 'utils/CommonFunction'; | ||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function SearchPublicNoticeTable({ searchCriteria }) { | |||||
export default function SearchPaymentTable({ searchCriteria }) { | |||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | ||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
@@ -30,8 +30,8 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { | |||||
} | } | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
setRows(recordList); | |||||
}, [recordList]); | |||||
set_searchCriteria(searchCriteria); | |||||
}, [searchCriteria]); | |||||
const handleEditClick = (params) => () => { | const handleEditClick = (params) => () => { | ||||
navigate('/paymentPage/details/' + params.row.id); | navigate('/paymentPage/details/' + params.row.id); | ||||
@@ -5,9 +5,7 @@ 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 DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
@@ -30,7 +28,6 @@ const BackgroundHead = { | |||||
const Index = () => { | const Index = () => { | ||||
const [record,setRecord] = React.useState([]); | |||||
const [searchCriteria, setSearchCriteria] = React.useState({ | const [searchCriteria, setSearchCriteria] = React.useState({ | ||||
dateTo: DateUtils.dateValue(new Date()), | dateTo: DateUtils.dateValue(new Date()), | ||||
dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), | dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), | ||||
@@ -39,23 +36,8 @@ const Index = () => { | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
setOnReady(true); | setOnReady(true); | ||||
}, [record]); | |||||
React.useEffect(() => { | |||||
loadGrid(); | |||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
function loadGrid(){ | |||||
HttpUtils.get({ | |||||
url: UrlUtils.PAYMENT_LIST, | |||||
params: searchCriteria, | |||||
onSuccess: function(responseData){ | |||||
setRecord(responseData); | |||||
} | |||||
}); | |||||
} | |||||
function applySearch(input) { | function applySearch(input) { | ||||
setSearchCriteria(input); | setSearchCriteria(input); | ||||
} | } | ||||
@@ -93,7 +75,7 @@ const Index = () => { | |||||
sx={{width: "-webkit-fill-available"}} | sx={{width: "-webkit-fill-available"}} | ||||
> | > | ||||
<EventTable | <EventTable | ||||
recordList={record} | |||||
searchCriteria={searchCriteria} | |||||
/> | /> | ||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -9,7 +9,7 @@ import { useEffect, useState } from "react"; | |||||
import { useNavigate, useLocation } from "react-router-dom"; | import { useNavigate, useLocation } from "react-router-dom"; | ||||
// import * as FormatUtils from "utils/FormatUtils"; | // import * as FormatUtils from "utils/FormatUtils"; | ||||
// const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | // const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
import * as Utils from "auth/utils"; | |||||
import {getBowserType, local, preferpaymentmethods} from "auth/utils"; | |||||
import { | import { | ||||
Button, | Button, | ||||
@@ -80,7 +80,7 @@ const Index = () => { | |||||
localStorage.removeItem("webtoken"); | localStorage.removeItem("webtoken"); | ||||
localStorage.removeItem("transactionid"); | localStorage.removeItem("transactionid"); | ||||
localStorage.removeItem("paymentId"); | localStorage.removeItem("paymentId"); | ||||
if (Utils.getBowserType() === "PC_Browser"){ | |||||
if (getBowserType() === "PC_Browser"){ | |||||
setIsFullScreen(false) | setIsFullScreen(false) | ||||
setBrowserType(desktopBrowser) | setBrowserType(desktopBrowser) | ||||
} else { | } else { | ||||
@@ -190,12 +190,12 @@ const Index = () => { | |||||
HttpUtils.post({ | HttpUtils.post({ | ||||
url: UrlUtils.PAYMENT_AVAILABLE_PAYMENT, | url: UrlUtils.PAYMENT_AVAILABLE_PAYMENT, | ||||
params: { | params: { | ||||
"locale": locale === 'en' ?Utils.local.en:locale === 'zh-HK' ?Utils.local.zh:Utils.local.cn, | |||||
"locale": locale === 'en' ?local.en:locale === 'zh-HK' ?local.zh:local.cn, | |||||
"amount": totalAmount, | "amount": totalAmount, | ||||
// "eserviceids": [ | // "eserviceids": [ | ||||
// "<eserviceid>", "<eserviceid>" | // "<eserviceid>", "<eserviceid>" | ||||
// ], | // ], | ||||
"preferpaymentmethods": Utils.preferpaymentmethods | |||||
"preferpaymentmethods": preferpaymentmethods | |||||
}, | }, | ||||
onSuccess: (responseData) => { | onSuccess: (responseData) => { | ||||
let availableMethods = responseData.availablepaymentmethods; | let availableMethods = responseData.availablepaymentmethods; | ||||
@@ -2,13 +2,13 @@ | |||||
import { | import { | ||||
Grid, Typography, Stack | Grid, Typography, Stack | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import MainCard from "../../../components/MainCard"; | |||||
import MainCard from "components/MainCard"; | |||||
import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
//import axios from "axios"; | //import axios from "axios"; | ||||
//import {apiPath} from "../../auth/utils"; | //import {apiPath} from "../../auth/utils"; | ||||
import * as UrlUtils from "../../../utils/ApiPathConst"; | |||||
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 LoadingComponent from "../extra-pages/LoadingComponent"; | //import LoadingComponent from "../extra-pages/LoadingComponent"; | ||||
//import SearchForm from "./UserSearchForm_Organization"; | //import SearchForm from "./UserSearchForm_Organization"; | ||||