Browse Source

application bulk published

master
Anna Ho 1 year ago
parent
commit
2dd069453b
7 changed files with 136 additions and 11 deletions
  1. +2
    -2
      src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js
  2. +125
    -5
      src/pages/PublicNotice/Search_GLD/DataGrid.js
  3. +5
    -4
      src/pages/PublicNotice/Search_GLD/index.js
  4. +1
    -0
      src/translations/en.json
  5. +1
    -0
      src/translations/zh-CN.json
  6. +1
    -0
      src/translations/zh-HK.json
  7. +1
    -0
      src/utils/ApiPathConst.js

+ 2
- 2
src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js View File

@@ -119,7 +119,7 @@ const ApplicationDetailCard = (
handlePaymentCheck(appIdList) handlePaymentCheck(appIdList)
return; return;
} }
setErrorText("公共啟事申請已過期");
setErrorText(intl.formatMessage({ id: "MSG.expiredApp" }));
setErrorPopUp(true); setErrorPopUp(true);
} }
}); });
@@ -693,7 +693,7 @@ const ApplicationDetailCard = (
}} }}
> >
<DialogTitle></DialogTitle> <DialogTitle></DialogTitle>
<Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography>
<Typography variant="h2" style={{ padding: '16px' }}><FormattedMessage id="MSG.actionFail" /></Typography>
<DialogContent style={{ display: 'flex', }}> <DialogContent style={{ display: 'flex', }}>
<Stack direction="column" justifyContent="space-between"> <Stack direction="column" justifyContent="space-between">
{ {


+ 125
- 5
src/pages/PublicNotice/Search_GLD/DataGrid.js View File

@@ -1,19 +1,35 @@
// material-ui // material-ui
import * as React from 'react'; import * as React from 'react';
import { import {
Button
Button,
Grid,
Typography,
Stack,
Dialog, DialogTitle, DialogContent, DialogActions,
} from '@mui/material'; } from '@mui/material';
import * as UrlUtils from "utils/ApiPathConst";
import * as HttpUtils from "utils/HttpUtils";
import * as DateUtils from "utils/DateUtils"; import * as DateUtils from "utils/DateUtils";
import * as FormatUtils from "utils/FormatUtils"; import * as FormatUtils from "utils/FormatUtils";
import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { FiDataGrid } from "components/FiDataGrid"; import { FiDataGrid } from "components/FiDataGrid";
import { notifyActionSuccess } from 'utils/CommonFunction';
import { FormattedMessage, useIntl } from "react-intl";
// ==============================|| EVENT TABLE ||============================== // // ==============================|| EVENT TABLE ||============================== //


export default function SearchPublicNoticeTable({ recordList }) {
export default function SearchPublicNoticeTable({ recordList, reloadFunction }) {
const [rows, setRows] = React.useState(recordList); const [rows, setRows] = React.useState(recordList);
const navigate = useNavigate() 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(() => { React.useEffect(() => {
setRows(recordList); setRows(recordList);
}, [recordList]); }, [recordList]);
@@ -57,7 +73,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
headerName: 'Contact Person', headerName: 'Contact Person',
flex: 2, flex: 2,
renderCell: (params) => { 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 : ""; company = company != null ? company : "";


/* /*
@@ -109,9 +125,55 @@ export default function SearchPublicNoticeTable({ recordList }) {
navigate('/application/' + params.id); navigate('/application/' + params.id);
} }


return (
<div style={{width: '100%' }}>
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 (<>

<div style={{ width: '100%' }}>
<Grid container direction="row" justifyContent="flex-start" alignItems="center" sx={{ p: 1 }} >
<Button
variant="contained"
onClick={()=>setIsConfirmPopUp(true)}
>
Published
</Button>
</Grid>

<FiDataGrid <FiDataGrid
checkboxSelection
disableRowSelectionOnClick
onRowSelectionModelChange={(newSelection) => {
setSelectedRowItems(newSelection);
}}
isRowSelectable={(params) => {
return ((params.row.creditor === true && params.row.status == "confirmed") ||
(params.row.creditor === false && params.row.status == "paid"))
}}
rows={rows} rows={rows}
columns={columns} columns={columns}
customPageSize={10} customPageSize={10}
@@ -119,5 +181,63 @@ export default function SearchPublicNoticeTable({ recordList }) {
onRowDoubleClick={handleRowDoubleClick} onRowDoubleClick={handleRowDoubleClick}
/> />
</div> </div>
<div>
<Dialog
open={isConfirmPopUp}
onClose={() => setIsConfirmPopUp(false)}
PaperProps={{
sx: {
minWidth: '40vw',
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' },
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' }
}
}}
>
<DialogTitle>
<Typography variant="h3" >
<FormattedMessage id="confirm" />
</Typography>
</DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Stack direction="column" justifyContent="space-between">
<Typography variant="h4" style={{ padding: '16px' }}>Please Confirm to mark selected application as Published.</Typography>
</Stack>
</DialogContent>
<DialogActions>
<Button onClick={() => setIsConfirmPopUp(false)} aria-label={intl.formatMessage({ id: 'close' })}>
<Typography variant="h5">
<FormattedMessage id="close" />
</Typography></Button>

<Button onClick={()=>doPublish()} aria-label={intl.formatMessage({ id: 'confirm' })}>
<Typography variant="h5">
<FormattedMessage id="confirm" />
</Typography></Button>
</DialogActions>
</Dialog>
</div>
<div>
<Dialog
open={isWarningPopUp}
onClose={() => setIsWarningPopUp(false)}
PaperProps={{
sx: {
minWidth: '40vw',
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
}
}}
>
<DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h4" style={{ padding: '16px' }}>{intl.formatMessage({ id: "MSG.plzSelectApp" })}</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setIsWarningPopUp(false)}><Typography variant="h5">OK</Typography></Button>
</DialogActions>
</Dialog>
</div>
</>

); );
} }

+ 5
- 4
src/pages/PublicNotice/Search_GLD/index.js View File

@@ -5,8 +5,8 @@ import {
Stack Stack
} from '@mui/material'; } from '@mui/material';
import MainCard from "components/MainCard"; import MainCard from "components/MainCard";
import * as UrlUtils from "utils/ApiPathConst";
import * as React from "react"; import * as React from "react";
import * as UrlUtils from "utils/ApiPathConst";
import * as HttpUtils from "utils/HttpUtils"; import * as HttpUtils from "utils/HttpUtils";
import * as DateUtils from "utils/DateUtils"; import * as DateUtils from "utils/DateUtils";


@@ -40,7 +40,7 @@ const UserSearchPage_Individual = () => {
const [onReady, setOnReady] = React.useState(false); const [onReady, setOnReady] = React.useState(false);


React.useEffect(() => { React.useEffect(() => {
getUserList();
getDataList();
getOrgCombo(); getOrgCombo();
getIssueCombo(); getIssueCombo();
}, []); }, []);
@@ -50,10 +50,10 @@ const UserSearchPage_Individual = () => {
}, [record]); }, [record]);


React.useEffect(() => { React.useEffect(() => {
getUserList();
getDataList();
}, [searchCriteria]); }, [searchCriteria]);


function getUserList() {
function getDataList() {
HttpUtils.get({ HttpUtils.get({
url: UrlUtils.GET_PUBLIC_NOTICE_LIST, url: UrlUtils.GET_PUBLIC_NOTICE_LIST,
params: searchCriteria, params: searchCriteria,
@@ -122,6 +122,7 @@ const UserSearchPage_Individual = () => {
> >
<EventTable <EventTable
recordList={record} recordList={record}
reloadFunction={getDataList}
/> />
</MainCard> </MainCard>
</Grid> </Grid>


+ 1
- 0
src/translations/en.json View File

@@ -37,6 +37,7 @@
"MSG.registerPersonal": "To complete the online application, you need to upload digital copies of identification documents.<br/>e.g. Hong Kong Identity Card, Passport, Mainland China Identity Card, Professional Practicing Certificate, etc.", "MSG.registerPersonal": "To complete the online application, you need to upload digital copies of identification documents.<br/>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.<br/>e.g. Business Registration Certificate, Professional Practicing Certificate, etc.", "MSG.registerOrg": "You need to upload the proof documents for the online application.<br/>e.g. Business Registration Certificate, Professional Practicing Certificate, etc.",
"MSG.paymentMsg": "Your application and payment have been received", "MSG.paymentMsg": "Your application and payment have been received",
"MSG.expiredApp": "Public notice application has expired",


"MSG.paymentCancelMsg1": "Payment cancellation message:", "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:", "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:",


+ 1
- 0
src/translations/zh-CN.json View File

@@ -37,6 +37,7 @@
"MSG.registerPersonal": "需上载身份证明文件数码档案以进行网上申请。 <br/>如:香港身份证; 护照; 中国内地身份证; 专业执业证书等", "MSG.registerPersonal": "需上载身份证明文件数码档案以进行网上申请。 <br/>如:香港身份证; 护照; 中国内地身份证; 专业执业证书等",
"MSG.registerOrg": "需上载以下任何一份证明文件以进行网上申请。 <br/>如:商业登记证;专业执业证书", "MSG.registerOrg": "需上载以下任何一份证明文件以进行网上申请。 <br/>如:商业登记证;专业执业证书",
"MSG.paymentMsg": "你的申请和付款已收到", "MSG.paymentMsg": "你的申请和付款已收到",
"MSG.expiredApp": "公共启事申请已过期",
"MSG.paymentCancelMsg1": "付款取消讯息:", "MSG.paymentCancelMsg1": "付款取消讯息:",
"MSG.paymentCancelMsg2": "你的付款已被取消。我们收到了你的付款请求,但由于某些原因,付款无法完成。请注意以下事项:", "MSG.paymentCancelMsg2": "你的付款已被取消。我们收到了你的付款请求,但由于某些原因,付款无法完成。请注意以下事项:",


+ 1
- 0
src/translations/zh-HK.json View File

@@ -37,6 +37,7 @@
"MSG.registerPersonal": "需上載身份證明文件數碼檔案以進行網上申請。<br/>如:香港身份證; 護照; 中國內地身份證; 專業執業証書等", "MSG.registerPersonal": "需上載身份證明文件數碼檔案以進行網上申請。<br/>如:香港身份證; 護照; 中國內地身份證; 專業執業証書等",
"MSG.registerOrg": "需上載以下任何一份證明文件以進行網上申請。<br/>如:商業登記證;專業執業證書", "MSG.registerOrg": "需上載以下任何一份證明文件以進行網上申請。<br/>如:商業登記證;專業執業證書",
"MSG.paymentMsg": "你的申請和付款已收到", "MSG.paymentMsg": "你的申請和付款已收到",
"MSG.expiredApp": "公共啟事申請已過期",


"MSG.paymentCancelMsg1": "付款取消訊息:", "MSG.paymentCancelMsg1": "付款取消訊息:",
"MSG.paymentCancelMsg2": "你的付款已被取消。我們收到了你的付款請求,但由於某些原因,付款無法完成。請注意以下事項:", "MSG.paymentCancelMsg2": "你的付款已被取消。我們收到了你的付款請求,但由於某些原因,付款無法完成。請注意以下事項:",


+ 1
- 0
src/utils/ApiPathConst.js View File

@@ -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_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_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 = 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 UPDATE_PUBLIC_NOTICE_APPLY_DETAIL = apiPath+'/application/save';
export const GET_AUDIT_LOG_LIST = apiPath+'/settings/auditLogList'; export const GET_AUDIT_LOG_LIST = apiPath+'/settings/auditLogList';




Loading…
Cancel
Save