浏览代码

add login public check, message check, demand note no

CR013B2
CCHooo 3 个月前
父节点
当前提交
3663276cb1
共有 13 个文件被更改,包括 87 次插入67 次删除
  1. +2
    -2
      src/pages/Proof/Payment/Pay_Online.js
  2. +9
    -2
      src/pages/Proof/Payment/index.js
  3. +2
    -2
      src/pages/Proof/Reply_Public/ProofForm.js
  4. +15
    -13
      src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js
  5. +6
    -6
      src/pages/PublicNotice/ListPanel/PendingPaymentTab.js
  6. +35
    -20
      src/pages/PublicNotice/Search_Mark_As_Paid_GLD/DataGrid.js
  7. +3
    -7
      src/pages/authentication/AuthWrapper.js
  8. +4
    -0
      src/pages/authentication/auth-forms/PasswordAlertDialog.js
  9. +5
    -11
      src/pages/dashboard/Public/index.js
  10. +1
    -0
      src/translations/en.json
  11. +1
    -0
      src/translations/zh-CN.json
  12. +1
    -0
      src/translations/zh-HK.json
  13. +3
    -4
      src/utils/Utils.js

+ 2
- 2
src/pages/Proof/Payment/Pay_Online.js 查看文件

@@ -176,8 +176,8 @@ const Index = () => {
<br />
{checkPaymentSuspention()?
<div>
<Typography style={{ textAlign: "flex-start" }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<Typography style={{ textAlign: "flex-start", color: "red" }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography>
<br />
</div>:null


+ 9
- 2
src/pages/Proof/Payment/index.js 查看文件

@@ -12,12 +12,14 @@ const Pay_Creditor = Loadable(lazy(() => import('./Pay_Creditor')));
const Pay_Dn = Loadable(lazy(() => import('./Pay_DN')));
const Pay_Office = Loadable(lazy(() => import('./Pay_Office')));
const Pay_Online = Loadable(lazy(() => import('./Pay_Online')));
import { checkPaymentSuspention } from "utils/Utils";


const Index = () => {
const params = useParams();
const [onReady, setOnReady] = useState(false);
const [record, setRecord] = useState({});
const [paymentMethod, setPaymentMethod] = useState();
const navigate = useNavigate()

useEffect(() => {
@@ -33,6 +35,11 @@ const Index = () => {
navigate("/proof/search");
}
setRecord(responseData.data);
if(checkPaymentSuspention()){
setPaymentMethod("online")
}else{
setPaymentMethod(responseData.data.paymentMethod)
}
},
onError: () => {

@@ -56,12 +63,12 @@ const Index = () => {
record={record}
/>
: (
record.paymentMethod == "demandNote" ?
paymentMethod == "demandNote" ?
<Pay_Dn
record={record}
/>
: (
record.paymentMethod == "online" ?
paymentMethod == "online" ?
<Pay_Online
record={record}
/>


+ 2
- 2
src/pages/Proof/Reply_Public/ProofForm.js 查看文件

@@ -436,8 +436,8 @@ const FormPanel = ({ formData }) => {
<td style={tabelStyle}>
<FormattedMessage id="payOnline" />
{checkPaymentSuspention()?
<Typography style={{ padding: '16px' }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<Typography style={{ padding: '16px', color: "red" }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography>:null
}
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => {


+ 15
- 13
src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js 查看文件

@@ -746,7 +746,7 @@ const ApplicationDetailCard = (
</Grid>
<Grid item xs={12} md={8} lg={8} sx={{ display: 'flex', alignItems: 'center' }}>
<Grid container direction="row" justifyContent="flex-start">
<Grid item xs={10} md={5} lg={5} sx={{ display: 'flex', alignItems: 'center' }}>
<Grid item xs={10} md={6} lg={6} sx={{ display: 'flex', alignItems: 'center' }}>
<FormControl variant="outlined" fullWidth >
<Typography
// fullWidth
@@ -757,18 +757,20 @@ const ApplicationDetailCard = (
</Typography>
</FormControl>
</Grid>
<Grid item md={3} lg={3}>
<Button
size="small"
variant="contained"
onClick={() =>{setIsPaymentMeansPopUp(true)}}
sx={{
textTransform: 'capitalize',
alignItems: 'end',
}}>
Change
</Button>
</Grid>
{currentApplicationDetailData.paymentMethod!=null?
<Grid item md={3} lg={3}>
<Button
size="small"
variant="contained"
onClick={() =>{setIsPaymentMeansPopUp(true)}}
sx={{
textTransform: 'capitalize',
alignItems: 'end',
}}>
Change
</Button>
</Grid>:null
}
</Grid>
</Grid>
</Grid>


+ 6
- 6
src/pages/PublicNotice/ListPanel/PendingPaymentTab.js 查看文件

@@ -240,19 +240,19 @@ export default function SubmittedTab({ setCount, url }) {
{
params.row.paymentMethod=="online"?
locale === 'en' ?
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
:
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
:params.row.paymentMethod=="demandNote" ?
locale === 'en' ?
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
:
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
:
locale === 'en' ?
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
:
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
}
{/* {
locale === 'en' ?


+ 35
- 20
src/pages/PublicNotice/Search_Mark_As_Paid_GLD/DataGrid.js 查看文件

@@ -36,7 +36,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
const [isConfirmPopUp, setIsConfirmPopUp] = React.useState(false);
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false);
const [demandNoteNoPopUp, setDemandNoteNoPopUp] = React.useState(false);
const [confirmDemandNoteNoPopUp, setConfirmDemandNoteNoPopUp] = React.useState(false);
// const [confirmDemandNoteNoPopUp, setConfirmDemandNoteNoPopUp] = React.useState(false);
const [demandNoteNo, setDemandNoteNo] = React.useState();
const [demandNoteNoId, setDemandNoteNoId] = React.useState();
@@ -71,7 +71,8 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
function updateDemandNoteNo(id, remark) {
setDemandNoteNoId(id)
setDemandNoteNo(remark)
setConfirmDemandNoteNoPopUp(true)
doDemandNoteNo()
// setConfirmDemandNoteNoPopUp(true)
}
function editDemandNoteNo(id, remark) {
@@ -81,7 +82,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
}

const doDemandNoteNo = () => {
setConfirmDemandNoteNoPopUp(false);
// setConfirmDemandNoteNoPopUp(false);
console.log(refreshTrigger)
HttpUtils.post({
url: APPLICATION_UPDATE_DEMAND_NOTE_NO + "/" + demandNoteNoId,
@@ -213,21 +214,35 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
</Button>
</Stack>
:
<TextField
size="small"
variant="outlined"
defaultValue={params.row.demandNoteNo || ''}
onBlur={handleBlur}
placeholder="Enter Demand Note No."
InputProps={{
style: { height: '32px', fontSize: '0.875rem' }
}}
sx={{
'& .MuiOutlinedInput-root': { height: '32px' },
flex: 1,
minWidth: '60px'
}}
/>
<Stack direction="row" justifyContent="space-between" alignItems="center" width="100%">
<TextField
size="small"
variant="outlined"
defaultValue={params.row.demandNoteNo || ''}
onBlur={handleBlur}
placeholder="Enter Demand Note No."
InputProps={{
style: { height: '32px', fontSize: '0.875rem' }
}}
sx={{
'& .MuiOutlinedInput-root': { height: '32px' },
flex: 1,
minWidth: '60px'
}}
/>
<Button
// size="small"
variant="contained"
onClick={() => updateDemandNoteNo(params.row.id, params.row.demandNoteNo)}
sx={{
textTransform: 'capitalize',
alignItems: 'end',

}}>
save
{/* <Typography ml={1} variant="h5"> Edit</Typography> */}
</Button>
</Stack>
}
</div>
);
@@ -360,7 +375,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
</DialogActions>
</Dialog>
</div>
<div>
{/* <div>
<Dialog
open={confirmDemandNoteNoPopUp}
onClose={() => setConfirmDemandNoteNoPopUp(false)}
@@ -381,7 +396,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
<Button onClick={() => doDemandNoteNo()}><Typography variant="h5">Confirm</Typography></Button>
</DialogActions>
</Dialog>
</div>
</div> */}
<div>
<Dialog
open={demandNoteNoPopUp}


+ 3
- 7
src/pages/authentication/AuthWrapper.js 查看文件

@@ -2,12 +2,11 @@ import PropTypes from 'prop-types';
import { Box, Grid, Typography } from '@mui/material';
// import { Stack } from '@mui/material';
import Loadable from 'components/Loadable';
import { lazy, useContext } from 'react';
import { lazy, } from 'react';
import { FormattedMessage, useIntl } from "react-intl";
import { checkSysEnv, checkPaymentSuspention } from "utils/Utils";
import backbroundImg from 'assets/images/bg_ml.jpg';
import 'assets/style/loginStyles.css';
import { SysContext } from "components/SysSettingProvider"

const AuthCard = Loadable(lazy(() => import('./AuthCardCustom')));

@@ -21,7 +20,6 @@ const BackgroundHead = {
const AuthWrapper = ({ children }) => {
// Move useIntl inside component
const intl = useIntl();
const { sysSetting } = useContext(SysContext);

return (
<Box sx={{ minHeight: '87vh' }}>
@@ -45,7 +43,7 @@ const AuthWrapper = ({ children }) => {
<Grid item xs={12} sx={{ ml: 4,}}>
{checkPaymentSuspention()?
<Typography style={{ textAlign: "flex-start" }}>
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography>
:
<Typography style={{ textAlign: "flex-start" }}>
@@ -81,7 +79,6 @@ const AuthWrapper = ({ children }) => {
</Grid>
</Grid>
</Grid>
{sysSetting?.publicLogin?
<Grid item xs={12} md={4} lg={4} xl={4}>
<Grid
container
@@ -93,8 +90,7 @@ const AuthWrapper = ({ children }) => {
<AuthCard>{children}</AuthCard>
</Grid>
</Grid>
</Grid>:null
}
</Grid>
</Grid>
</div>
</Box>


+ 4
- 0
src/pages/authentication/auth-forms/PasswordAlertDialog.js 查看文件

@@ -47,6 +47,10 @@ const PasswordAlertDialog = (props) => {
<Typography display="inline">
<FormattedMessage id="loginErrorMessage4"/>
</Typography>:
props.errorMassage === 'PUBLIC_LOGIN_DISABLE' ?
<Typography display="inline">
<FormattedMessage id="loginErrorMessage7"/>
</Typography>:
<Typography display="inline">
<FormattedMessage id="loginErrorMessage5"/>
</Typography>


+ 5
- 11
src/pages/dashboard/Public/index.js 查看文件

@@ -51,13 +51,12 @@ const DashboardDefault = () => {
const [isLoading, setLoding] = useState(true);
const [itemList, setItemList] = React.useState([]);
const [listData, setListData] = React.useState([]);
const [paymentSuspention, setPaymentSuspention] = useState(false);
const [isPopUp, setIsPopUp] = React.useState(false);
React.useEffect(() => {
loadMessageData()
loadNoticeData()
checkPaymentSuspention()?setPaymentSuspention(true):setPaymentSuspention(false)
localStorage.setItem('searchCriteria',"")
}, []);

@@ -75,19 +74,14 @@ const DashboardDefault = () => {
}
}

React.useEffect(() => {
// console.log(messageOnReady)
// console.log(onNoticeReady)
if(paymentSuspention){
setIsPopUp(true);
}
}, [paymentSuspention]);

React.useEffect(() => {
// console.log(messageOnReady)
// console.log(onNoticeReady)
if(messageOnReady&&onNoticeReady){
setLoding(false)
if(checkPaymentSuspention()){
setIsPopUp(true);
}
// console.log(123)
}
}, [messageOnReady,onNoticeReady]);
@@ -246,7 +240,7 @@ const DashboardDefault = () => {
</DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h5" style={{ padding: '16px' }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography>
</DialogContent>
<DialogActions>


+ 1
- 0
src/translations/en.json 查看文件

@@ -165,6 +165,7 @@
"loginErrorMessage4":"System Connection Failed",
"loginErrorMessage5":"Incorrect Username or Password",
"loginErrorMessage6":"User account not found",
"loginErrorMessage7":"System is under maintenance, please check back later",

"pleaseLloginMessage1":"User account already created",
"pleaseLloginMessage2":"You are our existing user, please login to your account.",


+ 1
- 0
src/translations/zh-CN.json 查看文件

@@ -202,6 +202,7 @@
"loginErrorMessage4":"系统连接失败",
"loginErrorMessage5":"用户登入名称或密码错误",
"loginErrorMessage6":"找不到用户帐户",
"loginErrorMessage7":"系统正在维护中,请稍后再查看",
"pleaseLloginMessage1":"帐户已建立",
"pleaseLloginMessage2":"你是我们的现有用户,请登入你的帐户。",


+ 1
- 0
src/translations/zh-HK.json 查看文件

@@ -203,6 +203,7 @@
"loginErrorMessage4":"系統連接失敗",
"loginErrorMessage5":"用戶名或密碼錯誤",
"loginErrorMessage6":"找不到用戶帳戶",
"loginErrorMessage7":"系統正在維護中,請稍後再查看",

"pleaseLloginMessage1":"帳戶已建立",
"pleaseLloginMessage2":"你是我們的現有用戶,請登入你的帳戶。",


+ 3
- 4
src/utils/Utils.js 查看文件

@@ -110,13 +110,12 @@ export const checkSysEnv = () =>{
// console.log(localStorage.getItem('sysEnv'))
return localStorage.getItem('sysEnv')
}
}
}
export const checkPaymentSuspention = () =>{
if (localStorage.getItem('paymentSuspention') != null){
// console.log(localStorage.getItem('sysEnv'))
return localStorage.getItem('paymentSuspention')
return JSON.parse(localStorage.getItem('paymentSuspention'))
}
}
}
/**
** This function is used for demo purpose route navigation
** In real app you won't need this function because your app will navigate to same route for each users regardless of ability


正在加载...
取消
保存