diff --git a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js index e2b7701..2019da2 100644 --- a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js @@ -119,7 +119,7 @@ const ApplicationDetailCard = ( handlePaymentCheck(appIdList) return; } - setErrorText("公共啟事申請已過期"); + setErrorText(intl.formatMessage({ id: "MSG.expiredApp" })); setErrorPopUp(true); } }); @@ -693,7 +693,7 @@ const ApplicationDetailCard = ( }} > - 行動失敗 + { diff --git a/src/pages/PublicNotice/Search_GLD/DataGrid.js b/src/pages/PublicNotice/Search_GLD/DataGrid.js index 014647f..0a5f982 100644 --- a/src/pages/PublicNotice/Search_GLD/DataGrid.js +++ b/src/pages/PublicNotice/Search_GLD/DataGrid.js @@ -1,19 +1,35 @@ // material-ui import * as React from 'react'; import { - Button + Button, + Grid, + Typography, + Stack, + Dialog, DialogTitle, DialogContent, DialogActions, } from '@mui/material'; +import * as UrlUtils from "utils/ApiPathConst"; +import * as HttpUtils from "utils/HttpUtils"; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; import { useNavigate } from "react-router-dom"; import { FiDataGrid } from "components/FiDataGrid"; +import { notifyActionSuccess } from 'utils/CommonFunction'; +import { FormattedMessage, useIntl } from "react-intl"; // ==============================|| EVENT TABLE ||============================== // -export default function SearchPublicNoticeTable({ recordList }) { +export default function SearchPublicNoticeTable({ recordList, reloadFunction }) { const [rows, setRows] = React.useState(recordList); const navigate = useNavigate() + const [selectedRowItems, setSelectedRowItems] = React.useState([]); + + const [isConfirmPopUp, setIsConfirmPopUp] = React.useState(false); + const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); + + const intl = useIntl(); + + React.useEffect(() => { setRows(recordList); }, [recordList]); @@ -57,7 +73,7 @@ export default function SearchPublicNoticeTable({ recordList }) { headerName: 'Contact Person', flex: 2, renderCell: (params) => { - let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName; + let company = params.row.enCompanyName != null ? params.row.enCompanyName : params.row.chCompanyName; company = company != null ? company : ""; /* @@ -109,9 +125,55 @@ export default function SearchPublicNoticeTable({ recordList }) { navigate('/application/' + params.id); } - return ( -
+ const doPublish = () => { + setIsConfirmPopUp(false); + let appIdList = []; + const datas = rows?.filter((row) => + selectedRowItems.includes(row.id) + ); + // console.log(datas) + for (var i = 0; i < datas?.length; i++) { + appIdList.push(datas[i].id); + } + if(appIdList.length<1){ + setIsWarningPopUp(true); + }else{ + HttpUtils.post({ + url: UrlUtils.SET_PUBLIC_NOTICE_STATUS_PUBLISH_BULK, + params: { + ids: appIdList + }, + onSuccess: () => { + reloadFunction() + notifyActionSuccess("Action Success!") + } + }); + } + + } + + return (<> + +
+ + + + { + setSelectedRowItems(newSelection); + }} + isRowSelectable={(params) => { + return ((params.row.creditor === true && params.row.status == "confirmed") || + (params.row.creditor === false && params.row.status == "paid")) + }} rows={rows} columns={columns} customPageSize={10} @@ -119,5 +181,63 @@ export default function SearchPublicNoticeTable({ recordList }) { onRowDoubleClick={handleRowDoubleClick} />
+
+ setIsConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } + } + }} + > + + + + + + + + Please Confirm to mark selected application as Published. + + + + + + + + +
+
+ setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + Warning + + {intl.formatMessage({ id: "MSG.plzSelectApp" })} + + + + + +
+ + ); } diff --git a/src/pages/PublicNotice/Search_GLD/index.js b/src/pages/PublicNotice/Search_GLD/index.js index 0dc3730..4a8e300 100644 --- a/src/pages/PublicNotice/Search_GLD/index.js +++ b/src/pages/PublicNotice/Search_GLD/index.js @@ -5,8 +5,8 @@ import { Stack } from '@mui/material'; import MainCard from "components/MainCard"; -import * as UrlUtils from "utils/ApiPathConst"; import * as React from "react"; +import * as UrlUtils from "utils/ApiPathConst"; import * as HttpUtils from "utils/HttpUtils"; import * as DateUtils from "utils/DateUtils"; @@ -40,7 +40,7 @@ const UserSearchPage_Individual = () => { const [onReady, setOnReady] = React.useState(false); React.useEffect(() => { - getUserList(); + getDataList(); getOrgCombo(); getIssueCombo(); }, []); @@ -50,10 +50,10 @@ const UserSearchPage_Individual = () => { }, [record]); React.useEffect(() => { - getUserList(); + getDataList(); }, [searchCriteria]); - function getUserList() { + function getDataList() { HttpUtils.get({ url: UrlUtils.GET_PUBLIC_NOTICE_LIST, params: searchCriteria, @@ -122,6 +122,7 @@ const UserSearchPage_Individual = () => { > diff --git a/src/translations/en.json b/src/translations/en.json index 6033720..ad1c7cf 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -37,6 +37,7 @@ "MSG.registerPersonal": "To complete the online application, you need to upload digital copies of identification documents.
e.g. Hong Kong Identity Card, Passport, Mainland China Identity Card, Professional Practicing Certificate, etc.", "MSG.registerOrg": "You need to upload the proof documents for the online application.
e.g. Business Registration Certificate, Professional Practicing Certificate, etc.", "MSG.paymentMsg": "Your application and payment have been received", + "MSG.expiredApp": "Public notice application has expired", "MSG.paymentCancelMsg1": "Payment cancellation message:", "MSG.paymentCancelMsg2": "Your payment has been cancelled. We have received your payment request, but due to certain reasons, the payment could not be processed. Please take note of the following:", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 3cb2af8..d4efc02 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -37,6 +37,7 @@ "MSG.registerPersonal": "需上载身份证明文件数码档案以进行网上申请。
如:香港身份证; 护照; 中国内地身份证; 专业执业证书等", "MSG.registerOrg": "需上载以下任何一份证明文件以进行网上申请。
如:商业登记证;专业执业证书", "MSG.paymentMsg": "你的申请和付款已收到", + "MSG.expiredApp": "公共启事申请已过期", "MSG.paymentCancelMsg1": "付款取消讯息:", "MSG.paymentCancelMsg2": "你的付款已被取消。我们收到了你的付款请求,但由于某些原因,付款无法完成。请注意以下事项:", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index c85dba3..b6e248c 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -37,6 +37,7 @@ "MSG.registerPersonal": "需上載身份證明文件數碼檔案以進行網上申請。
如:香港身份證; 護照; 中國內地身份證; 專業執業証書等", "MSG.registerOrg": "需上載以下任何一份證明文件以進行網上申請。
如:商業登記證;專業執業證書", "MSG.paymentMsg": "你的申請和付款已收到", + "MSG.expiredApp": "公共啟事申請已過期", "MSG.paymentCancelMsg1": "付款取消訊息:", "MSG.paymentCancelMsg2": "你的付款已被取消。我們收到了你的付款請求,但由於某些原因,付款無法完成。請注意以下事項:", diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index ad61c6e..602035b 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -116,6 +116,7 @@ export const SET_PUBLIC_NOTICE_STATUS_WITHDRAW = apiPath+'/application/applicati export const SET_PUBLIC_NOTICE_STATUS_RESUBMIT = apiPath+'/application/application-detail-status-resubmit'; export const SET_PUBLIC_NOTICE_STATUS_REVIEWED = apiPath+'/application/application-detail-status-reviewed'; export const SET_PUBLIC_NOTICE_STATUS_PUBLISH = apiPath+'/application/application-detail-status-publish'; +export const SET_PUBLIC_NOTICE_STATUS_PUBLISH_BULK = apiPath+'/application/application-detail-status-publish-bulk'; export const UPDATE_PUBLIC_NOTICE_APPLY_DETAIL = apiPath+'/application/save'; export const GET_AUDIT_LOG_LIST = apiPath+'/settings/auditLogList';