| @@ -27,26 +27,50 @@ const SearchPublicNoticeForm = ({ formData }) => { | |||||
| initialValues: data, | initialValues: data, | ||||
| }); | }); | ||||
| const DisplayField = ({ name, width }) => { | |||||
| return <TextField | |||||
| fullWidth | |||||
| disabled | |||||
| size="small" | |||||
| onChange={formik.handleChange} | |||||
| id={name} | |||||
| name={name} | |||||
| value={formik.values[name]} | |||||
| variant="outlined" | |||||
| sx={ | |||||
| { | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| width: width ? width : '100%' | |||||
| } | |||||
| const DisplayField = ({ name, width, dummyUser }) => { | |||||
| return <> | |||||
| {dummyUser? | |||||
| <TextField | |||||
| fullWidth | |||||
| disabled | |||||
| size="small" | |||||
| onChange={formik.handleChange} | |||||
| id={name} | |||||
| name={name} | |||||
| value={"GLD: "+formik.values[name]} | |||||
| variant="outlined" | |||||
| sx={ | |||||
| { | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| width: width ? width : '100%' | |||||
| } | |||||
| } | |||||
| /> | |||||
| : | |||||
| <TextField | |||||
| fullWidth | |||||
| disabled | |||||
| size="small" | |||||
| onChange={formik.handleChange} | |||||
| id={name} | |||||
| name={name} | |||||
| value={formik.values[name]} | |||||
| variant="outlined" | |||||
| sx={ | |||||
| { | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| width: width ? width : '100%' | |||||
| } | |||||
| } | |||||
| /> | |||||
| } | } | ||||
| />; | |||||
| </> | |||||
| } | } | ||||
| @@ -97,9 +121,16 @@ const SearchPublicNoticeForm = ({ formData }) => { | |||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12} md={8} lg={8}> | <Grid item xs={12} md={8} lg={8}> | ||||
| <DisplayField | |||||
| name={formik.values?.orgId ? 'enCompanyName' : 'contactPerson'} | |||||
| /> | |||||
| { | |||||
| formik.values?.orgId? | |||||
| <DisplayField | |||||
| name={formik.values?.enCompanyName == "GLD" ? 'custName' : 'enCompanyName'} | |||||
| dummyUser={true} | |||||
| />: | |||||
| <DisplayField | |||||
| name={'contactPerson'} | |||||
| /> | |||||
| } | |||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| @@ -37,6 +37,7 @@ const ApplicationDetailCard = ({ | |||||
| useEffect(() => { | useEffect(() => { | ||||
| if (formData) { | if (formData) { | ||||
| console.log(formData) | |||||
| setData(formData); | setData(formData); | ||||
| } | } | ||||
| }, [formData]); | }, [formData]); | ||||
| @@ -46,26 +47,50 @@ const ApplicationDetailCard = ({ | |||||
| initialValues: data, | initialValues: data, | ||||
| }); | }); | ||||
| const DisplayField = ({ name, width }) => { | |||||
| return <TextField | |||||
| fullWidth | |||||
| disabled | |||||
| size="small" | |||||
| onChange={formik.handleChange} | |||||
| id={name} | |||||
| name={name} | |||||
| value={formik.values[name]} | |||||
| variant="outlined" | |||||
| sx={ | |||||
| { | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| width: width ? width : '100%' | |||||
| } | |||||
| const DisplayField = ({ name, width, dummyUser }) => { | |||||
| return <> | |||||
| {dummyUser? | |||||
| <TextField | |||||
| fullWidth | |||||
| disabled | |||||
| size="small" | |||||
| onChange={formik.handleChange} | |||||
| id={name} | |||||
| name={name} | |||||
| value={"GLD: "+formik.values[name]} | |||||
| variant="outlined" | |||||
| sx={ | |||||
| { | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| width: width ? width : '100%' | |||||
| } | |||||
| } | |||||
| /> | |||||
| : | |||||
| <TextField | |||||
| fullWidth | |||||
| disabled | |||||
| size="small" | |||||
| onChange={formik.handleChange} | |||||
| id={name} | |||||
| name={name} | |||||
| value={formik.values[name]} | |||||
| variant="outlined" | |||||
| sx={ | |||||
| { | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| width: width ? width : '100%' | |||||
| } | |||||
| } | |||||
| /> | |||||
| } | } | ||||
| />; | |||||
| </> | |||||
| } | } | ||||
| const confirmCancel = () => { | const confirmCancel = () => { | ||||
| @@ -170,10 +195,12 @@ const ApplicationDetailCard = ({ | |||||
| <Grid item xs={12} md={9} lg={9}> | <Grid item xs={12} md={9} lg={9}> | ||||
| <FormControl variant="outlined" fullWidth disabled > | <FormControl variant="outlined" fullWidth disabled > | ||||
| {data.orgId === null ? | |||||
| <DisplayField name="contactPerson" /> | |||||
| {data?.orgId? | |||||
| <DisplayField | |||||
| name="applicant" | |||||
| dummyUser={data?.enCompanyName == "GLD" ? true : false}/> | |||||
| : | : | ||||
| <DisplayField name="applicant" /> | |||||
| <DisplayField name="contactPerson" /> | |||||
| } | } | ||||
| </FormControl> | </FormControl> | ||||
| </Grid> | </Grid> | ||||
| @@ -83,6 +83,9 @@ export default function SearchPublicNoticeTable({searchCriteria, applyGridOnRead | |||||
| 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 : ""; | ||||
| if (company == "GLD"){ | |||||
| company = company + ": " + params.row.appCustName | |||||
| } | |||||
| return (<> | return (<> | ||||
| {params?.value}<br />{company} | {params?.value}<br />{company} | ||||
| </>); | </>); | ||||
| @@ -68,7 +68,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
| refNo: data.refNo, | refNo: data.refNo, | ||||
| code: data.code, | code: data.code, | ||||
| issueId: issueSelected?.id, | issueId: issueSelected?.id, | ||||
| gazettGroup: groupSelected?.type, | |||||
| gazettGroup: groupSelected?.code, | |||||
| dateFrom: sentDateFrom, | dateFrom: sentDateFrom, | ||||
| dateTo: sentDateTo, | dateTo: sentDateTo, | ||||
| contact: data.contact, | contact: data.contact, | ||||
| @@ -115,7 +115,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| return true | return true | ||||
| } | } | ||||
| }), | }), | ||||
| careOfDum: yup.string().max(60, getMaxErrStr(60)).test('checkCareOfDumFormat', intl.formatMessage({ id: 'requireCareOf' }), function (value) { | |||||
| custName: yup.string().max(150, getMaxErrStr(150)).test('checkCustNameFormat', intl.formatMessage({ id: 'requireCustName' }), function (value) { | |||||
| if (isDummyLoggedIn()) { | if (isDummyLoggedIn()) { | ||||
| if (value !== undefined) { | if (value !== undefined) { | ||||
| return true | return true | ||||
| @@ -175,8 +175,9 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| setSubmitting(true) | setSubmitting(true) | ||||
| let careOf = values.careOf ?? ""; | let careOf = values.careOf ?? ""; | ||||
| let remarks = values.remarks ?? ""; | let remarks = values.remarks ?? ""; | ||||
| let custName = values.custName ?? ""; | |||||
| if (isDummyLoggedIn()) { | if (isDummyLoggedIn()) { | ||||
| careOf = values.careOfDum | |||||
| custName = values.custName | |||||
| } | } | ||||
| if (isDummyLoggedIn()) { | if (isDummyLoggedIn()) { | ||||
| remarks = values.emailAddress | remarks = values.emailAddress | ||||
| @@ -196,6 +197,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| }, | }, | ||||
| issueId: issueId, | issueId: issueId, | ||||
| careOf: careOf, | careOf: careOf, | ||||
| custName: custName, | |||||
| remarks: remarks, | remarks: remarks, | ||||
| }, | }, | ||||
| files: [attachment], | files: [attachment], | ||||
| @@ -270,15 +272,27 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| <Box xs={12} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | <Box xs={12} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | ||||
| <form onSubmit={formik.handleSubmit}> | <form onSubmit={formik.handleSubmit}> | ||||
| <Grid container spacing={1} sx={{ minHeight: '80vh' }} direction="row" justifyContent="flex-start" alignItems="center"> | <Grid container spacing={1} sx={{ minHeight: '80vh' }} direction="row" justifyContent="flex-start" alignItems="center"> | ||||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||||
| {FieldUtils.getTextField({ | |||||
| label: intl.formatMessage({ id: 'applyPerson' }) + ":", | |||||
| valueName: "applyPerson", | |||||
| form: formik, | |||||
| disabled: true, | |||||
| autoFocus: false | |||||
| })} | |||||
| </Grid> | |||||
| { | |||||
| isDummyLoggedIn()? | |||||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||||
| {FieldUtils.getTextField({ | |||||
| label: intl.formatMessage({ id: 'applyPerson' }) + ":", | |||||
| valueName: "custName", | |||||
| form: formik, | |||||
| disabled: false, | |||||
| autoFocus: true | |||||
| })} | |||||
| </Grid>: | |||||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||||
| {FieldUtils.getTextField({ | |||||
| label: intl.formatMessage({ id: 'applyPerson' }) + ":", | |||||
| valueName: "applyPerson", | |||||
| form: formik, | |||||
| disabled: true, | |||||
| autoFocus: false | |||||
| })} | |||||
| </Grid> | |||||
| } | |||||
| <Grid item xs={12} md={12}> | <Grid item xs={12} md={12}> | ||||
| {FieldUtils.getTextField({ | {FieldUtils.getTextField({ | ||||
| label: intl.formatMessage({ id: 'contactPerson' }) + ":", | label: intl.formatMessage({ id: 'contactPerson' }) + ":", | ||||
| @@ -490,26 +504,14 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| </Grid> | </Grid> | ||||
| {isORGLoggedIn() ? | {isORGLoggedIn() ? | ||||
| <> | <> | ||||
| {isDummyLoggedIn() ? | |||||
| <Grid item xs={12} md={12} lg={12}> | |||||
| {FieldUtils.getCarOfField({ | |||||
| label: intl.formatMessage({ id: 'careOf' }) + ":", | |||||
| valueName: "careOfDum", | |||||
| form: formik, | |||||
| // disabled: true | |||||
| })} | |||||
| </Grid> | |||||
| : | |||||
| <Grid item xs={12} md={12} lg={12}> | |||||
| {FieldUtils.getCarOfField({ | |||||
| label: intl.formatMessage({ id: 'careOf' }) + ":", | |||||
| valueName: "careOf", | |||||
| form: formik, | |||||
| // disabled: true | |||||
| })} | |||||
| </Grid> | |||||
| } | |||||
| <Grid item xs={12} md={12} lg={12}> | |||||
| {FieldUtils.getCarOfField({ | |||||
| label: intl.formatMessage({ id: 'careOf' }) + ":", | |||||
| valueName: "careOf", | |||||
| form: formik, | |||||
| // disabled: true | |||||
| })} | |||||
| </Grid> | |||||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 3 }}> | <Grid item xs={12} md={12} lg={12} sx={{ mb: 3 }}> | ||||
| <Typography display="inline" variant="subtitle1" sx={{ color: 'primary.primary' }}> | <Typography display="inline" variant="subtitle1" sx={{ color: 'primary.primary' }}> | ||||
| <FormattedMessage id="noteOnClientRemark" /> | <FormattedMessage id="noteOnClientRemark" /> | ||||
| @@ -473,21 +473,38 @@ const ApplicationDetailCard = ( | |||||
| }, | }, | ||||
| }} | }} | ||||
| /> : | /> : | ||||
| <OutlinedInput | |||||
| fullWidth | |||||
| size="small" | |||||
| {...register("companyName", | |||||
| { | |||||
| value: companyName.enCompanyName, | |||||
| })} | |||||
| id='companyName' | |||||
| sx={{ | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| }} | |||||
| /> | |||||
| companyName.enCompanyName=="GLD"? | |||||
| <OutlinedInput | |||||
| fullWidth | |||||
| size="small" | |||||
| {...register("custName", | |||||
| { | |||||
| value: "GLD: "+currentApplicationDetailData.custName, | |||||
| })} | |||||
| id='custName' | |||||
| sx={{ | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| }} | |||||
| />: | |||||
| <OutlinedInput | |||||
| fullWidth | |||||
| size="small" | |||||
| {...register("companyName", | |||||
| { | |||||
| value: companyName.enCompanyName, | |||||
| })} | |||||
| id='companyName' | |||||
| sx={{ | |||||
| "& .MuiInputBase-input.Mui-disabled": { | |||||
| WebkitTextFillColor: "#000000", | |||||
| background: "#f8f8f8", | |||||
| }, | |||||
| }} | |||||
| /> | |||||
| } | } | ||||
| </FormControl> | </FormControl> | ||||
| </Grid> | </Grid> | ||||
| @@ -19,7 +19,6 @@ import { notifyActionSuccess, clickableLink } from 'utils/CommonFunction'; | |||||
| import { FormattedMessage, useIntl } from "react-intl"; | import { FormattedMessage, useIntl } from "react-intl"; | ||||
| import * as utils from "auth/utils" | import * as utils from "auth/utils" | ||||
| import { isGrantedAny } from "auth/utils"; | import { isGrantedAny } from "auth/utils"; | ||||
| // ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
| export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnReady }) { | export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnReady }) { | ||||
| @@ -106,6 +105,9 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea | |||||
| 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 : ""; | ||||
| if (company == "GLD"){ | |||||
| company = company + ": " + params.row.custName | |||||
| } | |||||
| let paymentMethod = params.row.paymentMethod!=null?intl.formatMessage({ id: utils.getPaymentMethod(params.row.paymentMethod)}):"" | let paymentMethod = params.row.paymentMethod!=null?intl.formatMessage({ id: utils.getPaymentMethod(params.row.paymentMethod)}):"" | ||||
| return (<> | return (<> | ||||
| {params?.value}<br />{company} <br/>{paymentMethod} | {params?.value}<br />{company} <br/>{paymentMethod} | ||||
| @@ -75,7 +75,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
| orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", | orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", | ||||
| issueId: issueSelected?.id, | issueId: issueSelected?.id, | ||||
| groupNo: data.groupNo, | groupNo: data.groupNo, | ||||
| gazettGroup: groupSelected?.type, | |||||
| gazettGroup: groupSelected?.code, | |||||
| }; | }; | ||||
| applySearch(temp); | applySearch(temp); | ||||
| // setSearchReady(true) | // setSearchReady(true) | ||||
| @@ -395,6 +395,7 @@ | |||||
| "contactPerson": "Contact Person", | "contactPerson": "Contact Person", | ||||
| "requireContactPerson": "Please enter contact person", | "requireContactPerson": "Please enter contact person", | ||||
| "requireCareOf": "Please enter client remarks", | "requireCareOf": "Please enter client remarks", | ||||
| "requireCustName": "Please enter the applicant", | |||||
| "search": "Search", | "search": "Search", | ||||
| "searchForm": "Search Form", | "searchForm": "Search Form", | ||||
| "cancel": "Cancel", | "cancel": "Cancel", | ||||
| @@ -427,6 +427,7 @@ | |||||
| "contactPerson": "联络人", | "contactPerson": "联络人", | ||||
| "requireContactPerson": "请输入联络人", | "requireContactPerson": "请输入联络人", | ||||
| "requireCareOf": "请输入客户备注", | "requireCareOf": "请输入客户备注", | ||||
| "requireCustName": "请输入申请人名称", | |||||
| "search": "搜寻", | "search": "搜寻", | ||||
| "searchForm": "搜寻表格", | "searchForm": "搜寻表格", | ||||
| "cancel": "取消", | "cancel": "取消", | ||||
| @@ -428,6 +428,7 @@ | |||||
| "contactPerson": "聯絡人", | "contactPerson": "聯絡人", | ||||
| "requireContactPerson": "請輸入聯絡人", | "requireContactPerson": "請輸入聯絡人", | ||||
| "requireCareOf": "請輸入客戶備註", | "requireCareOf": "請輸入客戶備註", | ||||
| "requireCustName": "請輸入申請人名稱", | |||||
| "search": "搜尋", | "search": "搜尋", | ||||
| "searchForm": "搜尋表格", | "searchForm": "搜尋表格", | ||||
| "cancel": "取消", | "cancel": "取消", | ||||
| @@ -91,12 +91,12 @@ export const publicNoticeStatic_GLD = [ | |||||
| export const groupTitle = [ | export const groupTitle = [ | ||||
| { key: 1, labelCht: 'A1 - 私人帳單', label: 'A1 - Private Bill', title: 'Private Bill', type: 'A001'}, | |||||
| { key: 2, labelCht: 'A2 - ???', label: 'A2 - Stock Shares', title: 'Stock Shares', type: 'A002'}, | |||||
| { key: 3, labelCht: 'B - 公司條例', label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B' }, | |||||
| { key: 4, labelCht: 'C - 高等法院', label: 'C - High Court', title: 'High Court', type: 'C' }, | |||||
| { key: 5, labelCht: 'D - 通知', label: 'D - Notices', title: 'Notices', type: 'D' }, | |||||
| { key: 6, labelCht: 'E - 其他', label: 'E - Miscellaneous (Companies)', title: 'Miscellaneous (Companies)', type: 'E' }, | |||||
| { key: 1, labelCht: 'A1 - 私人帳單', label: 'A1 - Private Bill', title: 'Private Bill', type: 'A', code: 'A001'}, | |||||
| { key: 2, labelCht: 'A2 - ???', label: 'A2 - Stock Shares', title: 'Stock Shares', type: 'A', code: 'A002'}, | |||||
| { key: 3, labelCht: 'B - 公司條例', label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B', code: 'B' }, | |||||
| { key: 4, labelCht: 'C - 高等法院', label: 'C - High Court', title: 'High Court', type: 'C', code: 'C'}, | |||||
| { key: 5, labelCht: 'D - 通知', label: 'D - Notices', title: 'Notices', type: 'D', code: 'D' }, | |||||
| { key: 6, labelCht: 'E - 其他', label: 'E - Miscellaneous (Companies)', title: 'Miscellaneous (Companies)', type: 'E', code: 'E' }, | |||||
| ]; | ]; | ||||
| export const proofPrice = [ | export const proofPrice = [ | ||||