From 555eb2f810fc88b2f6ffdbfb0f8e2d11da166911 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 9 Feb 2024 12:07:14 +0800 Subject: [PATCH] proof returnBeforeDate -> reviseDeadline & proofPaymentDeadline --- src/pages/Proof/Create_FromApp/ProofForm.js | 55 ++++++++++++++----- src/pages/Proof/Create_FromApp/index.js | 3 +- src/pages/Proof/Payment/Pay.js | 2 +- .../Proof/Reply_GLD/ApplicationDetails.js | 11 +++- src/pages/Proof/Reply_GLD/index.js | 6 +- .../Proof/Reply_Public/ApplicationDetails.js | 24 +++++++- src/pages/Proof/Reply_Public/ProofForm.js | 6 +- src/pages/Proof/Search_Public/DataGrid.js | 10 ++-- src/translations/en.json | 3 +- src/translations/zh-CN.json | 1 + src/translations/zh-HK.json | 1 + src/utils/statusUtils/ProofStatus.js | 12 ++-- 12 files changed, 96 insertions(+), 38 deletions(-) diff --git a/src/pages/Proof/Create_FromApp/ProofForm.js b/src/pages/Proof/Create_FromApp/ProofForm.js index 359521a..be183f8 100644 --- a/src/pages/Proof/Create_FromApp/ProofForm.js +++ b/src/pages/Proof/Create_FromApp/ProofForm.js @@ -91,11 +91,11 @@ const FormPanel = ({ formData }) => { })); formik.setFieldValue("noOfPages", responseData.data.total_no_of_page); formik.setFieldValue("fee", (data.groupType == "Private Bill" ? 6552 * responseData.data.total_no_of_page : responseData.data.length * colValue)); - if(data.groupType == "Private Bill" && responseData.data.file.length>0){ + if (data.groupType == "Private Bill" && responseData.data.file.length > 0) { let attachmentList = attachments; - for(let i=0; i item.name == file.filename)["no_of_page"] = file.no_of_page; + attachmentList.find(item => item.name == file.filename)["no_of_page"] = file.no_of_page; } setAttachments(attachmentList); } @@ -129,7 +129,8 @@ const FormPanel = ({ formData }) => { length: values.length, colCount: columnPrice.colCount, noOfPages: values.noOfPages, - returnBeforeDate: DateUtils.convertToDate(values.beforeDate).getTime() + reviseDeadline: DateUtils.convertToDate(values.reviseDeadline).getTime(), + proofPaymentDeadline: DateUtils.convertToDate(values.proofPaymentDeadline).getTime() }, files: attachments, onSuccess: function (responeData) { @@ -196,15 +197,41 @@ const FormPanel = ({ formData }) => { - Return Before Date: + Return Revise Before: + + + + + + + Payment Before Date: + + { - + { @@ -414,7 +441,7 @@ const FormPanel = ({ formData }) => { variant="contained" color="success" type="submit" - disabled = {saving} + disabled={saving} sx={{ textTransform: 'capitalize', alignItems: 'end' diff --git a/src/pages/Proof/Create_FromApp/index.js b/src/pages/Proof/Create_FromApp/index.js index 1299d75..02be45a 100644 --- a/src/pages/Proof/Create_FromApp/index.js +++ b/src/pages/Proof/Create_FromApp/index.js @@ -59,7 +59,8 @@ const Index = () => { responseData.data["groupType"] = responseData.data.groupTitle; - responseData.data["beforeDate"] = DateUtils.datetimeFieldFormat(responseData.data.returnBeforeDate); + responseData.data["reviseDeadline"] = DateUtils.datetimeFieldFormat(responseData.data.reviseDeadline); + responseData.data["proofPaymentDeadline"] = DateUtils.datetimeFieldFormat(responseData.data.proofPaymentDeadline); setRecord(responseData.data); } }); diff --git a/src/pages/Proof/Payment/Pay.js b/src/pages/Proof/Payment/Pay.js index 46ef276..9d19ec2 100644 --- a/src/pages/Proof/Payment/Pay.js +++ b/src/pages/Proof/Payment/Pay.js @@ -109,7 +109,7 @@ const Index = () => { 我們已收到申請編號: {record?.appNo} 的稿件校對確定及可付印的指示。

- 請於 {DateUtils.dateStr_Cht(record?.returnBeforeDate)} 下午 2:00 前 完成繳費,我們將於收到繳費確認後處理刊出事宜。 + 請於 {DateUtils.datetimeStr(record?.proofPaymentDeadline)} 前 完成繳費,我們將於收到繳費確認後處理刊出事宜。

如你在憲報期數 {record?.issueYear} 年 {record?.issueVolume} 卷, 第 {record?.issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。
diff --git a/src/pages/Proof/Reply_GLD/ApplicationDetails.js b/src/pages/Proof/Reply_GLD/ApplicationDetails.js index 7207894..c68a81b 100644 --- a/src/pages/Proof/Reply_GLD/ApplicationDetails.js +++ b/src/pages/Proof/Reply_GLD/ApplicationDetails.js @@ -266,10 +266,17 @@ const ApplicationDetailCard = ({ - Deadline for payment and reply: + Deadline for payment: - Before {DateUtils.datetimeStr(data.returnBeforeDate)} + Before {DateUtils.datetimeStr(data.proofPaymentDeadline)} + + + Deadline for revise: + + + Before {DateUtils.datetimeStr(data.reviseDeadline)} diff --git a/src/pages/Proof/Reply_GLD/index.js b/src/pages/Proof/Reply_GLD/index.js index a22c395..6a2d44b 100644 --- a/src/pages/Proof/Reply_GLD/index.js +++ b/src/pages/Proof/Reply_GLD/index.js @@ -76,10 +76,10 @@ const Index = () => { responseData.data["groupType"] = responseData.data.groupTitle; responseData.data["action"] = responseData.data.replyDate ? responseData.data.action : true; - let returnBeforeDate = DateUtils.convertToDate(responseData.data.returnBeforeDate); + let proofPaymentDeadline = DateUtils.convertToDate(responseData.data.proofPaymentDeadline); let current = new Date(); - setIsOverTime(current.getTime() > returnBeforeDate.getTime()); - setShowCancelBtn(responseData.data.cancelled || responseData.data.replyDate || current.getTime() > returnBeforeDate.getTime()) + setIsOverTime(current.getTime() > proofPaymentDeadline.getTime()); + setShowCancelBtn(responseData.data.cancelled || responseData.data.replyDate || current.getTime() > proofPaymentDeadline.getTime()) diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index fa77bd7..2b736dc 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -240,12 +240,32 @@ const ApplicationDetailCard = ({ formData, }) => {   {locale === 'en' ? - `${intl.formatMessage({id: 'before'})} ${DateUtils.datetimeStr(data.returnBeforeDate)} ` + `${intl.formatMessage({id: 'before'})} ${DateUtils.datetimeStr(data.reviseDeadline)} ` : - `${DateUtils.datetimeStr_Cht(data.returnBeforeDate)} ${intl.formatMessage({id: 'before'})}` + `${DateUtils.datetimeStr_Cht(data.reviseDeadline)} ${intl.formatMessage({id: 'before'})}` } + + + + + + + : + + + +   + {locale === 'en' ? + `${intl.formatMessage({id: 'before'})} ${DateUtils.datetimeStr(data.proofPaymentDeadline)} ` + : + `${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 76530f5..d1fdc03 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -131,10 +131,10 @@ const FormPanel = ({ formData }) => { } const isOverTime = () => { - let returnBeforeDate = DateUtils.convertToDate(formik.values?.returnBeforeDate); - if (!returnBeforeDate) return true; + let proofPaymentDeadline = DateUtils.convertToDate(formik.values?.proofPaymentDeadline); + if (!proofPaymentDeadline) return true; let current = new Date(); - return current.getTime() > returnBeforeDate; + return current.getTime() > proofPaymentDeadline; } diff --git a/src/pages/Proof/Search_Public/DataGrid.js b/src/pages/Proof/Search_Public/DataGrid.js index 7d8e7d5..c15f6a0 100644 --- a/src/pages/Proof/Search_Public/DataGrid.js +++ b/src/pages/Proof/Search_Public/DataGrid.js @@ -105,15 +105,15 @@ export default function SearchPublicNoticeTable({ recordList }) { } }, { - id: 'returnBeforeDate', - field: 'returnBeforeDate', + id: 'proofPaymentDeadline', + field: 'proofPaymentDeadline', headerName: intl.formatMessage({id: 'replyBefore'}), width: isMdOrLg ? 'auto' : 250, flex: isMdOrLg ? 1.5 : undefined, valueGetter: (params) => { - let returnBeforeDate = DateUtils.convertToDate(params?.value); - returnBeforeDate = returnBeforeDate.setHours(14, 0, 0, 0); - return locale === 'en' ? DateUtils.datetimeStr(returnBeforeDate) : DateUtils.datetimeStr_Cht(returnBeforeDate); + let proofPaymentDeadline = DateUtils.convertToDate(params?.value); + proofPaymentDeadline = proofPaymentDeadline.setHours(14, 0, 0, 0); + return locale === 'en' ? DateUtils.datetimeStr(proofPaymentDeadline) : DateUtils.datetimeStr_Cht(proofPaymentDeadline); } }, { diff --git a/src/translations/en.json b/src/translations/en.json index 2709d54..5c3a766 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -325,7 +325,8 @@ "applicationPublishDate": "Publish date", "pleaseCheckReminder": "Please download the following printed manuscript file and proofread it carefully", "payAnd": "Pay and ", - "commentDeadline": "Deadline for submission of manuscripts", + "commentDeadline": "Deadline for Revise", + "paymentDeadline": "Deadline for Payment", "before": "Before", "page": "Page", "proofReplyDate": "Proof Reply Date", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 4a92306..6c011ca 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -322,6 +322,7 @@ "pleaseCheckReminder": "请下载下列印刷稿档案,并仔细校对", "payAnd": "缴费及", "commentDeadline": "返稿最后限期", + "paymentDeadline": "付款最后限期", "before": "前", "page": "页", "proofReplyDate": "校对回覆日期", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 6828519..d8b906b 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -327,6 +327,7 @@ "pleaseCheckReminder": "請下載下列印刷稿檔案,並仔細校對", "payAnd": "繳費及", "commentDeadline": "返稿最後限期", + "paymentDeadline": "付款最後限期", "before": "前", "page": "頁", "proofReplyDate": "校對回覆日期", diff --git a/src/utils/statusUtils/ProofStatus.js b/src/utils/statusUtils/ProofStatus.js index fdf6b39..1cdde36 100644 --- a/src/utils/statusUtils/ProofStatus.js +++ b/src/utils/statusUtils/ProofStatus.js @@ -31,7 +31,7 @@ function getStatus(params) { // console.log(params) let replyDate = params.row?params.row.replyDate:params.replyDate; let action = params.row?params.row.action:params.action; - let returnBeforeDate = params.row?params.row.returnBeforeDate:params.returnBeforeDate; + let proofPaymentDeadline = params.row?params.row.proofPaymentDeadline:params.proofPaymentDeadline; let isCancelled = params.row?params.row.cancelled:params.cancelled; if(isCancelled) return cancel; @@ -40,14 +40,14 @@ function getStatus(params) { if(replyDate){ return action?confirm:unable; }else{ - return isOverTime(returnBeforeDate)? timeOut: pendingReply; + return isOverTime(proofPaymentDeadline)? timeOut: pendingReply; } } -const isOverTime = (returnBeforeDate) => { - if (!returnBeforeDate) return true; - returnBeforeDate = DateUtils.convertToDate(returnBeforeDate); +const isOverTime = (proofPaymentDeadline) => { + if (!proofPaymentDeadline) return true; + proofPaymentDeadline = DateUtils.convertToDate(proofPaymentDeadline); let current = new Date(); - return current.getTime() > returnBeforeDate.getTime(); + return current.getTime() > proofPaymentDeadline.getTime(); }