| @@ -4,6 +4,7 @@ import { | |||||
| Button | Button | ||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
| import * as FormatUtils from "utils/FormatUtils"; | |||||
| import * as PublicNoteStatusUtils from "utils/statusUtils/PublicNoteStatusUtils" | import * as PublicNoteStatusUtils from "utils/statusUtils/PublicNoteStatusUtils" | ||||
| import { FiDataGrid } from "components/FiDataGrid"; | import { FiDataGrid } from "components/FiDataGrid"; | ||||
| // ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
| @@ -100,6 +101,15 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| return (params?.value) ? (params?.value) : ""; | return (params?.value) ? (params?.value) : ""; | ||||
| } | } | ||||
| }, | }, | ||||
| { | |||||
| id: 'fee', | |||||
| field: 'fee', | |||||
| headerName: 'Amount($)', | |||||
| flex: 1, | |||||
| valueGetter: (params) => { | |||||
| return FormatUtils.currencyFormat(params?.value); | |||||
| } | |||||
| }, | |||||
| ]; | ]; | ||||
| return ( | return ( | ||||
| @@ -110,7 +120,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| rowHeight={80} | rowHeight={80} | ||||
| rows={rows} | rows={rows} | ||||
| columns={columns} | columns={columns} | ||||
| customPageSize={5} | |||||
| customPageSize={10} | |||||
| onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
| /> | /> | ||||
| </div> | </div> | ||||
| @@ -43,7 +43,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
| const findReadyToSend=()=>{ | const findReadyToSend=()=>{ | ||||
| const temp = { | const temp = { | ||||
| status: 'pending', | |||||
| readySend: true | |||||
| }; | }; | ||||
| applySearch(temp); | applySearch(temp); | ||||
| } | } | ||||
| @@ -165,13 +165,14 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
| { | { | ||||
| field: 'appNo', | field: 'appNo', | ||||
| headerName: 'App No.', | headerName: 'App No.', | ||||
| width: 120, | |||||
| width: 150, | |||||
| }, | }, | ||||
| { | { | ||||
| id: 'contactPerson', | id: 'contactPerson', | ||||
| field: 'contactPerson', | field: 'contactPerson', | ||||
| headerName: 'Client', | headerName: 'Client', | ||||
| width: 300, | |||||
| minWidth: 300, | |||||
| flex:1, | |||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName; | let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName; | ||||
| company = company != null ? company : ""; | company = company != null ? company : ""; | ||||
| @@ -200,7 +201,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
| { | { | ||||
| field: 'cm', | field: 'cm', | ||||
| headerName: 'Length', | headerName: 'Length', | ||||
| width: 100, | |||||
| width: 120, | |||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return (<> | return (<> | ||||
| {params?.value + "cm"}<br /> | {params?.value + "cm"}<br /> | ||||
| @@ -211,7 +212,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
| { | { | ||||
| field: 'amount', | field: 'amount', | ||||
| headerName: 'Amount($)', | headerName: 'Amount($)', | ||||
| width: 100, | |||||
| width: 120, | |||||
| align: 'right', | align: 'right', | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return FormatUtils.currencyFormat(params?.value); | return FormatUtils.currencyFormat(params?.value); | ||||
| @@ -220,7 +221,7 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
| { | { | ||||
| field: 'dnNo', | field: 'dnNo', | ||||
| headerName: 'DN No.', | headerName: 'DN No.', | ||||
| width: 220, | |||||
| width: 250, | |||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return <Button sx={{fontSize: '8px'}} onClick={handleDnClick(params)}><u>{params.row.dnNo}</u></Button>; | 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', | id: 'issueDate', | ||||
| field: 'issueDate', | field: 'issueDate', | ||||
| headerName: 'Due Date / Sent Date', | headerName: 'Due Date / Sent Date', | ||||
| width: 250, | |||||
| width: 300, | |||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return (<> | return (<> | ||||
| {DateUtils.dateStr(params?.value)} | {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: () => ( | renderHeader: () => ( | ||||
| <><DownloadIcon />DN File</> | <><DownloadIcon />DN File</> | ||||
| ), | ), | ||||
| width: 250, | |||||
| width: 280, | |||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return <Button onClick={onDownloadClick(params)}><u>{params.row.filename}</u></Button>; | return <Button onClick={onDownloadClick(params)}><u>{params.row.filename}</u></Button>; | ||||
| }, | }, | ||||
| @@ -156,7 +156,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
| }} | }} | ||||
| renderInput={(params) => ( | renderInput={(params) => ( | ||||
| <TextField {...params} | <TextField {...params} | ||||
| label="Organisation" | |||||
| label="BR No./Organisation" | |||||
| InputLabelProps={{ | InputLabelProps={{ | ||||
| shrink: true | shrink: true | ||||
| }} | }} | ||||
| @@ -2,7 +2,7 @@ | |||||
| import { | import { | ||||
| Grid, Button, Checkbox, FormControlLabel, Typography, | Grid, Button, Checkbox, FormControlLabel, Typography, | ||||
| Dialog, DialogTitle, DialogContent, DialogActions, | Dialog, DialogTitle, DialogContent, DialogActions, | ||||
| FormHelperText | |||||
| FormHelperText, TextField, | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| // import { FormControlLabel } from '@material-ui/core'; | // import { FormControlLabel } from '@material-ui/core'; | ||||
| import MainCard from "components/MainCard"; | import MainCard from "components/MainCard"; | ||||
| @@ -10,6 +10,7 @@ import * as React from "react"; | |||||
| import { useFormik } from 'formik'; | import { useFormik } from 'formik'; | ||||
| import * as yup from 'yup'; | import * as yup from 'yup'; | ||||
| import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
| import * as DateUtils from 'utils/DateUtils'; | |||||
| import * as HttpUtils from 'utils/HttpUtils'; | import * as HttpUtils from 'utils/HttpUtils'; | ||||
| import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
| import * as FieldUtils from "utils/FieldUtils"; | import * as FieldUtils from "utils/FieldUtils"; | ||||
| @@ -19,8 +20,8 @@ import Loadable from 'components/Loadable'; | |||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| import { notifySaveSuccess } from 'utils/CommonFunction'; | import { notifySaveSuccess } from 'utils/CommonFunction'; | ||||
| import { useIntl } from "react-intl"; | 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 ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -48,12 +49,12 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| return <Typography variant="errorMessage1">{errorMsg}</Typography> | 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({ | const formik = useFormik({ | ||||
| @@ -83,11 +84,11 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| }), | }), | ||||
| }), | }), | ||||
| onSubmit: values => { | onSubmit: values => { | ||||
| if (values.country==null){ | |||||
| setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | |||||
| if (values.country == null) { | |||||
| setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' })) | |||||
| } else { | } 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 { | } else { | ||||
| HttpUtils.post({ | HttpUtils.post({ | ||||
| url: UrlUtils.POST_ORG_SAVE_PATH, | url: UrlUtils.POST_ORG_SAVE_PATH, | ||||
| @@ -124,7 +125,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| setEditMode(false); | setEditMode(false); | ||||
| } | } | ||||
| }); | }); | ||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -204,24 +205,24 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| </> : | </> : | ||||
| <> | <> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <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 | 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> | </ThemeProvider> | ||||
| </> | </> | ||||
| } | } | ||||
| @@ -244,13 +245,13 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| currentUserData.creditor ? | currentUserData.creditor ? | ||||
| <Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <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> | </ThemeProvider> | ||||
| </Grid> | </Grid> | ||||
| : | : | ||||
| @@ -261,7 +262,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| color="orange" | color="orange" | ||||
| onClick={() => setCreditorConfirmPopUp(true)} | onClick={() => setCreditorConfirmPopUp(true)} | ||||
| > | > | ||||
| Mark as Creditor | |||||
| Mark as Credit Client | |||||
| </Button> | </Button> | ||||
| </ThemeProvider> | </ThemeProvider> | ||||
| </Grid> | </Grid> | ||||
| @@ -300,7 +301,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| <Grid item lg={4} > | <Grid item lg={4} > | ||||
| <FormControlLabel | <FormControlLabel | ||||
| control={<Checkbox checked={formik.values.creditor} />} | control={<Checkbox checked={formik.values.creditor} />} | ||||
| label="is Creditor" | |||||
| label="is Credit Client" | |||||
| name="creditor" | name="creditor" | ||||
| onChange={() => { | onChange={() => { | ||||
| formik.setFieldValue("creditor", !formik.values.creditor); | formik.setFieldValue("creditor", !formik.values.creditor); | ||||
| @@ -331,12 +332,29 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| </Grid> | </Grid> | ||||
| <Grid item lg={4} > | <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> | ||||
| <Grid item lg={4} > | <Grid item lg={4} > | ||||
| @@ -423,7 +441,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| > | > | ||||
| <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
| <DialogContent style={{ display: 'flex', }}> | <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> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button> | <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> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
| <DialogContent style={{ display: 'flex', }}> | <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> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button> | <Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button> | ||||
| @@ -224,16 +224,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| disabled: true, | disabled: true, | ||||
| form: formik | 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> | ||||
| <Grid item lg={4} ></Grid> | <Grid item lg={4} ></Grid> | ||||
| @@ -349,7 +340,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
| > | > | ||||
| <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
| <DialogContent style={{ display: 'flex', }}> | <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> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button> | <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> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
| <DialogContent style={{ display: 'flex', }}> | <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> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button> | <Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button> | ||||
| @@ -2,12 +2,13 @@ | |||||
| import { | import { | ||||
| Grid, Button, Typography, | Grid, Button, Typography, | ||||
| Dialog, DialogTitle, DialogContent, DialogActions, | Dialog, DialogTitle, DialogContent, DialogActions, | ||||
| FormHelperText | |||||
| FormHelperText, TextField | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import MainCard from "components/MainCard"; | import MainCard from "components/MainCard"; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| import * as yup from 'yup'; | import * as yup from 'yup'; | ||||
| import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
| import * as DateUtils from 'utils/DateUtils'; | |||||
| import * as HttpUtils from 'utils/HttpUtils'; | import * as HttpUtils from 'utils/HttpUtils'; | ||||
| import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
| import * as FieldUtils from "utils/FieldUtils"; | import * as FieldUtils from "utils/FieldUtils"; | ||||
| @@ -18,7 +19,7 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo | |||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| import { notifyCreateSuccess } from 'utils/CommonFunction'; | import { notifyCreateSuccess } from 'utils/CommonFunction'; | ||||
| import {useIntl} from "react-intl"; | |||||
| import { useIntl } from "react-intl"; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -48,34 +49,34 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
| enableReinitialize: true, | enableReinitialize: true, | ||||
| initialValues: currentUserData, | initialValues: currentUserData, | ||||
| validationSchema: yup.object().shape({ | 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(), | addressLine2: yup.string().max(40).nullable(), | ||||
| addressLine3: 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(), | 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 => { | onSubmit: values => { | ||||
| if (values.country==null){ | |||||
| setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | |||||
| if (values.country == null) { | |||||
| setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' })) | |||||
| } else { | } 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 { | } else { | ||||
| HttpUtils.post({ | HttpUtils.post({ | ||||
| url: UrlUtils.POST_ORG_SAVE_PATH, | url: UrlUtils.POST_ORG_SAVE_PATH, | ||||
| @@ -107,7 +108,7 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
| } | } | ||||
| }, | }, | ||||
| onSuccess: function (responseData) { | onSuccess: function (responseData) { | ||||
| if(responseData.msg){ | |||||
| if (responseData.msg) { | |||||
| setFailText(responseData.msg); | setFailText(responseData.msg); | ||||
| setIsFailPopUp(true); | setIsFailPopUp(true); | ||||
| return; | return; | ||||
| @@ -143,131 +144,148 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
| <div style={{ padding: 24 }}> | <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> | ||||
| <div> | <div> | ||||
| @@ -123,7 +123,7 @@ const OrganizationSearchForm = ({ applySearch }) => { | |||||
| renderInput={(params) => ( | renderInput={(params) => ( | ||||
| <TextField | <TextField | ||||
| {...params} | {...params} | ||||
| label="Creditor/Non-creditor" | |||||
| label="Credit Client/Non-Credit Client" | |||||
| InputLabelProps={{ | InputLabelProps={{ | ||||
| shrink: true | shrink: true | ||||
| }} | }} | ||||
| @@ -85,8 +85,8 @@ export default function OrganizationTable({ recordList }) { | |||||
| { | { | ||||
| id: 'creditor', | id: 'creditor', | ||||
| field: 'creditor', | field: 'creditor', | ||||
| headerName: 'Creditor', | |||||
| width: 100, | |||||
| headerName: 'Credit Client', | |||||
| width: 150, | |||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return params?.value?"Yes":""; | return params?.value?"Yes":""; | ||||
| } | } | ||||
| @@ -64,7 +64,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| { | { | ||||
| id: 'appNo', | id: 'appNo', | ||||
| field: 'appNo', | field: 'appNo', | ||||
| headerName: intl.formatMessage({id: 'terms'}), | |||||
| headerName: intl.formatMessage({id: 'particulars'}), | |||||
| width: isMdOrLg ? 'auto' : 300, | width: isMdOrLg ? 'auto' : 300, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| @@ -81,7 +81,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| { | { | ||||
| id: 'fee', | id: 'fee', | ||||
| field: 'fee', | field: 'fee', | ||||
| headerName: intl.formatMessage({id: 'currencyPrice'}) + ' (HK$)', | |||||
| headerName: intl.formatMessage({id: 'currencyAmount'}) + ' ($)', | |||||
| width: 200, | width: 200, | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : ""; | 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 container direction="row" justifyContent="flex-end" sx={{backgroundColor: '#fff' }}> | ||||
| <Grid item> | <Grid item> | ||||
| <Typography align="right" variant="h4" sx={{mr:2,mt:1}}> | <Typography align="right" variant="h4" sx={{mr:2,mt:1}}> | ||||
| <FormattedMessage id="payTotal"/>: | |||||
| <FormattedMessage id="payTotal"/> : | |||||
| <span style={{ color: "blue", fontWeight: "bold", }}> | <span style={{ color: "blue", fontWeight: "bold", }}> | ||||
| (HK$) {FormatUtils.currencyFormat(total)} | |||||
| $ {FormatUtils.currencyFormat(total)} | |||||
| </span> | </span> | ||||
| </Typography> | </Typography> | ||||
| </Grid> | </Grid> | ||||
| @@ -136,7 +136,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||||
| <Grid container > | <Grid container > | ||||
| <Grid item xs={6} md={6} sx={{ml:-5, textAlign: "right" }}> | <Grid item xs={6} md={6} sx={{ml:-5, textAlign: "right" }}> | ||||
| <FormLabel sx={{ fontSize: "16px", color: "#000000" }}> | <FormLabel sx={{ fontSize: "16px", color: "#000000" }}> | ||||
| <FormattedMessage id="payTotal"/>: | |||||
| <FormattedMessage id="payTotalDeatail"/>: | |||||
| </FormLabel> | </FormLabel> | ||||
| </Grid> | </Grid> | ||||
| <Grid xs={6} md={5} sx={{ml:5,textAlign: "left" }}> | <Grid xs={6} md={5} sx={{ml:5,textAlign: "left" }}> | ||||
| @@ -299,7 +299,7 @@ const Index = () => { | |||||
| <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> | <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> | ||||
| <img src={FpsIcon} width="80" height="80" alt="FPS"></img> | <img src={FpsIcon} width="80" height="80" alt="FPS"></img> | ||||
| <br /> | <br /> | ||||
| <FormattedMessage id="payTotal"/> | |||||
| <FormattedMessage id="payTotalDeatail"/> | |||||
| <br /> | <br /> | ||||
| {"HK$ " + currencyFormat(paymentData.amount)} | {"HK$ " + currencyFormat(paymentData.amount)} | ||||
| </Typography> | </Typography> | ||||
| @@ -64,7 +64,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| headerName: 'Trans. Date', | headerName: 'Trans. Date', | ||||
| flex: 1, | flex: 1, | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return DateUtils.datetimeStr(params?.value); | |||||
| return DateUtils.dateStr(params?.value); | |||||
| } | } | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -72,7 +72,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| headerName: 'Status', | headerName: 'Status', | ||||
| width: 150, | width: 150, | ||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return PaymentStatus.getStatus_Cht(params); | |||||
| return PaymentStatus.getStatus_Eng(params); | |||||
| } | } | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -77,7 +77,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return DateUtils.datetimeStr(params?.value); | |||||
| return DateUtils.dateStr(params?.value); | |||||
| } | } | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -94,7 +94,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| { | { | ||||
| id: 'payAmount', | id: 'payAmount', | ||||
| field: 'payAmount', | field: 'payAmount', | ||||
| headerName: intl.formatMessage({id: 'fee'}), | |||||
| headerName: intl.formatMessage({id: 'currencyAmount'}) + ' ($)', | |||||
| width: 150, | width: 150, | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : ""; | return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : ""; | ||||
| @@ -37,6 +37,9 @@ const FormPanel = ({ formData }) => { | |||||
| const [saving, setSaving] = React.useState(false); | const [saving, setSaving] = React.useState(false); | ||||
| const [proofPaymentDeadlineMin, setProofPaymentDeadlineMin] = React.useState({}); | |||||
| const [reviseDeadlineMin, setReviseDeadlineMin] = React.useState({}); | |||||
| const navigate = useNavigate() | const navigate = useNavigate() | ||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| @@ -46,6 +49,8 @@ const FormPanel = ({ formData }) => { | |||||
| setColumnPrice(ComboData.proofPrice[1]) | setColumnPrice(ComboData.proofPrice[1]) | ||||
| formData['length'] = 18; | formData['length'] = 18; | ||||
| } | } | ||||
| setProofPaymentDeadlineMin(formData.proofPaymentDeadline); | |||||
| setReviseDeadlineMin(formData.reviseDeadline); | |||||
| } | } | ||||
| }, [formData]); | }, [formData]); | ||||
| @@ -206,6 +211,7 @@ const FormPanel = ({ formData }) => { | |||||
| onChange={formik.handleChange} | onChange={formik.handleChange} | ||||
| name="reviseDeadline" | name="reviseDeadline" | ||||
| value={formik.values["reviseDeadline"]} | value={formik.values["reviseDeadline"]} | ||||
| InputProps={{ inputProps: { min: DateUtils.datetimeStr(reviseDeadlineMin) } }} | |||||
| variant="outlined" | variant="outlined" | ||||
| sx={ | sx={ | ||||
| { | { | ||||
| @@ -232,6 +238,7 @@ const FormPanel = ({ formData }) => { | |||||
| onChange={formik.handleChange} | onChange={formik.handleChange} | ||||
| name="proofPaymentDeadline" | name="proofPaymentDeadline" | ||||
| value={formik.values["proofPaymentDeadline"]} | value={formik.values["proofPaymentDeadline"]} | ||||
| InputProps={{ inputProps: { min: DateUtils.datetimeStr(proofPaymentDeadlineMin) } }} | |||||
| variant="outlined" | variant="outlined" | ||||
| sx={ | sx={ | ||||
| { | { | ||||
| @@ -139,7 +139,7 @@ const ApplicationDetailCard = ({ | |||||
| <Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
| <Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
| sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
| <FormLabel><Typography variant="h5">App No.:</Typography></FormLabel> | |||||
| <FormLabel><Typography variant="h5">App. No.:</Typography></FormLabel> | |||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12} md={9} lg={9}> | <Grid item xs={12} md={9} lg={9}> | ||||
| @@ -151,7 +151,7 @@ const ApplicationDetailCard = ({ | |||||
| <Grid container alignItems={"left"}> | <Grid container alignItems={"left"}> | ||||
| <Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
| sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
| <FormLabel><Typography variant="h5">Status:</Typography></FormLabel> | |||||
| <FormLabel><Typography variant="h5">App. Status:</Typography></FormLabel> | |||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}> | <Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}> | ||||
| @@ -83,11 +83,7 @@ const FormPanel = ({ formData }) => { | |||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyActionSuccess("提交成功!") | notifyActionSuccess("提交成功!") | ||||
| if (actionValue) { | if (actionValue) { | ||||
| if(data.creditor){ | |||||
| navigate("/proof/search"); | |||||
| }else{ | |||||
| navigate("/proof/pay/" + params.id); | |||||
| } | |||||
| navigate("/proof/pay/" + params.id); | |||||
| } else { | } else { | ||||
| navigate("/proof/search"); | navigate("/proof/search"); | ||||
| } | } | ||||
| @@ -20,6 +20,7 @@ import Loadable from 'components/Loadable'; | |||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
| import * as HttpUtils from "utils/HttpUtils" | import * as HttpUtils from "utils/HttpUtils" | ||||
| import * as DateUtils from "utils/DateUtils" | |||||
| import * as UrlUtils from "utils/ApiPathConst" | import * as UrlUtils from "utils/ApiPathConst" | ||||
| import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; | import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; | ||||
| @@ -93,7 +94,11 @@ const ApplicationDetailCard = ( | |||||
| }; | }; | ||||
| const complatedClick = () => () => { | const complatedClick = () => () => { | ||||
| setStatus("complete") | |||||
| let issueDate = DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate); | |||||
| let current = new Date(); | |||||
| if(current.getTime() >= issueDate.getTime()){ | |||||
| setStatus("complete") | |||||
| } | |||||
| }; | }; | ||||
| const withdrawnClick = () => () => { | const withdrawnClick = () => () => { | ||||
| @@ -225,11 +230,13 @@ const ApplicationDetailCard = ( | |||||
| // size="large" | // size="large" | ||||
| variant="contained" | variant="contained" | ||||
| onClick={complatedClick()} | onClick={complatedClick()} | ||||
| disabled={(new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime()} | |||||
| sx={{ | sx={{ | ||||
| textTransform: 'capitalize', | textTransform: 'capitalize', | ||||
| alignItems: 'end', | alignItems: 'end', | ||||
| backgroundColor: '#52b202' | backgroundColor: '#52b202' | ||||
| }}> | }}> | ||||
| <DoneIcon /> | <DoneIcon /> | ||||
| <Typography ml={1} variant="h5">Complete</Typography> | <Typography ml={1} variant="h5">Complete</Typography> | ||||
| </Button> | </Button> | ||||
| @@ -119,6 +119,7 @@ const GazetteDetailCard = ( | |||||
| // size="large" | // size="large" | ||||
| variant="contained" | variant="contained" | ||||
| onClick={groupDetailClick()} | onClick={groupDetailClick()} | ||||
| disabled={applicationDetailData.data.status!="submitted"&&applicationDetailData.data.status!="reviewed"} | |||||
| sx={{ | sx={{ | ||||
| textTransform: 'capitalize', | textTransform: 'capitalize', | ||||
| alignItems: 'end' | alignItems: 'end' | ||||
| @@ -167,7 +167,13 @@ const ApplicationDetailCard = ( | |||||
| variant="contained" | variant="contained" | ||||
| onClick={cancelledClick()} | onClick={cancelledClick()} | ||||
| color="edit" | 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' })} | title={intl.formatMessage({ id: 'cancel' })} | ||||
| startIcon={<CloseIcon />} | startIcon={<CloseIcon />} | ||||
| aria-label={intl.formatMessage({ id: 'cancel' })} | aria-label={intl.formatMessage({ id: 'cancel' })} | ||||
| @@ -81,12 +81,16 @@ export default function BaseGrid({rows}) { | |||||
| renderCell: (params) => ( | renderCell: (params) => ( | ||||
| isORGLoggedIn()? | isORGLoggedIn()? | ||||
| <div> | <div> | ||||
| <FormattedMessage id="gazetteCount" />: {params.row.issueVolume + "/" + params.row.issueYear | |||||
| + " No. " + params.row.issueNo}<br /> | |||||
| Care Of: {params.row.careOf} <br/> | Care Of: {params.row.careOf} <br/> | ||||
| <FormattedMessage variant="pnspsNormalText" id="myRemarks"/>: {params.row.remarks} | <FormattedMessage variant="pnspsNormalText" id="myRemarks"/>: {params.row.remarks} | ||||
| </div>: | </div>: | ||||
| <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> */} | {/* <Typography variant="pnspsNormalText">{params.row.remarks}</Typography> */} | ||||
| </div> | </div> | ||||
| ) | ) | ||||
| @@ -19,9 +19,9 @@ import { useNavigate } from "react-router-dom"; | |||||
| import { | import { | ||||
| isORGLoggedIn, | isORGLoggedIn, | ||||
| } from "utils/Utils"; | } 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 ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
| export default function SubmittedTab({ rows }) { | export default function SubmittedTab({ rows }) { | ||||
| @@ -66,8 +66,8 @@ export default function SubmittedTab({ rows }) { | |||||
| console.log(rows) | console.log(rows) | ||||
| console.log(selectedCareOf) | console.log(selectedCareOf) | ||||
| rows.forEach((element) => { | 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))); | // 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++) { | for (var i = 0; i < datas?.length; i++) { | ||||
| appIdList.push(datas[i].id); | appIdList.push(datas[i].id); | ||||
| } | } | ||||
| if(appIdList.length<1){ | |||||
| setExpiryDateErrText(intl.formatMessage({ id: 'MSG.plzSelectApp' })); | |||||
| setExpiryDateErr(true); | |||||
| return; | |||||
| } | |||||
| HttpUtils.post({ | HttpUtils.post({ | ||||
| url: UrlUtils.POST_CHECK_APP_EXPRITY_DATE, | url: UrlUtils.POST_CHECK_APP_EXPRITY_DATE, | ||||
| params: { | params: { | ||||
| @@ -105,7 +110,7 @@ export default function SubmittedTab({ rows }) { | |||||
| responData.msg.forEach((item) => { | responData.msg.forEach((item) => { | ||||
| str += "App: " + item.appNo + ", 到期日: " + DateUtils.datetimeStr_Cht(item.expiryDate) + "\n"; | 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); | setExpiryDateErr(true); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -117,69 +122,41 @@ export default function SubmittedTab({ rows }) { | |||||
| { | { | ||||
| id: 'appNo', | id: 'appNo', | ||||
| field: 'appNo', | field: 'appNo', | ||||
| headerName: intl.formatMessage({id: 'applicationId'}), | |||||
| headerName: intl.formatMessage({ id: 'applicationId' }), | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| }, | }, | ||||
| { | { | ||||
| id: 'created', | id: 'created', | ||||
| field: 'created', | field: 'created', | ||||
| headerName: intl.formatMessage({id: 'submitDate'}), | |||||
| headerName: intl.formatMessage({ id: 'submitDate' }), | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| return DateUtils.datetimeStr(params.value); | 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', | id: 'remarks', | ||||
| field: '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, | width: isMdOrLg ? 'auto' : 400, | ||||
| flex: isMdOrLg ? 3 : undefined, | flex: isMdOrLg ? 3 : undefined, | ||||
| renderCell: (params) => ( | renderCell: (params) => ( | ||||
| isORGLoggedIn() ? | isORGLoggedIn() ? | ||||
| <div> | <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> : | ||||
| <div> | <div> | ||||
| {/* <Typography variant="pnspsNormalText"> */} | |||||
| {params.row.remarks} | |||||
| {/* </Typography> */} | |||||
| {params.row.remarks} | |||||
| </div> | </div> | ||||
| ) | ) | ||||
| }, | }, | ||||
| { | { | ||||
| id: 'fee', | id: 'fee', | ||||
| field: 'fee', | field: 'fee', | ||||
| headerName: intl.formatMessage({id: 'price'}), | |||||
| headerName: intl.formatMessage({ id: 'price' }), | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| @@ -189,11 +166,11 @@ export default function SubmittedTab({ rows }) { | |||||
| { | { | ||||
| id: 'status', | id: 'status', | ||||
| field: 'status', | field: 'status', | ||||
| headerName: intl.formatMessage({id: 'status'}), | |||||
| headerName: intl.formatMessage({ id: 'status' }), | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return [StatusUtils.getStatusIntl(params,intl)] | |||||
| return [StatusUtils.getStatusIntl(params, intl)] | |||||
| }, | }, | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -203,8 +180,8 @@ export default function SubmittedTab({ rows }) { | |||||
| width: 150, | width: 150, | ||||
| cellClassName: 'actions', | cellClassName: 'actions', | ||||
| renderCell: (params) => { | 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>; | </Button>; | ||||
| }, | }, | ||||
| } | } | ||||
| @@ -220,21 +197,20 @@ export default function SubmittedTab({ rows }) { | |||||
| content.push(<> | content.push(<> | ||||
| <Stack direction="row" justifyContent="space-between"> | <Stack direction="row" justifyContent="space-between"> | ||||
| <Typography variant="h5"> | <Typography variant="h5"> | ||||
| <FormattedMessage id="applicationId"/>: {datas[i].appNo} | |||||
| <FormattedMessage id="applicationId" />: {datas[i].appNo} | |||||
| </Typography> | </Typography> | ||||
| ({DateUtils.datetimeStr(datas[i].created)}) | ({DateUtils.datetimeStr(datas[i].created)}) | ||||
| </Stack> | </Stack> | ||||
| <FormattedMessage id="extraMark"/>: {datas[i].remarks} | |||||
| <FormattedMessage id="extraMark" />: {datas[i].remarks} | |||||
| <br /><br /> | <br /><br /> | ||||
| </>); | </>); | ||||
| totalAmount += datas[i].fee; | totalAmount += datas[i].fee; | ||||
| } | } | ||||
| content.push(<Typography variant="h5"> | content.push(<Typography variant="h5"> | ||||
| <FormattedMessage id="totalAmount"/> (HK$): {FormatUtils.currencyFormat(totalAmount)} | |||||
| <FormattedMessage id="totalAmount" /> (HK$): {FormatUtils.currencyFormat(totalAmount)} | |||||
| <br /><br /> | <br /><br /> | ||||
| </Typography>); | </Typography>); | ||||
| //setAmount(totalAmount); | |||||
| return content; | return content; | ||||
| } | } | ||||
| @@ -317,15 +293,15 @@ export default function SubmittedTab({ rows }) { | |||||
| /> | /> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <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> | </ThemeProvider> | ||||
| </div> | </div> | ||||
| @@ -343,7 +319,7 @@ export default function SubmittedTab({ rows }) { | |||||
| > | > | ||||
| <DialogTitle> | <DialogTitle> | ||||
| <Typography variant="h3" > | <Typography variant="h3" > | ||||
| <FormattedMessage id="payConfirm"/> | |||||
| <FormattedMessage id="payConfirm" /> | |||||
| </Typography> | </Typography> | ||||
| </DialogTitle> | </DialogTitle> | ||||
| <DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
| @@ -352,15 +328,15 @@ export default function SubmittedTab({ rows }) { | |||||
| </Stack> | </Stack> | ||||
| </DialogContent> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setIsPopUp(false)} aria-label={intl.formatMessage({id: 'close'})}> | |||||
| <Button onClick={() => setIsPopUp(false)} aria-label={intl.formatMessage({ id: 'close' })}> | |||||
| <Typography variant="h5"> | <Typography variant="h5"> | ||||
| <FormattedMessage id="close"/> | |||||
| <FormattedMessage id="close" /> | |||||
| </Typography></Button> | </Typography></Button> | ||||
| <Button onClick={() => doPayment()} aria-label={intl.formatMessage({id: 'confirm'})}> | |||||
| <Button onClick={() => doPayment()} aria-label={intl.formatMessage({ id: 'confirm' })}> | |||||
| <Typography variant="h5"> | <Typography variant="h5"> | ||||
| <FormattedMessage id="confirm"/> | |||||
| </Typography></Button> | |||||
| <FormattedMessage id="confirm" /> | |||||
| </Typography></Button> | |||||
| </DialogActions> | </DialogActions> | ||||
| </Dialog> | </Dialog> | ||||
| </div> | </div> | ||||
| @@ -387,15 +363,15 @@ export default function SubmittedTab({ rows }) { | |||||
| </Stack> | </Stack> | ||||
| </DialogContent> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setCheckCareOf(false)} aria-label={intl.formatMessage({id: 'close'})}> | |||||
| <Button onClick={() => setCheckCareOf(false)} aria-label={intl.formatMessage({ id: 'close' })}> | |||||
| <Typography variant="h5"> | <Typography variant="h5"> | ||||
| <FormattedMessage id="close"/> | |||||
| <FormattedMessage id="close" /> | |||||
| </Typography></Button> | </Typography></Button> | ||||
| <Button onClick={() => afterWarningPayment()} aria-label={intl.formatMessage({id: 'confirm'})}> | |||||
| <Button onClick={() => afterWarningPayment()} aria-label={intl.formatMessage({ id: 'confirm' })}> | |||||
| <Typography variant="h5"> | <Typography variant="h5"> | ||||
| <FormattedMessage id="confirm"/> | |||||
| </Typography></Button> | |||||
| <FormattedMessage id="confirm" /> | |||||
| </Typography></Button> | |||||
| </DialogActions> | </DialogActions> | ||||
| </Dialog> | </Dialog> | ||||
| </div> | </div> | ||||
| @@ -413,7 +389,7 @@ export default function SubmittedTab({ rows }) { | |||||
| }} | }} | ||||
| > | > | ||||
| <DialogTitle></DialogTitle> | <DialogTitle></DialogTitle> | ||||
| <Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | |||||
| <Typography variant="h4" style={{ paddingLeft: '24px' }}><FormattedMessage id="MSG.actionFail" /></Typography> | |||||
| <DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
| <Stack direction="column" justifyContent="space-between"> | <Stack direction="column" justifyContent="space-between"> | ||||
| { | { | ||||
| @@ -422,9 +398,9 @@ export default function SubmittedTab({ rows }) { | |||||
| </Stack> | </Stack> | ||||
| </DialogContent> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setExpiryDateErr(false)} aria-label={intl.formatMessage({id: 'close'})}> | |||||
| <Button onClick={() => setExpiryDateErr(false)} aria-label={intl.formatMessage({ id: 'close' })}> | |||||
| <Typography variant="h5"> | <Typography variant="h5"> | ||||
| <FormattedMessage id="close"/> | |||||
| <FormattedMessage id="close" /> | |||||
| </Typography></Button> | </Typography></Button> | ||||
| </DialogActions> | </DialogActions> | ||||
| </Dialog> | </Dialog> | ||||
| @@ -6,13 +6,13 @@ import { | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
| import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; | 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 { | import { | ||||
| isORGLoggedIn, | 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 ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
| export default function SearchPublicNoticeTable({ recordList }) { | export default function SearchPublicNoticeTable({ recordList }) { | ||||
| @@ -23,7 +23,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| const intl = useIntl(); | const intl = useIntl(); | ||||
| const handleDetailClick = (params) => () => { | const handleDetailClick = (params) => () => { | ||||
| navigate('/publicNotice/'+ params.id); | |||||
| navigate('/publicNotice/' + params.id); | |||||
| }; | }; | ||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| @@ -34,14 +34,14 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| { | { | ||||
| id: 'appNo', | id: 'appNo', | ||||
| field: 'appNo', | field: 'appNo', | ||||
| headerName: intl.formatMessage({id: 'applicationId'}), | |||||
| headerName: intl.formatMessage({ id: 'applicationId' }), | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| }, | }, | ||||
| { | { | ||||
| id: 'created', | id: 'created', | ||||
| field: 'created', | field: 'created', | ||||
| headerName: intl.formatMessage({id: 'submitDate'}), | |||||
| headerName: intl.formatMessage({ id: 'submitDate' }), | |||||
| width: isMdOrLg ? 'auto' : 160, | width: isMdOrLg ? 'auto' : 160, | ||||
| flex: isMdOrLg ? 1 : undefined, | flex: isMdOrLg ? 1 : undefined, | ||||
| valueGetter: (params) => { | valueGetter: (params) => { | ||||
| @@ -77,24 +77,28 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| { | { | ||||
| id: 'remarks', | id: 'remarks', | ||||
| field: '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, | width: isMdOrLg ? 'auto' : 400, | ||||
| flex: isMdOrLg ? 3 : undefined, | flex: isMdOrLg ? 3 : undefined, | ||||
| renderCell: (params) => ( | 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', | id: 'status', | ||||
| field: 'status', | field: 'status', | ||||
| headerName: intl.formatMessage({id: 'status'}), | |||||
| headerName: intl.formatMessage({ id: 'status' }), | |||||
| width: 200, | width: 200, | ||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return [StatusUtils.getStatusIntl(params, intl)] | return [StatusUtils.getStatusIntl(params, intl)] | ||||
| @@ -108,16 +112,16 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| cellClassName: 'actions', | cellClassName: 'actions', | ||||
| renderCell: (params) => { | renderCell: (params) => { | ||||
| return <Button onClick={handleDetailClick(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>; | </Button>; | ||||
| }, | }, | ||||
| } | } | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | function handleRowDoubleClick(params) { | ||||
| navigate('/publicNotice/'+ params.id); | |||||
| navigate('/publicNotice/' + params.id); | |||||
| } | } | ||||
| return ( | return ( | ||||
| @@ -6,6 +6,7 @@ import { | |||||
| InputAdornment, | InputAdornment, | ||||
| Typography, FormLabel, | Typography, FormLabel, | ||||
| OutlinedInput, | OutlinedInput, | ||||
| TextField | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import MainCard from "../../../components/MainCard"; | import MainCard from "../../../components/MainCard"; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| @@ -18,6 +19,7 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo | |||||
| //import {useParams} from "react-router-dom"; | //import {useParams} from "react-router-dom"; | ||||
| import Visibility from '@mui/icons-material/Visibility'; | import Visibility from '@mui/icons-material/Visibility'; | ||||
| import VisibilityOff from '@mui/icons-material/VisibilityOff'; | import VisibilityOff from '@mui/icons-material/VisibilityOff'; | ||||
| import { useIntl } from "react-intl"; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewRecord }) => { | const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewRecord }) => { | ||||
| @@ -25,8 +27,12 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR | |||||
| const [currentUserData, setCurrentUserData] = React.useState({}); | const [currentUserData, setCurrentUserData] = React.useState({}); | ||||
| const [locked, setLocked] = useState(false); | const [locked, setLocked] = useState(false); | ||||
| const [showPassword, setShowPassword] = React.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 handleClickShowPassword = () => setShowPassword((show) => !show); | ||||
| const handleMouseDownPassword = () => setShowPassword(!showPassword); | const handleMouseDownPassword = () => setShowPassword(!showPassword); | ||||
| @@ -49,9 +55,40 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR | |||||
| } | } | ||||
| }, [currentUserData]); | }, [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(() => { | useEffect(() => { | ||||
| //upload latest data to parent | //upload latest data to parent | ||||
| const values = getValues(); | const values = getValues(); | ||||
| values.password = pw; | |||||
| values.pwErr = pwErr; | |||||
| const objectData = { | const objectData = { | ||||
| ...values, | ...values, | ||||
| locked: locked, | locked: locked, | ||||
| @@ -110,19 +147,19 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR | |||||
| <Grid item xs={7} s={7} md={7} lg={6}> | <Grid item xs={7} s={7} md={7} lg={6}> | ||||
| <FormControl variant="outlined" fullWidth required> | <FormControl variant="outlined" fullWidth required> | ||||
| <OutlinedInput | |||||
| <TextField | |||||
| variant="outlined" | |||||
| fullWidth | fullWidth | ||||
| size="small" | 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' | id='password' | ||||
| type={showPassword ? 'text' : 'password'} | type={showPassword ? 'text' : 'password'} | ||||
| disabled={!isNewRecord} | disabled={!isNewRecord} | ||||
| error={pwErr} | |||||
| helperText={pwErr} | |||||
| onChange={(value) => { | |||||
| setPw(value.target.value); | |||||
| }} | |||||
| endAdornment={ | endAdornment={ | ||||
| <InputAdornment position="end"> | <InputAdornment position="end"> | ||||
| <IconButton | <IconButton | ||||
| @@ -138,7 +175,6 @@ const UserInformationCard = ({ isCollectData, updateUserObject, userData, isNewR | |||||
| /> | /> | ||||
| </FormControl> | </FormControl> | ||||
| </Grid> | </Grid> | ||||
| <span style={{ "color": "red" }}>{errors.password?.message}</span> | |||||
| </Grid> | </Grid> | ||||
| </Grid> : null | </Grid> : null | ||||
| } | } | ||||
| @@ -171,6 +171,7 @@ const UserMaintainPage = () => { | |||||
| return false; | return false; | ||||
| }); | }); | ||||
| } else { | } else { | ||||
| if(editedCustomerData.pwErr) return; | |||||
| axios.post(POST_ADMIN_USER_REGISTER, | axios.post(POST_ADMIN_USER_REGISTER, | ||||
| { | { | ||||
| "username": editedCustomerData.username, | "username": editedCustomerData.username, | ||||
| @@ -45,12 +45,6 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}); | 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({ | const formik = useFormik({ | ||||
| enableReinitialize: true, | enableReinitialize: true, | ||||
| initialValues: currentUserData, | initialValues: currentUserData, | ||||
| @@ -68,7 +62,6 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| fax_countryCode: yup.string().min(3, intl.formatMessage({id: 'require3Number'})), | fax_countryCode: yup.string().min(3, intl.formatMessage({id: 'require3Number'})), | ||||
| phoneNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).required(intl.formatMessage({id: 'requireContactNumber'})), | phoneNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).required(intl.formatMessage({id: 'requireContactNumber'})), | ||||
| faxNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).nullable(), | faxNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).nullable(), | ||||
| district: yup.string().required(getRequiredErrStr("district")), | |||||
| }), | }), | ||||
| onSubmit: values => { | onSubmit: values => { | ||||
| if (values.country==null){ | if (values.country==null){ | ||||
| @@ -102,6 +95,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
| addressLine3: values.addressLine3, | addressLine3: values.addressLine3, | ||||
| }, | }, | ||||
| preferLocale: values.preferLocale.type | |||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess(); | notifySaveSuccess(); | ||||
| @@ -519,6 +513,17 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| form: formik | form: formik | ||||
| })} | })} | ||||
| </Grid> | </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> | ||||
| </Grid> | </Grid> | ||||
| </form> | </form> | ||||
| @@ -44,11 +44,6 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
| return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}); | 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({ | const formik = useFormik({ | ||||
| enableReinitialize: true, | enableReinitialize: true, | ||||
| initialValues: currentUserData, | initialValues: currentUserData, | ||||
| @@ -63,9 +58,9 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
| fax_countryCode: yup.string().min(3, intl.formatMessage({id: 'require3Number'})), | fax_countryCode: yup.string().min(3, intl.formatMessage({id: 'require3Number'})), | ||||
| phoneNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).required(intl.formatMessage({id: 'requireContactNumber'})), | phoneNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).required(intl.formatMessage({id: 'requireContactNumber'})), | ||||
| faxNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).nullable(), | faxNumber: yup.string().min(8, intl.formatMessage({id: 'require8Number'})).nullable(), | ||||
| district: yup.string().required(getRequiredErrStr("district")), | |||||
| }), | }), | ||||
| onSubmit: values => { | onSubmit: values => { | ||||
| // console.log(values) | |||||
| if (values.country==null){ | if (values.country==null){ | ||||
| setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | ||||
| } else { | } else { | ||||
| @@ -92,6 +87,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
| addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
| addressLine3: values.addressLine3, | addressLine3: values.addressLine3, | ||||
| }, | }, | ||||
| preferLocale: values.preferLocale.type | |||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess(); | notifySaveSuccess(); | ||||
| @@ -357,6 +353,17 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
| form: formik | form: formik | ||||
| })} | })} | ||||
| </Grid> | </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> | ||||
| </Grid> | </Grid> | ||||
| </form> | </form> | ||||
| @@ -22,7 +22,7 @@ const BackgroundHead = { | |||||
| } | } | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| import {getObjectByValue} from "utils/CommonFunction"; | |||||
| import {getObjectByValue,getObjectByType} from "utils/CommonFunction"; | |||||
| import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
| const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
| const UserInformationCard = Loadable(React.lazy(() => import('./UserInformationCard_Individual'))); | 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["fax_countryCode"] = response.data.faxNo?.countryCode; | ||||
| response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLogin) : ""; | response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLogin) : ""; | ||||
| response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale); | |||||
| setFormData(response.data); | setFormData(response.data); | ||||
| } | } | ||||
| @@ -104,7 +105,9 @@ const UserMaintainPage_Individual = () => { | |||||
| response.data["faxNumber"] = response.data.faxNo?.faxNumber; | response.data["faxNumber"] = response.data.faxNo?.faxNumber; | ||||
| response.data["fax_countryCode"] = response.data.faxNo?.countryCode; | 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); | setFormData(response.data); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -101,7 +101,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| orgId: values.orgId, | orgId: values.orgId, | ||||
| // brNo: values.brNo, | // brNo: values.brNo, | ||||
| // brExpiryDate: values.brExpiryDate, | // brExpiryDate: values.brExpiryDate, | ||||
| preferLocale: values.preferLocale.type | |||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess() | notifySaveSuccess() | ||||
| @@ -394,8 +394,17 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| form: formik | form: formik | ||||
| })} | })} | ||||
| </Grid> | </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 item lg={4}> | ||||
| <Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
| @@ -19,6 +19,7 @@ import { notifySaveSuccess, } from 'utils/CommonFunction'; | |||||
| import {FormattedMessage, useIntl} from "react-intl"; | import {FormattedMessage, useIntl} from "react-intl"; | ||||
| import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | ||||
| import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
| import * as ComboData from "utils/ComboData"; | |||||
| // import { | // import { | ||||
| // isPrimaryLoggedIn, | // isPrimaryLoggedIn, | ||||
| @@ -67,6 +68,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => { | |||||
| countryCode: values.tel_countryCode, | countryCode: values.tel_countryCode, | ||||
| phoneNumber: values.phoneNumber | phoneNumber: values.phoneNumber | ||||
| }, | }, | ||||
| preferLocale: values.preferLocale.type | |||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess() | notifySaveSuccess() | ||||
| @@ -202,6 +204,16 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => { | |||||
| form: formik | form: formik | ||||
| })} | })} | ||||
| </Grid> | </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> | </Grid> | ||||
| </div> | </div> | ||||
| @@ -19,7 +19,7 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import { useNavigate } from 'react-router-dom'; | import { useNavigate } from 'react-router-dom'; | ||||
| import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
| import {getObjectByValue} from "utils/CommonFunction"; | |||||
| import {getObjectByValue,getObjectByType} from "utils/CommonFunction"; | |||||
| const BackgroundHead = { | const BackgroundHead = { | ||||
| backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
| @@ -139,6 +139,8 @@ const UserMaintainPage_Organization = () => { | |||||
| response.data["faxNumber"] = response.data.faxNo?.faxNumber; | response.data["faxNumber"] = response.data.faxNo?.faxNumber; | ||||
| response.data["fax_countryCode"] = response.data.faxNo?.countryCode; | 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):""; | //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["faxNumber"] = response.data.faxNo?.faxNumber; | ||||
| response.data["fax_countryCode"] = response.data.faxNo?.countryCode; | 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):""; | //response.data["orgId"] = response.data.brExpiryDate?DateUtils.dateStr(response.data.brExpiryDate):""; | ||||
| setUserData(response.data); | setUserData(response.data); | ||||
| @@ -46,7 +46,6 @@ const UserSearchForm = ({ applySearch }) => { | |||||
| enName: data.fullenName, | enName: data.fullenName, | ||||
| post: data.post, | post: data.post, | ||||
| email: data.email, | email: data.email, | ||||
| phone: data.phone, | |||||
| locked: locked, | locked: locked, | ||||
| }; | }; | ||||
| applySearch(temp); | applySearch(temp); | ||||
| @@ -136,18 +135,6 @@ const UserSearchForm = ({ applySearch }) => { | |||||
| /> | /> | ||||
| </Grid> | </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 }}> | <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
| <FormControlLabel | <FormControlLabel | ||||
| control={ | control={ | ||||
| @@ -33,8 +33,10 @@ const UserSearchForm_Individual = ({ applySearch }) => { | |||||
| fullName: data.fullenName, | fullName: data.fullenName, | ||||
| email: data.email, | email: data.email, | ||||
| phone: data.phone, | phone: data.phone, | ||||
| accountFilter: accountFilter, | |||||
| }; | }; | ||||
| if(accountFilter!="All"){ | |||||
| temp["accountFilter"] = accountFilter; | |||||
| } | |||||
| applySearch(temp); | applySearch(temp); | ||||
| }; | }; | ||||
| @@ -113,7 +115,7 @@ const UserSearchForm_Individual = ({ applySearch }) => { | |||||
| disablePortal | disablePortal | ||||
| id="accountFilter" | id="accountFilter" | ||||
| size="small" | size="small" | ||||
| options={["Active", "Locked", "Not verified"]} | |||||
| options={["All","Active", "Locked", "Not verified"]} | |||||
| value={accountFilter} | value={accountFilter} | ||||
| onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
| if (newValue !== null) { | if (newValue !== null) { | ||||
| @@ -109,6 +109,10 @@ const AuthLoginCustom = () => { | |||||
| // setLocale("zh-CN"); | // setLocale("zh-CN"); | ||||
| localStorage.setItem('locale','zh-CN'); | localStorage.setItem('locale','zh-CN'); | ||||
| } | } | ||||
| if (response.data.preferLocale ==="en"){ | |||||
| // setLocale("zh-CN"); | |||||
| localStorage.setItem('locale','en'); | |||||
| } | |||||
| } | } | ||||
| dispatch(handleLogin(data)) | dispatch(handleLogin(data)) | ||||
| navigate('/dashboard'); | navigate('/dashboard'); | ||||
| @@ -118,7 +122,11 @@ const AuthLoginCustom = () => { | |||||
| .catch((error) => { | .catch((error) => { | ||||
| // setSuccess(false) | // setSuccess(false) | ||||
| setOnLogin(false) | setOnLogin(false) | ||||
| setErrorMassage(error.response.data.error) | |||||
| if(error.response!= undefined){ | |||||
| setErrorMassage(error.response.data.error) | |||||
| }else{ | |||||
| setErrorMassage("CONNECTION_ERROR") | |||||
| } | |||||
| setOpen(true) | setOpen(true) | ||||
| }); | }); | ||||
| } else { | } else { | ||||
| @@ -303,13 +303,13 @@ const CustomFormWizard = (props) => { | |||||
| selectedAddress4, selectedAddress5, | selectedAddress4, selectedAddress5, | ||||
| termsAndConAccept, termsAndConNotAccept, fileList]) | termsAndConAccept, termsAndConNotAccept, fileList]) | ||||
| useEffect(()=>{ | |||||
| useEffect(() => { | |||||
| setDistrictErrStr(""); | setDistrictErrStr(""); | ||||
| if(selectedAddress5?.type === "hongKong"){ | |||||
| if(selectedAddress4 ==null || selectedAddress4 == ""|| selectedAddress4 == {}) | |||||
| if (selectedAddress5?.type === "hongKong") { | |||||
| if (selectedAddress4 == null || selectedAddress4 == "" || selectedAddress4 == {}) | |||||
| setDistrictErrStr(getRequiredErrStr("district")) | setDistrictErrStr(getRequiredErrStr("district")) | ||||
| } | } | ||||
| },[selectedAddress4, selectedAddress5]) | |||||
| }, [selectedAddress4, selectedAddress5]) | |||||
| useEffect(() => { | useEffect(() => { | ||||
| props.step == 2 ? _onSubmit() : null; | props.step == 2 ? _onSubmit() : null; | ||||
| @@ -541,11 +541,11 @@ const CustomFormWizard = (props) => { | |||||
| return <Typography variant="errorMessage1">{errorMsg}</Typography> | 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({ | const formik = useFormik({ | ||||
| @@ -581,14 +581,17 @@ const CustomFormWizard = (props) => { | |||||
| .matches(/^(?=.*[0-9])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1Number' })) }) | .matches(/^(?=.*[0-9])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1Number' })) }) | ||||
| .matches(/^(?=.*[!@#%&])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1SpecialChar' })) }), | .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' }))), | 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' }))), | address1: yup.string().max(40, getMaxErrStr(40, "addressLine1")).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))), | ||||
| address2: yup.string().max(40, getMaxErrStr(40, "addressLine2")), | address2: yup.string().max(40, getMaxErrStr(40, "addressLine2")), | ||||
| address3: yup.string().max(40, getMaxErrStr(40, "addressLine3")), | 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' }))), | 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' }))), | 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(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) }) | ||||
| .matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpace' })}`) }) | .matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpace' })}`) }) | ||||
| .test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredValid' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`), function (value) { | .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位數字'), | // faxCountryCode: yup.string().min(3,'請輸入3位數字'), | ||||
| phone: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requireAtLeast8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))), | phone: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requireAtLeast8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))), | ||||
| // fax: yup.string().min(8,'請輸入8位數字'), | // 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 && ( | {formik.touched.idDocType && ( | ||||
| selectedIdDocType === null || selectedIdDocType?.type == null ? | 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" /> | <FormattedMessage id="requireIdDocType" /> | ||||
| </FormHelperText> : '' | </FormHelperText> : '' | ||||
| )} | )} | ||||
| @@ -1067,12 +1070,17 @@ const CustomFormWizard = (props) => { | |||||
| } | } | ||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12} md={12}> | |||||
| <Typography variant="subtitle1"> | |||||
| (<FormattedMessage id="registerNameLabel" />) | |||||
| </Typography> | |||||
| </Grid> | |||||
| <Grid item xs={12} md={6}> | <Grid item xs={12} md={6}> | ||||
| <Stack spacing={1}> | <Stack spacing={1}> | ||||
| <InputLabel htmlFor="enName-signup"> | <InputLabel htmlFor="enName-signup"> | ||||
| <Typography variant="pnspsFormHeader"> | <Typography variant="pnspsFormHeader"> | ||||
| <FormattedMessage id="userEnglishName" /> | <FormattedMessage id="userEnglishName" /> | ||||
| {selectedIdDocType.type === "CNID" ? "" : <span style={{ color: '#f10000' }}>*</span>} | |||||
| {selectedIdDocType.type === "CNID" ? "" : <span style={{ color: '#f10000' }}></span>} | |||||
| </Typography> | </Typography> | ||||
| </InputLabel> | </InputLabel> | ||||
| <OutlinedInput | <OutlinedInput | ||||
| @@ -1105,7 +1113,7 @@ const CustomFormWizard = (props) => { | |||||
| <InputLabel htmlFor="chName-signup"> | <InputLabel htmlFor="chName-signup"> | ||||
| <Typography variant="pnspsFormHeader"> | <Typography variant="pnspsFormHeader"> | ||||
| <FormattedMessage id="userChineseName" /> | <FormattedMessage id="userChineseName" /> | ||||
| <span style={{ color: '#f10000' }}>*</span> | |||||
| <span style={{ color: '#f10000' }}></span> | |||||
| </Typography> | </Typography> | ||||
| </InputLabel> | </InputLabel> | ||||
| <OutlinedInput | <OutlinedInput | ||||
| @@ -1199,7 +1207,7 @@ const CustomFormWizard = (props) => { | |||||
| value={selectedAddress4} | value={selectedAddress4} | ||||
| options={ComboData.district} | options={ComboData.district} | ||||
| disabled={checkCountry} | disabled={checkCountry} | ||||
| error={Boolean(districtErrStr!="")} | |||||
| error={Boolean(districtErrStr != "")} | |||||
| onBlur={formik.handleBlur} | onBlur={formik.handleBlur} | ||||
| getOptionLabel={(option) => option.type ? intl.formatMessage({ id: option.type }) : ""} | getOptionLabel={(option) => option.type ? intl.formatMessage({ id: option.type }) : ""} | ||||
| onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
| @@ -1252,7 +1260,7 @@ const CustomFormWizard = (props) => { | |||||
| {formik.errors.address3} | {formik.errors.address3} | ||||
| </FormHelperText> | </FormHelperText> | ||||
| )} | )} | ||||
| {districtErrStr!= "" && ( | |||||
| {districtErrStr != "" && ( | |||||
| <FormHelperText error > | <FormHelperText error > | ||||
| {districtErrStr} | {districtErrStr} | ||||
| </FormHelperText> | </FormHelperText> | ||||
| @@ -1685,8 +1693,8 @@ const CustomFormWizard = (props) => { | |||||
| <FormattedMessage id="idDocType" />: | <FormattedMessage id="idDocType" />: | ||||
| </Typography> | </Typography> | ||||
| <Typography variant="pnspsFormHeader" name="preview-idDocType"> | <Typography variant="pnspsFormHeader" name="preview-idDocType"> | ||||
| {intl.formatMessage({ id: selectedIdDocType?.label??" " })} | |||||
| {intl.formatMessage({ id: selectedIdDocType?.label ?? " " })} | |||||
| </Typography> | </Typography> | ||||
| </Stack> | </Stack> | ||||
| </Grid> | </Grid> | ||||
| @@ -29,22 +29,27 @@ const PasswordAlertDialog = (props) => { | |||||
| <DialogTitle id="alert-dialog-title"> | <DialogTitle id="alert-dialog-title"> | ||||
| <Stack mt={1} mr={4} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}> | <Stack mt={1} mr={4} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}> | ||||
| <CancelOutlinedIcon color="error" sx={{ width: "35px", height: "40px" }} /> | <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> | </Stack> | ||||
| </DialogTitle> | </DialogTitle> | ||||
| @@ -20,13 +20,26 @@ const DashboardDefault = () => { | |||||
| backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
| backgroundPosition: 'right' | 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 ( | return ( | ||||
| <Grid container sx={{minHeight: '87vh', backgroundColor: "backgroundColor.default"}} direction="column"> | <Grid container sx={{minHeight: '87vh', backgroundColor: "backgroundColor.default"}} direction="column"> | ||||
| <Grid item xs={12}> | <Grid item xs={12}> | ||||
| <div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <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' }}}> | <Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | ||||
| Morning, {userData.fullenName} | |||||
| {getWelcomeMsg()}, {userData.fullenName} | |||||
| </Typography> | </Typography> | ||||
| </Stack> | </Stack> | ||||
| </div> | </div> | ||||
| @@ -35,6 +35,20 @@ const DashboardDefault = () => { | |||||
| backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
| backgroundPosition: 'right' | 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 ( | return ( | ||||
| <Grid container sx={{ minHeight: '87vh' }} direction="column"> | <Grid container sx={{ minHeight: '87vh' }} direction="column"> | ||||
| <Grid item xs={12} > | <Grid item xs={12} > | ||||
| @@ -42,7 +56,7 @@ const DashboardDefault = () => { | |||||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
| {/* <Typography variant="h5">我的公共啟事</Typography> */} | {/* <Typography variant="h5">我的公共啟事</Typography> */} | ||||
| <Typography color='#FFF' variant="h5" sx={{ ml: 10, display: { xs: 'none', sm: 'none', md: 'block' } }}> | <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> | </Typography> | ||||
| </Stack> | </Stack> | ||||
| </div> | </div> | ||||
| @@ -61,6 +61,10 @@ const Index = () => { | |||||
| // setLocale("zh-CN"); | // setLocale("zh-CN"); | ||||
| localStorage.setItem('locale','zh-CN'); | localStorage.setItem('locale','zh-CN'); | ||||
| } | } | ||||
| if (response.data.preferLocale ==="en"){ | |||||
| // setLocale("zh-CN"); | |||||
| localStorage.setItem('locale','en'); | |||||
| } | |||||
| } | } | ||||
| dispatch(handleLogin(data)) | dispatch(handleLogin(data)) | ||||
| navigate('/dashboard'); | navigate('/dashboard'); | ||||
| @@ -2,15 +2,16 @@ | |||||
| "en": "English", | "en": "English", | ||||
| "zh-HK": "繁體中文", | "zh-HK": "繁體中文", | ||||
| "zh-CN": "简体中文", | "zh-CN": "简体中文", | ||||
| "language":"Language", | |||||
| "PNSPS": "PNSPS", | "PNSPS": "PNSPS", | ||||
| "HKSARGOV": "HKSAR Government", | "HKSARGOV": "HKSAR Government", | ||||
| "HKGLD": "Government Logistics Department", | "HKGLD": "Government Logistics Department", | ||||
| "importantNotice": "Important Notice", | "importantNotice": "Important Notice", | ||||
| "privacyPolicy": "Privacy Policy", | "privacyPolicy": "Privacy Policy", | ||||
| "Gazette": "Gazette", | "Gazette": "Gazette", | ||||
| "gazetteDate": "GazetteDate", | |||||
| "gazetteLength": "length", | |||||
| "gazetteDate": "Gazette Date", | |||||
| "gazetteLength": "Length", | |||||
| "gazetteSampleName": "Gazette Supplement No. 6", | "gazetteSampleName": "Gazette Supplement No. 6", | ||||
| "reason": "Reason", | "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.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.proofOutOfTime": "Response out of time, please apply again.", | ||||
| "MSG.plzSelectApp": "Please select application", | |||||
| "MSG.actionFail": "Action failed", | |||||
| "registerTitle1": "Become", | "registerTitle1": "Become", | ||||
| "registerTitle2": "Gazette Notice", | "registerTitle2": "Gazette Notice", | ||||
| @@ -78,7 +81,7 @@ | |||||
| "registerFail": "Application failed, please try again later", | "registerFail": "Application failed, please try again later", | ||||
| "mainPage": "Main Page", | "mainPage": "Main Page", | ||||
| "myPublicNotice": "My Public Notice", | |||||
| "myPublicNotice": "My Public Notices", | |||||
| "publicNotice": "Public Notice", | "publicNotice": "Public Notice", | ||||
| "publicNoticePayment": "Public Notice: Payment", | "publicNoticePayment": "Public Notice: Payment", | ||||
| "publicNoticePaymentFail": "Public Notice: Payment Failed", | "publicNoticePaymentFail": "Public Notice: Payment Failed", | ||||
| @@ -93,7 +96,10 @@ | |||||
| "onlinePaymentHistory": "Online Payment History", | "onlinePaymentHistory": "Online Payment History", | ||||
| "setting": "Settings", | "setting": "Settings", | ||||
| "companyOrUserRecord": "Company/Institutional User Records", | "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", | "login": "Login", | ||||
| "logout": "Logout", | "logout": "Logout", | ||||
| @@ -105,6 +111,13 @@ | |||||
| "register": "Register", | "register": "Register", | ||||
| "userLoginName": "Username", | "userLoginName": "Username", | ||||
| "userPassword": "Password", | "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", | "newPassword": "New Password", | ||||
| "setNewPassword": "Please enter new password", | "setNewPassword": "Please enter new password", | ||||
| "forgotUserPassword": "Forgot Password", | "forgotUserPassword": "Forgot Password", | ||||
| @@ -137,6 +150,7 @@ | |||||
| "registerNewBusinessUser": "Apply as organisation/company user", | "registerNewBusinessUser": "Apply as organisation/company user", | ||||
| "becomeNewBusinessUser": "Become New Organisation/Company user", | "becomeNewBusinessUser": "Become New Organisation/Company user", | ||||
| "userName": "Username", | "userName": "Username", | ||||
| "registerNameLabel": "Please provide either an English name or a Chinese name, at a minimum.", | |||||
| "userChineseName": "Chinese Name", | "userChineseName": "Chinese Name", | ||||
| "userEnglishName": "English Name", | "userEnglishName": "English Name", | ||||
| "userContactName": "Name", | "userContactName": "Name", | ||||
| @@ -312,12 +326,13 @@ | |||||
| "price": "Price", | "price": "Price", | ||||
| "pay": "Pay", | "pay": "Pay", | ||||
| "payDate": "Payment Date", | "payDate": "Payment Date", | ||||
| "payDateFrom": "Payment date (from)", | |||||
| "payDateFrom": "Payment Date (from)", | |||||
| "payStatus": "Payment Status", | "payStatus": "Payment Status", | ||||
| "payId": "Payment Code", | "payId": "Payment Code", | ||||
| "payConfirm": "Confirm payment", | "payConfirm": "Confirm payment", | ||||
| "payCancel": "Cancel payment", | "payCancel": "Cancel payment", | ||||
| "payTotal": "Payment total", | |||||
| "payTotalDeatail": "Total Payment Amount", | |||||
| "payTotal": "Total", | |||||
| "payDetail": "Payment Details", | "payDetail": "Payment Details", | ||||
| "payMethod": "Payment method", | "payMethod": "Payment method", | ||||
| "selectPaymentMethod": "Please select a payment method", | "selectPaymentMethod": "Please select a payment method", | ||||
| @@ -331,8 +346,9 @@ | |||||
| "totalAmount": "Total Amount", | "totalAmount": "Total Amount", | ||||
| "close": "Close", | "close": "Close", | ||||
| "confirm": "Confirm", | "confirm": "Confirm", | ||||
| "terms": "Terms", | |||||
| "particulars": "Particulars", | |||||
| "currencyPrice": "Price", | "currencyPrice": "Price", | ||||
| "currencyAmount": "Amount", | |||||
| "transactionRefNo": "Transaction Reference Number", | "transactionRefNo": "Transaction Reference Number", | ||||
| "selectedPaymentMethod": "Selected payment method", | "selectedPaymentMethod": "Selected payment method", | ||||
| "paymentMethodNotAvailable":"The payment function is currently not available", | "paymentMethodNotAvailable":"The payment function is currently not available", | ||||
| @@ -342,7 +358,7 @@ | |||||
| "publicNoticeDetailTitle": "Public Notice Application Information", | "publicNoticeDetailTitle": "Public Notice Application Information", | ||||
| "applyPerson": "Applicant", | "applyPerson": "Applicant", | ||||
| "applyStatus": "Application Status", | |||||
| "applyStatus": "App. Status", | |||||
| "gazetteCount": "Gazette issues number", | "gazetteCount": "Gazette issues number", | ||||
| "gazetteCount2" :"Gazette issues number / Remarks", | "gazetteCount2" :"Gazette issues number / Remarks", | ||||
| "gazetteCount2_1" :"Care Of / Remarks", | "gazetteCount2_1" :"Care Of / Remarks", | ||||
| @@ -383,7 +399,7 @@ | |||||
| "transactionNo": "Transaction number", | "transactionNo": "Transaction number", | ||||
| "transactionDate": "Transaction date", | "transactionDate": "Transaction date", | ||||
| "transactionTime": "Transaction time", | "transactionTime": "Transaction time", | ||||
| "paymentRefCode": "Payment Reference Number", | |||||
| "paymentRefCode": "Payment reference number", | |||||
| "paymentInfoRecord": "Payment Notice Record", | "paymentInfoRecord": "Payment Notice Record", | ||||
| "paymentRecordId": "Payment record number", | "paymentRecordId": "Payment record number", | ||||
| @@ -434,9 +450,9 @@ | |||||
| "organizationProfile": "Organisation Profile", | "organizationProfile": "Organisation Profile", | ||||
| "organizationDetails": "Organisation Details", | "organizationDetails": "Organisation Details", | ||||
| "brNo": "BR No.", | "brNo": "BR No.", | ||||
| "creditorAccount": "Creditor account", | |||||
| "creditorAccount": "Credit Client", | |||||
| "nameEng": "Name (Eng)", | "nameEng": "Name (Eng)", | ||||
| "nameChi": "Name (Ch)", | |||||
| "nameChi": "Name (Chi)", | |||||
| "expiryDate": "Expiry date", | "expiryDate": "Expiry date", | ||||
| "create": "Create", | "create": "Create", | ||||
| "confirmTo": "Confirm to ", | "confirmTo": "Confirm to ", | ||||
| @@ -2,6 +2,7 @@ | |||||
| "en": "English", | "en": "English", | ||||
| "zh-HK": "繁體中文", | "zh-HK": "繁體中文", | ||||
| "zh-CN": "简体中文", | "zh-CN": "简体中文", | ||||
| "language":"語言", | |||||
| "PNSPS": "公共启事提交及缴费系统", | "PNSPS": "公共启事提交及缴费系统", | ||||
| "HKSARGOV": "香港特别行政区政府", | "HKSARGOV": "香港特别行政区政府", | ||||
| @@ -11,7 +12,7 @@ | |||||
| "Gazette": "宪报", | "Gazette": "宪报", | ||||
| "gazetteDate": "宪报日期", | "gazetteDate": "宪报日期", | ||||
| "gazetteLength": "长度", | "gazetteLength": "长度", | ||||
| "gazetteSampleName": "宪报第6号副刊公告", | |||||
| "gazetteSampleName": "宪报第6号副刊公共启事", | |||||
| "reason": "原因", | "reason": "原因", | ||||
| "payInstantly": "即时网上缴费", | "payInstantly": "即时网上缴费", | ||||
| @@ -63,9 +64,11 @@ | |||||
| "MSG.payMsg3": "如你在宪报期数{issueYear} 年{issueVolume} 卷, 第{issueNo} 期内有多于一个公共启事的申请,你可选择完成所有此期所有稿件校对确定后,于缴费期限前在「我的公共启事」内合并付款。 ", | "MSG.payMsg3": "如你在宪报期数{issueYear} 年{issueVolume} 卷, 第{issueNo} 期内有多于一个公共启事的申请,你可选择完成所有此期所有稿件校对确定后,于缴费期限前在「我的公共启事」内合并付款。 ", | ||||
| "MSG.proofOutOfTime": "回覆逾时,请重新申请。", | "MSG.proofOutOfTime": "回覆逾时,请重新申请。", | ||||
| "MSG.plzSelectApp": "请选择公共启事。", | |||||
| "MSG.actionFail": "行动失败", | |||||
| "registerTitle1": "立即成为", | "registerTitle1": "立即成为", | ||||
| "registerTitle2": "宪报刊登公告", | |||||
| "registerTitle2": "宪报刊登公共启事", | |||||
| "registerTitle3": "用户", | "registerTitle3": "用户", | ||||
| "registerSubTitle": "只需4-5分钟", | "registerSubTitle": "只需4-5分钟", | ||||
| "or": "或", | "or": "或", | ||||
| @@ -92,7 +95,9 @@ | |||||
| "onlinePaymentHistory": "网上付款记录", | "onlinePaymentHistory": "网上付款记录", | ||||
| "setting": "设置", | "setting": "设置", | ||||
| "companyOrUserRecord": "公司/机构用户记录", | "companyOrUserRecord": "公司/机构用户记录", | ||||
| "welcomeMsg": "午安! 请选择所需服务。", | |||||
| "welcomeMsg_am": "早安! 请选择所需服务。", | |||||
| "welcomeMsg_pm": "午安! 请选择所需服务。", | |||||
| "welcomeMsg_night": "晚安! 请选择所需服务。", | |||||
| "login": "登录", | "login": "登录", | ||||
| "logout": "登出", | "logout": "登出", | ||||
| @@ -104,6 +109,13 @@ | |||||
| "register": "申请", | "register": "申请", | ||||
| "userLoginName": "用户登入名称", | "userLoginName": "用户登入名称", | ||||
| "userPassword": "密码", | "userPassword": "密码", | ||||
| "loginErrorMessage1":"帐户将被封锁", | |||||
| "loginErrorMessage2":"帐户连续五次登入错误,请与系统管理员联络", | |||||
| "loginErrorMessage3":"帐户尚未验证", | |||||
| "loginErrorMessage4":"系统连接失败", | |||||
| "loginErrorMessage5":"用户名或密码错误", | |||||
| "newPassword": "新密码", | "newPassword": "新密码", | ||||
| "setNewPassword": "请输入新密码", | "setNewPassword": "请输入新密码", | ||||
| "forgotUserPassword": "忘记密码", | "forgotUserPassword": "忘记密码", | ||||
| @@ -132,6 +144,7 @@ | |||||
| "registerNewBusinessUser": "申请机构/公司用户", | "registerNewBusinessUser": "申请机构/公司用户", | ||||
| "becomeNewBusinessUser": "成为新的机构/公司用户", | "becomeNewBusinessUser": "成为新的机构/公司用户", | ||||
| "userName": "用户名称", | "userName": "用户名称", | ||||
| "registerNameLabel": "请至少输入英文姓名或中文姓名。", | |||||
| "userChineseName": "中文姓名", | "userChineseName": "中文姓名", | ||||
| "userEnglishName": "英文姓名", | "userEnglishName": "英文姓名", | ||||
| "userContactName": "姓名", | "userContactName": "姓名", | ||||
| @@ -312,6 +325,7 @@ | |||||
| "payId": "付款编号", | "payId": "付款编号", | ||||
| "payConfirm": "确认付款", | "payConfirm": "确认付款", | ||||
| "payCancel": "取消付款", | "payCancel": "取消付款", | ||||
| "payTotalDeatail": "付款总额", | |||||
| "payTotal": "付款总额", | "payTotal": "付款总额", | ||||
| "payDetail": "付款详情", | "payDetail": "付款详情", | ||||
| "payMethod": "付款方式", | "payMethod": "付款方式", | ||||
| @@ -326,8 +340,9 @@ | |||||
| "totalAmount": "总额", | "totalAmount": "总额", | ||||
| "close": "关闭", | "close": "关闭", | ||||
| "confirm": "确认", | "confirm": "确认", | ||||
| "terms": "项目", | |||||
| "particulars": "项目", | |||||
| "currencyPrice": "金额", | "currencyPrice": "金额", | ||||
| "currencyAmount": "金额", | |||||
| "transactionRefNo": "交易參考編號", | "transactionRefNo": "交易參考編號", | ||||
| "selectedPaymentMethod": "已選擇付款方法", | "selectedPaymentMethod": "已選擇付款方法", | ||||
| "paymentMethodNotAvailable":"付款功能現在不可用", | "paymentMethodNotAvailable":"付款功能現在不可用", | ||||
| @@ -400,8 +415,8 @@ | |||||
| "submitApplication": "提交公共启事申请", | "submitApplication": "提交公共启事申请", | ||||
| "applicationSubheading": "提供你的启事内容作排版,校对及计价。", | "applicationSubheading": "提供你的启事内容作排版,校对及计价。", | ||||
| "announcement": "公告", | |||||
| "viewAllAnnouncement": "显示所有公告", | |||||
| "announcement": "公共启事", | |||||
| "viewAllAnnouncement": "显示所有公共启事", | |||||
| "systemMessage": "系统消息", | "systemMessage": "系统消息", | ||||
| "viewAllSystemMessage": "显示所有消息", | "viewAllSystemMessage": "显示所有消息", | ||||
| "msgDetails": "消息详情", | "msgDetails": "消息详情", | ||||
| @@ -2,6 +2,7 @@ | |||||
| "en": "English", | "en": "English", | ||||
| "zh-HK": "繁體中文", | "zh-HK": "繁體中文", | ||||
| "zh-CN": "简体中文", | "zh-CN": "简体中文", | ||||
| "language":"語言", | |||||
| "PNSPS": "公共啟事提交及繳費系統", | "PNSPS": "公共啟事提交及繳費系統", | ||||
| "HKSARGOV": "香港特別行政區政府", | "HKSARGOV": "香港特別行政區政府", | ||||
| @@ -11,7 +12,7 @@ | |||||
| "Gazette": "憲報", | "Gazette": "憲報", | ||||
| "gazetteDate": "憲報日期", | "gazetteDate": "憲報日期", | ||||
| "gazetteLength": "長度", | "gazetteLength": "長度", | ||||
| "gazetteSampleName": "憲報第6號副刊公告", | |||||
| "gazetteSampleName": "憲報第6號副刊公共啟事", | |||||
| "reason": "原因", | "reason": "原因", | ||||
| "payInstantly": "即時網上繳費", | "payInstantly": "即時網上繳費", | ||||
| @@ -63,9 +64,11 @@ | |||||
| "MSG.payMsg3": "如你在憲報期數 {issueYear} 年 {issueVolume} 卷, 第 {issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。", | "MSG.payMsg3": "如你在憲報期數 {issueYear} 年 {issueVolume} 卷, 第 {issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。", | ||||
| "MSG.proofOutOfTime": "回覆逾時,請重新申請。", | "MSG.proofOutOfTime": "回覆逾時,請重新申請。", | ||||
| "MSG.plzSelectApp": "請選擇公共啟事。", | |||||
| "MSG.actionFail": "行動失敗", | |||||
| "registerTitle1": "立即成為", | "registerTitle1": "立即成為", | ||||
| "registerTitle2": "憲報刊登公告", | |||||
| "registerTitle2": "憲報刊登公共啟事", | |||||
| "registerTitle3": "用戶", | "registerTitle3": "用戶", | ||||
| "registerSubTitle": "只需4-5分鐘", | "registerSubTitle": "只需4-5分鐘", | ||||
| "or": "或", | "or": "或", | ||||
| @@ -92,7 +95,9 @@ | |||||
| "onlinePaymentHistory": "網上付款記錄", | "onlinePaymentHistory": "網上付款記錄", | ||||
| "setting": "設定", | "setting": "設定", | ||||
| "companyOrUserRecord": "公司/機構用戶記錄", | "companyOrUserRecord": "公司/機構用戶記錄", | ||||
| "welcomeMsg": "午安! 請選擇所需服務。", | |||||
| "welcomeMsg_am": "早安! 請選擇所需服務。", | |||||
| "welcomeMsga_pm": "午安! 請選擇所需服務。", | |||||
| "welcomeMsg_night": "晚安! 請選擇所需服務。", | |||||
| "login": "登入", | "login": "登入", | ||||
| "logout": "登出", | "logout": "登出", | ||||
| @@ -104,6 +109,13 @@ | |||||
| "register": "申請", | "register": "申請", | ||||
| "userLoginName": "用戶登入名稱", | "userLoginName": "用戶登入名稱", | ||||
| "userPassword": "密碼", | "userPassword": "密碼", | ||||
| "loginErrorMessage1":"帳戶將被封鎖", | |||||
| "loginErrorMessage2":"帳戶連續五次登入錯誤,請與系統管理員聯絡", | |||||
| "loginErrorMessage3":"帳戶尚未驗證", | |||||
| "loginErrorMessage4":"系統連接失敗", | |||||
| "loginErrorMessage5":"用戶名或密碼錯誤", | |||||
| "newPassword": "新密碼", | "newPassword": "新密碼", | ||||
| "setNewPassword": "請輸入新密碼", | "setNewPassword": "請輸入新密碼", | ||||
| "forgotUserPassword": "忘記密碼", | "forgotUserPassword": "忘記密碼", | ||||
| @@ -112,10 +124,8 @@ | |||||
| "forgotPasswordSubTitle": "請輸入你的用戶登入名稱以重設密碼", | "forgotPasswordSubTitle": "請輸入你的用戶登入名稱以重設密碼", | ||||
| "forgotPasswordSubTitle1": "請輸入你的用戶登入名稱", | "forgotPasswordSubTitle1": "請輸入你的用戶登入名稱", | ||||
| "forgotPasswordSubTitle2": "以重設密碼", | "forgotPasswordSubTitle2": "以重設密碼", | ||||
| "forgotUsernameSubTitle": "請輸入你的電郵以重設密碼", | "forgotUsernameSubTitle": "請輸入你的電郵以重設密碼", | ||||
| "forgotUsernameSubTitle1": "請輸入你的電郵", | "forgotUsernameSubTitle1": "請輸入你的電郵", | ||||
| "resetPasswordSuccess": "已成功重設密碼。", | "resetPasswordSuccess": "已成功重設密碼。", | ||||
| "securityCode": "安全驗證碼", | "securityCode": "安全驗證碼", | ||||
| "sentSecurityCode1": "我們已將驗證碼送至你的電郵:", | "sentSecurityCode1": "我們已將驗證碼送至你的電郵:", | ||||
| @@ -137,6 +147,7 @@ | |||||
| "registerNewBusinessUser": "申請機構/公司用戶", | "registerNewBusinessUser": "申請機構/公司用戶", | ||||
| "becomeNewBusinessUser": "成為新的機構/公司用戶", | "becomeNewBusinessUser": "成為新的機構/公司用戶", | ||||
| "userName": "用戶名稱", | "userName": "用戶名稱", | ||||
| "registerNameLabel": "請至少輸入英文姓名或中文姓名。", | |||||
| "userChineseName": "中文姓名", | "userChineseName": "中文姓名", | ||||
| "userEnglishName": "英文姓名", | "userEnglishName": "英文姓名", | ||||
| "userContactName": "姓名", | "userContactName": "姓名", | ||||
| @@ -317,6 +328,7 @@ | |||||
| "payId": "付款編號", | "payId": "付款編號", | ||||
| "payConfirm": "確認付款", | "payConfirm": "確認付款", | ||||
| "payCancel": "取消付款", | "payCancel": "取消付款", | ||||
| "payTotalDeatail": "付款總額", | |||||
| "payTotal": "付款總額", | "payTotal": "付款總額", | ||||
| "payDetail": "付款詳情", | "payDetail": "付款詳情", | ||||
| "payMethod": "付款方式", | "payMethod": "付款方式", | ||||
| @@ -331,8 +343,9 @@ | |||||
| "totalAmount": "總額", | "totalAmount": "總額", | ||||
| "close": "關閉", | "close": "關閉", | ||||
| "confirm": "確認", | "confirm": "確認", | ||||
| "terms": "項目", | |||||
| "particulars": "項目", | |||||
| "currencyPrice": "金額", | "currencyPrice": "金額", | ||||
| "currencyAmount": "金額", | |||||
| "transactionRefNo": "交易參考編號", | "transactionRefNo": "交易參考編號", | ||||
| "selectedPaymentMethod": "已選擇付款方法", | "selectedPaymentMethod": "已選擇付款方法", | ||||
| "paymentMethodNotAvailable":"付款功能現在不可用", | "paymentMethodNotAvailable":"付款功能現在不可用", | ||||
| @@ -405,8 +418,8 @@ | |||||
| "submitApplication": "提交公共啟事申請", | "submitApplication": "提交公共啟事申請", | ||||
| "applicationSubheading": "提供你的啟事內容作排版,校對及計價。", | "applicationSubheading": "提供你的啟事內容作排版,校對及計價。", | ||||
| "announcement": "公告", | |||||
| "viewAllAnnouncement": "顯示所有公告", | |||||
| "announcement": "通告", | |||||
| "viewAllAnnouncement": "顯示所有通告", | |||||
| "systemMessage": "系統消息", | "systemMessage": "系統消息", | ||||
| "viewAllSystemMessage": "顯示所有消息", | "viewAllSystemMessage": "顯示所有消息", | ||||
| "msgDetails": "消息詳情", | "msgDetails": "消息詳情", | ||||
| @@ -122,6 +122,12 @@ export const denmandNoteStatus_Public = [ | |||||
| export const CreditorStatus = [ | export const CreditorStatus = [ | ||||
| { key: 0, labelCht: '全部', label: 'All', type: 'all' }, | { 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' }, | |||||
| ]; | ]; | ||||
| @@ -30,7 +30,19 @@ export function getObjectByValue(list, valueName, value) { | |||||
| const obj = list.find((element) => { | const obj = list.find((element) => { | ||||
| return element[valueName] === parseInt(value); | 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 | return obj === undefined || Object.keys(obj).length <= 0 ? null : obj | ||||
| } | } | ||||
| @@ -21,7 +21,7 @@ export function getStatusByText(status, creditor) { | |||||
| return getStatusTag({ color: "#22a13f", text: "待付款" }) | return getStatusTag({ color: "#22a13f", text: "待付款" }) | ||||
| case "paid": | case "paid": | ||||
| return getStatusTag({ color: "#22a13f", text: "待發佈" }) | return getStatusTag({ color: "#22a13f", text: "待發佈" }) | ||||
| case "complated": | |||||
| case "completed": | |||||
| return getStatusTag({ color: "#8a8784", text: "已完成" }) | return getStatusTag({ color: "#8a8784", text: "已完成" }) | ||||
| case "notAccepted": | case "notAccepted": | ||||
| return getStatusTag({ color: "#d9372b", text: "不接受" }) | return getStatusTag({ color: "#d9372b", text: "不接受" }) | ||||
| @@ -54,7 +54,7 @@ export function getStatusByTextEng(status, creditor) { | |||||
| return getStatusTag({ color: "#F39C12", text: "Pending Payment" }) | return getStatusTag({ color: "#F39C12", text: "Pending Payment" }) | ||||
| case "paid": | case "paid": | ||||
| return getStatusTag({ color: "#3498DB", text: "Pending Publish" }) | return getStatusTag({ color: "#3498DB", text: "Pending Publish" }) | ||||
| case "complated": | |||||
| case "completed": | |||||
| return getStatusTag({ color: "#8a8784", text: "Completed" }) | return getStatusTag({ color: "#8a8784", text: "Completed" }) | ||||
| case "notAccepted": | case "notAccepted": | ||||
| return getStatusTag({ color: "#d9372b", text: "Not accepted" }) | 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'}) }) | return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPayment'}) }) | ||||
| case "paid": | case "paid": | ||||
| return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) }) | return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) }) | ||||
| case "complated": | |||||
| case "completed": | |||||
| return getStatusTag({ color: "#8a8784", text: intl.formatMessage({id: 'completed'}) }) | return getStatusTag({ color: "#8a8784", text: intl.formatMessage({id: 'completed'}) }) | ||||
| case "notAccepted": | case "notAccepted": | ||||
| return getStatusTag({ color: "#d9372b", text: intl.formatMessage({id: 'notAccepted'}) }) | return getStatusTag({ color: "#d9372b", text: intl.formatMessage({id: 'notAccepted'}) }) | ||||