@@ -26,7 +26,10 @@ import { notifyActionSuccess } from 'utils/CommonFunction'; | |||||
import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; | import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; | ||||
import { ThemeProvider } from "@emotion/react"; | import { ThemeProvider } from "@emotion/react"; | ||||
import { FormattedMessage, useIntl } from "react-intl"; | import { FormattedMessage, useIntl } from "react-intl"; | ||||
import { isDummyLoggedIn } from "utils/Utils" | |||||
import { | |||||
isDummyLoggedIn, | |||||
checkIsOnlyOnlinePayment | |||||
} from "utils/Utils" | |||||
const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | ||||
//import * as ProofStatus from "utils/statusUtils/ProofStatus"; | //import * as ProofStatus from "utils/statusUtils/ProofStatus"; | ||||
@@ -46,6 +49,7 @@ const FormPanel = ({ formData }) => { | |||||
const [warningTitle, setWarningTitle] = React.useState(""); | const [warningTitle, setWarningTitle] = React.useState(""); | ||||
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | ||||
const [warningText, setWarningText] = React.useState(""); | const [warningText, setWarningText] = React.useState(""); | ||||
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const params = useParams(); | const params = useParams(); | ||||
@@ -61,6 +65,7 @@ const FormPanel = ({ formData }) => { | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (formData) { | if (formData) { | ||||
setData(formData); | setData(formData); | ||||
setOnlyOnlinePayment(checkIsOnlyOnlinePayment(formData.issueDate)) | |||||
if (isDummyLoggedIn()) { | if (isDummyLoggedIn()) { | ||||
set_paymentMethod("demandNote") | set_paymentMethod("demandNote") | ||||
} | } | ||||
@@ -461,90 +466,94 @@ const FormPanel = ({ formData }) => { | |||||
}} /> | }} /> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td style={tabelStyle}> | |||||
{isOverDnReviseDeadline() ? | |||||
<></> : | |||||
<Checkbox | |||||
checked={paymentMethod == "demandNote"} | |||||
onChange={() => { | |||||
set_paymentMethod("demandNote") | |||||
}} | |||||
/> | |||||
} | |||||
</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payDn" /> | |||||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="atm" /></li> | |||||
<li><FormattedMessage id="pps" /></li> | |||||
<li><FormattedMessage id="eBank" /></li> | |||||
<li><FormattedMessage id="phoneBank" /></li> | |||||
<li><FormattedMessage id="eCheque" /></li> | |||||
<li><FormattedMessage id="fps" /></li> | |||||
<li><FormattedMessage id="hkpo" /></li> | |||||
<li><FormattedMessage id="store" /></li> | |||||
<li><FormattedMessage id="post" /></li> | |||||
</ul> | |||||
<Typography variant="h6"> | |||||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||||
</Typography> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payDnRemark" values={{ | |||||
date: DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "dateStrFormat" })) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td style={tabelStyle}> | |||||
{ | |||||
isOverNpgoReviseDeadline() ? | |||||
<></> : | |||||
<Checkbox | |||||
checked={paymentMethod == "office"} | |||||
onChange={() => { | |||||
set_paymentMethod("office") | |||||
}} | |||||
/> | |||||
} | |||||
</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payNPGO" /> | |||||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="cheque" /></li> | |||||
<li><FormattedMessage id="drafts" /></li> | |||||
<li><FormattedMessage id="cashierOrders" /></li> | |||||
<li><FormattedMessage id="cash" /></li> | |||||
</ul> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"11:30 a.m.":"上午11時30分"}</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"12:00 p.m.":"下午12時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payNPGORemark" values={{ | |||||
date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" })) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
{!isOnlyOnlinePayment? | |||||
<> | |||||
<tr> | |||||
<td style={tabelStyle}> | |||||
{isOverDnReviseDeadline() ? | |||||
<></> : | |||||
<Checkbox | |||||
checked={paymentMethod == "demandNote"} | |||||
onChange={() => { | |||||
set_paymentMethod("demandNote") | |||||
}} | |||||
/> | |||||
} | |||||
</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payDn" /> | |||||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="atm" /></li> | |||||
<li><FormattedMessage id="pps" /></li> | |||||
<li><FormattedMessage id="eBank" /></li> | |||||
<li><FormattedMessage id="phoneBank" /></li> | |||||
<li><FormattedMessage id="eCheque" /></li> | |||||
<li><FormattedMessage id="fps" /></li> | |||||
<li><FormattedMessage id="hkpo" /></li> | |||||
<li><FormattedMessage id="store" /></li> | |||||
<li><FormattedMessage id="post" /></li> | |||||
</ul> | |||||
<Typography variant="h6"> | |||||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||||
</Typography> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payDnRemark" values={{ | |||||
date: DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "dateStrFormat" })) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td style={tabelStyle}> | |||||
{ | |||||
isOverNpgoReviseDeadline() ? | |||||
<></> : | |||||
<Checkbox | |||||
checked={paymentMethod == "office"} | |||||
onChange={() => { | |||||
set_paymentMethod("office") | |||||
}} | |||||
/> | |||||
} | |||||
</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payNPGO" /> | |||||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="cheque" /></li> | |||||
<li><FormattedMessage id="drafts" /></li> | |||||
<li><FormattedMessage id="cashierOrders" /></li> | |||||
<li><FormattedMessage id="cash" /></li> | |||||
</ul> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"11:30 a.m.":"上午11時30分"}</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"12:00 p.m.":"下午12時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payNPGORemark" values={{ | |||||
date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" })) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
</>:null | |||||
} | |||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
@@ -33,7 +33,7 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => { | |||||
const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList, isOnlyOnlinePayment }) => { | |||||
const [isWarningPopUp, setIsWarningPopUp] = useState(false); | const [isWarningPopUp, setIsWarningPopUp] = useState(false); | ||||
const [warningTitle, setWarningTitle] = useState(""); | const [warningTitle, setWarningTitle] = useState(""); | ||||
const [warningText, setWarningText] = useState(""); | const [warningText, setWarningText] = useState(""); | ||||
@@ -383,62 +383,66 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
}} /> | }} /> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td style={tabelStyle}><FormattedMessage id="payDn" /> | |||||
<br /><a href="#payDnDetails" onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="atm" /></li> | |||||
<li><FormattedMessage id="pps" /></li> | |||||
<li><FormattedMessage id="eBank" /></li> | |||||
<li><FormattedMessage id="phoneBank" /></li> | |||||
<li><FormattedMessage id="eCheque" /></li> | |||||
<li><FormattedMessage id="fps" /></li> | |||||
<li><FormattedMessage id="hkpo" /></li> | |||||
<li><FormattedMessage id="store" /></li> | |||||
<li><FormattedMessage id="post" /></li> | |||||
</ul> | |||||
<Typography variant="h6"> | |||||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||||
</Typography> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(closingDateOff, dft)} {locale==='en'?"5:00 p.m.":"下午5時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payDnRemark" values={{ | |||||
date: DateUtils.dateFormat(closeDate, dft) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td style={tabelStyle}><FormattedMessage id="payNPGO" /> | |||||
<br /><a href="#payNPGODetails" onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="cheque" /></li> | |||||
<li><FormattedMessage id="drafts" /></li> | |||||
<li><FormattedMessage id="cashierOrders" /></li> | |||||
<li><FormattedMessage id="cash" /></li> | |||||
</ul> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"12:00 p.m.":"下午12時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payNPGORemark" values={{ | |||||
date: DateUtils.dateFormat(closeDate, dft) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
{!isOnlyOnlinePayment? | |||||
<> | |||||
<tr> | |||||
<td style={tabelStyle}><FormattedMessage id="payDn" /> | |||||
<br /><a href="#payDnDetails" onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="atm" /></li> | |||||
<li><FormattedMessage id="pps" /></li> | |||||
<li><FormattedMessage id="eBank" /></li> | |||||
<li><FormattedMessage id="phoneBank" /></li> | |||||
<li><FormattedMessage id="eCheque" /></li> | |||||
<li><FormattedMessage id="fps" /></li> | |||||
<li><FormattedMessage id="hkpo" /></li> | |||||
<li><FormattedMessage id="store" /></li> | |||||
<li><FormattedMessage id="post" /></li> | |||||
</ul> | |||||
<Typography variant="h6"> | |||||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||||
</Typography> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(closingDateOff, dft)} {locale==='en'?"5:00 p.m.":"下午5時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payDnRemark" values={{ | |||||
date: DateUtils.dateFormat(closeDate, dft) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td style={tabelStyle}><FormattedMessage id="payNPGO" /> | |||||
<br /><a href="#payNPGODetails" onClick={() => { | |||||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||||
setWarningText( | |||||
<><FormattedMessage id="paymentMethodMeans" />: | |||||
<ul> | |||||
<li><FormattedMessage id="cheque" /></li> | |||||
<li><FormattedMessage id="drafts" /></li> | |||||
<li><FormattedMessage id="cashierOrders" /></li> | |||||
<li><FormattedMessage id="cash" /></li> | |||||
</ul> | |||||
</> | |||||
); | |||||
setIsWarningPopUp(true); | |||||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
</td> | |||||
<td style={tabelStyle}>{DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"12:00 p.m.":"下午12時"}</td> | |||||
<td style={tabelStyle}> | |||||
<FormattedMessage id="payNPGORemark" values={{ | |||||
date: DateUtils.dateFormat(closeDate, dft) | |||||
}} /> | |||||
</td> | |||||
</tr> | |||||
</>:null | |||||
} | |||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
@@ -20,6 +20,7 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||||
import { | import { | ||||
// isORGLoggedIn, | // isORGLoggedIn, | ||||
isDummyLoggedIn, | isDummyLoggedIn, | ||||
checkIsOnlyOnlinePayment | |||||
// isCreditorLoggedIn | // isCreditorLoggedIn | ||||
} from "utils/Utils"; | } from "utils/Utils"; | ||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -29,6 +30,7 @@ const ApplyForm = () => { | |||||
const [gazetteIssueList, setGazetteIssueList] = React.useState([]); | const [gazetteIssueList, setGazetteIssueList] = React.useState([]); | ||||
const [selections, setSelection] = React.useState([]); | const [selections, setSelection] = React.useState([]); | ||||
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); | |||||
const [isLoading, setLoding] = React.useState(true); | const [isLoading, setLoding] = React.useState(true); | ||||
const intl = useIntl(); | const intl = useIntl(); | ||||
@@ -64,6 +66,7 @@ const ApplyForm = () => { | |||||
setGazetteIssueList(response?.gazetteIssueList); | setGazetteIssueList(response?.gazetteIssueList); | ||||
setSelection(selection); | setSelection(selection); | ||||
setUserData(response); | setUserData(response); | ||||
setOnlyOnlinePayment(checkIsOnlyOnlinePayment(response?.gazetteIssueList[0].issueDate)) | |||||
} | } | ||||
}); | }); | ||||
}; | }; | ||||
@@ -106,8 +109,11 @@ const ApplyForm = () => { | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (userData !== null) setLoding(false); | |||||
}, [userData]); | |||||
if (userData !== null&& isOnlyOnlinePayment !== null){ | |||||
setLoding(false); | |||||
// console.log(isOnlyOnlinePayment) | |||||
} | |||||
}, [userData,isOnlyOnlinePayment]); | |||||
return ( | return ( | ||||
isLoading ? | isLoading ? | ||||
@@ -121,6 +127,7 @@ const ApplyForm = () => { | |||||
loadedData={userData} | loadedData={userData} | ||||
_selections={selections} | _selections={selections} | ||||
gazetteIssueList = {gazetteIssueList} | gazetteIssueList = {gazetteIssueList} | ||||
isOnlyOnlinePayment = {isOnlyOnlinePayment} | |||||
/> | /> | ||||
); | ); | ||||
}; | }; | ||||
@@ -181,4 +181,19 @@ export const isPasswordExpiry = () =>{ | |||||
return false; | return false; | ||||
} | } | ||||
} | |||||
export const checkIsOnlyOnlinePayment = (date) => { | |||||
const targetDate = new Date("2026-01-28") | |||||
const checkDate = DateUtils.convertToDate(date) | |||||
if (isDummyLoggedIn()){ | |||||
return false; | |||||
} | |||||
// console.log(checkDate) | |||||
// console.log(targetDate) | |||||
if (checkDate >= targetDate) { | |||||
return true | |||||
} else { | |||||
return false; | |||||
} | |||||
} | } |