From 06e1d3f9c2d563c50b2792769078da2cdb73845d Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Feb 2024 12:43:11 +0800 Subject: [PATCH] update public application list --- .../ListPanel/PendingPaymentTab.js | 120 +++++++----------- src/translations/en.json | 2 + src/translations/zh-CN.json | 2 + src/translations/zh-HK.json | 2 + 4 files changed, 54 insertions(+), 72 deletions(-) diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index 0fae35a..7581c20 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -19,9 +19,9 @@ import { useNavigate } from "react-router-dom"; import { isORGLoggedIn, } from "utils/Utils"; -import {ThemeProvider, useTheme} from "@emotion/react"; -import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; -import {FormattedMessage, useIntl} from "react-intl"; +import { ThemeProvider, useTheme } from "@emotion/react"; +import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst"; +import { FormattedMessage, useIntl } from "react-intl"; // ==============================|| EVENT TABLE ||============================== // export default function SubmittedTab({ rows }) { @@ -66,8 +66,8 @@ export default function SubmittedTab({ rows }) { console.log(rows) console.log(selectedCareOf) rows.forEach((element) => { - if (element.careOf===selectedCareOf.label){ - afteSelectedList.push(element) + if (element.careOf === selectedCareOf.label) { + afteSelectedList.push(element) } }); // afteSelectedList.push(rows.find(obj => obj.careOf ===(selectedCareOf.label))); @@ -91,6 +91,11 @@ export default function SubmittedTab({ rows }) { for (var i = 0; i < datas?.length; i++) { appIdList.push(datas[i].id); } + if(appIdList.length<1){ + setExpiryDateErrText(intl.formatMessage({ id: 'MSG.plzSelectApp' })); + setExpiryDateErr(true); + return; + } HttpUtils.post({ url: UrlUtils.POST_CHECK_APP_EXPRITY_DATE, params: { @@ -105,7 +110,7 @@ export default function SubmittedTab({ rows }) { responData.msg.forEach((item) => { str += "App: " + item.appNo + ", 到期日: " + DateUtils.datetimeStr_Cht(item.expiryDate) + "\n"; }); - setExpiryDateErrText(str.split('\n').map(str => <>{str}
)); + setExpiryDateErrText(str.split('\n').map(str => <>{str}
)); setExpiryDateErr(true); } }); @@ -117,69 +122,41 @@ export default function SubmittedTab({ rows }) { { id: 'appNo', field: 'appNo', - headerName: intl.formatMessage({id: 'applicationId'}), + headerName: intl.formatMessage({ id: 'applicationId' }), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, }, { id: 'created', field: 'created', - headerName: intl.formatMessage({id: 'submitDate'}), + headerName: intl.formatMessage({ id: 'submitDate' }), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { return DateUtils.datetimeStr(params.value); } }, - // { - // id: 'contactPerson', - // field: 'contactPerson', - // headerName: '聯絡人', - // flex: 2, - // renderCell: (params) => { - // let phone = JSON.parse(params.row.contactTelNo); - // let faxNo = JSON.parse(params.row.contactFaxNo); - - // let contact = ""; - // if (phone) { - // contact = "電話: " + phone?.countryCode + " " + phone?.phoneNumber - // } - - // if (faxNo && faxNo?.faxNumber) { - // if (contact != "") - // contact = contact + ", " - // contact = contact + "傳真:" + faxNo?.countryCode + " " + faxNo?.faxNumber - // } - - // return (<> - // {params?.value}
- // {contact} - // ); - // } - // }, { id: 'remarks', field: 'remarks', - headerName: isORGLoggedIn() ? intl.formatMessage({id: 'gazetteCount2_1'}) : intl.formatMessage({id: 'myRemarks'}), + headerName: isORGLoggedIn() ? intl.formatMessage({ id: 'gazetteCount2_1' }) : intl.formatMessage({ id: 'myRemarks' }), width: isMdOrLg ? 'auto' : 400, flex: isMdOrLg ? 3 : undefined, renderCell: (params) => ( isORGLoggedIn() ?
- Care Of: {params.row.careOf}
- : {params.row.remarks} + Care Of: {params.row.careOf}
+ : {params.row.remarks}
:
- {/* */} - {params.row.remarks} - {/* */} + {params.row.remarks}
) }, { id: 'fee', field: 'fee', - headerName: intl.formatMessage({id: 'price'}), + headerName: intl.formatMessage({ id: 'price' }), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { @@ -189,11 +166,11 @@ export default function SubmittedTab({ rows }) { { id: 'status', field: 'status', - headerName: intl.formatMessage({id: 'status'}), + headerName: intl.formatMessage({ id: 'status' }), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { - return [StatusUtils.getStatusIntl(params,intl)] + return [StatusUtils.getStatusIntl(params, intl)] }, }, { @@ -203,8 +180,8 @@ export default function SubmittedTab({ rows }) { width: 150, cellClassName: 'actions', renderCell: (params) => { - return ; }, } @@ -220,21 +197,20 @@ export default function SubmittedTab({ rows }) { content.push(<> - : {datas[i].appNo} + : {datas[i].appNo} ({DateUtils.datetimeStr(datas[i].created)}) - : {datas[i].remarks} + : {datas[i].remarks}

); totalAmount += datas[i].fee; } content.push( - (HK$): {FormatUtils.currencyFormat(totalAmount)} + (HK$): {FormatUtils.currencyFormat(totalAmount)}

); - //setAmount(totalAmount); return content; } @@ -317,15 +293,15 @@ export default function SubmittedTab({ rows }) { /> - + @@ -343,7 +319,7 @@ export default function SubmittedTab({ rows }) { > - + @@ -352,15 +328,15 @@ export default function SubmittedTab({ rows }) { - - + + @@ -387,15 +363,15 @@ export default function SubmittedTab({ rows }) { - - + + @@ -413,7 +389,7 @@ export default function SubmittedTab({ rows }) { }} > - 行動失敗 + { @@ -422,9 +398,9 @@ export default function SubmittedTab({ rows }) { - diff --git a/src/translations/en.json b/src/translations/en.json index 6930139..e8afbbb 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -64,6 +64,8 @@ "MSG.payMsg3": "If you have multiple public notice applications within the Year {issueYear}, Volume {issueVolume}, Issue {issueNo} of the Official Gazette, you can choose to merge the payment for all the approved manuscripts within this issue in 'My Public Notice' before the payment deadline.", "MSG.proofOutOfTime": "Response out of time, please apply again.", + "MSG.plzSelectApp": "Please select application", + "MSG.actionFail": "Action failed", "registerTitle1": "Become", "registerTitle2": "Gazette Notice", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index f442884..c393d75 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -63,6 +63,8 @@ "MSG.payMsg3": "如你在宪报期数{issueYear} 年{issueVolume} 卷, 第{issueNo} 期内有多于一个公共启事的申请,你可选择完成所有此期所有稿件校对确定后,于缴费期限前在「我的公共启事」内合并付款。 ", "MSG.proofOutOfTime": "回覆逾时,请重新申请。", + "MSG.plzSelectApp": "请选择公共启事。", + "MSG.actionFail": "行动失败", "registerTitle1": "立即成为", "registerTitle2": "宪报刊登公共启事", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 259083d..d9a89a6 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -63,6 +63,8 @@ "MSG.payMsg3": "如你在憲報期數 {issueYear} 年 {issueVolume} 卷, 第 {issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。", "MSG.proofOutOfTime": "回覆逾時,請重新申請。", + "MSG.plzSelectApp": "請選擇公共啟事。", + "MSG.actionFail": "行動失敗", "registerTitle1": "立即成為", "registerTitle2": "憲報刊登公共啟事",