| @@ -8,11 +8,15 @@ import * as HttpUtils from "../utils/HttpUtils" | |||
| import * as UrlUtils from "../utils/ApiPathConst" | |||
| import * as DateUtils from "../utils/DateUtils" | |||
| import { FiDataGrid } from './FiDataGrid'; | |||
| import {useTheme} from "@emotion/react"; | |||
| import {useMediaQuery} from "@mui/material"; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function FileList({ refType, refId, allowDelete, sx, dateHideable,lang, ...props }) { | |||
| const [rows, setRows] = React.useState([]); | |||
| const [rowModesModel] = React.useState({}); | |||
| const theme = useTheme(); | |||
| const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | |||
| React.useEffect(() => { | |||
| loadData(); | |||
| @@ -92,13 +96,15 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||
| id: 'filename', | |||
| field: 'filename', | |||
| headerName: lang=="ch"?"檔案名稱":'File Name', | |||
| flex: 3, | |||
| width: isMdOrLg ? 'auto' : 400, | |||
| flex: isMdOrLg ? 3 : undefined, | |||
| }, | |||
| { | |||
| id: 'filesize', | |||
| field: 'filesize', | |||
| headerName: lang=="ch"?"檔案大小":'File Size', | |||
| flex: 1, | |||
| width: isMdOrLg ? 'auto' : 160, | |||
| flex: isMdOrLg ? 1 : undefined, | |||
| valueGetter: (params) => { | |||
| return convertToStr(params.value); | |||
| } | |||
| @@ -110,7 +116,8 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||
| id: 'created', | |||
| field: 'created', | |||
| headerName: lang=="ch"?"日期":'Created', | |||
| flex: 1, | |||
| width: isMdOrLg ? 'auto' : 160, | |||
| flex: isMdOrLg ? 1 : undefined, | |||
| valueGetter: (params) => { | |||
| return DateUtils.datetimeStr(params.value); | |||
| } | |||
| @@ -137,13 +144,15 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||
| id: 'filename', | |||
| field: 'filename', | |||
| headerName: lang=="ch"?"檔案名稱":'File Name', | |||
| flex: 3, | |||
| width: isMdOrLg ? 'auto' : 400, | |||
| flex: isMdOrLg ? 3 : undefined, | |||
| }, | |||
| { | |||
| id: 'filesize', | |||
| field: 'filesize', | |||
| headerName: lang=="ch"?"檔案大小":'File Size', | |||
| flex: 1, | |||
| width: isMdOrLg ? 'auto' : 160, | |||
| flex: isMdOrLg ? 1 : undefined, | |||
| valueGetter: (params) => { | |||
| return convertToStr(params.value); | |||
| } | |||
| @@ -175,7 +184,6 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||
| } | |||
| return ( | |||
| // <div style={{height: 400, width: '100%'}}> | |||
| <FiDataGrid | |||
| {...props} | |||
| hideFooterSelectedRowCount={true} | |||
| @@ -191,7 +199,7 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||
| }} | |||
| pageSizeOptions={[5, 10]} | |||
| autoHeight={true} | |||
| /> | |||
| // </div> | |||
| ); | |||
| } | |||
| @@ -58,7 +58,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||
| faxNumber: yup.string().min(8, displayErrorMsg('請輸入8位數字')).nullable(), | |||
| brExpiryDate: yup.string().min(8).required(displayErrorMsg('請輸入商業登記證有效日期')), | |||
| brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(`請輸入有效商業登記證號碼`)), function (value) { | |||
| var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ | |||
| var brNo_pattern = /[0-9]{8}/ | |||
| if (value !== undefined) { | |||
| if (value.match(brNo_pattern)) { | |||
| return true | |||
| @@ -55,10 +55,10 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||
| phoneNumber: yup.string().min(8, displayErrorMsg('請輸入有效聯絡電話')).required(displayErrorMsg('請輸入聯絡電話')), | |||
| faxNumber: yup.string().min(8).nullable(), | |||
| brExpiryDate: yup.string().min(8).required(displayErrorMsg('請輸入商業登記證有效日期')), | |||
| brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234-123-12-12-1)`)), function (value) { | |||
| var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ | |||
| brNo: yup.string().max(8).required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234)`)), function (value) { | |||
| var brNo_pattern = /[0-9]{8}/ | |||
| if (value !== undefined) { | |||
| if (value.match(brNo_pattern)) { | |||
| if (value.size==8 && value.match(brNo_pattern)) { | |||
| return true | |||
| } else { | |||
| return false | |||
| @@ -4,23 +4,24 @@ import { | |||
| CardContent, | |||
| Grid, TextField, | |||
| Typography, | |||
| Checkbox, FormControlLabel, | |||
| Autocomplete, | |||
| } from '@mui/material'; | |||
| import MainCard from "../../../components/MainCard"; | |||
| import MainCard from "components/MainCard"; | |||
| import { useForm } from "react-hook-form"; | |||
| import { useState } from "react"; | |||
| import * as React from "react"; | |||
| import * as UrlUtils from "../../../utils/ApiPathConst"; | |||
| import * as HttpUtils from "../../../utils/HttpUtils"; | |||
| import * as UrlUtils from "utils/ApiPathConst"; | |||
| import * as HttpUtils from "utils/HttpUtils"; | |||
| import * as ComboData from "utils/ComboData"; | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const OrganizationSearchForm = ({ applySearch }) => { | |||
| const [type, setType] = useState([]); | |||
| const [creditorSelected, setCreditorSelected] = React.useState({ key: 0, labelCht: '全部', label: 'All', type: 'all' }); | |||
| const { reset, register, handleSubmit } = useForm() | |||
| const onSubmit = (data) => { | |||
| @@ -34,8 +35,12 @@ const OrganizationSearchForm = ({ applySearch }) => { | |||
| brNo: data.brNo, | |||
| enCompanyName: data.enCompanyName, | |||
| chCompanyName: data.chCompanyName, | |||
| searchCreditor: data.searchCreditor | |||
| }; | |||
| if(creditorSelected.type == 'true'){ | |||
| temp["creditor"] = true; | |||
| }else if(creditorSelected.type == 'false'){ | |||
| temp["creditor"] = false; | |||
| } | |||
| applySearch(temp); | |||
| }; | |||
| @@ -102,12 +107,26 @@ const OrganizationSearchForm = ({ applySearch }) => { | |||
| </Grid> | |||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3}}> | |||
| <FormControlLabel | |||
| {...register("searchCreditor")} | |||
| control={<Checkbox/>} | |||
| label="Search Creditor Only" | |||
| id="searchCreditor" | |||
| /> | |||
| <Autocomplete | |||
| {...register("searchCreditor")} | |||
| id="searchCreditor" | |||
| size="small" | |||
| options={ComboData.CreditorStatus} | |||
| value={creditorSelected} | |||
| onChange={(event, newValue) => { | |||
| setCreditorSelected(newValue); | |||
| }} | |||
| getOptionLabel={(option) => option.label} | |||
| renderInput={(params) => ( | |||
| <TextField | |||
| {...params} | |||
| label="Status" | |||
| InputLabelProps={{ | |||
| shrink: true | |||
| }} | |||
| /> | |||
| )} | |||
| /> | |||
| </Grid> | |||
| </Grid> | |||
| @@ -76,11 +76,14 @@ const FormPanel = ({ formData }) => { | |||
| }, | |||
| files: attachments ? attachments : [], | |||
| onSuccess: function () { | |||
| notifyActionSuccess("提交成功!") | |||
| if (actionValue) { | |||
| notifyActionSuccess("提交成功!") | |||
| navigate("/proof/pay/" + params.id); | |||
| if(data.creditor){ | |||
| navigate("/proof/search"); | |||
| }else{ | |||
| navigate("/proof/pay/" + params.id); | |||
| } | |||
| } else { | |||
| notifyActionSuccess("提交成功!") | |||
| navigate("/proof/search"); | |||
| } | |||
| }, | |||
| @@ -100,19 +100,23 @@ const ApplicationDetailCard = ( | |||
| setStatus("withdraw") | |||
| }; | |||
| const doPublish =()=>()=>{ | |||
| setStatus("publish") | |||
| } | |||
| const onProofClick = () => { | |||
| if (applicationDetailData.data.groupNo) { | |||
| HttpUtils.get({ | |||
| url: UrlUtils.CHECK_CREATE_PROOF+"/"+currentApplicationDetailData.id, | |||
| onSuccess:function(responeData){ | |||
| if(responeData.success == true){ | |||
| url: UrlUtils.CHECK_CREATE_PROOF + "/" + currentApplicationDetailData.id, | |||
| onSuccess: function (responeData) { | |||
| if (responeData.success == true) { | |||
| window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer"); | |||
| window.addEventListener("focus", onFocus) | |||
| }else{ | |||
| } else { | |||
| let msg = responeData.msg; | |||
| if(msg === "haveActiveProof"){ | |||
| if (msg === "haveActiveProof") { | |||
| msg = "Action Failed: There is already a pending payment and proofreading record for client review." | |||
| }else if(msg === "haveProofed"){ | |||
| } else if (msg === "haveProofed") { | |||
| msg = "Action Failed: Already proofed." | |||
| } | |||
| setWarningText(msg); | |||
| @@ -120,8 +124,8 @@ const ApplicationDetailCard = ( | |||
| } | |||
| } | |||
| }); | |||
| }else { | |||
| } else { | |||
| setWarningText("Please generate Gazette Code before Create Proof."); | |||
| setIsWarningPopUp(true); | |||
| } | |||
| @@ -199,33 +203,49 @@ const ApplicationDetailCard = ( | |||
| <Typography ml={1} variant="h5">Not accept</Typography> | |||
| </Button> | |||
| </> : | |||
| currentApplicationDetailData.status == "paid" ? | |||
| (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 1) ? | |||
| <> | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={complatedClick()} | |||
| onClick={doPublish()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| backgroundColor: '#52b202' | |||
| }}> | |||
| <DoneIcon /> | |||
| <Typography ml={1} variant="h5">Complete</Typography> | |||
| <Typography ml={1} variant="h5">Publish</Typography> | |||
| </Button> | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={withdrawnClick()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| backgroundColor: '#ffa733' | |||
| }}> | |||
| <CloseIcon /> | |||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||
| </Button> | |||
| </> : null | |||
| </> | |||
| : | |||
| (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ? | |||
| <> | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={complatedClick()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| backgroundColor: '#52b202' | |||
| }}> | |||
| <DoneIcon /> | |||
| <Typography ml={1} variant="h5">Complete</Typography> | |||
| </Button> | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={withdrawnClick()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| backgroundColor: '#ffa733' | |||
| }}> | |||
| <CloseIcon /> | |||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||
| </Button> | |||
| </> : null | |||
| } | |||
| </Stack> | |||
| </Grid> | |||
| @@ -267,7 +287,7 @@ const ApplicationDetailCard = ( | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: {md:1, lg:3} }}> | |||
| <Grid item xs={12} sm={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: { md: 1, lg: 3 } }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={4} lg={4} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| @@ -329,7 +349,7 @@ const ApplicationDetailCard = ( | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: {md:1, lg:3} }}> | |||
| <Grid item xs={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: { md: 1, lg: 3 } }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={4} lg={4} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| @@ -351,7 +371,7 @@ const ApplicationDetailCard = ( | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| mr:1 | |||
| mr: 1 | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 3, | |||
| @@ -414,7 +434,7 @@ const ApplicationDetailCard = ( | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: {md:1, lg:3} }}> | |||
| <Grid item xs={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: { md: 1, lg: 3 } }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={4} lg={4} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| @@ -436,7 +456,7 @@ const ApplicationDetailCard = ( | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| mr:1, | |||
| mr: 1, | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 3, | |||
| @@ -32,7 +32,8 @@ import { | |||
| SET_PUBLIC_NOTICE_STATUS_COMPLATED, | |||
| SET_PUBLIC_NOTICE_STATUS_WITHDRAW, | |||
| SET_PUBLIC_NOTICE_STATUS_RESUBMIT, | |||
| SET_PUBLIC_NOTICE_STATUS_REVIEWED | |||
| SET_PUBLIC_NOTICE_STATUS_REVIEWED, | |||
| SET_PUBLIC_NOTICE_STATUS_PUBLISH | |||
| } from "utils/ApiPathConst"; | |||
| const StatusChangeDialog = Loadable(lazy(() => import('./StatusChangeDialog'))); | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| @@ -182,6 +183,8 @@ const PublicNoticeDetail_GLD = () => { | |||
| onNotAcceptClick(getReason); | |||
| } else if (getStatus == "resubmit") { | |||
| onReSubmitClick(); | |||
| } else if (getStatus == "publish") { | |||
| onPublishClick(); | |||
| } | |||
| } | |||
| }, [statusWindowAccepted]); | |||
| @@ -225,6 +228,19 @@ const PublicNoticeDetail_GLD = () => { | |||
| }); | |||
| } | |||
| const onPublishClick = () => { | |||
| if (params.id <= 0) return; | |||
| HttpUtils.get({ | |||
| url: `${SET_PUBLIC_NOTICE_STATUS_PUBLISH}/${params.id}`, | |||
| onSuccess: function () { | |||
| setOpen(false); | |||
| handleClose(); | |||
| loadApplicationDetail() | |||
| notifySaveSuccess() | |||
| } | |||
| }); | |||
| } | |||
| const onComplatedClick = () => { | |||
| if (params.id > 0) { | |||
| axios.get(`${SET_PUBLIC_NOTICE_STATUS_COMPLATED}/${params.id}`) | |||
| @@ -301,7 +317,7 @@ const PublicNoticeDetail_GLD = () => { | |||
| }, [getUploadStatus]); | |||
| return ( | |||
| <Grid container sx={{ width:"100%", backgroundColor: 'backgroundColor.default' }} direction="column"> | |||
| <Grid container sx={{ width: "100%", backgroundColor: 'backgroundColor.default' }} direction="column"> | |||
| <StatusChangeDialog open={open} | |||
| handleClose={handleClose} | |||
| setReason={setReason} | |||
| @@ -324,12 +340,12 @@ const PublicNoticeDetail_GLD = () => { | |||
| </div> | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={12}> | |||
| <Stack direction="row"> | |||
| <Button title="Back" sx={{ml:3.5, mt:2.5}} style={{ border: '2px solid' }} variant="outlined" onClick={()=>{navigate("/application/search")}}> | |||
| <ForwardIcon style={{height: 30, width: 50, transform : "rotate(180deg)"}}/> | |||
| <Stack direction="row"> | |||
| <Button title="Back" sx={{ ml: 3.5, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/application/search") }}> | |||
| <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | |||
| </Button> | |||
| <Typography ml={4} mt={3} variant="h4">{title}</Typography> | |||
| </Stack> | |||
| </Stack> | |||
| </Grid> | |||
| {/* <Grid item xs={12} > | |||
| <Stack direction="row" height='20px' justifyContent="flex-start" alignItems="center"> | |||
| @@ -341,7 +357,7 @@ const PublicNoticeDetail_GLD = () => { | |||
| <Grid item xs={12} md={12} lg={9} xl={9}> | |||
| <Grid container direction="column"> | |||
| <Grid item xs={12} sm={12} md={12} lg={12} xl={12}> | |||
| <Box xs={12} sx={{ ml:2 , mt:3, mr:{xs:2, sm:2}, borderRadius: '10px', backgroundColor: '#ffffff' }}> | |||
| <Box xs={12} sx={{ ml: 2, mt: 3, mr: { xs: 2, sm: 2 }, borderRadius: '10px', backgroundColor: '#ffffff' }}> | |||
| {isLoading && editMode ? | |||
| <LoadingComponent /> : | |||
| <ApplicationDetailCard | |||
| @@ -358,7 +374,7 @@ const PublicNoticeDetail_GLD = () => { | |||
| </Box> | |||
| </Grid> | |||
| <Grid item xs={12} md={12} lg={12} xl={12}> | |||
| <Box xs={12} sx={{ml:2, mt:3, mr:{xs:2, sm:2}, borderRadius: '10px', backgroundColor: '#ffffff' }}> | |||
| <Box xs={12} sx={{ ml: 2, mt: 3, mr: { xs: 2, sm: 2 }, borderRadius: '10px', backgroundColor: '#ffffff' }}> | |||
| <GazetteDetailCard | |||
| // updateUserObject={updateUserObject} | |||
| applicationDetailData={applicationDetailData} | |||
| @@ -369,21 +385,21 @@ const PublicNoticeDetail_GLD = () => { | |||
| </Box> | |||
| </Grid> | |||
| <Grid item xs={12} md={12} lg={12} xl={12}> | |||
| <Box xs={12} sx={{ml:2, mt:3, mr:{sm:2}, borderRadius: '10px',width: {xs:'92vw', sm:'96.5vw', md:"auto"}, backgroundColor: '#ffffff' }}> | |||
| <Box xs={12} sx={{ ml: 2, mt: 3, mr: { sm: 2 }, borderRadius: '10px', width: { xs: '92vw', sm: '96.5vw', md: "auto" }, backgroundColor: '#ffffff' }}> | |||
| <TabTableDetail | |||
| applicationDetailData={applicationDetailData} | |||
| proofList={proofList} | |||
| paymentList={paymentList} | |||
| /> | |||
| </Box> | |||
| <br/> | |||
| <br /> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={12} lg={3} xl={3}> | |||
| <Grid item xs={12} md={12} lg={3} xl={3} sx={{ mt: { xs: -3, sm: -3 } }}> | |||
| <Grid container> | |||
| <Grid item xs={12} md={12}> | |||
| <Box xs={12} md={12} height='800px' sx={{ ml:2, mt:3, mr:{xs:2, sm:2}, borderRadius: '10px', backgroundColor: '#ffffff' }}> | |||
| <Box xs={12} md={12} height='800px' sx={{ ml: 2, mt: 3, mb: 3, mr: { xs: 2, sm: 2 }, borderRadius: '10px', backgroundColor: '#ffffff' }}> | |||
| <ClientDetailCard | |||
| // updateUserObject={updateUserObject} | |||
| applicationDetailData={applicationDetailData} | |||
| @@ -148,7 +148,8 @@ const ApplicationDetailCard = ( | |||
| onClick={() => { checkExprityDate(true) }} | |||
| disabled={currentApplicationDetailData.status == "rejected" | |||
| || currentApplicationDetailData.status == "cancelled" | |||
| || currentApplicationDetailData.status == "paid"} | |||
| || currentApplicationDetailData.status == "paid" | |||
| || currentApplicationDetailData.creditor} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| @@ -144,12 +144,11 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||
| : | |||
| <form onSubmit={formik.handleSubmit} style={{ padding: 12 }}> | |||
| {/*top button*/} | |||
| <Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center"> | |||
| <Grid item xs={12} sm={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center"> | |||
| <Grid container maxWidth justifyContent="flex-start"> | |||
| {editMode ? | |||
| <> | |||
| <Grid item sx={{ ml: 3, mr: 3 }}> | |||
| <Grid item sx={{ mr: 3 }}> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| @@ -180,7 +179,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||
| </> | |||
| : | |||
| <> | |||
| <Grid item sx={{ ml: 3, mr: 3 }}> | |||
| <Grid item sx={{ mr: 3 }}> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| @@ -195,319 +194,315 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||
| </Grid> | |||
| </> | |||
| } | |||
| </Grid> | |||
| </Grid> | |||
| {/*end top button*/} | |||
| <Typography variant="h4" sx={{ mt: 3, ml: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> | |||
| <Typography variant="h4" sx={{ mt: 3, mb: 2, borderBottom: "1px solid black" }}> | |||
| Individual User Details | |||
| </Typography> | |||
| <Grid container spacing={1} sx={{ mt: 3, ml: 3, mb: 2, mr: 3}}> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Username:", | |||
| valueName: "username", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "English Name:", | |||
| valueName: "enName", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={12}> | |||
| <Grid container> | |||
| <Grid item xs={12} sm={12} md={12} lg={4} > | |||
| {FieldUtils.getTextField({ | |||
| label: "Username:", | |||
| valueName: "username", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Created Date:", | |||
| valueName: "createDate", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Prefix:", | |||
| valueName: "prefix", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "English Name:", | |||
| valueName: "enName", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Chinese Name:", | |||
| valueName: "chName", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Created Date:", | |||
| valueName: "createDate", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Prefix:", | |||
| valueName: "prefix", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Last Updated:", | |||
| valueName: "modifieDate", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Chinese Name:", | |||
| valueName: "chName", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "ID Type:", | |||
| valueName: "idDocType", | |||
| disabled: (!editMode), | |||
| dataList: ComboData.idDocType, | |||
| filterOptions: (options) => options, | |||
| getOptionLabel: (item) => item ? typeof item === 'string' ? item : (item["type"] ? item["type"] + "-" + item["label"] : "") : "", | |||
| onInputChange: (event, newValue, setInputValue) => { | |||
| if (newValue == null) { | |||
| setInputValue(""); | |||
| } | |||
| let _val = newValue.split("-"); | |||
| if (_val[0]) { | |||
| setInputValue(_val[0]); | |||
| } | |||
| }, | |||
| onChange: (event, newValue) => { | |||
| if (newValue == null) { | |||
| formik.setFieldValue("idDocType", ""); | |||
| return; | |||
| } | |||
| formik.setFieldValue("idDocType", newValue.type); | |||
| }, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Last Updated:", | |||
| valueName: "modifieDate", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getPhoneField({ | |||
| label: "Contact Tel:", | |||
| valueName: { | |||
| code: "tel_countryCode", | |||
| num: "phoneNumber" | |||
| }, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "ID Type:", | |||
| valueName: "idDocType", | |||
| disabled: (!editMode), | |||
| dataList: ComboData.idDocType, | |||
| filterOptions: (options) => options, | |||
| getOptionLabel: (item) => item ? typeof item === 'string' ? item : (item["type"] ? item["type"] + "-" + item["label"] : "") : "", | |||
| onInputChange: (event, newValue, setInputValue) => { | |||
| if (newValue == null) { | |||
| setInputValue(""); | |||
| } | |||
| let _val = newValue.split("-"); | |||
| if (_val[0]) { | |||
| setInputValue(_val[0]); | |||
| } | |||
| }, | |||
| onChange: (event, newValue) => { | |||
| if (newValue == null) { | |||
| formik.setFieldValue("idDocType", ""); | |||
| return; | |||
| } | |||
| formik.setFieldValue("idDocType", newValue.type); | |||
| }, | |||
| 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="h5">Verified:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getPhoneField({ | |||
| label: "Contact Tel:", | |||
| valueName: { | |||
| code: "tel_countryCode", | |||
| num: "phoneNumber" | |||
| }, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| { | |||
| currentUserData.verifiedBy || editMode ? | |||
| <Grid item xs={12} md={6} lg={6}> | |||
| {FieldUtils.initField({ | |||
| valueName: "verifiedStatus", | |||
| disabled: true, | |||
| form: formik, | |||
| })} | |||
| </Grid> | |||
| : | |||
| <> | |||
| <Grid item xs={10} md={4} lg={4}> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">Verified:</Typography> | |||
| </Grid> | |||
| { | |||
| currentUserData.verifiedBy || editMode ? | |||
| <Grid item xs={12} sm={12} md={6} lg={6} sx={{mb:2}}> | |||
| {FieldUtils.initField({ | |||
| valueName: "verifiedStatus", | |||
| disabled: true, | |||
| form: formik, | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={1}> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| }} | |||
| onClick={onVerifiedClick} | |||
| > | |||
| <Typography variant="h5">Verify</Typography> | |||
| </Button> | |||
| </Grid> | |||
| </> | |||
| } | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">ID No.:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={6} lg={6}> | |||
| <Grid container> | |||
| {formik.values.idDocType == "HKID" ? | |||
| : | |||
| <> | |||
| <Grid item lg={8}> | |||
| <Grid item xs={8} sm={8} md={6} lg={4} sx={{mb:2}}> | |||
| {FieldUtils.initField({ | |||
| valueName: "identification", | |||
| disabled: (!editMode), | |||
| valueName: "verifiedStatus", | |||
| disabled: true, | |||
| form: formik, | |||
| placeholder: "證件號碼", | |||
| inputProps: { | |||
| maxLength: 7, | |||
| onKeyDown: (e) => { | |||
| if (e.key === 'Enter') { | |||
| e.preventDefault(); | |||
| } | |||
| }, | |||
| } | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| <Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2 ,mb:2}}> | |||
| <Button | |||
| variant="contained" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| }} | |||
| onClick={onVerifiedClick} | |||
| > | |||
| <Typography variant="h5">Verify</Typography> | |||
| </Button> | |||
| </Grid> | |||
| </> | |||
| } | |||
| </Grid> | |||
| </Grid> | |||
| <Grid xs={12} sm={12} md={12} lg={4}> | |||
| <Grid container alignItems={"center"} sx={{mb:2}}> | |||
| <Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">ID No.:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={9} lg={6}> | |||
| <Grid container> | |||
| {formik.values.idDocType === "HKID" ? | |||
| <> | |||
| <Grid item xs={6} sm={6} md={6} lg={7.5} sx={{mr:1}}> | |||
| {FieldUtils.initField({ | |||
| valueName: "identification", | |||
| disabled: (!editMode), | |||
| form: formik, | |||
| placeholder: "證件號碼", | |||
| inputProps: { | |||
| maxLength: 7, | |||
| onKeyDown: (e) => { | |||
| if (e.key === 'Enter') { | |||
| e.preventDefault(); | |||
| } | |||
| }, | |||
| } | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={2} sm={2} md={2} lg={2}> | |||
| {FieldUtils.initField({ | |||
| valueName: "checkDigit", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| </> : | |||
| <Grid item xs={12} sm={6} md={6} lg={12}> | |||
| {FieldUtils.initField({ | |||
| valueName: "checkDigit", | |||
| valueName: "identification", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| </> : | |||
| <Grid item lg={12}> | |||
| {FieldUtils.initField({ | |||
| valueName: "identification", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| } | |||
| } | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getPhoneField({ | |||
| label: "Fax No.:", | |||
| valueName: { | |||
| code: "fax_countryCode", | |||
| num: "faxNumber" | |||
| }, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getPhoneField({ | |||
| label: "Fax No.:", | |||
| valueName: { | |||
| code: "fax_countryCode", | |||
| num: "faxNumber" | |||
| }, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Last Login:", | |||
| valueName: "lastLoginDate", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Last Login:", | |||
| valueName: "lastLoginDate", | |||
| disabled: true, | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "Country:", | |||
| valueName: "country", | |||
| dataList: ComboData.country, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "Country:", | |||
| valueName: "country", | |||
| dataList: ComboData.country, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Email:", | |||
| valueName: "emailAddress", | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getTextField({ | |||
| label: "Email:", | |||
| valueName: "emailAddress", | |||
| disabled: (!editMode), | |||
| 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="h5">Status:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| <Grid container alignItems={"center"} sx={{mb:2}}> | |||
| <Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">Status:</Typography> | |||
| </Grid> | |||
| { | |||
| editMode ? | |||
| <Grid item xs={12} md={6} lg={6}> | |||
| {FieldUtils.initField({ | |||
| valueName: "status", | |||
| disabled: true, | |||
| form: formik, | |||
| })} | |||
| </Grid> | |||
| : | |||
| <> | |||
| <Grid item lg={4}> | |||
| { | |||
| editMode ? | |||
| <Grid item xs={8} sm={8} md={6} lg={6}> | |||
| {FieldUtils.initField({ | |||
| valueName: "status", | |||
| disabled: true, | |||
| form: formik, | |||
| })} | |||
| </Grid> | |||
| {locked ? | |||
| <Grid item lg={1} sx={{ml:1}}> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| color="success" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| }} | |||
| onClick={doUnlock} | |||
| > | |||
| <Typography variant="h5">Active</Typography> | |||
| </Button> | |||
| </Grid> | |||
| : | |||
| <Grid item lg={1} sx={{ml:1}}> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| color="error" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| }} | |||
| onClick={doLock} | |||
| > | |||
| <Typography variant="h5">Lock</Typography> | |||
| </Button> | |||
| : | |||
| <> | |||
| <Grid item xs={8} sm={8} md={6} lg={4}> | |||
| {FieldUtils.initField({ | |||
| valueName: "status", | |||
| disabled: true, | |||
| form: formik, | |||
| })} | |||
| </Grid> | |||
| } | |||
| </> | |||
| } | |||
| {locked ? | |||
| <Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2}}> | |||
| <Button | |||
| variant="contained" | |||
| color="success" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| }} | |||
| onClick={doUnlock} | |||
| > | |||
| <Typography variant="h5">Active</Typography> | |||
| </Button> | |||
| </Grid> | |||
| : | |||
| <Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2}}> | |||
| <Button | |||
| variant="contained" | |||
| color="error" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| }} | |||
| onClick={doLock} | |||
| > | |||
| <Typography variant="h5">Lock</Typography> | |||
| </Button> | |||
| </Grid> | |||
| } | |||
| </> | |||
| } | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getAddressField({ | |||
| label: "Address:", | |||
| valueName: ["addressLine1", "addressLine2", "addressLine3"], | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getAddressField({ | |||
| label: "Address:", | |||
| valueName: ["addressLine1", "addressLine2", "addressLine3"], | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "District:", | |||
| valueName: "district", | |||
| dataList: ComboData.district, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| <Grid item xs={12} sm={12} md={12} lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "District:", | |||
| valueName: "district", | |||
| dataList: ComboData.district, | |||
| disabled: (!editMode), | |||
| form: formik | |||
| })} | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </form> | |||
| } | |||
| </MainCard> | |||
| @@ -1,7 +1,7 @@ | |||
| // material-ui | |||
| import * as React from "react"; | |||
| import { Grid, Typography, Button, Stack, Box } from '@mui/material'; | |||
| import { Grid, Typography, Button, Stack } from '@mui/material'; | |||
| import FileList from "../../../components/FileList" | |||
| import MainCard from "../../../components/MainCard"; | |||
| import * as HttpUtils from "../../../utils/HttpUtils"; | |||
| @@ -35,26 +35,6 @@ const UserMaintainPage_Individual = () => { | |||
| const [formData, setFormData] = React.useState({}) | |||
| const [isLoading, setLoding] = React.useState(true); | |||
| const _sx = { | |||
| ml: 6, | |||
| mr: 6, | |||
| mb: 3, | |||
| mt: 3, | |||
| padding: "4 2 4 2", | |||
| boxShadow: 1, | |||
| border: 1, | |||
| borderColor: '#DDD', | |||
| '& .MuiDataGrid-cell': { | |||
| borderTop: 1, | |||
| borderBottom: 1, | |||
| borderColor: "#EEE" | |||
| }, | |||
| '& .MuiDataGrid-footerContainer': { | |||
| border: 1, | |||
| borderColor: "#EEE" | |||
| } | |||
| } | |||
| React.useEffect(() => { | |||
| loadData(); | |||
| }, []); | |||
| @@ -102,7 +82,7 @@ const UserMaintainPage_Individual = () => { | |||
| isLoading ? | |||
| <LoadingComponent /> | |||
| : | |||
| <Grid container sx={{ minHeight: '90vh', backgroundColor: 'backgroundColor.default' }}> | |||
| <Grid container sx={{ backgroundColor: 'backgroundColor.default', maxWidth:'100%' }}> | |||
| <Grid item xs={12}> | |||
| <div style={BackgroundHead}> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| @@ -116,29 +96,26 @@ const UserMaintainPage_Individual = () => { | |||
| </Button> | |||
| </Grid> | |||
| {/*col 1*/} | |||
| <Grid item xs={12}> | |||
| <Grid item xs={12} sm={12} md={12} lg={12} > | |||
| <Grid container> | |||
| <Grid item xs={12} md={12} lg={12}> | |||
| <Box xs={12} ml={0} mt={-1} mr={0} sx={{ p: 1, borderRadius: '10px' }}> | |||
| <UserInformationCard | |||
| formData={formData} | |||
| loadDataFun={loadData} | |||
| /> | |||
| </Box> | |||
| <Grid item xs={12} sm={12} md={12} lg={12} > | |||
| <UserInformationCard | |||
| formData={formData} | |||
| loadDataFun={loadData} | |||
| /> | |||
| </Grid> | |||
| <Grid item xs={12} md={12} lg={12}> | |||
| <Box xs={12} ml={0} mt={-3} mr={11.5} sx={{ p: 1, borderRadius: '10px' }}> | |||
| <MainCard elevation={0} border={false} content={false}> | |||
| <Typography variant="h4" sx={{ mt: 4, ml: 6, mb: 2, mr: 6, borderBottom: "1px solid black" }}> | |||
| Files | |||
| </Typography> | |||
| <MainCard elevation={0} border={false} content={false} sx={{maxWidth: '100%', mr:2, width: "-webkit-fill-available"}}> | |||
| <Typography variant="h4" sx={{ mt: 4, ml: 2, mb: 2, mr: 2, borderBottom: "1px solid black" }}> | |||
| Files | |||
| </Typography> | |||
| <Grid item xs={12} sm={12} md={12} lg={12} sx={{maxWidth: '100%'}}> | |||
| <FileList | |||
| sx={_sx} | |||
| refId={params.id} | |||
| refType={"identification"} | |||
| /> | |||
| </MainCard> | |||
| </Box> | |||
| </Grid> | |||
| </MainCard> | |||
| <br /> | |||
| </Grid> | |||
| </Grid> | |||
| @@ -59,8 +59,8 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||
| phoneNumber: yup.string().min(8, displayErrorMsg('請輸入8位數字')).required(displayErrorMsg('請輸入聯絡電話')), | |||
| faxNumber: yup.string().min(8, displayErrorMsg('請輸入8位數字')).nullable(), | |||
| brExpiryDate: yup.string().min(8, displayErrorMsg('請輸入商業登記證有效日期')), | |||
| brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234-123-12-12-1)`), function (value) { | |||
| var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ | |||
| brNo: yup.string().max(8).required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234)`), function (value) { | |||
| var brNo_pattern = /[0-9]{8}/ | |||
| if (value !== undefined) { | |||
| if (value.match(brNo_pattern)) { | |||
| return true | |||
| @@ -56,6 +56,7 @@ const Register = () => { | |||
| const [completed, setCompleted] = useState([false]); | |||
| const [updateValid, setUpdateValid] = useState(false); | |||
| const [base64Url, setBase64Url] = useState("") | |||
| const [checkCode, setCheckCode] = useState("") | |||
| const [idNo, setIdNo] = useState(""); | |||
| const totalSteps = () => { | |||
| @@ -526,8 +526,9 @@ const BusCustomFormWizard = (props) => { | |||
| phone: yup.string().min(8, displayErrorMsg('請輸入最少8位數字')).required(displayErrorMsg('請輸入聯絡電話')), | |||
| fax: yup.string().min(8, displayErrorMsg('請輸入最少8位數字')), | |||
| brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], displayErrorMsg('請輸入商業登記證有效日期')).max("2099-12-31", displayErrorMsg('請輸入商業登記證有效日期')).required(displayErrorMsg('請輸入商業登記證有效日期')), | |||
| brNo: yup.string().required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234-123-12-12-1)`), function (value) { | |||
| var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ | |||
| brNo: yup.string().max(8).required(displayErrorMsg('請輸入商業登記證號碼')).test('checkBrNoFormat', displayErrorMsg(`請輸入有效商業登記證號碼 (e.g. 12341234)`), function (value) { | |||
| // var brNo_pattern = /[0-9]{8}-[0-9]{3}-(0[1-9]|1[012])-[0-9]{2}-[0-9A-Z]{1}/ | |||
| var brNo_pattern = /[0-9]{8}/ | |||
| if (value !== undefined) { | |||
| if (value.match(brNo_pattern)) { | |||
| return true | |||
| @@ -834,7 +835,7 @@ const BusCustomFormWizard = (props) => { | |||
| <Stack spacing={1}> | |||
| <InputLabel htmlFor="brNo-signup" sx={{ whiteSpace: 'pre-wrap', wordWrap: 'break-word' }}> | |||
| <Typography variant="pnspsFormHeader"> | |||
| 商業登記證號碼 (e.g. 12341234-123-12-12-1) | |||
| 商業登記證號碼 (e.g. 12341234) | |||
| <span style={{ color: '#f10000' }}>*</span> | |||
| </Typography> | |||
| </InputLabel> | |||
| @@ -77,6 +77,7 @@ export const SET_PUBLIC_NOTICE_STATUS_COMPLATED = apiPath+'/application/applicat | |||
| export const SET_PUBLIC_NOTICE_STATUS_WITHDRAW = apiPath+'/application/application-detail-status-withdrawn'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_RESUBMIT = apiPath+'/application/application-detail-status-resubmit'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_REVIEWED = apiPath+'/application/application-detail-status-reviewed'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_PUBLISH = apiPath+'/application/application-detail-status-publish'; | |||
| export const UPDATE_PUBLIC_NOTICE_APPLY_DETAIL = apiPath+'/application/save'; | |||
| export const GET_ISSUE_COMBO = apiPath+'/gazette-issue/combo'; | |||
| @@ -86,4 +86,10 @@ export const denmandNoteStatus = [ | |||
| { key: 2, labelCht: '待支付', label:'To be Paid', type: 'to be paid' }, | |||
| { key: 3, labelCht: '已付費', label:'Paid', type: 'paid' }, | |||
| ]; | |||
| export const CreditorStatus = [ | |||
| { key: 0, labelCht: '全部', label: 'All', type: 'all' }, | |||
| { key: 1, labelCht: '債權人', label:'Creditor', type: 'true' }, | |||
| { key: 2, labelCht: '非債權人', label:'No-Creditor', type: 'false' }, | |||
| ]; | |||
| @@ -27,12 +27,12 @@ export const getDateField = ({ label, valueName, form, disabled }) => { | |||
| } | |||
| export const getTextField = ({ label, valueName, form, disabled }) => { | |||
| return <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| return <Grid container alignItems={"center"} xs={12} sm={12} md={12} lg={12} sx={{mb:2}}> | |||
| <Grid item xs={12} sm={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">{label}</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={6} lg={6}> | |||
| <Grid item xs={12} sm={12} md={6} lg={6}> | |||
| {initField({ | |||
| type: "text", | |||
| valueName: valueName, | |||
| @@ -71,7 +71,7 @@ export const getTextArea = ({ label, valueName, form, disabled, inputProps, ...p | |||
| export const getPhoneField = ({ label, valueName, form, disabled }) => { | |||
| return <Grid container alignItems={"center"}> | |||
| return <Grid container alignItems={"center"} sx={{mb:2}}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">{label}</Typography> | |||
| @@ -123,7 +123,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={6} lg={6}> | |||
| <Grid item lg={12}> | |||
| <Grid item lg={12} sx={{mb:2}}> | |||
| {initField({ | |||
| type: "text", | |||
| valueName: valueName[0], | |||
| @@ -131,7 +131,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { | |||
| disabled: disabled | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={12}> | |||
| <Grid item lg={12} sx={{mb:2}}> | |||
| {initField({ | |||
| type: "text", | |||
| valueName: valueName[1], | |||
| @@ -139,7 +139,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { | |||
| disabled: disabled | |||
| })} | |||
| </Grid> | |||
| <Grid item lg={12}> | |||
| <Grid item lg={12} sx={{mb:2}}> | |||
| {initField({ | |||
| type: "text", | |||
| valueName: valueName[2], | |||
| @@ -152,7 +152,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { | |||
| } | |||
| export const getComboField = ({ label, dataList, valueName, form, disabled, getOptionLabel, onInputChange, onChange, filterOptions, ...props }) => { | |||
| return <Grid container alignItems={"center"}> | |||
| return <Grid container alignItems={"center"} sx={{mb:2}}> | |||
| <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography variant="h5">{label}</Typography> | |||
| </Grid> | |||
| @@ -3,17 +3,17 @@ | |||
| import {getStatusTag} from "utils/statusUtils/Base"; | |||
| export function getStatus(params) { | |||
| return getStatusByText(params.row.status); | |||
| return getStatusByText(params.row.status, params.row.creditor); | |||
| } | |||
| export function getStatusByText(status) { | |||
| export function getStatusByText(status, creditor) { | |||
| switch (status) { | |||
| case "submitted": | |||
| return getStatusTag({ color: "#f5a83d", text: "處理中" }) | |||
| case "reviewed": | |||
| return getStatusTag({ color: "#f5a83d", text: "處理中" }) | |||
| case "confirmed": | |||
| if (localStorage.getItem('userData').creditor) | |||
| if (creditor) | |||
| return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||
| else | |||
| return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||
| @@ -37,16 +37,16 @@ export function getStatusByText(status) { | |||
| } | |||
| export function getStatusEng(params) { | |||
| return getStatusByTextEng(params.row.status); | |||
| return getStatusByTextEng(params.row.status, params.row.creditor); | |||
| } | |||
| export function getStatusByTextEng(status) { | |||
| export function getStatusByTextEng(status, creditor) { | |||
| switch (status) { | |||
| case "submitted": | |||
| return getStatusTag({ color: "#f5a83d", text: "Submitted" }) | |||
| case "reviewed": | |||
| return getStatusTag({ color: "#0C489E", text: "Reviewed" }) | |||
| case "confirmed": | |||
| if (localStorage.getItem('userData').creditor) | |||
| if (creditor) | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Publish" }) | |||
| else | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||