Jason Chuang il y a 1 an
Parent
révision
ebbd7f79da
44 fichiers modifiés avec 657 ajouts et 439 suppressions
  1. +11
    -1
      src/pages/DemandNote/Create/DataGrid.js
  2. +10
    -9
      src/pages/DemandNote/Search/DataGrid.js
  3. +1
    -1
      src/pages/DemandNote/Search/SearchForm.js
  4. +64
    -46
      src/pages/Organization/DetailPage/OrganizationCard.js
  5. +3
    -12
      src/pages/Organization/DetailPage/OrganizationPubCard.js
  6. +156
    -138
      src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js
  7. +1
    -1
      src/pages/Organization/SearchPage/OrganizationSearchForm.js
  8. +2
    -2
      src/pages/Organization/SearchPage/OrganizationTable.js
  9. +4
    -4
      src/pages/Payment/Details_Public/DataGrid.js
  10. +1
    -1
      src/pages/Payment/Details_Public/PaymentDetails.js
  11. +1
    -1
      src/pages/Payment/FPS/FPS.js
  12. +2
    -2
      src/pages/Payment/Search_GLD/DataGrid.js
  13. +2
    -2
      src/pages/Payment/Search_Public/DataGrid.js
  14. +7
    -0
      src/pages/Proof/Create_FromApp/ProofForm.js
  15. +2
    -2
      src/pages/Proof/Reply_GLD/ApplicationDetails.js
  16. +1
    -5
      src/pages/Proof/Reply_Public/ProofForm.js
  17. +8
    -1
      src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js
  18. +1
    -0
      src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js
  19. +7
    -1
      src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js
  20. +5
    -1
      src/pages/PublicNotice/ListPanel/BaseGrid.js
  21. +48
    -72
      src/pages/PublicNotice/ListPanel/PendingPaymentTab.js
  22. +26
    -22
      src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js
  23. +47
    -11
      src/pages/User/DetailPage/UserInformationCard.js
  24. +1
    -0
      src/pages/User/DetailPage/index.js
  25. +12
    -7
      src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js
  26. +13
    -6
      src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js
  27. +5
    -2
      src/pages/User/DetailsPage_Individual/index.js
  28. +12
    -3
      src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
  29. +12
    -0
      src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js
  30. +4
    -1
      src/pages/User/DetailsPage_Organization/index.js
  31. +0
    -13
      src/pages/User/SearchPage/UserSearchForm.js
  32. +4
    -2
      src/pages/User/SearchPage_Individual/UserSearchForm_Individual.js
  33. +9
    -1
      src/pages/authentication/auth-forms/AuthLoginCustom.js
  34. +27
    -19
      src/pages/authentication/auth-forms/CustomFormWizard.js
  35. +21
    -16
      src/pages/authentication/auth-forms/PasswordAlertDialog.js
  36. +14
    -1
      src/pages/dashboard/GLD/index.js
  37. +15
    -1
      src/pages/dashboard/Public/index.js
  38. +4
    -0
      src/pages/iAmSmart/AuthCallback/index.js
  39. +28
    -12
      src/translations/en.json
  40. +21
    -6
      src/translations/zh-CN.json
  41. +21
    -8
      src/translations/zh-HK.json
  42. +8
    -2
      src/utils/ComboData.js
  43. +13
    -1
      src/utils/CommonFunction.js
  44. +3
    -3
      src/utils/statusUtils/PublicNoteStatusUtils.js

+ 11
- 1
src/pages/DemandNote/Create/DataGrid.js Voir le fichier

@@ -4,6 +4,7 @@ import {
Button
} from '@mui/material';
import * as DateUtils from "utils/DateUtils";
import * as FormatUtils from "utils/FormatUtils";
import * as PublicNoteStatusUtils from "utils/statusUtils/PublicNoteStatusUtils"
import { FiDataGrid } from "components/FiDataGrid";
// ==============================|| EVENT TABLE ||============================== //
@@ -100,6 +101,15 @@ export default function SearchPublicNoticeTable({ recordList }) {
return (params?.value) ? (params?.value) : "";
}
},
{
id: 'fee',
field: 'fee',
headerName: 'Amount($)',
flex: 1,
valueGetter: (params) => {
return FormatUtils.currencyFormat(params?.value);
}
},
];

return (
@@ -110,7 +120,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
rowHeight={80}
rows={rows}
columns={columns}
customPageSize={5}
customPageSize={10}
onRowDoubleClick={handleEditClick}
/>
</div>


+ 10
- 9
src/pages/DemandNote/Search/DataGrid.js Voir le fichier

@@ -43,7 +43,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })

const findReadyToSend=()=>{
const temp = {
status: 'pending',
readySend: true
};
applySearch(temp);
}
@@ -165,13 +165,14 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
{
field: 'appNo',
headerName: 'App No.',
width: 120,
width: 150,
},
{
id: 'contactPerson',
field: 'contactPerson',
headerName: 'Client',
width: 300,
minWidth: 300,
flex:1,
renderCell: (params) => {
let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName;
company = company != null ? company : "";
@@ -200,7 +201,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
{
field: 'cm',
headerName: 'Length',
width: 100,
width: 120,
renderCell: (params) => {
return (<>
{params?.value + "cm"}<br />
@@ -211,7 +212,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
{
field: 'amount',
headerName: 'Amount($)',
width: 100,
width: 120,
align: 'right',
valueGetter: (params) => {
return FormatUtils.currencyFormat(params?.value);
@@ -220,7 +221,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
{
field: 'dnNo',
headerName: 'DN No.',
width: 220,
width: 250,
renderCell: (params) => {
return <Button sx={{fontSize: '8px'}} onClick={handleDnClick(params)}><u>{params.row.dnNo}</u></Button>;
},
@@ -229,11 +230,11 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
id: 'issueDate',
field: 'issueDate',
headerName: 'Due Date / Sent Date',
width: 250,
width: 300,
renderCell: (params) => {
return (<>
{DateUtils.dateStr(params?.value)}
{params.row.sentDate ? "<br />" + DateUtils.datetimeStr(params.row.sentDate) + " - " + params.row.sentBy : " / To be sent"}
{params.row.sentDate ? <><br /> {DateUtils.datetimeStr(params.row.sentDate)} - {params.row.sentBy} </>: <> / To be sent</>}
</>);
}
},
@@ -243,7 +244,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
renderHeader: () => (
<><DownloadIcon />DN File</>
),
width: 250,
width: 280,
renderCell: (params) => {
return <Button onClick={onDownloadClick(params)}><u>{params.row.filename}</u></Button>;
},


+ 1
- 1
src/pages/DemandNote/Search/SearchForm.js Voir le fichier

@@ -156,7 +156,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue
}}
renderInput={(params) => (
<TextField {...params}
label="Organisation"
label="BR No./Organisation"
InputLabelProps={{
shrink: true
}}


+ 64
- 46
src/pages/Organization/DetailPage/OrganizationCard.js Voir le fichier

@@ -2,7 +2,7 @@
import {
Grid, Button, Checkbox, FormControlLabel, Typography,
Dialog, DialogTitle, DialogContent, DialogActions,
FormHelperText
FormHelperText, TextField,
} from '@mui/material';
// import { FormControlLabel } from '@material-ui/core';
import MainCard from "components/MainCard";
@@ -10,6 +10,7 @@ import * as React from "react";
import { useFormik } from 'formik';
import * as yup from 'yup';
import { useEffect, useState } from "react";
import * as DateUtils from 'utils/DateUtils';
import * as HttpUtils from 'utils/HttpUtils';
import * as UrlUtils from "utils/ApiPathConst";
import * as FieldUtils from "utils/FieldUtils";
@@ -19,8 +20,8 @@ import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifySaveSuccess } from 'utils/CommonFunction';
import { useIntl } from "react-intl";
import {PNSPS_BUTTON_THEME} from "themes/buttonConst";
import {ThemeProvider} from "@emotion/react";
import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
import { ThemeProvider } from "@emotion/react";

// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -48,12 +49,12 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
return <Typography variant="errorMessage1">{errorMsg}</Typography>
}

function getMaxErrStr(num, fieldname){
return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}));
function getMaxErrStr(num, fieldname) {
return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: fieldname ? intl.formatMessage({ id: fieldname }) + ": " : "" }));
}

