From e789f1b1bc86f1ac93c5230779e66a318dbfe8cc Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 8 May 2024 15:55:13 +0800 Subject: [PATCH] update --- src/pages/Proof/Create_FromApp/ProofForm.js | 4 +- src/pages/Proof/Payment/Pay.js | 339 ++++++++---------- src/pages/Proof/Payment/Pay_Creditor.js | 127 +++---- src/pages/Proof/Payment/Pay_DN.js | 280 +++++++++++++++ src/pages/Proof/Payment/Pay_Office.js | 280 +++++++++++++++ src/pages/Proof/Payment/Pay_Online.js | 280 +++++++++++++++ src/pages/Proof/Payment/index.js | 58 ++- .../Proof/Reply_Public/ApplicationDetails.js | 12 +- src/pages/Proof/Reply_Public/ProofForm.js | 10 +- src/translations/en.json | 4 +- src/translations/zh-CN.json | 6 +- src/translations/zh-HK.json | 6 +- 12 files changed, 1102 insertions(+), 304 deletions(-) create mode 100644 src/pages/Proof/Payment/Pay_DN.js create mode 100644 src/pages/Proof/Payment/Pay_Office.js create mode 100644 src/pages/Proof/Payment/Pay_Online.js diff --git a/src/pages/Proof/Create_FromApp/ProofForm.js b/src/pages/Proof/Create_FromApp/ProofForm.js index 9516bf3..f85b983 100644 --- a/src/pages/Proof/Create_FromApp/ProofForm.js +++ b/src/pages/Proof/Create_FromApp/ProofForm.js @@ -207,7 +207,7 @@ const FormPanel = ({ formData }) => { - Deadline for proof with revison: + Deadline for online proof with revison: { - Deadline for confirm proof and payment: + Deadline for online confirm proof: import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' const BackgroundHead = { @@ -28,55 +25,20 @@ const BackgroundHead = { backgroundPosition: 'right' } -import { - // useEffect, - useState -} from "react"; import { PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME } from "../../../themes/buttonConst"; import { ThemeProvider } from "@emotion/react"; import { FormattedMessage, useIntl } from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // -const Index = () => { - const params = useParams(); +const Index = ({ record }) => { const navigate = useNavigate() - const [fee, setFee] = useState(0); - const [record, setRecord] = React.useState({}); - const [onReady, setOnReady] = React.useState(false); const [isPopUp, setIsPopUp] = useState(false); - const [paymentHoldedErrText, setPaymentHoldedErrText] = React.useState(""); - const [paymentHoldedErr, setPaymentHoldedErr] = React.useState(false); + const [paymentHoldedErrText, setPaymentHoldedErrText] = useState(""); + const [paymentHoldedErr, setPaymentHoldedErr] = useState(false); const intl = useIntl(); - React.useEffect(() => { - loadForm(); - }, []); - - React.useEffect(() => { - setOnReady(true); - }, [record]); - - - const loadForm = () => { - if (params.id > 0) { - HttpUtils.get({ - url: UrlUtils.GET_PROOF_PAY + "/" + params.id, - onSuccess: (responseData) => { - // if (!responseData.data?.id) { - // navigate("/proof/search"); - // } - setRecord(responseData.data); - setFee(responseData.data.fee); - }, - onError: () => { - - } - }); - } - } - function doPayment() { setIsPopUp(false); let appIdList = [record?.appId] @@ -93,23 +55,23 @@ const Index = () => { const latestData = {}; responseData.forEach(item => { - const { appId, timeDiff } = item; - if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) { - latestData[appId] = item; - } + const { appId, timeDiff } = item; + if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) { + latestData[appId] = item; + } }); const latestDataObjects = Object.values(latestData); - + const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); const filteredAppIds = filteredData.map(item => item.appId); - + const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); const combinedAppIdsArray = [...appIdsNotInData, ...filteredAppIds]; - + const readyToPayment = appIdList.every(appId => combinedAppIdsArray.includes(appId)); - if (readyToPayment){ - navigate('/paymentPage', { state: { amount: fee, appIdList: appIdList } }); - }else{ + if (readyToPayment) { + navigate('/paymentPage', { state: { amount: record.fee, appIdList: appIdList } }); + } else { const appIdsInData = appIdList.filter(appId => !combinedAppIdsArray.some(item => item === appId)); const HoldingApplication = latestDataObjects.filter(item => appIdsInData.includes(item.appId)); const resultString = HoldingApplication.map(item => item.appNo).join(' , '); @@ -122,156 +84,149 @@ const Index = () => { }; return ( - !onReady ? - - - + ( + + +
+ + + + + +
-
- : - ( - - -
- - - + {/*row 1*/} + + +
+ + + - -
-
- {/*row 1*/} - - -
- - - - - - -
-
- - - {DateUtils.datetimeStr(record?.proofPaymentDeadline)} - - -
-
-
- - - - : - - - - - + +
+
+ + + {DateUtils.datetimeStr(record?.proofPaymentDeadline)} + + +
+
+
+ - + + : + - - - () - - - -
-
+ + + + + + + + + + () + + +
+
-
- setIsPopUp(false)} - PaperProps={{ - sx: { - minWidth: '40vw', - maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, - maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } - } - }} - > - - - + +
+ setIsPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } + } + }} + > + + + + + + + + + (HK$): {FormatUtils.currencyFormat(record.fee)} - - - - - (HK$): {FormatUtils.currencyFormat(fee)} - - - - - - - - -
- {/*row 2*/} -
- setPaymentHoldedErr(false)} - PaperProps={{ - sx: { - minWidth: '40vw', - maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, - maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } - } - }} - > - - - - -
- - - - - -
-
- + + +
+
+ {/*row 2*/} +
+ setPaymentHoldedErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + +
+ + + + + +
+
+
- ) + ) ); diff --git a/src/pages/Proof/Payment/Pay_Creditor.js b/src/pages/Proof/Payment/Pay_Creditor.js index feb8fe1..99ed049 100644 --- a/src/pages/Proof/Payment/Pay_Creditor.js +++ b/src/pages/Proof/Payment/Pay_Creditor.js @@ -5,17 +5,10 @@ import { Stack, Button, } from '@mui/material'; -import * as UrlUtils from "utils/ApiPathConst"; -import * as React from "react"; -import * as HttpUtils from "utils/HttpUtils"; -import { useParams } from "react-router-dom"; import { useNavigate } from "react-router-dom"; -import Loadable from 'components/Loadable'; -const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); - import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' -import {FormattedMessage} from "react-intl"; +import { FormattedMessage } from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -28,101 +21,67 @@ const BackgroundHead = { // ==============================|| DASHBOARD - DEFAULT ||============================== // -const Index = () => { - const params = useParams(); +const Index = ({ record }) => { const navigate = useNavigate() - const [record, setRecord] = React.useState(); - const [onReady, setOnReady] = React.useState(false); - - React.useEffect(() => { - loadForm(); - }, []); - - React.useEffect(() => { - setOnReady(true); - }, [record]); - - - const loadForm = () => { - if (params.id > 0) { - HttpUtils.get({ - url: UrlUtils.GET_PROOF_PAY + "/" + params.id, - onSuccess: (responseData) => { - if (!responseData.data?.id) { - navigate("/proof/search"); - } - setRecord(responseData.data); - } - }); - } - } - return ( - !onReady ? - - - + ( + + +
+ + + + + +
-
- : - ( - - -
- - - + {/*row 1*/} + + +
+ + + - -
-
- {/*row 1*/} - - -
- - - - - - + -

- +

+
- - - -
-
-
+ + + +
+
- {/*row 2*/} -
+
+ {/*row 2*/} +
- ) + ) ); diff --git a/src/pages/Proof/Payment/Pay_DN.js b/src/pages/Proof/Payment/Pay_DN.js new file mode 100644 index 0000000..a01864d --- /dev/null +++ b/src/pages/Proof/Payment/Pay_DN.js @@ -0,0 +1,280 @@ +// material-ui +import { + Grid, + Typography, + Stack, + Button, + Dialog, DialogTitle, DialogContent, DialogActions +} from '@mui/material'; +import * as UrlUtils from "utils/ApiPathConst"; +import * as React from "react"; +import * as HttpUtils from "utils/HttpUtils"; +import { useParams } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; +import * as DateUtils from "utils/DateUtils" +import * as FormatUtils from "utils/FormatUtils"; + +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); + +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} + +import { + // useEffect, + useState +} from "react"; +import { PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME } from "../../../themes/buttonConst"; +import { ThemeProvider } from "@emotion/react"; +import { FormattedMessage, useIntl } from "react-intl"; +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const Index = () => { + const params = useParams(); + const navigate = useNavigate() + const [fee, setFee] = useState(0); + + const [record, setRecord] = React.useState({}); + const [onReady, setOnReady] = React.useState(false); + const [isPopUp, setIsPopUp] = useState(false); + const [paymentHoldedErrText, setPaymentHoldedErrText] = React.useState(""); + const [paymentHoldedErr, setPaymentHoldedErr] = React.useState(false); + + const intl = useIntl(); + + React.useEffect(() => { + loadForm(); + }, []); + + React.useEffect(() => { + setOnReady(true); + }, [record]); + + + const loadForm = () => { + if (params.id > 0) { + HttpUtils.get({ + url: UrlUtils.GET_PROOF_PAY + "/" + params.id, + onSuccess: (responseData) => { + // if (!responseData.data?.id) { + // navigate("/proof/search"); + // } + setRecord(responseData.data); + setFee(responseData.data.fee); + }, + onError: () => { + + } + }); + } + } + + function doPayment() { + setIsPopUp(false); + let appIdList = [record?.appId] + handlePaymentCheck(appIdList) + } + + const handlePaymentCheck = (appIdList) => { + HttpUtils.post({ + url: UrlUtils.PAYMENT_CHECK, + params: { + appIds: appIdList + }, + onSuccess: (responseData) => { + const latestData = {}; + + responseData.forEach(item => { + const { appId, timeDiff } = item; + if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) { + latestData[appId] = item; + } + }); + const latestDataObjects = Object.values(latestData); + + const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); + const filteredAppIds = filteredData.map(item => item.appId); + + const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); + const combinedAppIdsArray = [...appIdsNotInData, ...filteredAppIds]; + + const readyToPayment = appIdList.every(appId => combinedAppIdsArray.includes(appId)); + if (readyToPayment){ + navigate('/paymentPage', { state: { amount: fee, appIdList: appIdList } }); + }else{ + const appIdsInData = appIdList.filter(appId => !combinedAppIdsArray.some(item => item === appId)); + const HoldingApplication = latestDataObjects.filter(item => appIdsInData.includes(item.appId)); + const resultString = HoldingApplication.map(item => item.appNo).join(' , '); + setPaymentHoldedErrText(resultString); + // setPaymentHoldedErrText(intl.formatMessage({ id: 'MSG.paymentHolded' }, { appNo: record.appNo })); + setPaymentHoldedErr(true); + } + } + }); + }; + + return ( + !onReady ? + + + + + + : + ( + + +
+ + + + + +
+
+ {/*row 1*/} + + +
+ + + + + + +
+
+ + + {DateUtils.datetimeStr(record?.proofPaymentDeadline)} + + +
+
+
+ + + + : + + + + + + + + + + + + () + + + +
+
+
+
+ setIsPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } + } + }} + > + + + + + + + + + (HK$): {FormatUtils.currencyFormat(fee)} + + + + + + + + +
+ {/*row 2*/} +
+ setPaymentHoldedErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + +
+ + + + + +
+
+
+ + + ) + + + ); +}; + +export default Index; diff --git a/src/pages/Proof/Payment/Pay_Office.js b/src/pages/Proof/Payment/Pay_Office.js new file mode 100644 index 0000000..a01864d --- /dev/null +++ b/src/pages/Proof/Payment/Pay_Office.js @@ -0,0 +1,280 @@ +// material-ui +import { + Grid, + Typography, + Stack, + Button, + Dialog, DialogTitle, DialogContent, DialogActions +} from '@mui/material'; +import * as UrlUtils from "utils/ApiPathConst"; +import * as React from "react"; +import * as HttpUtils from "utils/HttpUtils"; +import { useParams } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; +import * as DateUtils from "utils/DateUtils" +import * as FormatUtils from "utils/FormatUtils"; + +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); + +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} + +import { + // useEffect, + useState +} from "react"; +import { PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME } from "../../../themes/buttonConst"; +import { ThemeProvider } from "@emotion/react"; +import { FormattedMessage, useIntl } from "react-intl"; +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const Index = () => { + const params = useParams(); + const navigate = useNavigate() + const [fee, setFee] = useState(0); + + const [record, setRecord] = React.useState({}); + const [onReady, setOnReady] = React.useState(false); + const [isPopUp, setIsPopUp] = useState(false); + const [paymentHoldedErrText, setPaymentHoldedErrText] = React.useState(""); + const [paymentHoldedErr, setPaymentHoldedErr] = React.useState(false); + + const intl = useIntl(); + + React.useEffect(() => { + loadForm(); + }, []); + + React.useEffect(() => { + setOnReady(true); + }, [record]); + + + const loadForm = () => { + if (params.id > 0) { + HttpUtils.get({ + url: UrlUtils.GET_PROOF_PAY + "/" + params.id, + onSuccess: (responseData) => { + // if (!responseData.data?.id) { + // navigate("/proof/search"); + // } + setRecord(responseData.data); + setFee(responseData.data.fee); + }, + onError: () => { + + } + }); + } + } + + function doPayment() { + setIsPopUp(false); + let appIdList = [record?.appId] + handlePaymentCheck(appIdList) + } + + const handlePaymentCheck = (appIdList) => { + HttpUtils.post({ + url: UrlUtils.PAYMENT_CHECK, + params: { + appIds: appIdList + }, + onSuccess: (responseData) => { + const latestData = {}; + + responseData.forEach(item => { + const { appId, timeDiff } = item; + if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) { + latestData[appId] = item; + } + }); + const latestDataObjects = Object.values(latestData); + + const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); + const filteredAppIds = filteredData.map(item => item.appId); + + const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); + const combinedAppIdsArray = [...appIdsNotInData, ...filteredAppIds]; + + const readyToPayment = appIdList.every(appId => combinedAppIdsArray.includes(appId)); + if (readyToPayment){ + navigate('/paymentPage', { state: { amount: fee, appIdList: appIdList } }); + }else{ + const appIdsInData = appIdList.filter(appId => !combinedAppIdsArray.some(item => item === appId)); + const HoldingApplication = latestDataObjects.filter(item => appIdsInData.includes(item.appId)); + const resultString = HoldingApplication.map(item => item.appNo).join(' , '); + setPaymentHoldedErrText(resultString); + // setPaymentHoldedErrText(intl.formatMessage({ id: 'MSG.paymentHolded' }, { appNo: record.appNo })); + setPaymentHoldedErr(true); + } + } + }); + }; + + return ( + !onReady ? + + + + + + : + ( + + +
+ + + + + +
+
+ {/*row 1*/} + + +
+ + + + + + +
+
+ + + {DateUtils.datetimeStr(record?.proofPaymentDeadline)} + + +
+
+
+ + + + : + + + + + + + + + + + + () + + + +
+
+
+
+ setIsPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } + } + }} + > + + + + + + + + + (HK$): {FormatUtils.currencyFormat(fee)} + + + + + + + + +
+ {/*row 2*/} +
+ setPaymentHoldedErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + +
+ + + + + +
+
+
+ + + ) + + + ); +}; + +export default Index; diff --git a/src/pages/Proof/Payment/Pay_Online.js b/src/pages/Proof/Payment/Pay_Online.js new file mode 100644 index 0000000..a01864d --- /dev/null +++ b/src/pages/Proof/Payment/Pay_Online.js @@ -0,0 +1,280 @@ +// material-ui +import { + Grid, + Typography, + Stack, + Button, + Dialog, DialogTitle, DialogContent, DialogActions +} from '@mui/material'; +import * as UrlUtils from "utils/ApiPathConst"; +import * as React from "react"; +import * as HttpUtils from "utils/HttpUtils"; +import { useParams } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; +import * as DateUtils from "utils/DateUtils" +import * as FormatUtils from "utils/FormatUtils"; + +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); + +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} + +import { + // useEffect, + useState +} from "react"; +import { PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME } from "../../../themes/buttonConst"; +import { ThemeProvider } from "@emotion/react"; +import { FormattedMessage, useIntl } from "react-intl"; +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const Index = () => { + const params = useParams(); + const navigate = useNavigate() + const [fee, setFee] = useState(0); + + const [record, setRecord] = React.useState({}); + const [onReady, setOnReady] = React.useState(false); + const [isPopUp, setIsPopUp] = useState(false); + const [paymentHoldedErrText, setPaymentHoldedErrText] = React.useState(""); + const [paymentHoldedErr, setPaymentHoldedErr] = React.useState(false); + + const intl = useIntl(); + + React.useEffect(() => { + loadForm(); + }, []); + + React.useEffect(() => { + setOnReady(true); + }, [record]); + + + const loadForm = () => { + if (params.id > 0) { + HttpUtils.get({ + url: UrlUtils.GET_PROOF_PAY + "/" + params.id, + onSuccess: (responseData) => { + // if (!responseData.data?.id) { + // navigate("/proof/search"); + // } + setRecord(responseData.data); + setFee(responseData.data.fee); + }, + onError: () => { + + } + }); + } + } + + function doPayment() { + setIsPopUp(false); + let appIdList = [record?.appId] + handlePaymentCheck(appIdList) + } + + const handlePaymentCheck = (appIdList) => { + HttpUtils.post({ + url: UrlUtils.PAYMENT_CHECK, + params: { + appIds: appIdList + }, + onSuccess: (responseData) => { + const latestData = {}; + + responseData.forEach(item => { + const { appId, timeDiff } = item; + if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) { + latestData[appId] = item; + } + }); + const latestDataObjects = Object.values(latestData); + + const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); + const filteredAppIds = filteredData.map(item => item.appId); + + const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); + const combinedAppIdsArray = [...appIdsNotInData, ...filteredAppIds]; + + const readyToPayment = appIdList.every(appId => combinedAppIdsArray.includes(appId)); + if (readyToPayment){ + navigate('/paymentPage', { state: { amount: fee, appIdList: appIdList } }); + }else{ + const appIdsInData = appIdList.filter(appId => !combinedAppIdsArray.some(item => item === appId)); + const HoldingApplication = latestDataObjects.filter(item => appIdsInData.includes(item.appId)); + const resultString = HoldingApplication.map(item => item.appNo).join(' , '); + setPaymentHoldedErrText(resultString); + // setPaymentHoldedErrText(intl.formatMessage({ id: 'MSG.paymentHolded' }, { appNo: record.appNo })); + setPaymentHoldedErr(true); + } + } + }); + }; + + return ( + !onReady ? + + + + + + : + ( + + +
+ + + + + +
+
+ {/*row 1*/} + + +
+ + + + + + +
+
+ + + {DateUtils.datetimeStr(record?.proofPaymentDeadline)} + + +
+
+
+ + + + : + + + + + + + + + + + + () + + + +
+
+
+
+ setIsPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } + } + }} + > + + + + + + + + + (HK$): {FormatUtils.currencyFormat(fee)} + + + + + + + + +
+ {/*row 2*/} +
+ setPaymentHoldedErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + +
+ + + + + +
+
+
+ + + ) + + + ); +}; + +export default Index; diff --git a/src/pages/Proof/Payment/index.js b/src/pages/Proof/Payment/index.js index 3a6168b..93107b4 100644 --- a/src/pages/Proof/Payment/index.js +++ b/src/pages/Proof/Payment/index.js @@ -1,16 +1,60 @@ -import * as React from "react"; +import { useState, useEffect, lazy } from "react"; import Loadable from 'components/Loadable'; -const Pay = Loadable(React.lazy(() => import('./Pay'))); -const Pay_Creditor = Loadable(React.lazy(() => import('./Pay_Creditor'))); +import { useParams } from "react-router-dom"; +//const Pay = Loadable(lazy(() => import('./Pay'))); +const Pay_Creditor = Loadable(lazy(() => import('./Pay_Creditor'))); +const Pay_Dn = Loadable(lazy(() => import('./Pay_DN'))); +const Pay_Office = Loadable(lazy(() => import('./Pay_Office'))); +const Pay_Online = Loadable(lazy(() => import('./Pay_Online'))); + const Index = () => { + const params = useParams(); + + const [record, setRecord] = useState(); + + useEffect(() => { + if (params.id > 0) { + HttpUtils.get({ + url: UrlUtils.GET_PROOF_PAY + "/" + params.id, + onSuccess: (responseData) => { + if (!responseData.data?.id) { + navigate("/proof/search"); + } + setRecord(responseData.data); + }, + onError: () => { + + } + }); + } + }, []); + + return ( - JSON.parse(localStorage.getItem('userData')).creditor? - - : - + record.creditor ? + + : ( + record.paymentMethod == "demandNote" ? + + : ( + record.paymentMethod == "online" ? + + : + + ) + ) ); + } export default Index; \ No newline at end of file diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index 57f99af..3507368 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -10,7 +10,7 @@ import { import { useFormik } from 'formik'; import * as React from "react"; -//import * as DateUtils from "utils/DateUtils" +import * as DateUtils from "utils/DateUtils" import * as FormatUtils from "utils/FormatUtils" import { useParams } from "react-router-dom"; import Loadable from 'components/Loadable'; @@ -23,7 +23,7 @@ const ApplicationDetailCard = ({ formData, }) => { const params = useParams(); const intl = useIntl(); - //const { locale } = intl; + const { locale } = intl; const [data, setData] = React.useState({}); //const [proofId, setProofId] = React.useState(); @@ -228,7 +228,7 @@ const ApplicationDetailCard = ({ formData, }) => { - {/* @@ -243,8 +243,8 @@ const ApplicationDetailCard = ({ formData, }) => { `${DateUtils.datetimeStr_Cht(data.reviseDeadline)} ${intl.formatMessage({ id: 'before' })}` } - */} -{/* + + @@ -259,7 +259,7 @@ const ApplicationDetailCard = ({ formData, }) => { `${DateUtils.datetimeStr_Cht(data.proofPaymentDeadline)} ${intl.formatMessage({ id: 'before' })}` } - */} + diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index e3bcca4..8c11ff1 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -283,7 +283,7 @@ const FormPanel = ({ formData }) => { { - actionValue ? + actionValue && formData.creditor==false ? @@ -319,9 +319,9 @@ const FormPanel = ({ formData }) => { @@ -353,9 +353,9 @@ const FormPanel = ({ formData }) => { diff --git a/src/translations/en.json b/src/translations/en.json index 8f2b75f..0b7bf19 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -383,8 +383,8 @@ "applicationPublishDate": "Publish Date", "pleaseCheckReminder": "Please download the following printed manuscript file and proofread it carefully", "payAnd": "Pay and ", - "commentDeadline": "Deadline for proof with revison", - "paymentDeadline": "Deadline for confirm proof and payment", + "commentDeadline": "Deadline for online proof with revison", + "paymentDeadline": "Deadline for online confirm proof", "confirmingDealine": "Deadline for Confirming Proof", "PaymentCoonpletDealine": "Deadline for Payment Completeion", "payOnline":"Pay online via this system PNSPS", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 5ca833b..40a98c2 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -38,7 +38,7 @@ "applyTickStr":"我确认上述提到的截止日期。", "confirmingDealine": "确认校对的截止日期", "PaymentCoonpletDealine": "付款截止日期", - "payOnline":"透过此系统 GPNSPS 线上支付", + "payOnline":"透过此系统 GPNSPS 网上支付", "payDn":"透过发出一般缴款单付款", "payNPGO":"在 NPGO 收款办公室付款", "paymentMeans":"付款方式", @@ -397,8 +397,8 @@ "applicationPublishDate": "刊出日期", "pleaseCheckReminder": "请下载下列印刷稿档案,并仔细校对", "payAnd": "缴费及", - "commentDeadline": "返稿最后限期", - "paymentDeadline": "确定付印及缴费最后限期", + "commentDeadline": "网上返稿最后限期", + "paymentDeadline": "网上确定付印最后限期", "before": "前", "page": "页", "proofReplyDate": "校对回复日期", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 1b383bf..437492f 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -38,7 +38,7 @@ "applyTickStr":"我確認上述提到的日期。", "confirmingDealine": "確認校對的截止日期", "PaymentCoonpletDealine": "付款截止日期", - "payOnline":"透過此系統 GPNSPS 線上支付", + "payOnline":"透過此系統 GPNSPS 網上支付", "payDn":"透過發出一般繳款單付款", "payNPGO":"在 NPGO 收款辦公室付款", "paymentMeans":"付款方式", @@ -400,8 +400,8 @@ "applicationPublishDate": "刊出日期", "pleaseCheckReminder": "請下載下列印刷稿檔案,並仔細校對", "payAnd": "繳費及", - "commentDeadline": "返稿最後限期", - "paymentDeadline": "確定付印及繳費最後限期", + "commentDeadline": "網上返稿最後限期", + "paymentDeadline": "網上確定付印最後限期", "before": "前", "page": "頁", "proofReplyDate": "校對回覆日期",
{ - set_paymentMethod("dn") + set_paymentMethod("demandNote") }} />
{ - set_paymentMethod("npgo") + set_paymentMethod("office") }} />