diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index 12fda75..57f99af 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -10,20 +10,20 @@ 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'; const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; import FileList from "components/FileList" -import {FormattedMessage, useIntl} from "react-intl"; +import { FormattedMessage, useIntl } from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // 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(); @@ -68,7 +68,7 @@ const ApplicationDetailCard = ({ formData, }) => { content={false} > - +
@@ -80,7 +80,7 @@ const ApplicationDetailCard = ({ formData, }) => { - : + : @@ -89,12 +89,12 @@ const ApplicationDetailCard = ({ formData, }) => { - + - : + : @@ -113,7 +113,7 @@ const ApplicationDetailCard = ({ formData, }) => { - : + : @@ -128,12 +128,12 @@ const ApplicationDetailCard = ({ formData, }) => { - + - : + : @@ -150,7 +150,7 @@ const ApplicationDetailCard = ({ formData, }) => { - : + : @@ -160,7 +160,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + @@ -182,7 +182,7 @@ const ApplicationDetailCard = ({ formData, }) => { - : + : @@ -196,20 +196,20 @@ const ApplicationDetailCard = ({ formData, }) => { - + - + - + { - - {/* - - */} +   {locale === 'en' ? - `${intl.formatMessage({id: 'before'})} ${DateUtils.datetimeStr(data.reviseDeadline)} ` - : - `${DateUtils.datetimeStr_Cht(data.reviseDeadline)} ${intl.formatMessage({id: 'before'})}` - } + `${intl.formatMessage({ id: 'before' })} ${DateUtils.datetimeStr(data.reviseDeadline)} ` + : + `${DateUtils.datetimeStr_Cht(data.reviseDeadline)} ${intl.formatMessage({ id: 'before' })}` + } - - + */} +{/* @@ -256,17 +254,17 @@ const ApplicationDetailCard = ({ formData, }) => {   {locale === 'en' ? - `${intl.formatMessage({id: 'before'})} ${DateUtils.datetimeStr(data.proofPaymentDeadline)} ` - : - `${DateUtils.datetimeStr_Cht(data.proofPaymentDeadline)} ${intl.formatMessage({id: 'before'})}` - } + `${intl.formatMessage({ id: 'before' })} ${DateUtils.datetimeStr(data.proofPaymentDeadline)} ` + : + `${DateUtils.datetimeStr_Cht(data.proofPaymentDeadline)} ${intl.formatMessage({ id: 'before' })}` + } - + */} - : + : @@ -276,17 +274,16 @@ const ApplicationDetailCard = ({ formData, }) => { { formik.values.groupType === "Private Bill" ? - ( {data.noOfPages} {intl.formatMessage({id: 'page'})} x $6,552 ) + ( {data.noOfPages} {intl.formatMessage({ id: 'page' })} x $6,552 ) : ( {data.length} cm x {data.colCount === 2 ? - "$364 "+intl.formatMessage({id: 'doubleCol'}) : - "$182 "+intl.formatMessage({id: 'singleCol'})} ) + "$364 " + intl.formatMessage({ id: 'doubleCol' }) : + "$182 " + intl.formatMessage({ id: 'singleCol' })} ) } - diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index d160ccf..96f34b6 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -7,6 +7,7 @@ import { TextField, FormLabel, Button, + Checkbox, RadioGroup, Radio, FormControlLabel } from '@mui/material'; @@ -25,6 +26,7 @@ import { notifyActionSuccess } from 'utils/CommonFunction'; import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; import { ThemeProvider } from "@emotion/react"; import { FormattedMessage, useIntl } from "react-intl"; + const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); //import * as ProofStatus from "utils/statusUtils/ProofStatus"; @@ -35,6 +37,7 @@ const FormPanel = ({ formData }) => { const intl = useIntl(); const { locale } = intl; const [data, setData] = React.useState({}); + const [paymentMethod, set_paymentMethod] = React.useState(""); const [attachments, setAttachments] = React.useState([]); const [actionValue, setActionValue] = React.useState(true); @@ -45,6 +48,13 @@ const FormPanel = ({ formData }) => { const navigate = useNavigate() const params = useParams(); + const tabelStyle = { + border: "2px solid gray", + borderCollapse: "collapse", + padding: "right" + } + + React.useEffect(() => { if (formData) { setData(formData); @@ -84,6 +94,7 @@ const FormPanel = ({ formData }) => { id: data.id, action: actionValue, vaild: values.vaild, + paymentMethod: paymentMethod }, files: attachments ? attachments : [], onSuccess: function (responseData) { @@ -145,7 +156,27 @@ const FormPanel = ({ formData }) => { } const isOverReviseDeadline = () => { + if (paymentMethod == "dn") return isOverDnReviseDeadline(); + if (paymentMethod == "npgo") return isOverNpgoReviseDeadline(); + //online payment let reviseDeadline = DateUtils.convertToDate(formik.values?.reviseDeadline); + reviseDeadline?.setTime(reviseDeadline?.getTime() + (14 * 60 * 60 * 1000));// 14:00 + if (!reviseDeadline) return true; + let current = new Date(); + return current.getTime() > reviseDeadline; + } + + const isOverDnReviseDeadline = () => { + let reviseDeadline = DateUtils.convertToDate(formData.beforeClosingDate); + reviseDeadline?.setTime(reviseDeadline?.getTime() + (17 * 60 * 60 * 1000));// 17:00 + if (!reviseDeadline) return true; + let current = new Date(); + return current.getTime() > reviseDeadline; + } + + const isOverNpgoReviseDeadline = () => { + let reviseDeadline = DateUtils.convertToDate(formik.values?.reviseDeadline); + reviseDeadline?.setTime(reviseDeadline?.getTime() + (12 * 60 * 60 * 1000));// 12:00 if (!reviseDeadline) return true; let current = new Date(); return current.getTime() > reviseDeadline; @@ -153,6 +184,7 @@ const FormPanel = ({ formData }) => { + return ( { { actionValue ? - null + + + + + + + + + + + + + + + + + { + isOverDnReviseDeadline() ? + <> : + + + + + + + + } + { + isOverNpgoReviseDeadline() ? + <> : + + + + + + + + } + +
+ { + set_paymentMethod("online") + }} + /> + +
    +
  • +
  • +
  • +
+
{DateUtils.dateFormat(formData.closingDate, "YYYY年MM月DD日")} 2:00 p.m.{DateUtils.dateFormat(formData.closingDate, "YYYY年MM月DD日")} 2:30 p.m.
+ { + set_paymentMethod("dn") + }} + /> + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+
{DateUtils.dateFormat(formData.beforeClosingDate, "YYYY年MM月DD日")} 5:00 p.m. + +
+ { + set_paymentMethod("npgo") + }} + /> + +
    +
  • +
  • +
+
{DateUtils.dateFormat(formData.closingDate, "YYYY年MM月DD日")} 12:00 p.m. + +
+
+ : isOverReviseDeadline() ? - + @@ -332,7 +457,6 @@ const FormPanel = ({ formData }) => {
-