Procházet zdrojové kódy

handle dummy user client display

CR003
Alex Cheung před 9 měsíci
rodič
revize
50a22d0d69
12 změnil soubory, kde provedl 184 přidání a 99 odebrání
  1. +53
    -22
      src/pages/Proof/Create_FromApp/ApplicationDetails.js
  2. +49
    -22
      src/pages/Proof/Reply_GLD/ApplicationDetails.js
  3. +3
    -0
      src/pages/Proof/Search_GLD/DataGrid.js
  4. +1
    -1
      src/pages/Proof/Search_GLD/SearchForm.js
  5. +33
    -31
      src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js
  6. +32
    -15
      src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js
  7. +3
    -1
      src/pages/PublicNotice/Search_GLD/DataGrid.js
  8. +1
    -1
      src/pages/PublicNotice/Search_GLD/SearchForm.js
  9. +1
    -0
      src/translations/en.json
  10. +1
    -0
      src/translations/zh-CN.json
  11. +1
    -0
      src/translations/zh-HK.json
  12. +6
    -6
      src/utils/ComboData.js

+ 53
- 22
src/pages/Proof/Create_FromApp/ApplicationDetails.js Zobrazit soubor

@@ -27,26 +27,50 @@ const SearchPublicNoticeForm = ({ formData }) => {
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 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>


+ 49
- 22
src/pages/Proof/Reply_GLD/ApplicationDetails.js Zobrazit soubor

@@ -37,6 +37,7 @@ const ApplicationDetailCard = ({

useEffect(() => {
if (formData) {
console.log(formData)
setData(formData);
}
}, [formData]);
@@ -46,26 +47,50 @@ const ApplicationDetailCard = ({
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 = () => {
@@ -170,10 +195,12 @@ const ApplicationDetailCard = ({

<Grid item xs={12} md={9} lg={9}>
<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>
</Grid>


+ 3
- 0
src/pages/Proof/Search_GLD/DataGrid.js Zobrazit soubor

@@ -83,6 +83,9 @@ export default function SearchPublicNoticeTable({searchCriteria, applyGridOnRead
renderCell: (params) => {
let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName;
company = company != null ? company : "";
if (company == "GLD"){
company = company + ": " + params.row.appCustName
}
return (<>
{params?.value}<br />{company}
</>);


+ 1
- 1
src/pages/Proof/Search_GLD/SearchForm.js Zobrazit soubor

@@ -68,7 +68,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss
refNo: data.refNo,
code: data.code,
issueId: issueSelected?.id,
gazettGroup: groupSelected?.type,
gazettGroup: groupSelected?.code,
dateFrom: sentDateFrom,
dateTo: sentDateTo,
contact: data.contact,


+ 33
- 31
src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js Zobrazit soubor

@@ -115,7 +115,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) =>
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 (value !== undefined) {
return true
@@ -175,8 +175,9 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) =>
setSubmitting(true)
let careOf = values.careOf ?? "";
let remarks = values.remarks ?? "";
let custName = values.custName ?? "";
if (isDummyLoggedIn()) {
careOf = values.careOfDum
custName = values.custName
}
if (isDummyLoggedIn()) {
remarks = values.emailAddress
@@ -196,6 +197,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) =>
},
issueId: issueId,
careOf: careOf,
custName: custName,
remarks: remarks,
},
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' }}>
<form onSubmit={formik.handleSubmit}>
<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}>
{FieldUtils.getTextField({
label: intl.formatMessage({ id: 'contactPerson' }) + ":",
@@ -490,26 +504,14 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) =>
</Grid>
{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 }}>
<Typography display="inline" variant="subtitle1" sx={{ color: 'primary.primary' }}>
<FormattedMessage id="noteOnClientRemark" />


+ 32
- 15
src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js Zobrazit soubor

@@ -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>
</Grid>


+ 3
- 1
src/pages/PublicNotice/Search_GLD/DataGrid.js Zobrazit soubor

@@ -19,7 +19,6 @@ import { notifyActionSuccess, clickableLink } from 'utils/CommonFunction';
import { FormattedMessage, useIntl } from "react-intl";
import * as utils from "auth/utils"
import { isGrantedAny } from "auth/utils";

// ==============================|| EVENT TABLE ||============================== //

export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnReady }) {
@@ -106,6 +105,9 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
renderCell: (params) => {
let company = params.row.enCompanyName != null ? params.row.enCompanyName : params.row.chCompanyName;
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)}):""
return (<>
{params?.value}<br />{company} <br/>{paymentMethod}


+ 1
- 1
src/pages/PublicNotice/Search_GLD/SearchForm.js Zobrazit soubor

@@ -75,7 +75,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss
orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "",
issueId: issueSelected?.id,
groupNo: data.groupNo,
gazettGroup: groupSelected?.type,
gazettGroup: groupSelected?.code,
};
applySearch(temp);
// setSearchReady(true)


+ 1
- 0
src/translations/en.json Zobrazit soubor

@@ -395,6 +395,7 @@
"contactPerson": "Contact Person",
"requireContactPerson": "Please enter contact person",
"requireCareOf": "Please enter client remarks",
"requireCustName": "Please enter the applicant",
"search": "Search",
"searchForm": "Search Form",
"cancel": "Cancel",


+ 1
- 0
src/translations/zh-CN.json Zobrazit soubor

@@ -427,6 +427,7 @@
"contactPerson": "联络人",
"requireContactPerson": "请输入联络人",
"requireCareOf": "请输入客户备注",
"requireCustName": "请输入申请人名称",
"search": "搜寻",
"searchForm": "搜寻表格",
"cancel": "取消",


+ 1
- 0
src/translations/zh-HK.json Zobrazit soubor

@@ -428,6 +428,7 @@
"contactPerson": "聯絡人",
"requireContactPerson": "請輸入聯絡人",
"requireCareOf": "請輸入客戶備註",
"requireCustName": "請輸入申請人名稱",
"search": "搜尋",
"searchForm": "搜尋表格",
"cancel": "取消",


+ 6
- 6
src/utils/ComboData.js Zobrazit soubor

@@ -91,12 +91,12 @@ export const publicNoticeStatic_GLD = [


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 = [


Načítá se…
Zrušit
Uložit