function getRequiredErrStr(fieldname){
return displayErrorMsg(intl.formatMessage({ id: 'require'},{fieldname:fieldname?intl.formatMessage({ id: fieldname}):""}));
function getRequiredErrStr(fieldname) {
return displayErrorMsg(intl.formatMessage({ id: 'require' }, { fieldname: fieldname ? intl.formatMessage({ id: fieldname }) : "" }));
}

const formik = useFormik({
@@ -83,11 +84,11 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
}),
}),
onSubmit: values => {
if (values.country==null){
setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'}))
if (values.country == null) {
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' }))
} else {
if (values.country.key ==1 && values.district == null){
setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'}))
if (values.country.key == 1 && values.district == null) {
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' }))
} else {
HttpUtils.post({
url: UrlUtils.POST_ORG_SAVE_PATH,
@@ -124,7 +125,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
setEditMode(false);
}
});
}
}
}
}
});
@@ -204,24 +205,24 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
</> :
<>
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Grid item sx={{ ml: 0, mr: 3 }}>
<Button
variant="contained"
onClick={loadDataFun}
color="cancel"
>
<Grid item sx={{ ml: 0, mr: 3 }}>
<Button
variant="contained"
onClick={loadDataFun}
color="cancel"
>
Reset & Back
</Button>
</Grid>
<Grid item sx={{ ml: 3, mr: 3 }}>
<Button
variant="contained"
type="submit"
color="success"
>
Save
</Button>
</Grid>
</Button>
</Grid>
<Grid item sx={{ ml: 3, mr: 3 }}>
<Button
variant="contained"
type="submit"
color="success"
>
Save
</Button>
</Grid>
</ThemeProvider>
</>
}
@@ -244,13 +245,13 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
currentUserData.creditor ?
<Grid item sx={{ ml: 3, mr: 3 }}>
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Button
variant="contained"
color="error"
onClick={() => setNonCreditorConfirmPopUp(true)}
>
Mark as Non-Creditor
</Button>
<Button
variant="contained"
color="error"
onClick={() => setNonCreditorConfirmPopUp(true)}
>
Mark as Non-Credit Client
</Button>
</ThemeProvider>
</Grid>
:
@@ -261,7 +262,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
color="orange"
onClick={() => setCreditorConfirmPopUp(true)}
>
Mark as Creditor
Mark as Credit Client
</Button>
</ThemeProvider>
</Grid>
@@ -300,7 +301,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
<Grid item lg={4} >
<FormControlLabel
control={<Checkbox checked={formik.values.creditor} />}
label="is Creditor"
label="is Credit Client"
name="creditor"
onChange={() => {
formik.setFieldValue("creditor", !formik.values.creditor);
@@ -331,12 +332,29 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
</Grid>

<Grid item lg={4} >
{FieldUtils.getDateField({
label: FieldUtils.notNullFieldLabel("Expiry Date:"),
valueName: "brExpiryDate",
disabled: (!editMode && !createMode),
form: formik
})}
<Grid container alignItems={"center"}>
<Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
<Typography variant="pnspsFormParagraphBold">{FieldUtils.notNullFieldLabel("Expiry Date:")}</Typography>
</Grid>
<Grid item xs={12} md={6} lg={6}>
<TextField
fullWidth
id="brExpiryDate"
name="brExpiryDate"
type="date"
inputProps={{ min: DateUtils.dateStr(new Date()) }}
error={Boolean(formik.errors["brExpiryDate"])}
helperText={formik.errors["brExpiryDate"] ? formik.errors["brExpiryDate"] : ''}
onChange={formik.handleChange}
value={formik.values["brExpiryDate"]}
disabled={(!editMode && !createMode)}
sx={{
width:'100%'
}}
/>
</Grid>
</Grid>
</Grid>

<Grid item lg={4} >
@@ -423,7 +441,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
>
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Creditor?</Typography>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Credit Client?</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
@@ -445,7 +463,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
>
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Creditor?</Typography>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Credit Client?</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>


+ 3
- 12
src/pages/Organization/DetailPage/OrganizationPubCard.js Voir le fichier

@@ -224,16 +224,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
disabled: true,
form: formik
})}
{/* <FormControlLabel
control={<Checkbox checked={formik.values.creditor} />}
label="is Creditor"
name="creditor"
onChange={() => {
formik.setFieldValue("creditor", !formik.values.creditor);
}}
disabled={true}
//disabled={!editMode && !createMode}
/> */}
</Grid>

<Grid item lg={4} ></Grid>
@@ -349,7 +340,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
>
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Creditor?</Typography>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Credit Client?</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
@@ -371,7 +362,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
>
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Creditor?</Typography>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Credit Client?</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>


+ 156
- 138
src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js Voir le fichier

@@ -2,12 +2,13 @@
import {
Grid, Button, Typography,
Dialog, DialogTitle, DialogContent, DialogActions,
FormHelperText
FormHelperText, TextField
} from '@mui/material';
import MainCard from "components/MainCard";
import * as React from "react";
import * as yup from 'yup';
import { useEffect, useState } from "react";
import * as DateUtils from 'utils/DateUtils';
import * as HttpUtils from 'utils/HttpUtils';
import * as UrlUtils from "utils/ApiPathConst";
import * as FieldUtils from "utils/FieldUtils";
@@ -18,7 +19,7 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifyCreateSuccess } from 'utils/CommonFunction';
import {useIntl} from "react-intl";
import { useIntl } from "react-intl";

// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -48,34 +49,34 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => {
enableReinitialize: true,
initialValues: currentUserData,
validationSchema: yup.object().shape({
enCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'userRequireEnglishName'}))).required(displayErrorMsg(intl.formatMessage({id: 'userRequireEnglishName'}))),
chCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'userRequireChineseName'}))).nullable(),
addressLine1: yup.string().max(40).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine1'}))),
enCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({ id: 'userRequireEnglishName' }))).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireEnglishName' }))),
chCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' }))).nullable(),
addressLine1: yup.string().max(40).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))),
addressLine2: yup.string().max(40).nullable(),
addressLine3: yup.string().max(40).nullable(),
fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({id: 'requireDialingCode'}))).nullable(),
tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({id: 'requireDialingCode'}))),
phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'requiredValidNumber'}))).required(displayErrorMsg(intl.formatMessage({id: 'requireContactNumber'}))),
fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))).nullable(),
tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))),
phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requiredValidNumber' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))),
faxNumber: yup.string().min(8).nullable(),
brExpiryDate: yup.string().min(8).required(displayErrorMsg(intl.formatMessage({id: 'pleaseFillInBusinessRegCertValidityDate'}))),
brNo: yup.string().max(8).required(displayErrorMsg(intl.formatMessage({id: 'pleaseFillInBusinessRegCertNumber'})))
.test('checkBrNoFormat', displayErrorMsg(`${intl.formatMessage({id: 'pleaseFillInValidBusinessRegCertNumber'})} (e.g. 12341234)`), function (value) {
var brNo_pattern = /[0-9]{8}/
if (value !== undefined) {
if (value.match(brNo_pattern)) {
return true
} else {
return false
brExpiryDate: yup.string().min(8).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }))),
brNo: yup.string().max(8).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertNumber' })))
.test('checkBrNoFormat', displayErrorMsg(`${intl.formatMessage({ id: 'pleaseFillInValidBusinessRegCertNumber' })} (e.g. 12341234)`), function (value) {
var brNo_pattern = /[0-9]{8}/
if (value !== undefined) {
if (value.match(brNo_pattern)) {
return true
} else {
return false
}
}
}
}),
}),
}),
onSubmit: values => {
if (values.country==null){
setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'}))
if (values.country == null) {
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' }))
} else {
if (values.country.key ==1 && values.district == null){
setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'}))
if (values.country.key == 1 && values.district == null) {
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' }))
} else {
HttpUtils.post({
url: UrlUtils.POST_ORG_SAVE_PATH,
@@ -107,7 +108,7 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => {
}
},
onSuccess: function (responseData) {
if(responseData.msg){
if (responseData.msg) {
setFailText(responseData.msg);
setIsFailPopUp(true);
return;
@@ -143,131 +144,148 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => {


<div style={{ padding: 24 }}>
<form onSubmit={formik.handleSubmit}>
{!onReady?
<LoadingComponent />
:
<Grid container spacing={1}>
{/*top*/}
<Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center">
<Grid item sx={{mr: 3 }}>
<Button
size="large"
variant="contained"
type="submit"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
>
Create
</Button>
</Grid>
</Grid>
{/*top*/}
<form onSubmit={formik.handleSubmit}>
{!onReady ?
<LoadingComponent />
:
<Grid container spacing={1}>
{/*top*/}
<Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center">
<Grid item sx={{ mr: 3 }}>
<Button
size="large"
variant="contained"
type="submit"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
>
Create
</Button>
</Grid>
</Grid>
{/*top*/}

<Grid item xs={12}>
<FormHelperText error id="helper-text-address1-signup">
<Typography variant="errorMessage1">
{errorMsg}
</Typography>
</FormHelperText>
</Grid>
<Grid item lg={4}>
{FieldUtils.getTextField({
label: "BR No.:",
valueName: "brNo",
form: formik
})}
</Grid>
<Grid item xs={12}>
<FormHelperText error id="helper-text-address1-signup">
<Typography variant="errorMessage1">
{errorMsg}
</Typography>
</FormHelperText>
</Grid>

<Grid item lg={8}></Grid>
<Grid item lg={4}>
{FieldUtils.getTextField({
label: "BR No.:",
valueName: "brNo",
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getTextField({
label: FieldUtils.notNullFieldLabel("Name (Eng):"),
valueName: "enCompanyName",
form: formik
})}
</Grid>
<Grid item lg={8}></Grid>

<Grid item lg={4}>
{FieldUtils.getTextField({
label: "Name (Ch):",
valueName: "chCompanyName",
form: formik
})}
</Grid>
<Grid item lg={4}>
{FieldUtils.getTextField({
label: FieldUtils.notNullFieldLabel("Name (Eng):"),
valueName: "enCompanyName",
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getDateField({
label: FieldUtils.notNullFieldLabel("Expiry Date:"),
valueName: "brExpiryDate",
form: formik
})}
</Grid>
<Grid item lg={4}>
{FieldUtils.getTextField({
label: "Name (Ch):",
valueName: "chCompanyName",
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getTextField({
label: FieldUtils.notNullFieldLabel("Contact Person:"),
valueName: "contactPerson",
form: formik
})}
</Grid>
<Grid item lg={4} >
<Grid container alignItems={"center"}>
<Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
<Typography variant="pnspsFormParagraphBold">{FieldUtils.notNullFieldLabel("Expiry Date:")}</Typography>
</Grid>
<Grid item xs={12} md={6} lg={6}>
<TextField
fullWidth
id="brExpiryDate"
name="brExpiryDate"
type="date"
inputProps={{ min: DateUtils.dateStr(new Date()) }}
error={Boolean(formik.errors["brExpiryDate"])}
helperText={formik.errors["brExpiryDate"] ? formik.errors["brExpiryDate"] : ''}
onChange={formik.handleChange}
value={formik.values["brExpiryDate"]}
sx={{
width: '100%'
}}
/>
</Grid>
</Grid>

<Grid item lg={4}>
{FieldUtils.getPhoneField({
label: FieldUtils.notNullFieldLabel("Contact Tel:"),
valueName: {
code: "tel_countryCode",
num: "phoneNumber"
},
form: formik
})}
</Grid>
</Grid>

<Grid item lg={4}>
{FieldUtils.getPhoneField({
label: "Fax No:",
valueName: {
code: "fax_countryCode",
num: "faxNumber"
},
form: formik
})}
</Grid>
<Grid item lg={4}>
{FieldUtils.getTextField({
label: FieldUtils.notNullFieldLabel("Contact Person:"),
valueName: "contactPerson",
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getComboField({
label: FieldUtils.notNullFieldLabel("Country:"),
valueName: "country",
dataList: ComboData.country,
getOptionLabel: (option) => option.type? intl.formatMessage({ id: option.type}) : "",
form: formik
})}
</Grid>
<Grid item lg={4}>
{FieldUtils.getPhoneField({
label: FieldUtils.notNullFieldLabel("Contact Tel:"),
valueName: {
code: "tel_countryCode",
num: "phoneNumber"
},
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getComboField({
label: FieldUtils.notNullFieldLabel("District:"),
valueName: "district",
dataList: ComboData.district,
getOptionLabel: (option) => option.type? intl.formatMessage({ id: option.type}) : "",
form: formik
})}
</Grid>
<Grid item lg={4}>
{FieldUtils.getPhoneField({
label: "Fax No:",
valueName: {
code: "fax_countryCode",
num: "faxNumber"
},
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getAddressField({
label: FieldUtils.notNullFieldLabel("Address:"),
valueName: ["addressLine1", "addressLine2", "addressLine3"],
form: formik
})}
</Grid>
</Grid>
}
</form>
<Grid item lg={4}>
{FieldUtils.getComboField({
label: FieldUtils.notNullFieldLabel("Country:"),
valueName: "country",
dataList: ComboData.country,
getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getComboField({
label: FieldUtils.notNullFieldLabel("District:"),
valueName: "district",
dataList: ComboData.district,
getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
form: formik
})}
</Grid>

<Grid item lg={4}>
{FieldUtils.getAddressField({
label: FieldUtils.notNullFieldLabel("Address:"),
valueName: ["addressLine1", "addressLine2", "addressLine3"],
form: formik
})}
</Grid>
</Grid>
}
</form>
</div>

<div>


+ 1
- 1
src/pages/Organization/SearchPage/OrganizationSearchForm.js Voir le fichier

@@ -123,7 +123,7 @@ const OrganizationSearchForm = ({ applySearch }) => {
renderInput={(params) => (
<TextField
{...params}
label="Creditor/Non-creditor"
label="Credit Client/Non-Credit Client"
InputLabelProps={{
shrink: true
}}


+ 2
- 2
src/pages/Organization/SearchPage/OrganizationTable.js Voir le fichier

@@ -85,8 +85,8 @@ export default function OrganizationTable({ recordList }) {
{
id: 'creditor',
field: 'creditor',
headerName: 'Creditor',
width: 100,
headerName: 'Credit Client',
width: 150,
valueGetter: (params) => {
return params?.value?"Yes":"";
}


+ 4
- 4
src/pages/Payment/Details_Public/DataGrid.js Voir le fichier

@@ -64,7 +64,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
id: 'appNo',
field: 'appNo',
headerName: intl.formatMessage({id: 'terms'}),
headerName: intl.formatMessage({id: 'particulars'}),
width: isMdOrLg ? 'auto' : 300,
flex: isMdOrLg ? 1 : undefined,
renderCell: (params) => {
@@ -81,7 +81,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
id: 'fee',
field: 'fee',
headerName: intl.formatMessage({id: 'currencyPrice'}) + ' (HK$)',
headerName: intl.formatMessage({id: 'currencyAmount'}) + ' ($)',
width: 200,
valueGetter: (params) => {
return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : "";
@@ -102,9 +102,9 @@ export default function SearchPublicNoticeTable({ recordList }) {
<Grid container direction="row" justifyContent="flex-end" sx={{backgroundColor: '#fff' }}>
<Grid item>
<Typography align="right" variant="h4" sx={{mr:2,mt:1}}>
<FormattedMessage id="payTotal"/>:
<FormattedMessage id="payTotal"/>&nbsp;:&nbsp;
<span style={{ color: "blue", fontWeight: "bold", }}>
(HK$) {FormatUtils.currencyFormat(total)}
$&nbsp;{FormatUtils.currencyFormat(total)}
</span>
</Typography>
</Grid>


+ 1
- 1
src/pages/Payment/Details_Public/PaymentDetails.js Voir le fichier

@@ -136,7 +136,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => {
<Grid container >
<Grid item xs={6} md={6} sx={{ml:-5, textAlign: "right" }}>
<FormLabel sx={{ fontSize: "16px", color: "#000000" }}>
<FormattedMessage id="payTotal"/>:
<FormattedMessage id="payTotalDeatail"/>:
</FormLabel>
</Grid>
<Grid xs={6} md={5} sx={{ml:5,textAlign: "left" }}>


+ 1
- 1
src/pages/Payment/FPS/FPS.js Voir le fichier

@@ -299,7 +299,7 @@ const Index = () => {
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<img src={FpsIcon} width="80" height="80" alt="FPS"></img>
<br />
<FormattedMessage id="payTotal"/>
<FormattedMessage id="payTotalDeatail"/>
<br />
{"HK$ " + currencyFormat(paymentData.amount)}
</Typography>


+ 2
- 2
src/pages/Payment/Search_GLD/DataGrid.js Voir le fichier

@@ -64,7 +64,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
headerName: 'Trans. Date',
flex: 1,
valueGetter: (params) => {
return DateUtils.datetimeStr(params?.value);
return DateUtils.dateStr(params?.value);
}
},
{
@@ -72,7 +72,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
headerName: 'Status',
width: 150,
renderCell: (params) => {
return PaymentStatus.getStatus_Cht(params);
return PaymentStatus.getStatus_Eng(params);
}
},
{


+ 2
- 2
src/pages/Payment/Search_Public/DataGrid.js Voir le fichier

@@ -77,7 +77,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined,
valueGetter: (params) => {
return DateUtils.datetimeStr(params?.value);
return DateUtils.dateStr(params?.value);
}
},
{
@@ -94,7 +94,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
id: 'payAmount',
field: 'payAmount',
headerName: intl.formatMessage({id: 'fee'}),
headerName: intl.formatMessage({id: 'currencyAmount'}) + ' ($)',
width: 150,
valueGetter: (params) => {
return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : "";


+ 7
- 0
src/pages/Proof/Create_FromApp/ProofForm.js Voir le fichier

@@ -37,6 +37,9 @@ const FormPanel = ({ formData }) => {

const [saving, setSaving] = React.useState(false);

const [proofPaymentDeadlineMin, setProofPaymentDeadlineMin] = React.useState({});
const [reviseDeadlineMin, setReviseDeadlineMin] = React.useState({});

const navigate = useNavigate()

React.useEffect(() => {
@@ -46,6 +49,8 @@ const FormPanel = ({ formData }) => {
setColumnPrice(ComboData.proofPrice[1])
formData['length'] = 18;
}
setProofPaymentDeadlineMin(formData.proofPaymentDeadline);
setReviseDeadlineMin(formData.reviseDeadline);
}
}, [formData]);

@@ -206,6 +211,7 @@ const FormPanel = ({ formData }) => {
onChange={formik.handleChange}
name="reviseDeadline"
value={formik.values["reviseDeadline"]}
InputProps={{ inputProps: { min: DateUtils.datetimeStr(reviseDeadlineMin) } }}
variant="outlined"
sx={
{
@@ -232,6 +238,7 @@ const FormPanel = ({ formData }) => {
onChange={formik.handleChange}
name="proofPaymentDeadline"
value={formik.values["proofPaymentDeadline"]}
InputProps={{ inputProps: { min: DateUtils.datetimeStr(proofPaymentDeadlineMin) } }}
variant="outlined"
sx={
{


+ 2
- 2
src/pages/Proof/Reply_GLD/ApplicationDetails.js Voir le fichier

@@ -139,7 +139,7 @@ const ApplicationDetailCard = ({
<Grid container alignItems={"center"}>
<Grid item xs={12} md={3} lg={3}
sx={{ display: 'flex', alignItems: 'center' }}>
<FormLabel><Typography variant="h5">App No.:</Typography></FormLabel>
<FormLabel><Typography variant="h5">App. No.:</Typography></FormLabel>
</Grid>

<Grid item xs={12} md={9} lg={9}>
@@ -151,7 +151,7 @@ const ApplicationDetailCard = ({
<Grid container alignItems={"left"}>
<Grid item xs={12} md={3} lg={3}
sx={{ display: 'flex', alignItems: 'center' }}>
<FormLabel><Typography variant="h5">Status:</Typography></FormLabel>
<FormLabel><Typography variant="h5">App. Status:</Typography></FormLabel>
</Grid>

<Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}>


+ 1
- 5
src/pages/Proof/Reply_Public/ProofForm.js Voir le fichier

@@ -83,11 +83,7 @@ const FormPanel = ({ formData }) => {
onSuccess: function () {
notifyActionSuccess("提交成功!")
if (actionValue) {
if(data.creditor){
navigate("/proof/search");
}else{
navigate("/proof/pay/" + params.id);
}
navigate("/proof/pay/" + params.id);
} else {
navigate("/proof/search");
}


+ 8
- 1
src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js Voir le fichier

@@ -20,6 +20,7 @@ import Loadable from 'components/Loadable';
import { lazy } from 'react';
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
import * as HttpUtils from "utils/HttpUtils"
import * as DateUtils from "utils/DateUtils"
import * as UrlUtils from "utils/ApiPathConst"
import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";

@@ -93,7 +94,11 @@ const ApplicationDetailCard = (
};

const complatedClick = () => () => {
setStatus("complete")
let issueDate = DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate);
let current = new Date();
if(current.getTime() >= issueDate.getTime()){
setStatus("complete")
}
};

const withdrawnClick = () => () => {
@@ -225,11 +230,13 @@ const ApplicationDetailCard = (
// size="large"
variant="contained"
onClick={complatedClick()}
disabled={(new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime()}
sx={{
textTransform: 'capitalize',
alignItems: 'end',
backgroundColor: '#52b202'
}}>
<DoneIcon />
<Typography ml={1} variant="h5">Complete</Typography>
</Button>


+ 1
- 0
src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js Voir le fichier

@@ -119,6 +119,7 @@ const GazetteDetailCard = (
// size="large"
variant="contained"
onClick={groupDetailClick()}
disabled={applicationDetailData.data.status!="submitted"&&applicationDetailData.data.status!="reviewed"}
sx={{
textTransform: 'capitalize',
alignItems: 'end'


+ 7
- 1
src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js Voir le fichier

@@ -167,7 +167,13 @@ const ApplicationDetailCard = (
variant="contained"
onClick={cancelledClick()}
color="edit"
disabled={currentApplicationDetailData.status !== "submitted"}
disabled={currentApplicationDetailData.status == "rejected"
|| currentApplicationDetailData.status == "cancelled"
|| (!currentApplicationDetailData.creditor
&& currentApplicationDetailData.status == "paid")
|| (currentApplicationDetailData.creditor
&& currentApplicationDetailData.status == "confirmed")
}
title={intl.formatMessage({ id: 'cancel' })}
startIcon={<CloseIcon />}
aria-label={intl.formatMessage({ id: 'cancel' })}


+ 5
- 1
src/pages/PublicNotice/ListPanel/BaseGrid.js Voir le fichier

@@ -81,12 +81,16 @@ export default function BaseGrid({rows}) {
renderCell: (params) => (
isORGLoggedIn()?
<div>
<FormattedMessage id="gazetteCount" />: {params.row.issueVolume + "/" + params.row.issueYear
+ " No. " + params.row.issueNo}<br />
Care Of: {params.row.careOf} <br/>
<FormattedMessage variant="pnspsNormalText" id="myRemarks"/>: {params.row.remarks}
</div>:
<div>
{params.row.remarks}
<FormattedMessage id="gazetteCount" />: {params.row.issueVolume + "/" + params.row.issueYear
+ " No. " + params.row.issueNo}<br />
<FormattedMessage variant="pnspsNormalText" id="myRemarks"/>:{params.row.remarks}
{/* <Typography variant="pnspsNormalText">{params.row.remarks}</Typography> */}
</div>
)


+ 48
- 72
src/pages/PublicNotice/ListPanel/PendingPaymentTab.js Voir le fichier

@@ -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}<br/></>));
setExpiryDateErrText(str.split('\n').map(str => <>{str}<br /></>));
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}<br />
// {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() ?
<div>
Care Of: {params.row.careOf}<br/>
<FormattedMessage id="myRemarks"/>: {params.row.remarks}
Care Of: {params.row.careOf}<br />
<FormattedMessage id="myRemarks" />: {params.row.remarks}
</div> :
<div>
{/* <Typography variant="pnspsNormalText"> */}
{params.row.remarks}
{/* </Typography> */}
{params.row.remarks}
</div>
)
},
{
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 <Button aria-label={intl.formatMessage({id: 'viewDetail'})} onClick={handleDetailClick(params)}>
<FormattedMessage id="viewDetail"/>
return <Button aria-label={intl.formatMessage({ id: 'viewDetail' })} onClick={handleDetailClick(params)}>
<FormattedMessage id="viewDetail" />
</Button>;
},
}
@@ -220,21 +197,20 @@ export default function SubmittedTab({ rows }) {
content.push(<>
<Stack direction="row" justifyContent="space-between">
<Typography variant="h5">
<FormattedMessage id="applicationId"/>: {datas[i].appNo}
<FormattedMessage id="applicationId" />: {datas[i].appNo}
</Typography>
({DateUtils.datetimeStr(datas[i].created)})
</Stack>
<FormattedMessage id="extraMark"/>: {datas[i].remarks}
<FormattedMessage id="extraMark" />: {datas[i].remarks}
<br /><br />
</>);

totalAmount += datas[i].fee;
}
content.push(<Typography variant="h5">
<FormattedMessage id="totalAmount"/> (HK$): {FormatUtils.currencyFormat(totalAmount)}
<FormattedMessage id="totalAmount" /> (HK$): {FormatUtils.currencyFormat(totalAmount)}
<br /><br />
</Typography>);
//setAmount(totalAmount);
return content;
}

@@ -317,15 +293,15 @@ export default function SubmittedTab({ rows }) {
/>

<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Button
color="create"
variant="contained"
aria-label={intl.formatMessage({id: 'pay'})}
onClick={() => { handlePaymentBtn() }}
sx={{mt:2, ml:1}}
>
<FormattedMessage id="pay"/>
</Button>
<Button
color="create"
variant="contained"
aria-label={intl.formatMessage({ id: 'pay' })}
onClick={() => { handlePaymentBtn() }}
sx={{ mt: 2, ml: 1 }}
>
<FormattedMessage id="pay" />
</Button>
</ThemeProvider>
</div>

@@ -343,7 +319,7 @@ export default function SubmittedTab({ rows }) {
>
<DialogTitle>
<Typography variant="h3" >
<FormattedMessage id="payConfirm"/>
<FormattedMessage id="payConfirm" />
</Typography>
</DialogTitle>
<DialogContent style={{ display: 'flex', }}>
@@ -352,15 +328,15 @@ export default function SubmittedTab({ rows }) {
</Stack>
</DialogContent>
<DialogActions>
<Button onClick={() => setIsPopUp(false)} aria-label={intl.formatMessage({id: 'close'})}>
<Button onClick={() => setIsPopUp(false)} aria-label={intl.formatMessage({ id: 'close' })}>
<Typography variant="h5">
<FormattedMessage id="close"/>
<FormattedMessage id="close" />
</Typography></Button>

<Button onClick={() => doPayment()} aria-label={intl.formatMessage({id: 'confirm'})}>
<Button onClick={() => doPayment()} aria-label={intl.formatMessage({ id: 'confirm' })}>
<Typography variant="h5">
<FormattedMessage id="confirm"/>
</Typography></Button>
<FormattedMessage id="confirm" />
</Typography></Button>
</DialogActions>
</Dialog>
</div>
@@ -387,15 +363,15 @@ export default function SubmittedTab({ rows }) {
</Stack>
</DialogContent>
<DialogActions>
<Button onClick={() => setCheckCareOf(false)} aria-label={intl.formatMessage({id: 'close'})}>
<Button onClick={() => setCheckCareOf(false)} aria-label={intl.formatMessage({ id: 'close' })}>
<Typography variant="h5">
<FormattedMessage id="close"/>
<FormattedMessage id="close" />
</Typography></Button>

<Button onClick={() => afterWarningPayment()} aria-label={intl.formatMessage({id: 'confirm'})}>
<Button onClick={() => afterWarningPayment()} aria-label={intl.formatMessage({ id: 'confirm' })}>
<Typography variant="h5">
<FormattedMessage id="confirm"/>
</Typography></Button>
<FormattedMessage id="confirm" />
</Typography></Button>
</DialogActions>
</Dialog>
</div>
@@ -413,7 +389,7 @@ export default function SubmittedTab({ rows }) {
}}
>
<DialogTitle></DialogTitle>
<Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography>
<Typography variant="h4" style={{ paddingLeft: '24px' }}><FormattedMessage id="MSG.actionFail" /></Typography>
<DialogContent style={{ display: 'flex', }}>
<Stack direction="column" justifyContent="space-between">
{
@@ -422,9 +398,9 @@ export default function SubmittedTab({ rows }) {
</Stack>
</DialogContent>
<DialogActions>
<Button onClick={() => setExpiryDateErr(false)} aria-label={intl.formatMessage({id: 'close'})}>
<Button onClick={() => setExpiryDateErr(false)} aria-label={intl.formatMessage({ id: 'close' })}>
<Typography variant="h5">
<FormattedMessage id="close"/>
<FormattedMessage id="close" />
</Typography></Button>
</DialogActions>
</Dialog>


+ 26
- 22
src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js Voir le fichier

@@ -6,13 +6,13 @@ import {
} from '@mui/material';
import * as DateUtils from "utils/DateUtils";
import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
import {useNavigate} from "react-router-dom";
import {FiDataGrid} from "components/FiDataGrid";
import { useNavigate } from "react-router-dom";
import { FiDataGrid } from "components/FiDataGrid";
import {
isORGLoggedIn,
} from "utils/Utils";
import {useTheme} from "@emotion/react";
import {FormattedMessage, useIntl} from "react-intl";
} from "utils/Utils";
import { useTheme } from "@emotion/react";
import { FormattedMessage, useIntl } from "react-intl";
// ==============================|| EVENT TABLE ||============================== //

export default function SearchPublicNoticeTable({ recordList }) {
@@ -23,7 +23,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
const intl = useIntl();

const handleDetailClick = (params) => () => {
navigate('/publicNotice/'+ params.id);
navigate('/publicNotice/' + params.id);
};

React.useEffect(() => {
@@ -34,14 +34,14 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
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) => {
@@ -77,24 +77,28 @@ export default function SearchPublicNoticeTable({ recordList }) {
{
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()?
<div>
Care Of: {params.row.careOf} <br/>
<FormattedMessage id="myRemarks"/>: {params.row.remarks}
</div>:
<div>
<Typography variant="pnspsNormalText">{params.row.remarks}</Typography>
</div>
)
isORGLoggedIn() ?
<div>
<FormattedMessage id="gazetteCount" />: {params.row.issueVolume + "/" + params.row.issueYear
+ " No. " + params.row.issueNo}<br />
Care Of: {params.row.careOf} <br />
<FormattedMessage id="myRemarks" />: {params.row.remarks}
</div> :
<div>
<FormattedMessage id="gazetteCount" />: {params.row.issueVolume + "/" + params.row.issueYear
+ " No. " + params.row.issueNo}<br />
<Typography variant="pnspsNormalText">{params.row.remarks}</Typography>
</div>
)
},
{
id: 'status',
field: 'status',
headerName: intl.formatMessage({id: 'status'}),
headerName: intl.formatMessage({ id: 'status' }),
width: 200,
renderCell: (params) => {
return [StatusUtils.getStatusIntl(params, intl)]
@@ -108,16 +112,16 @@ export default function SearchPublicNoticeTable({ recordList }) {
cellClassName: 'actions',
renderCell: (params) => {
return <Button onClick={handleDetailClick(params)}
aria-label={intl.formatMessage({id: 'viewDetail'})}
aria-label={intl.formatMessage({ id: 'viewDetail' })}
>
<FormattedMessage id="viewDetail"/>
<FormattedMessage id="viewDetail" />
</Button>;
},
}
];

function handleRowDoubleClick(params) {
navigate('/publicNotice/'+ params.id);
navigate('/publicNotice/' + params.id);
}

return (


+ 47
- 11
src/pages/User/DetailPage/UserInformationCard.js Voir le fichier

@@ -6,6 +6,7 @@ import {
InputAdornment,
Typography, FormLabel,
OutlinedInput,
TextField
} from '@mui/material';
import MainCard from "../../../components/MainCard";
import * as React from "react";
@@ -18,6 +19,7 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo
//import {useParams} from "react-router-dom";
import Visibility from '@mui/icons-material/Visibility';
import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { useIntl } from "react-intl";

// ==============================|| DASHBOARD - DEFAULT ||============================== //
const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewRecord }) => {
@@ -25,8 +27,12 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR
const [currentUserData, setCurrentUserData] = React.useState({});
const [locked, setLocked] = useState(false);
const [showPassword, setShowPassword] = React.useState(false);
const [onReady, setOnReady] = useState(false);
const { register, getValues, formState: { errors }, } = useForm()
const [onReady, setOnReady] = React.useState(false);
const [pw, setPw] = React.useState("");
const [pwErr, setPwErr] = React.useState("");
const { register, getValues } = useForm();

const intl = useIntl();

const handleClickShowPassword = () => setShowPassword((show) => !show);
const handleMouseDownPassword = () => setShowPassword(!showPassword);
@@ -49,9 +55,40 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR
}
}, [currentUserData]);

useEffect(() => {
console.log("num");
console.log(pw.match(/^(?=.*[0-9])/));
console.log("small char");
console.log(pw.match(/^(?=.*[a-z])/));
console.log("SpecialChar");
console.log(pw.match(/^(?=.*[!@#%&]?)/));
setPwErr('');
if (pw.length == 0) {
setPwErr(intl.formatMessage({ id: 'requirePassword' }));
} else if (pw.length < 8) {
setPwErr(intl.formatMessage({ id: 'atLeast8CharPassword' }));
} else if (pw.length > 60) {
setPwErr(intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: "" }));
}
else if (/\s/.test(pw) ) {
setPwErr(intl.formatMessage({ id: 'noSpacePassword' }));
} else if (! /[a-z]/.test(pw)) {
setPwErr(intl.formatMessage({ id: 'atLeastOneSmallLetter' }));
} else if (! /[A-Z]/.test(pw)) {
setPwErr(intl.formatMessage({ id: 'atLeastOneCapLetter' }));
} else if (! /[0-9]/.test(pw)) {
setPwErr(intl.formatMessage({ id: 'atLeast1Number' }));
} else if (! /[!@#%&]/.test(pw)) {
setPwErr(intl.formatMessage({ id: 'atLeast1SpecialChar' }));
}
}, [pw]);

useEffect(() => {
//upload latest data to parent
const values = getValues();
values.password = pw;
values.pwErr = pwErr;
const objectData = {
...values,
locked: locked,
@@ -110,19 +147,19 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR

<Grid item xs={7} s={7} md={7} lg={6}>
<FormControl variant="outlined" fullWidth required>
<OutlinedInput
<TextField
variant="outlined"
fullWidth
size="small"
{...register("password", {
minLength: {
value: 8,
message: "Must be at least 8 characters long",
},
validate: (value) => value % 2 === 0 || "The number of servings must be an even number",
})}
{...register("password")}
id='password'
type={showPassword ? 'text' : 'password'}
disabled={!isNewRecord}
error={pwErr}
helperText={pwErr}
onChange={(value) => {
setPw(value.target.value);
}}
endAdornment={
<InputAdornment position="end">
<IconButton
@@ -138,7 +175,6 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR
/>
</FormControl>
</Grid>
<span style={{ "color": "red" }}>{errors.password?.message}</span>
</Grid>
</Grid> : null
}


+ 1
- 0
src/pages/User/DetailPage/index.js Voir le fichier

@@ -171,6 +171,7 @@ const UserMaintainPage = () => {
return false;
});
} else {
if(editedCustomerData.pwErr) return;
axios.post(POST_ADMIN_USER_REGISTER,
{
"username": editedCustomerData.username,


+ 12
- 7
src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js Voir le fichier

@@ -45,12 +45,6 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""});
}

function getRequiredErrStr(fieldname){
return intl.formatMessage({ id: 'require'},{fieldname:fieldname?intl.formatMessage({ id: fieldname}):""});
}



const formik = useFormik({
enableReinitialize: true,
initialValues: currentUserData,
@@ -68,7 +62,6 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
fax_countryCode: yup.string().min(3, intl.formatMessage({id: 'require3Number'})),
phoneNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).required(intl.formatMessage({id: 'requireContactNumber'})),
faxNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).nullable(),
district: yup.string().required(getRequiredErrStr("district")),
}),
onSubmit: values => {
if (values.country==null){
@@ -102,6 +95,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
addressLine2: values.addressLine2,
addressLine3: values.addressLine3,
},
preferLocale: values.preferLocale.type
},
onSuccess: function () {
notifySaveSuccess();
@@ -519,6 +513,17 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
form: formik
})}
</Grid>

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getComboField({
label: intl.formatMessage({id: 'language'}) + ":",
valueName: "preferLocale",
dataList: ComboData.Locale,
getOptionLabel: (option) => option.label? option.label: "",
disabled: (!editMode),
form: formik
})}
</Grid>
</Grid>
</Grid>
</form>


+ 13
- 6
src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js Voir le fichier

@@ -44,11 +44,6 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""});
}

function getRequiredErrStr(fieldname){
return intl.formatMessage({ id: 'require'},{fieldname:fieldname?intl.formatMessage({ id: fieldname}):""});
}


const formik = useFormik({
enableReinitialize: true,
initialValues: currentUserData,
@@ -63,9 +58,9 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
fax_countryCode: yup.string().min(3, intl.formatMessage({id: 'require3Number'})),
phoneNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).required(intl.formatMessage({id: 'requireContactNumber'})),
faxNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).nullable(),
district: yup.string().required(getRequiredErrStr("district")),
}),
onSubmit: values => {
// console.log(values)
if (values.country==null){
setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'}))
} else {
@@ -92,6 +87,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
addressLine2: values.addressLine2,
addressLine3: values.addressLine3,
},
preferLocale: values.preferLocale.type
},
onSuccess: function () {
notifySaveSuccess();
@@ -357,6 +353,17 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
form: formik
})}
</Grid>

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getComboField({
label: intl.formatMessage({id: 'language'}) + ":",
valueName: "preferLocale",
dataList: ComboData.Locale,
getOptionLabel: (option) => option.label? option.label: "",
disabled: (!editMode),
form: formik
})}
</Grid>
</Grid>
</Grid>
</form>


+ 5
- 2
src/pages/User/DetailsPage_Individual/index.js Voir le fichier

@@ -22,7 +22,7 @@ const BackgroundHead = {
}
import Loadable from 'components/Loadable';
import { useNavigate } from "react-router-dom";
import {getObjectByValue} from "utils/CommonFunction";
import {getObjectByValue,getObjectByType} from "utils/CommonFunction";
import * as ComboData from "utils/ComboData";
const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent')));
const UserInformationCard = Loadable(React.lazy(() => import('./UserInformationCard_Individual')));
@@ -80,6 +80,7 @@ const UserMaintainPage_Individual = () => {
response.data["fax_countryCode"] = response.data.faxNo?.countryCode;
response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLogin) : "";
response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale);
setFormData(response.data);
}
@@ -104,7 +105,9 @@ const UserMaintainPage_Individual = () => {
response.data["faxNumber"] = response.data.faxNo?.faxNumber;
response.data["fax_countryCode"] = response.data.faxNo?.countryCode;
response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale);
// console.log(response.data)
setFormData(response.data);
}
});


+ 12
- 3
src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js Voir le fichier

@@ -101,7 +101,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
orgId: values.orgId,
// brNo: values.brNo,
// brExpiryDate: values.brExpiryDate,
preferLocale: values.preferLocale.type
},
onSuccess: function () {
notifySaveSuccess()
@@ -394,8 +394,17 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
form: formik
})}
</Grid>

<Grid item lg={8}></Grid>
<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getComboField({
label: intl.formatMessage({id: 'language'}) + ":",
valueName: "preferLocale",
dataList: ComboData.Locale,
getOptionLabel: (option) => option.label? option.label: "",
disabled: (!editMode),
form: formik
})}
</Grid>
<Grid item lg={4}></Grid>

<Grid item lg={4}>
<Grid container alignItems={"center"}>


+ 12
- 0
src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js Voir le fichier

@@ -19,6 +19,7 @@ import { notifySaveSuccess, } from 'utils/CommonFunction';
import {FormattedMessage, useIntl} from "react-intl";
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst";
import {ThemeProvider} from "@emotion/react";
import * as ComboData from "utils/ComboData";

// import {
// isPrimaryLoggedIn,
@@ -67,6 +68,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {
countryCode: values.tel_countryCode,
phoneNumber: values.phoneNumber
},
preferLocale: values.preferLocale.type
},
onSuccess: function () {
notifySaveSuccess()
@@ -202,6 +204,16 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {
form: formik
})}
</Grid>
<Grid item xs={12} lg={12}>
{FieldUtils.getComboField({
label: intl.formatMessage({id: 'language'}) + ":",
valueName: "preferLocale",
dataList: ComboData.Locale,
getOptionLabel: (option) => option.label? option.label: "",
disabled: (!editMode),
form: formik
})}
</Grid>

</Grid>
</div>


+ 4
- 1
src/pages/User/DetailsPage_Organization/index.js Voir le fichier

@@ -19,7 +19,7 @@ import ForwardIcon from '@mui/icons-material/Forward';
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import { useNavigate } from 'react-router-dom';
import * as ComboData from "utils/ComboData";
import {getObjectByValue} from "utils/CommonFunction";
import {getObjectByValue,getObjectByType} from "utils/CommonFunction";

const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
@@ -139,6 +139,8 @@ const UserMaintainPage_Organization = () => {
response.data["faxNumber"] = response.data.faxNo?.faxNumber;
response.data["fax_countryCode"] = response.data.faxNo?.countryCode;
response.data["status"] = response.data?.locked?"locked":response.data?.status;
response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale);
//response.data["orgId"] = response.data.brExpiryDate?DateUtils.dateStr(response.data.brExpiryDate):"";
@@ -162,6 +164,7 @@ const UserMaintainPage_Organization = () => {
response.data["faxNumber"] = response.data.faxNo?.faxNumber;
response.data["fax_countryCode"] = response.data.faxNo?.countryCode;
response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale);
//response.data["orgId"] = response.data.brExpiryDate?DateUtils.dateStr(response.data.brExpiryDate):"";
setUserData(response.data);


+ 0
- 13
src/pages/User/SearchPage/UserSearchForm.js Voir le fichier

@@ -46,7 +46,6 @@ const UserSearchForm = ({ applySearch }) => {
enName: data.fullenName,
post: data.post,
email: data.email,
phone: data.phone,
locked: locked,
};
applySearch(temp);
@@ -136,18 +135,6 @@ const UserSearchForm = ({ applySearch }) => {
/>
</Grid>

<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}>
<TextField
fullWidth
{...register("phone")}
id="phone"
label="Phone"
InputLabelProps={{
shrink: true
}}
/>
</Grid>

<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}>
<FormControlLabel
control={


+ 4
- 2
src/pages/User/SearchPage_Individual/UserSearchForm_Individual.js Voir le fichier

@@ -33,8 +33,10 @@ const UserSearchForm_Individual = ({ applySearch }) => {
fullName: data.fullenName,
email: data.email,
phone: data.phone,
accountFilter: accountFilter,
};
if(accountFilter!="All"){
temp["accountFilter"] = accountFilter;
}
applySearch(temp);
};

@@ -113,7 +115,7 @@ const UserSearchForm_Individual = ({ applySearch }) => {
disablePortal
id="accountFilter"
size="small"
options={["Active", "Locked", "Not verified"]}
options={["All","Active", "Locked", "Not verified"]}
value={accountFilter}
onChange={(event, newValue) => {
if (newValue !== null) {


+ 9
- 1
src/pages/authentication/auth-forms/AuthLoginCustom.js Voir le fichier

@@ -109,6 +109,10 @@ const AuthLoginCustom = () => {
// setLocale("zh-CN");
localStorage.setItem('locale','zh-CN');
}
if (response.data.preferLocale ==="en"){
// setLocale("zh-CN");
localStorage.setItem('locale','en');
}
}
dispatch(handleLogin(data))
navigate('/dashboard');
@@ -118,7 +122,11 @@ const AuthLoginCustom = () => {
.catch((error) => {
// setSuccess(false)
setOnLogin(false)
setErrorMassage(error.response.data.error)
if(error.response!= undefined){
setErrorMassage(error.response.data.error)
}else{
setErrorMassage("CONNECTION_ERROR")
}
setOpen(true)
});
} else {


+ 27
- 19
src/pages/authentication/auth-forms/CustomFormWizard.js Voir le fichier

@@ -303,13 +303,13 @@ const CustomFormWizard = (props) => {
selectedAddress4, selectedAddress5,
termsAndConAccept, termsAndConNotAccept, fileList])

useEffect(()=>{
useEffect(() => {
setDistrictErrStr("");
if(selectedAddress5?.type === "hongKong"){
if(selectedAddress4 ==null || selectedAddress4 == ""|| selectedAddress4 == {})
if (selectedAddress5?.type === "hongKong") {
if (selectedAddress4 == null || selectedAddress4 == "" || selectedAddress4 == {})
setDistrictErrStr(getRequiredErrStr("district"))
}
},[selectedAddress4, selectedAddress5])
}, [selectedAddress4, selectedAddress5])

useEffect(() => {
props.step == 2 ? _onSubmit() : null;
@@ -541,11 +541,11 @@ const CustomFormWizard = (props) => {
return <Typography variant="errorMessage1">{errorMsg}</Typography>
}

function getMaxErrStr(num, fieldname){
return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}));
function getMaxErrStr(num, fieldname) {
return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: fieldname ? intl.formatMessage({ id: fieldname }) + ": " : "" }));
}
function getRequiredErrStr(fieldname){
return displayErrorMsg(intl.formatMessage({ id: 'require'},{fieldname:fieldname?intl.formatMessage({ id: fieldname}):""}));
function getRequiredErrStr(fieldname) {
return displayErrorMsg(intl.formatMessage({ id: 'require' }, { fieldname: fieldname ? intl.formatMessage({ id: fieldname }) : "" }));
}

const formik = useFormik({
@@ -581,14 +581,17 @@ const CustomFormWizard = (props) => {
.matches(/^(?=.*[0-9])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1Number' })) })
.matches(/^(?=.*[!@#%&])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1SpecialChar' })) }),
confirmPassword: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'atLeast8CharPassword' }))).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseConfirmPassword' }))).oneOf([yup.ref('password'), null], displayErrorMsg(intl.formatMessage({ id: 'samePassword' }))),
enName: yup.string().max(40, getMaxErrStr(40)).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireEnglishName' }))),
chName: yup.string().max(6, getMaxErrStr(6)).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' }))),
enName: yup.string().max(40, getMaxErrStr(40)),
chName: yup.string().max(6, getMaxErrStr(6)).when('enName', {
is: (enName) => enName?false:true,
then: yup.string().required(displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' })))
}),
address1: yup.string().max(40, getMaxErrStr(40, "addressLine1")).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))),
address2: yup.string().max(40, getMaxErrStr(40, "addressLine2")),
address3: yup.string().max(40, getMaxErrStr(40, "addressLine3")),
email: yup.string().email(displayErrorMsg(intl.formatMessage({ id: 'validEmailFormat' }))).max(128, getMaxErrStr(128)).required(displayErrorMsg(intl.formatMessage({ id: 'requireEmail' }))),
emailConfirm: yup.string().email(displayErrorMsg(intl.formatMessage({ id: 'validEmailFormat' }))).max(128, getMaxErrStr(128)).required(displayErrorMsg(intl.formatMessage({ id: 'requireEmail' }))).oneOf([yup.ref('email'), null], displayErrorMsg(intl.formatMessage({ id: 'validSameEmail' }))),
idNo: yup.string().required(displayErrorMsg(`${intl.formatMessage({ id: 'require' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`))
idNo: yup.string().required(getRequiredErrStr('number'))
.matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) })
.matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpace' })}`) })
.test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredValid' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`), function (value) {
@@ -648,7 +651,7 @@ const CustomFormWizard = (props) => {
// faxCountryCode: yup.string().min(3,'請輸入3位數字'),
phone: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requireAtLeast8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))),
// fax: yup.string().min(8,'請輸入8位數字'),
captchaField: yup.string().max(5, getMaxErrStr(5)).required(displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))),//.oneOf([captcha], displayErrorMsg('請輸入有效驗證')),
captchaField: yup.string().max(5, getMaxErrStr(5)).required(displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))),//.oneOf([captcha], displayErrorMsg('請輸入有效驗證')),
}),
});

@@ -934,7 +937,7 @@ const CustomFormWizard = (props) => {
/>
{formik.touched.idDocType && (
selectedIdDocType === null || selectedIdDocType?.type == null ?
<FormHelperText error id="helper-text-idDocType-signup" sx={{fontSize:16,fontWeight: 'bold',}}>
<FormHelperText error id="helper-text-idDocType-signup" sx={{ fontSize: 16, fontWeight: 'bold', }}>
<FormattedMessage id="requireIdDocType" />
</FormHelperText> : ''
)}
@@ -1067,12 +1070,17 @@ const CustomFormWizard = (props) => {
}
</Grid>
</Grid>
<Grid item xs={12} md={12}>
<Typography variant="subtitle1">
(<FormattedMessage id="registerNameLabel" />)
</Typography>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="enName-signup">
<Typography variant="pnspsFormHeader">
<FormattedMessage id="userEnglishName" />
{selectedIdDocType.type === "CNID" ? "" : <span style={{ color: '#f10000' }}>*</span>}
{selectedIdDocType.type === "CNID" ? "" : <span style={{ color: '#f10000' }}></span>}
</Typography>
</InputLabel>
<OutlinedInput
@@ -1105,7 +1113,7 @@ const CustomFormWizard = (props) => {
<InputLabel htmlFor="chName-signup">
<Typography variant="pnspsFormHeader">
<FormattedMessage id="userChineseName" />
<span style={{ color: '#f10000' }}>*</span>
<span style={{ color: '#f10000' }}></span>
</Typography>
</InputLabel>
<OutlinedInput
@@ -1199,7 +1207,7 @@ const CustomFormWizard = (props) => {
value={selectedAddress4}
options={ComboData.district}
disabled={checkCountry}
error={Boolean(districtErrStr!="")}
error={Boolean(districtErrStr != "")}
onBlur={formik.handleBlur}
getOptionLabel={(option) => option.type ? intl.formatMessage({ id: option.type }) : ""}
onChange={(event, newValue) => {
@@ -1252,7 +1260,7 @@ const CustomFormWizard = (props) => {
{formik.errors.address3}
</FormHelperText>
)}
{districtErrStr!= "" && (
{districtErrStr != "" && (
<FormHelperText error >
{districtErrStr}
</FormHelperText>
@@ -1685,8 +1693,8 @@ const CustomFormWizard = (props) => {
<FormattedMessage id="idDocType" />:
</Typography>
<Typography variant="pnspsFormHeader" name="preview-idDocType">
{intl.formatMessage({ id: selectedIdDocType?.label??" " })}
{intl.formatMessage({ id: selectedIdDocType?.label ?? " " })}
</Typography>
</Stack>
</Grid>


+ 21
- 16
src/pages/authentication/auth-forms/PasswordAlertDialog.js Voir le fichier

@@ -29,22 +29,27 @@ const PasswordAlertDialog = (props) => {
<DialogTitle id="alert-dialog-title">
<Stack mt={1} mr={4} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
<CancelOutlinedIcon color="error" sx={{ width: "35px", height: "40px" }} />
{props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ?
<Stack direction="column">
<Typography display="inline">
帳戶將被封鎖
</Typography>
<Typography display="inline">
帳戶連續五次登入錯誤,請與系統管理員聯絡
</Typography>
</Stack> :
props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ?
<Typography display="inline">
帳戶尚未驗證
</Typography> :
<Typography display="inline">
用戶名或密碼錯誤
</Typography>
{
props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ?
<Stack direction="column">
<Typography display="inline">
<FormattedMessage id="loginErrorMessage1"/>
</Typography>
<Typography display="inline">
<FormattedMessage id="loginErrorMessage2"/>
</Typography>
</Stack> :
props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ?
<Typography display="inline">
<FormattedMessage id="loginErrorMessage3"/>
</Typography> :
props.errorMassage === 'CONNECTION_ERROR' ?
<Typography display="inline">
<FormattedMessage id="loginErrorMessage4"/>
</Typography>:
<Typography display="inline">
<FormattedMessage id="loginErrorMessage5"/>
</Typography>
}
</Stack>
</DialogTitle>


+ 14
- 1
src/pages/dashboard/GLD/index.js Voir le fichier

@@ -20,13 +20,26 @@ const DashboardDefault = () => {
backgroundColor: '#0C489E',
backgroundPosition: 'right'
}
const getWelcomeMsg=()=>{
var current = new Date()
var curHr = current.getHours()

if (curHr < 12) {
return "Good Morning"
} else if (curHr < 18) {
return "Good Afternoon"
} else {
//evening
return "Good Evening"
}
}
return (
<Grid container sx={{minHeight: '87vh', backgroundColor: "backgroundColor.default"}} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}>
Morning, {userData.fullenName}
{getWelcomeMsg()}, {userData.fullenName}
</Typography>
</Stack>
</div>


+ 15
- 1
src/pages/dashboard/Public/index.js Voir le fichier

@@ -35,6 +35,20 @@ const DashboardDefault = () => {
backgroundColor: '#0C489E',
backgroundPosition: 'right'
}

const getWelcomeMsg=()=>{
var current = new Date()
var curHr = current.getHours()

if (curHr < 12) {
return <FormattedMessage id="welcomeMsg_am" />
} else if (curHr < 18) {
return <FormattedMessage id="welcomeMsg_pm" />
} else {
return <FormattedMessage id="welcomeMsg_night" />
}
}

return (
<Grid container sx={{ minHeight: '87vh' }} direction="column">
<Grid item xs={12} >
@@ -42,7 +56,7 @@ const DashboardDefault = () => {
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
{/* <Typography variant="h5">我的公共啟事</Typography> */}
<Typography color='#FFF' variant="h5" sx={{ ml: 10, display: { xs: 'none', sm: 'none', md: 'block' } }}>
{isORGLoggedIn() ? userData.fullenName : userData.fullchName}, <FormattedMessage id="welcomeMsg" />
{isORGLoggedIn() ? userData.fullenName : userData.fullchName}, {getWelcomeMsg()}
</Typography>
</Stack>
</div>


+ 4
- 0
src/pages/iAmSmart/AuthCallback/index.js Voir le fichier

@@ -61,6 +61,10 @@ const Index = () => {
// setLocale("zh-CN");
localStorage.setItem('locale','zh-CN');
}
if (response.data.preferLocale ==="en"){
// setLocale("zh-CN");
localStorage.setItem('locale','en');
}
}
dispatch(handleLogin(data))
navigate('/dashboard');


+ 28
- 12
src/translations/en.json Voir le fichier

@@ -2,15 +2,16 @@
"en": "English",
"zh-HK": "繁體中文",
"zh-CN": "简体中文",

"language":"Language",
"PNSPS": "PNSPS",
"HKSARGOV": "HKSAR Government",
"HKGLD": "Government Logistics Department",
"importantNotice": "Important Notice",
"privacyPolicy": "Privacy Policy",
"Gazette": "Gazette",
"gazetteDate": "GazetteDate",
"gazetteLength": "length",
"gazetteDate": "Gazette Date",
"gazetteLength": "Length",
"gazetteSampleName": "Gazette Supplement No. 6",
"reason": "Reason",

@@ -64,6 +65,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",
@@ -78,7 +81,7 @@
"registerFail": "Application failed, please try again later",

"mainPage": "Main Page",
"myPublicNotice": "My Public Notice",
"myPublicNotice": "My Public Notices",
"publicNotice": "Public Notice",
"publicNoticePayment": "Public Notice: Payment",
"publicNoticePaymentFail": "Public Notice: Payment Failed",
@@ -93,7 +96,10 @@
"onlinePaymentHistory": "Online Payment History",
"setting": "Settings",
"companyOrUserRecord": "Company/Institutional User Records",
"welcomeMsg": "Good afternoon! Please select the required service.",
"welcomeMsg_am": "Good morning! Please select the required service.",
"welcomeMsg_pm": "Good afternoon! Please select the required service.",
"welcomeMsg_night": "Good evening! Please select the required service.",


"login": "Login",
"logout": "Logout",
@@ -105,6 +111,13 @@
"register": "Register",
"userLoginName": "Username",
"userPassword": "Password",
"loginErrorMessage1":"Account will be blocked",
"loginErrorMessage2":"Account login errors for Five Consecutive Times, please contact the system administrator",
"loginErrorMessage3":"Account has not been Verified",
"loginErrorMessage4":"System Connection Failed",
"loginErrorMessage5":"Incorrect Username or Password",

"newPassword": "New Password",
"setNewPassword": "Please enter new password",
"forgotUserPassword": "Forgot Password",
@@ -137,6 +150,7 @@
"registerNewBusinessUser": "Apply as organisation/company user",
"becomeNewBusinessUser": "Become New Organisation/Company user",
"userName": "Username",
"registerNameLabel": "Please provide either an English name or a Chinese name, at a minimum.",
"userChineseName": "Chinese Name",
"userEnglishName": "English Name",
"userContactName": "Name",
@@ -312,12 +326,13 @@
"price": "Price",
"pay": "Pay",
"payDate": "Payment Date",
"payDateFrom": "Payment date (from)",
"payDateFrom": "Payment Date (from)",
"payStatus": "Payment Status",
"payId": "Payment Code",
"payConfirm": "Confirm payment",
"payCancel": "Cancel payment",
"payTotal": "Payment total",
"payTotalDeatail": "Total Payment Amount",
"payTotal": "Total",
"payDetail": "Payment Details",
"payMethod": "Payment method",
"selectPaymentMethod": "Please select a payment method",
@@ -331,8 +346,9 @@
"totalAmount": "Total Amount",
"close": "Close",
"confirm": "Confirm",
"terms": "Terms",
"particulars": "Particulars",
"currencyPrice": "Price",
"currencyAmount": "Amount",
"transactionRefNo": "Transaction Reference Number",
"selectedPaymentMethod": "Selected payment method",
"paymentMethodNotAvailable":"The payment function is currently not available",
@@ -342,7 +358,7 @@
"publicNoticeDetailTitle": "Public Notice Application Information",
"applyPerson": "Applicant",
"applyStatus": "Application Status",
"applyStatus": "App. Status",
"gazetteCount": "Gazette issues number",
"gazetteCount2" :"Gazette issues number / Remarks",
"gazetteCount2_1" :"Care Of / Remarks",
@@ -383,7 +399,7 @@
"transactionNo": "Transaction number",
"transactionDate": "Transaction date",
"transactionTime": "Transaction time",
"paymentRefCode": "Payment Reference Number",
"paymentRefCode": "Payment reference number",

"paymentInfoRecord": "Payment Notice Record",
"paymentRecordId": "Payment record number",
@@ -434,9 +450,9 @@
"organizationProfile": "Organisation Profile",
"organizationDetails": "Organisation Details",
"brNo": "BR No.",
"creditorAccount": "Creditor account",
"creditorAccount": "Credit Client",
"nameEng": "Name (Eng)",
"nameChi": "Name (Ch)",
"nameChi": "Name (Chi)",
"expiryDate": "Expiry date",
"create": "Create",
"confirmTo": "Confirm to ",


+ 21
- 6
src/translations/zh-CN.json Voir le fichier

@@ -2,6 +2,7 @@
"en": "English",
"zh-HK": "繁體中文",
"zh-CN": "简体中文",
"language":"語言",

"PNSPS": "公共启事提交及缴费系统",
"HKSARGOV": "香港特别行政区政府",
@@ -11,7 +12,7 @@
"Gazette": "宪报",
"gazetteDate": "宪报日期",
"gazetteLength": "长度",
"gazetteSampleName": "宪报第6号副刊公",
"gazetteSampleName": "宪报第6号副刊公共启事",
"reason": "原因",

"payInstantly": "即时网上缴费",
@@ -63,9 +64,11 @@
"MSG.payMsg3": "如你在宪报期数{issueYear} 年{issueVolume} 卷, 第{issueNo} 期内有多于一个公共启事的申请,你可选择完成所有此期所有稿件校对确定后,于缴费期限前在「我的公共启事」内合并付款。 ",

"MSG.proofOutOfTime": "回覆逾时,请重新申请。",
"MSG.plzSelectApp": "请选择公共启事。",
"MSG.actionFail": "行动失败",

"registerTitle1": "立即成为",
"registerTitle2": "宪报刊登公",
"registerTitle2": "宪报刊登公共启事",
"registerTitle3": "用户",
"registerSubTitle": "只需4-5分钟",
"or": "或",
@@ -92,7 +95,9 @@
"onlinePaymentHistory": "网上付款记录",
"setting": "设置",
"companyOrUserRecord": "公司/机构用户记录",
"welcomeMsg": "午安! 请选择所需服务。",
"welcomeMsg_am": "早安! 请选择所需服务。",
"welcomeMsg_pm": "午安! 请选择所需服务。",
"welcomeMsg_night": "晚安! 请选择所需服务。",

"login": "登录",
"logout": "登出",
@@ -104,6 +109,13 @@
"register": "申请",
"userLoginName": "用户登入名称",
"userPassword": "密码",
"loginErrorMessage1":"帐户将被封锁",
"loginErrorMessage2":"帐户连续五次登入错误,请与系统管理员联络",
"loginErrorMessage3":"帐户尚未验证",
"loginErrorMessage4":"系统连接失败",
"loginErrorMessage5":"用户名或密码错误",

"newPassword": "新密码",
"setNewPassword": "请输入新密码",
"forgotUserPassword": "忘记密码",
@@ -132,6 +144,7 @@
"registerNewBusinessUser": "申请机构/公司用户",
"becomeNewBusinessUser": "成为新的机构/公司用户",
"userName": "用户名称",
"registerNameLabel": "请至少输入英文姓名或中文姓名。",
"userChineseName": "中文姓名",
"userEnglishName": "英文姓名",
"userContactName": "姓名",
@@ -312,6 +325,7 @@
"payId": "付款编号",
"payConfirm": "确认付款",
"payCancel": "取消付款",
"payTotalDeatail": "付款总额",
"payTotal": "付款总额",
"payDetail": "付款详情",
"payMethod": "付款方式",
@@ -326,8 +340,9 @@
"totalAmount": "总额",
"close": "关闭",
"confirm": "确认",
"terms": "项目",
"particulars": "项目",
"currencyPrice": "金额",
"currencyAmount": "金额",
"transactionRefNo": "交易參考編號",
"selectedPaymentMethod": "已選擇付款方法",
"paymentMethodNotAvailable":"付款功能現在不可用",
@@ -400,8 +415,8 @@

"submitApplication": "提交公共启事申请",
"applicationSubheading": "提供你的启事内容作排版,校对及计价。",
"announcement": "公",
"viewAllAnnouncement": "显示所有公",
"announcement": "公共启事",
"viewAllAnnouncement": "显示所有公共启事",
"systemMessage": "系统消息",
"viewAllSystemMessage": "显示所有消息",
"msgDetails": "消息详情",


+ 21
- 8
src/translations/zh-HK.json Voir le fichier

@@ -2,6 +2,7 @@
"en": "English",
"zh-HK": "繁體中文",
"zh-CN": "简体中文",
"language":"語言",

"PNSPS": "公共啟事提交及繳費系統",
"HKSARGOV": "香港特別行政區政府",
@@ -11,7 +12,7 @@
"Gazette": "憲報",
"gazetteDate": "憲報日期",
"gazetteLength": "長度",
"gazetteSampleName": "憲報第6號副刊公",
"gazetteSampleName": "憲報第6號副刊公共啟事",
"reason": "原因",

"payInstantly": "即時網上繳費",
@@ -63,9 +64,11 @@
"MSG.payMsg3": "如你在憲報期數 {issueYear} 年 {issueVolume} 卷, 第 {issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。",

"MSG.proofOutOfTime": "回覆逾時,請重新申請。",
"MSG.plzSelectApp": "請選擇公共啟事。",
"MSG.actionFail": "行動失敗",

"registerTitle1": "立即成為",
"registerTitle2": "憲報刊登公",
"registerTitle2": "憲報刊登公共啟事",
"registerTitle3": "用戶",
"registerSubTitle": "只需4-5分鐘",
"or": "或",
@@ -92,7 +95,9 @@
"onlinePaymentHistory": "網上付款記錄",
"setting": "設定",
"companyOrUserRecord": "公司/機構用戶記錄",
"welcomeMsg": "午安! 請選擇所需服務。",
"welcomeMsg_am": "早安! 請選擇所需服務。",
"welcomeMsga_pm": "午安! 請選擇所需服務。",
"welcomeMsg_night": "晚安! 請選擇所需服務。",

"login": "登入",
"logout": "登出",
@@ -104,6 +109,13 @@
"register": "申請",
"userLoginName": "用戶登入名稱",
"userPassword": "密碼",
"loginErrorMessage1":"帳戶將被封鎖",
"loginErrorMessage2":"帳戶連續五次登入錯誤,請與系統管理員聯絡",
"loginErrorMessage3":"帳戶尚未驗證",
"loginErrorMessage4":"系統連接失敗",
"loginErrorMessage5":"用戶名或密碼錯誤",

"newPassword": "新密碼",
"setNewPassword": "請輸入新密碼",
"forgotUserPassword": "忘記密碼",
@@ -112,10 +124,8 @@
"forgotPasswordSubTitle": "請輸入你的用戶登入名稱以重設密碼",
"forgotPasswordSubTitle1": "請輸入你的用戶登入名稱",
"forgotPasswordSubTitle2": "以重設密碼",

"forgotUsernameSubTitle": "請輸入你的電郵以重設密碼",
"forgotUsernameSubTitle1": "請輸入你的電郵",
"resetPasswordSuccess": "已成功重設密碼。",
"securityCode": "安全驗證碼",
"sentSecurityCode1": "我們已將驗證碼送至你的電郵:",
@@ -137,6 +147,7 @@
"registerNewBusinessUser": "申請機構/公司用戶",
"becomeNewBusinessUser": "成為新的機構/公司用戶",
"userName": "用戶名稱",
"registerNameLabel": "請至少輸入英文姓名或中文姓名。",
"userChineseName": "中文姓名",
"userEnglishName": "英文姓名",
"userContactName": "姓名",
@@ -317,6 +328,7 @@
"payId": "付款編號",
"payConfirm": "確認付款",
"payCancel": "取消付款",
"payTotalDeatail": "付款總額",
"payTotal": "付款總額",
"payDetail": "付款詳情",
"payMethod": "付款方式",
@@ -331,8 +343,9 @@
"totalAmount": "總額",
"close": "關閉",
"confirm": "確認",
"terms": "項目",
"particulars": "項目",
"currencyPrice": "金額",
"currencyAmount": "金額",
"transactionRefNo": "交易參考編號",
"selectedPaymentMethod": "已選擇付款方法",
"paymentMethodNotAvailable":"付款功能現在不可用",
@@ -405,8 +418,8 @@

"submitApplication": "提交公共啟事申請",
"applicationSubheading": "提供你的啟事內容作排版,校對及計價。",
"announcement": "告",
"viewAllAnnouncement": "顯示所有告",
"announcement": "告",
"viewAllAnnouncement": "顯示所有告",
"systemMessage": "系統消息",
"viewAllSystemMessage": "顯示所有消息",
"msgDetails": "消息詳情",


+ 8
- 2
src/utils/ComboData.js Voir le fichier

@@ -122,6 +122,12 @@ export const denmandNoteStatus_Public = [

export const CreditorStatus = [
{ key: 0, labelCht: '全部', label: 'All', type: 'all' },
{ key: 1, labelCht: '債權人', label:'Creditor', type: 'true' },
{ key: 2, labelCht: '非債權人', label:'No-Creditor', type: 'false' },
{ key: 1, labelCht: '債權人', label:'Credit Client', type: 'true' },
{ key: 2, labelCht: '非債權人', label:'Non-Credit Client', type: 'false' },
];

export const Locale = [
{ id: 1, key: 1, label: 'English', type: 'en' },
{ id: 2, key: 2, label: '繁體中文', type: 'zh_HK' },
{ id: 3, key: 3, label: '简体中文', type: 'zh_CN' },
];

+ 13
- 1
src/utils/CommonFunction.js Voir le fichier

@@ -30,7 +30,19 @@ export function getObjectByValue(list, valueName, value) {
const obj = list.find((element) => {
return element[valueName] === parseInt(value);
});
console.log(obj);
// console.log(obj);
return obj === undefined || Object.keys(obj).length <= 0 ? null : obj
}

export function getObjectByType(list, valueName, value) {
// console.log(list)
// console.log(valueName)
// console.log(value)
const obj = list.find((element) => {
// console.log(element[valueName])
return element[valueName] === value;
});
// console.log(obj);
return obj === undefined || Object.keys(obj).length <= 0 ? null : obj
}



+ 3
- 3
src/utils/statusUtils/PublicNoteStatusUtils.js Voir le fichier

@@ -21,7 +21,7 @@ export function getStatusByText(status, creditor) {
return getStatusTag({ color: "#22a13f", text: "待付款" })
case "paid":
return getStatusTag({ color: "#22a13f", text: "待發佈" })
case "complated":
case "completed":
return getStatusTag({ color: "#8a8784", text: "已完成" })
case "notAccepted":
return getStatusTag({ color: "#d9372b", text: "不接受" })
@@ -54,7 +54,7 @@ export function getStatusByTextEng(status, creditor) {
return getStatusTag({ color: "#F39C12", text: "Pending Payment" })
case "paid":
return getStatusTag({ color: "#3498DB", text: "Pending Publish" })
case "complated":
case "completed":
return getStatusTag({ color: "#8a8784", text: "Completed" })
case "notAccepted":
return getStatusTag({ color: "#d9372b", text: "Not accepted" })
@@ -88,7 +88,7 @@ export function getStatusByTextIntl(status, creditor, intl) {
return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPayment'}) })
case "paid":
return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) })
case "complated":
case "completed":
return getStatusTag({ color: "#8a8784", text: intl.formatMessage({id: 'completed'}) })
case "notAccepted":
return getStatusTag({ color: "#d9372b", text: intl.formatMessage({id: 'notAccepted'}) })


Chargement…
Annuler
Enregistrer