@@ -9,6 +9,7 @@ import { | |||||
import * as React from "react"; | import * as React from "react"; | ||||
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 * as DateUtils from "utils/DateUtils"; | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | ||||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
@@ -89,7 +90,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||||
</Grid> | </Grid> | ||||
<Grid item xs={6} md={5} sx={{ml:5, textAlign: "left" }}> | <Grid item xs={6} md={5} sx={{ml:5, textAlign: "left" }}> | ||||
<FormLabel sx={{ color: "#000000" }}> | <FormLabel sx={{ color: "#000000" }}> | ||||
{data.transDateStr + " (DD/MM/YYYY)"} | |||||
{DateUtils.dateFormat(data.transDateStr, intl.formatMessage({id: "dateStrFormat"})) +" ("+intl.formatMessage({id: "dateStrFormat"})+")"} | |||||
</FormLabel> | </FormLabel> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -77,7 +77,7 @@ const Index = () => { | |||||
if (!responseData.data?.id) { | if (!responseData.data?.id) { | ||||
navigate("/paymentPage/search"); | navigate("/paymentPage/search"); | ||||
} | } | ||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | ||||
setItemList(responseData.paymentItemList) | setItemList(responseData.paymentItemList) | ||||
setRecord(responseData.data); | setRecord(responseData.data); | ||||
@@ -9,6 +9,7 @@ import { | |||||
import * as React from "react"; | import * as React from "react"; | ||||
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 * as DateUtils from "utils/DateUtils"; | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | ||||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
@@ -24,30 +25,56 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (formData != null && formData != undefined && Object.keys(formData).length > 0) { | if (formData != null && formData != undefined && Object.keys(formData).length > 0) { | ||||
console.log(formData) | |||||
// console.log(formData) | |||||
setData(formData); | setData(formData); | ||||
} | } | ||||
}, [formData]); | }, [formData]); | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (data != null && data != undefined && Object.keys(data).length > 0) { | if (data != null && data != undefined && Object.keys(data).length > 0) { | ||||
console.log(data) | |||||
// console.log(data) | |||||
setOnReady(data != {}); | setOnReady(data != {}); | ||||
} | } | ||||
}, [data]); | }, [data]); | ||||
const getPaymentMethod=()=>{ | const getPaymentMethod=()=>{ | ||||
let paymentmethod = "" | let paymentmethod = "" | ||||
// console.log(locale) | |||||
if (data?.payload!=null) { | if (data?.payload!=null) { | ||||
paymentmethod = data.payload?.paymentdetail.paymentmethod; | paymentmethod = data.payload?.paymentdetail.paymentmethod; | ||||
if("01" == paymentmethod) return "PPS"; | |||||
if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card"; | |||||
if("04" == paymentmethod) return "FPS"; | |||||
if (locale == "zh-HK"){ | |||||
if("01" == paymentmethod) return "PPS"; | |||||
if("02" == paymentmethod || "03" == paymentmethod) return "信用卡"; | |||||
if("04" == paymentmethod) return "FPS"; | |||||
} | |||||
else if (locale == "zh-CN"){ | |||||
if("01" == paymentmethod) return "PPS"; | |||||
if("02" == paymentmethod || "03" == paymentmethod) return "信用卡"; | |||||
if("04" == paymentmethod) return "FPS"; | |||||
} | |||||
else { | |||||
if("01" == paymentmethod) return "PPS"; | |||||
if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card"; | |||||
if("04" == paymentmethod) return "FPS"; | |||||
} | |||||
} else { | } else { | ||||
paymentmethod = data.payMethod; | paymentmethod = data.payMethod; | ||||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "Credit Card"; | |||||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||||
if (locale == "zh-HK"){ | |||||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "信用卡"; | |||||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||||
} | |||||
else if (locale == "zh-CN"){ | |||||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "信用卡"; | |||||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||||
} | |||||
else { | |||||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "Credit Card"; | |||||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||||
} | |||||
} | } | ||||
return paymentmethod; | return paymentmethod; | ||||
} | } | ||||
@@ -109,7 +136,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||||
</Grid> | </Grid> | ||||
<Grid item xs={6} md={6} sx={{textAlign: "left" }}> | <Grid item xs={6} md={6} sx={{textAlign: "left" }}> | ||||
<FormLabel sx={{ fontSize: "16px", color: "#000000" }}> | <FormLabel sx={{ fontSize: "16px", color: "#000000" }}> | ||||
{data.transDateStr + " (DD/MM/YYYY)"} | |||||
{DateUtils.dateFormat(data.transDateStr, intl.formatMessage({id: "dateStrFormat"})) +" ("+intl.formatMessage({id: "dateStrFormat"})+")"} | |||||
</FormLabel> | </FormLabel> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -59,9 +59,9 @@ const Index = () => { | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (Object.keys(transactionData).length > 0) { | if (Object.keys(transactionData).length > 0) { | ||||
console.log(transactionData) | |||||
console.log(itemList) | |||||
console.log(record) | |||||
// console.log(transactionData) | |||||
// console.log(itemList) | |||||
// console.log(record) | |||||
setOnReady(true); | setOnReady(true); | ||||
} | } | ||||
}, [transactionData]); | }, [transactionData]); | ||||
@@ -102,21 +102,21 @@ const Index = () => { | |||||
"paymentId": params.id | "paymentId": params.id | ||||
}, | }, | ||||
onSuccess: function(responseData2){ | onSuccess: function(responseData2){ | ||||
responseData2.data["transDateStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData2.data["transDateStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData2.data["transTimeStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "HH:mm:ss"); | responseData2.data["transTimeStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "HH:mm:ss"); | ||||
setResponeData(responseData2.transactionData) | setResponeData(responseData2.transactionData) | ||||
setItemList(responseData2.paymentItemList) | setItemList(responseData2.paymentItemList) | ||||
setRecord(responseData2.data); | setRecord(responseData2.data); | ||||
}, | }, | ||||
onError: function(){ | onError: function(){ | ||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | ||||
setResponeData(responseData) | setResponeData(responseData) | ||||
} | } | ||||
}); | }); | ||||
}else{ | }else{ | ||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | ||||
setResponeData(responseData) | setResponeData(responseData) | ||||
setItemList(responseData.paymentItemList) | setItemList(responseData.paymentItemList) | ||||
@@ -104,7 +104,7 @@ const AckPage = () => { | |||||
onSuccess: function(responseData){ | onSuccess: function(responseData){ | ||||
localStorage.removeItem("webtoken"); | localStorage.removeItem("webtoken"); | ||||
localStorage.removeItem("transactionid"); | localStorage.removeItem("transactionid"); | ||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | ||||
setResponeDataData(responseData.transactionData) | setResponeDataData(responseData.transactionData) | ||||
setItemList(responseData.paymentItemList) | setItemList(responseData.paymentItemList) | ||||
@@ -99,7 +99,7 @@ const Fpscallback = () => { | |||||
localStorage.removeItem("webtoken"); | localStorage.removeItem("webtoken"); | ||||
localStorage.removeItem("transactionid"); | localStorage.removeItem("transactionid"); | ||||
} | } | ||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | ||||
setResponeDataData(responseData.transactionData) | setResponeDataData(responseData.transactionData) | ||||
setItemList(responseData.paymentItemList) | setItemList(responseData.paymentItemList) | ||||
@@ -123,7 +123,7 @@ const Index = () => { | |||||
localStorage.removeItem("webtoken"); | localStorage.removeItem("webtoken"); | ||||
localStorage.removeItem("transactionid"); | localStorage.removeItem("transactionid"); | ||||
} | } | ||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | ||||
setResponeDataData(responseData.transactionData) | setResponeDataData(responseData.transactionData) | ||||
setItemList(responseData.paymentItemList) | setItemList(responseData.paymentItemList) | ||||
@@ -696,10 +696,10 @@ const FormPanel = ({ formData }) => { | |||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({ id: 'ok' })} | |||||
aria-label={intl.formatMessage({ id: 'close' })} | |||||
onClick={() => setIsWarningPopUp(false)} | onClick={() => setIsWarningPopUp(false)} | ||||
> | > | ||||
<FormattedMessage id="ok" /> | |||||
<FormattedMessage id="close" /> | |||||
</Button> | </Button> | ||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||
@@ -623,7 +623,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({ id: 'ok' })} | |||||
aria-label={intl.formatMessage({ id: 'close' })} | |||||
onClick={() => { | onClick={() => { | ||||
if (val.contactPerson) { | if (val.contactPerson) { | ||||
apply(val); | apply(val); | ||||
@@ -636,7 +636,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
} | } | ||||
}} | }} | ||||
> | > | ||||
<FormattedMessage id="ok" /> | |||||
<FormattedMessage id="close" /> | |||||
</Button> | </Button> | ||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||