| @@ -0,0 +1,277 @@ | |||
| // material-ui | |||
| import { | |||
| CardContent, | |||
| Grid, | |||
| Stack, | |||
| FormControl, | |||
| OutlinedInput, | |||
| FormLabel, | |||
| } from '@mui/material'; | |||
| import MainCard from "components/MainCard"; | |||
| import * as React from "react"; | |||
| import { useFormik } from 'formik'; | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const SearchPublicNoticeForm = (formData) => { | |||
| const formik = useFormik({ | |||
| enableReinitialize: true, | |||
| initialValues: formData, | |||
| }); | |||
| const DisplayField = ({name}) => { | |||
| return <FormControl variant="outlined" fullWidth disabled > | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| onChange={formik.handleChange} | |||
| id={name} | |||
| name={name} | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl>; | |||
| } | |||
| return ( | |||
| <MainCard xs={12} md={12} lg={12} | |||
| border={false} | |||
| content={false}> | |||
| <form> | |||
| {/*row 1*/} | |||
| <CardContent sx={{ px: 2.5, pt: 3 }}> | |||
| <Grid item justifyContent="space-between" alignItems="center"> | |||
| Application Details | |||
| </Grid> | |||
| </CardContent> | |||
| {/*row 2*/} | |||
| <Grid container direction="column"> | |||
| <Grid item xs={12} md={12}> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Application No:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <DisplayField | |||
| name='appNo' | |||
| /> | |||
| <FormControl variant="outlined" fullWidth disabled > | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| onChange={formik.handleChange} | |||
| id='appNo' | |||
| name='appNo' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| {/* <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Status:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth > | |||
| {StatusUtils.getStatusByTextEng(currentApplicationDetailData.status)} | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> */} | |||
| </Grid> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Applicant:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled > | |||
| {formik.values.orgId === null ? | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='contactPerson' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> : | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='companyName' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| } | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={4} lg={4} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Contact Phone:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={8} lg={8}> | |||
| <Stack direction="row"> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled > | |||
| <OutlinedInput | |||
| size="small" | |||
| id='countryCode' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 3, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled > | |||
| <OutlinedInput | |||
| size="small" | |||
| type="tel" | |||
| id='phoneNumber' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 11, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Stack> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Contect Person:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled> | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='contactPerson' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={4} lg={4} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Contact Fax:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={8} lg={8}> | |||
| <Stack direction="row"> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| id='countryCode' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 3, | |||
| type: "tel" | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| type="tel" | |||
| id='faxNumber' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 8, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Stack> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </form> | |||
| </MainCard> | |||
| ); | |||
| }; | |||
| export default SearchPublicNoticeForm; | |||
| @@ -0,0 +1,136 @@ | |||
| // material-ui | |||
| import * as React from 'react'; | |||
| import { | |||
| Button | |||
| } from '@mui/material'; | |||
| import * as DateUtils from "utils/DateUtils"; | |||
| import {useNavigate} from "react-router-dom"; | |||
| import {FiDataGrid} from "components/FiDataGrid"; | |||
| // ==============================|| EVENT TABLE ||============================== // | |||
| export default function SearchPublicNoticeTable({ recordList }) { | |||
| const [rows, setRows] = React.useState(recordList); | |||
| const navigate = useNavigate() | |||
| React.useEffect(() => { | |||
| setRows(recordList); | |||
| }, [recordList]); | |||
| const handleEditClick = (params) => () => { | |||
| navigate('/application/'+ params.id); | |||
| }; | |||
| const columns = [ | |||
| { | |||
| field: 'actions', | |||
| headerName: 'Proof No.', | |||
| width: 150, | |||
| cellClassName: 'actions', | |||
| renderCell: (params) => { | |||
| return <Button onClick={handleEditClick(params)}><u>{params.row.refNo}</u></Button>; | |||
| }, | |||
| }, | |||
| { | |||
| id: 'appId', | |||
| field: 'appId', | |||
| headerName: 'Application No./ Gazette Code/ Gazette Issue', | |||
| flex: 1, | |||
| renderCell: (params) => { | |||
| let appNo = ""; | |||
| let code = ""; | |||
| let isssue = params.row.issueYear | |||
| +" Vol. "+zeroPad(params.row.issueVolume,3) | |||
| +", No. "+zeroPad(params.row.issueNo,2) | |||
| +", "+DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); | |||
| return [appNo+" ("+code+")"+isssue] | |||
| }, | |||
| }, | |||
| { | |||
| id: 'created', | |||
| field: 'created', | |||
| headerName: 'Proof Date', | |||
| flex: 1, | |||
| valueGetter: (params) => { | |||
| return DateUtils.datetimeStr(params?.value); | |||
| } | |||
| }, | |||
| { | |||
| id: 'created', | |||
| field: 'created', | |||
| headerName: 'Confirmed/Return Date', | |||
| flex: 1, | |||
| valueGetter: (params) => { | |||
| return DateUtils.datetimeStr(params?.value); | |||
| } | |||
| }, | |||
| { | |||
| id: 'contactPerson', | |||
| field: 'contactPerson', | |||
| headerName: 'Contact Person', | |||
| flex: 1, | |||
| renderCell: (params) => { | |||
| let company = params.row.enCompanyName!= null ?" ("+(params.row.enCompanyName)+")":""; | |||
| let phone = JSON.parse(params.row.contactTelNo); | |||
| let faxNo = JSON.parse(params.row.contactFaxNo); | |||
| let contact = ""; | |||
| if (phone) { | |||
| contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber | |||
| } | |||
| if (faxNo && faxNo?.faxNumber) { | |||
| if (contact != "") | |||
| contact = contact + ", " | |||
| contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber | |||
| } | |||
| return (<> | |||
| {params?.value + company}<br /> | |||
| {contact} | |||
| </>); | |||
| } | |||
| }, | |||
| { | |||
| id: 'groupNo', | |||
| field: 'groupNo', | |||
| headerName: 'Gazette Group', | |||
| flex: 1, | |||
| valueGetter: (params) => { | |||
| return (params?.value)?(params?.value):""; | |||
| } | |||
| }, | |||
| { | |||
| id: 'fee', | |||
| field: 'fee', | |||
| headerName: 'Fee', | |||
| flex: 1, | |||
| valueGetter: (params) => { | |||
| return (params?.value)?(params?.value):""; | |||
| } | |||
| }, | |||
| ]; | |||
| function zeroPad(num, places) { | |||
| num=num?num:0; | |||
| var zero = places - num.toString().length + 1; | |||
| return Array(+(zero > 0 && zero)).join("0") + num; | |||
| } | |||
| return ( | |||
| <div style={{ height: 400, width: '100%' }}> | |||
| <FiDataGrid | |||
| rows={rows} | |||
| columns={columns} | |||
| initialState={{ | |||
| pagination: { | |||
| paginationModel: { page: 0, pageSize: 5 }, | |||
| }, | |||
| }} | |||
| /> | |||
| </div> | |||
| ); | |||
| } | |||
| @@ -0,0 +1,166 @@ | |||
| // material-ui | |||
| import { | |||
| FormControl, | |||
| Grid, | |||
| FormLabel, | |||
| OutlinedInput, | |||
| } from '@mui/material'; | |||
| import MainCard from "components/MainCard"; | |||
| import * as React from "react"; | |||
| import { useFormik } from 'formik'; | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const GazetteDetails = ({formData}) => { | |||
| const formik = useFormik({ | |||
| enableReinitialize: true, | |||
| initialValues: formData, | |||
| }); | |||
| // function getIssueLabel(data) { | |||
| // if (data == {}) return ""; | |||
| // return data.year | |||
| // + " Vol. " + zeroPad(data.volume, 3) | |||
| // + ", No. " + zeroPad(data.issueNo, 2) | |||
| // + ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||
| // } | |||
| // function zeroPad(num, places) { | |||
| // num = num ? num : 0; | |||
| // var zero = places - num.toString().length + 1; | |||
| // return Array(+(zero > 0 && zero)).join("0") + num; | |||
| // } | |||
| return ( | |||
| <MainCard xs={12} md={12} lg={12} | |||
| border={false} | |||
| content={false}> | |||
| <form onSubmit={handleSubmit(onSubmit)}> | |||
| {/*row 1*/} | |||
| <CardContent sx={{ px: 2.5, pt: 3 }}> | |||
| <Grid item justifyContent="space-between" alignItems="center"> | |||
| Gazette Details | |||
| </Grid> | |||
| </CardContent> | |||
| {/*row 2*/} | |||
| <Grid container direction="column"> | |||
| <Grid item xs={12} md={12}> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Issue Number:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled > | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='issueNum' | |||
| onChange={formik.handleChange} | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Gazette Code:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled > | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='gazetteCode' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Issue Date:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled > | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='issueDate' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: 1 }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel>Group Title:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled > | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| id='groupTitle' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </form> | |||
| </MainCard> | |||
| ); | |||
| }; | |||
| export default GazetteDetails; | |||
| @@ -0,0 +1,81 @@ | |||
| // material-ui | |||
| import { | |||
| Grid, | |||
| } from '@mui/material'; | |||
| import MainCard from "components/MainCard"; | |||
| import * as UrlUtils from "utils/ApiPathConst"; | |||
| import * as React from "react"; | |||
| import * as HttpUtils from "utils/HttpUtils"; | |||
| import { useParams } from "react-router-dom"; | |||
| import Loadable from 'components/Loadable'; | |||
| const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
| const ApplicationDetails = Loadable(React.lazy(() => import('./ApplicationDetails'))); | |||
| //const GazetteDetails = Loadable(React.lazy(() => import('./GazetteDetails'))); | |||
| const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const Index = () => { | |||
| const params = useParams(); | |||
| const [record, setRecord] = React.useState(); | |||
| const [onReady, setOnReady] = React.useState(false); | |||
| React.useEffect(() => { | |||
| loadForm(); | |||
| }, []); | |||
| React.useEffect(() => { | |||
| setOnReady(true); | |||
| }, [record]); | |||
| const loadForm = () => { | |||
| if(params.id > 0){ | |||
| HttpUtils.get({ | |||
| url: UrlUtils.GET_PUBLIC_NOTICE_APPLY_DETAIL+"/"+params.id, | |||
| onSuccess:(responseData)=>{ | |||
| setRecord(responseData); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| return ( | |||
| !onReady ? | |||
| <LoadingComponent /> | |||
| : | |||
| <Grid container sx={{ minHeight: '85vh', backgroundColor: '#eee' }} direction="column" spacing={1} > | |||
| {/*row 1*/} | |||
| <Grid item xs={12} md={12} lg={12}> | |||
| <Grid container spacing={1}> | |||
| <Grid item xs={12} md={12} lg={8}> | |||
| <ApplicationDetails | |||
| formData={record} | |||
| /> | |||
| </Grid> | |||
| <Grid item xs={12} md={12} lg={4}> | |||
| <ApplicationDetails | |||
| formData={record} | |||
| /> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| {/*row 2*/} | |||
| <Grid item xs={12} md={12} lg={12}> | |||
| <MainCard elevation={0} | |||
| border={false} | |||
| content={false} | |||
| > | |||
| <EventTable | |||
| recordList={record} | |||
| /> | |||
| </MainCard> | |||
| </Grid> | |||
| </Grid> | |||
| ); | |||
| }; | |||
| export default Index; | |||
| @@ -1,101 +1,69 @@ | |||
| export function getStatus(params) { | |||
| switch (params.row.status) { | |||
| case "submitted": | |||
| return getStatusTag({ color: "#f5a83d", text: "已提交" }) | |||
| case "rejected": | |||
| return getStatusTag({ color: "#d9372b", text: "已拒絕" }) | |||
| case "cancelled": | |||
| return getStatusTag({ color: "#757373", text: "已取消" }) | |||
| case "accepted": | |||
| return getStatusTag({ color: "#22a13f", text: "處理中" }) | |||
| case "confirmed": | |||
| return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||
| case "paid": | |||
| return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||
| case "published": | |||
| return getStatusTag({ color: "#f5a83d", text: "待付款" }) | |||
| case "withdrawn": | |||
| return getStatusTag({ color: "#8a8784", text: "已撤回" }) | |||
| case "complated": | |||
| return getStatusTag({ color: "#8a8784", text: "已完成" }) | |||
| default: | |||
| return getStatusTag({ text: params.row.status }) | |||
| } | |||
| return getStatusByText(params.row.status); | |||
| } | |||
| export function getStatusByText(status) { | |||
| switch (status) { | |||
| case "submitted": | |||
| return getStatusTag({ color: "#f5a83d", text: "已提交" }) | |||
| case "rejected": | |||
| return getStatusTag({ color: "#d9372b", text: "已拒絕" }) | |||
| case "cancelled": | |||
| return getStatusTag({ color: "#757373", text: "已取消" }) | |||
| case "accepted": | |||
| return getStatusTag({ color: "#22a13f", text: "處理中" }) | |||
| return getStatusTag({ color: "#f5a83d", text: "處理中" }) | |||
| case "reviewed": | |||
| return getStatusTag({ color: "#f5a83d", text: "處理中" }) | |||
| case "confirmed": | |||
| if (localStorage.getItem('userData').creditor) | |||
| return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||
| else | |||
| return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||
| case "published": | |||
| return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||
| case "paid": | |||
| return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||
| case "published": | |||
| return getStatusTag({ color: "#f5a83d", text: "待付款" }) | |||
| case "withdrawn": | |||
| return getStatusTag({ color: "#8a8784", text: "已撤回" }) | |||
| case "complated": | |||
| return getStatusTag({ color: "#8a8784", text: "已完成" }) | |||
| default: | |||
| return getStatusTag({ text: params.row.status }) | |||
| } | |||
| } | |||
| export function getStatusEng(params) { | |||
| switch (params.row.status) { | |||
| case "submitted": | |||
| return getStatusTag({ color: "#f5a83d", text: "Submitted" }) | |||
| case "rejected": | |||
| return getStatusTag({ color: "#d9372b", text: "Rejected" }) | |||
| case "notAccepted": | |||
| return getStatusTag({ color: "#d9372b", text: "不接受" }) | |||
| case "resubmit": | |||
| return getStatusTag({ color: "#757373", text: "需重新提交" }) | |||
| case "cancelled": | |||
| return getStatusTag({ color: "#757373", text: "Cancelled" }) | |||
| case "accepted": | |||
| return getStatusTag({ color: "#22a13f", text: "Processing" }) | |||
| case "confirmed": | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||
| case "paid": | |||
| return getStatusTag({ color: "#22a13f", text: "To be published" }) | |||
| case "published": | |||
| return getStatusTag({ color: "#f5a83d", text: "Pending Payment" }) | |||
| return getStatusTag({ color: "#f5a83d", text: "已取消" }) | |||
| case "withdrawn": | |||
| return getStatusTag({ color: "#8a8784", text: "Withdrawn" }) | |||
| case "completed": | |||
| return getStatusTag({ color: "#8a8784", text: "Completed" }) | |||
| return getStatusTag({ color: "#8a8784", text: "已撤銷" }) | |||
| default: | |||
| return getStatusTag({ text: params.row.status }) | |||
| return getStatusTag({ text: status }) | |||
| } | |||
| } | |||
| export function getStatusEng(params) { | |||
| return getStatusByTextEng(params.row.status); | |||
| } | |||
| export function getStatusByTextEng(status) { | |||
| switch (status) { | |||
| case "submitted": | |||
| return getStatusTag({ color: "#f5a83d", text: "Submitted" }) | |||
| case "rejected": | |||
| return getStatusTag({ color: "#d9372b", text: "Rejected" }) | |||
| case "cancelled": | |||
| return getStatusTag({ color: "#757373", text: "Cancelled" }) | |||
| case "accepted": | |||
| return getStatusTag({ color: "#22a13f", text: "Processing" }) | |||
| return getStatusTag({ color: "#f5a83d", text: "Processing" }) | |||
| case "reviewed": | |||
| return getStatusTag({ color: "#f5a83d", text: "Processing" }) | |||
| case "confirmed": | |||
| if (localStorage.getItem('userData').creditor) | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Publish" }) | |||
| else | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||
| case "published": | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||
| case "paid": | |||
| return getStatusTag({ color: "#22a13f", text: "To Be Published" }) | |||
| case "published": | |||
| return getStatusTag({ color: "#f5a83d", text: "Pending Payment" }) | |||
| return getStatusTag({ color: "#22a13f", text: "Pending Publish" }) | |||
| case "complated": | |||
| return getStatusTag({ color: "#8a8784", text: "Completed" }) | |||
| case "notAccepted": | |||
| return getStatusTag({ color: "#d9372b", text: "Not accepted" }) | |||
| case "resubmit": | |||
| return getStatusTag({ color: "#757373", text: "Re-submit Required" }) | |||
| case "cancelled": | |||
| return getStatusTag({ color: "#f5a83d", text: "Cancelled" }) | |||
| case "withdrawn": | |||
| return getStatusTag({ color: "#8a8784", text: "Withdrawn" }) | |||
| case "completed": | |||
| return getStatusTag({ color: "#8a8784", text: "Completed" }) | |||
| default: | |||
| return getStatusTag({ text: params.row.status }) | |||
| return getStatusTag({ text: status }) | |||
| } | |||
| } | |||
| @@ -129,7 +129,11 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||
| disablePortal | |||
| id="status" | |||
| filterOptions={(options)=>options} | |||
| options={ComboData.publicNoticeStatic} | |||
| options={ | |||
| localStorage.getItem('userData').creditor? | |||
| ComboData.publicNoticeStatic_Creditor: | |||
| ComboData.publicNoticeStatic | |||
| } | |||
| values={status} | |||
| inputValue={status?.label} | |||
| onChange={(event, newValue) => { | |||
| @@ -29,7 +29,6 @@ import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||
| const PublicNotice = () => { | |||
| const [submittedList, setSubmittedList] = useState([]); | |||
| const [inProgressList, setInProgressList] = useState([]); | |||
| const [pendingPaymentList, setPendingPaymentList] = useState([]); | |||
| const [pendingPublishList, setPendingPublishList] = useState([]); | |||
| const [isLoading, setLoding] = useState(true); | |||
| @@ -60,7 +59,6 @@ const PublicNotice = () => { | |||
| url: `${UrlUtils.GET_PUBLIC_NOTICE_LIST_ListByStatus}`, | |||
| onSuccess: function (response) { | |||
| setSubmittedList(response["submitted"]); | |||
| setInProgressList(response["inProgress"]); | |||
| setPendingPaymentList(response["pendingPayment"]); | |||
| setPendingPublishList(response["pendingPublish"]); | |||
| } | |||
| @@ -106,10 +104,9 @@ const PublicNotice = () => { | |||
| <TabContext value={selectedTab}> | |||
| <Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | |||
| <TabList onChange={handleChange} aria-label="lab API tabs example"> | |||
| <Tab label={"已提交 (" + submittedList?.length + ")"} value="1" /> | |||
| <Tab label={"處理中 (" + inProgressList?.length + ")"} value="2" /> | |||
| <Tab label={"待發佈 (" + pendingPublishList?.length + ")"} value="3" /> | |||
| <Tab label={"待付款 (" + pendingPaymentList?.length + ")"} value="4" /> | |||
| <Tab label={"處理中(" + submittedList?.length + ")"} value="1" /> | |||
| <Tab label={"待發布(" + pendingPublishList?.length + ")"} value="3" /> | |||
| <Tab label={"待付款(" + pendingPaymentList?.length + ")"} value="4" /> | |||
| <Tab label="搜尋申請記錄" value="5" /> | |||
| </TabList> | |||
| </Box> | |||
| @@ -119,12 +116,6 @@ const PublicNotice = () => { | |||
| reloadFunction={reloadPage} | |||
| /> | |||
| </TabPanel> | |||
| <TabPanel value="2"> | |||
| <BaseGrid | |||
| rows={inProgressList} | |||
| reloadFunction={reloadPage} | |||
| /> | |||
| </TabPanel> | |||
| <TabPanel value="3"> | |||
| <BaseGrid | |||
| rows={pendingPublishList} | |||
| @@ -150,10 +141,9 @@ const PublicNotice = () => { | |||
| <TabContext value={selectedTab}> | |||
| <Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | |||
| <TabList onChange={handleChange} aria-label="lab API tabs example"> | |||
| <Tab label={"已提交 (" + submittedList.length + ")"} value="1" /> | |||
| <Tab label={"處理中 (" + inProgressList.length + ")"} value="2" /> | |||
| <Tab label={"待付款 (" + pendingPaymentList.length + ")"} value="3" /> | |||
| <Tab label={"待發佈 (" + pendingPublishList.length + ")"} value="4" /> | |||
| <Tab label={"處理中(" + submittedList.length + ")"} value="1" /> | |||
| <Tab label={"待付款(" + pendingPaymentList.length + ")"} value="3" /> | |||
| <Tab label={"待發布(" + pendingPublishList.length + ")"} value="4" /> | |||
| <Tab label="搜尋申請記錄" value="5" /> | |||
| </TabList> | |||
| </Box> | |||
| @@ -163,12 +153,6 @@ const PublicNotice = () => { | |||
| reloadFunction={reloadPage} | |||
| /> | |||
| </TabPanel> | |||
| <TabPanel value="2"> | |||
| <BaseGrid | |||
| rows={inProgressList} | |||
| reloadFunction={reloadPage} | |||
| /> | |||
| </TabPanel> | |||
| <TabPanel value="3"> | |||
| <PendingPaymentTab | |||
| rows={pendingPaymentList} | |||
| @@ -3,97 +3,44 @@ import { | |||
| FormControl, | |||
| Button, | |||
| Grid, | |||
| // InputAdornment, | |||
| Typography, FormLabel, | |||
| OutlinedInput, | |||
| Stack | |||
| } from '@mui/material'; | |||
| // import MainCard from "../../components/MainCard"; | |||
| const MainCard = Loadable(lazy(() => import('components/MainCard'))); | |||
| import { useForm } from "react-hook-form"; | |||
| import { | |||
| useEffect, | |||
| useState | |||
| } from "react"; | |||
| // import Checkbox from "@mui/material/Checkbox"; | |||
| import Loadable from 'components/Loadable'; | |||
| import { lazy } from 'react'; | |||
| const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); | |||
| // import {useParams} from "react-router-dom"; | |||
| import * as HttpUtils from "utils/HttpUtils" | |||
| // import * as ApiPathConst from "utils/ApiPathConst" | |||
| import * as StatusUtils from "../PublicNotice/ListPanel/PublicNoteStatusUtils"; | |||
| import BorderColorOutlinedIcon from '@mui/icons-material/BorderColorOutlined'; | |||
| import DoneIcon from '@mui/icons-material/Done'; | |||
| import CloseIcon from '@mui/icons-material/Close'; | |||
| import EditNoteIcon from '@mui/icons-material/EditNote'; | |||
| import DownloadIcon from '@mui/icons-material/Download'; | |||
| // import { Params } from '../../../node_modules/react-router-dom/dist/index'; | |||
| // import {useNavigate} from "react-router-dom"; | |||
| // import axios from "axios"; | |||
| // import { makeStyles } from '@material-ui/core/styles'; | |||
| // const useStyles = makeStyles({ | |||
| // input: { | |||
| // '& input[type=number]': { | |||
| // '-moz-appearance': 'textfield' | |||
| // }, | |||
| // '& input[type=number]::-webkit-outer-spin-button': { | |||
| // '-webkit-appearance': 'none', | |||
| // margin: 0 | |||
| // }, | |||
| // '& input[type=number]::-webkit-inner-spin-button': { | |||
| // '-webkit-appearance': 'none', | |||
| // margin: 0 | |||
| // } | |||
| // }, | |||
| // }); | |||
| import ReplayIcon from '@mui/icons-material/Replay'; | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const ApplicationDetailCard = ( | |||
| { applicationDetailData, | |||
| setStatus, | |||
| // setReload, | |||
| isEditMode, | |||
| setUpdateApplicationObject, | |||
| setiIsSave, | |||
| // isNewRecord | |||
| } | |||
| ) => { | |||
| // const params = useParams(); | |||
| const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | |||
| const [companyName, setCompanyName] = useState({}); | |||
| const [verified, setVerified] = useState(null); | |||
| const [fileDetail, setfileDetail] = useState({}); | |||
| const [onReady, setOnReady] = useState(false); | |||
| // const [reload, setReload] = useState(false); | |||
| // const classes = useStyles(); | |||
| // const navigate = useNavigate() | |||
| // const params = useParams(); | |||
| const [editMode, setEditMode] = useState(false); | |||
| const onEditClick = () => () => { | |||
| setEditMode(true); | |||
| isEditMode(true); | |||
| }; | |||
| const onSaveClick = () => () => { | |||
| //upload latest data to parent | |||
| const values = getValues(); | |||
| const objectData = { | |||
| ...values, | |||
| } | |||
| setUpdateApplicationObject({ objectData }); | |||
| setiIsSave(true) | |||
| }; | |||
| const { register, | |||
| getValues, | |||
| // setValue | |||
| } = useForm() | |||
| const { register } = useForm() | |||
| useEffect(() => { | |||
| //if user data from parent are not null | |||
| @@ -102,7 +49,7 @@ const ApplicationDetailCard = ( | |||
| loadApplicationDetail() | |||
| } | |||
| }, [applicationDetailData]); | |||
| useEffect(() => { | |||
| //if state data are ready and assign to different field | |||
| // console.log(currentApplicationDetailData) | |||
| @@ -127,24 +74,13 @@ const ApplicationDetailCard = ( | |||
| }); | |||
| }; | |||
| // useEffect(() => { | |||
| // if (Object.keys(applicationDetailData).length > 0) { | |||
| // loadApplicationDetail() | |||
| // } | |||
| // }, [reload]); | |||
| const reloadHandle = () => () => { | |||
| // setReload(true) | |||
| setEditMode(false) | |||
| location.reload(); | |||
| }; | |||
| const acceptedClick = () => () => { | |||
| setStatus("accept") | |||
| const reSubmitClick = () => () => { | |||
| setStatus("resubmit") | |||
| }; | |||
| const rejectedClick = () => () => { | |||
| setStatus("reject") | |||
| const notAcceptedClick = () => () => { | |||
| setStatus("notAccepted") | |||
| }; | |||
| const complatedClick = () => () => { | |||
| @@ -155,6 +91,16 @@ const ApplicationDetailCard = ( | |||
| setStatus("withdraw") | |||
| }; | |||
| const onProofClick = () => { | |||
| window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer"); | |||
| window.addEventListener("focus", onFocus) | |||
| } | |||
| const onFocus = () => { | |||
| location.reload(); | |||
| window.removeEventListener("focus", onFocus) | |||
| } | |||
| return ( | |||
| !onReady ? | |||
| <LoadingComponent /> | |||
| @@ -173,58 +119,11 @@ const ApplicationDetailCard = ( | |||
| spacing={2} | |||
| mb={2} | |||
| > | |||
| {editMode ? | |||
| <> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| onClick={reloadHandle()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| }} | |||
| > | |||
| Reset & Back | |||
| </Button> | |||
| <Button | |||
| size="large" | |||
| variant="contained" | |||
| onClick={onSaveClick()} | |||
| color="success" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| }} | |||
| > | |||
| Save | |||
| </Button> | |||
| </> : | |||
| <>{ | |||
| currentApplicationDetailData.status=="submitted"? | |||
| <Grid item sx={{ ml: 3, mr: 3 }}> | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={onEditClick()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| }}> | |||
| <BorderColorOutlinedIcon /> | |||
| <Typography ml={1}> Edit</Typography> | |||
| </Button> | |||
| </Grid> | |||
| : | |||
| null | |||
| } | |||
| </> | |||
| } | |||
| {currentApplicationDetailData.status == "accepted" ? | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| // onClick={handleNewUserClick} | |||
| onClick={() => { onProofClick() }} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end' | |||
| @@ -249,26 +148,23 @@ const ApplicationDetailCard = ( | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={acceptedClick()} | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| backgroundColor: '#52b202' | |||
| }}> | |||
| <DoneIcon /> | |||
| <Typography ml={1}> Accept</Typography> | |||
| onClick={reSubmitClick()} | |||
| color="orange" | |||
| > | |||
| <ReplayIcon /> | |||
| <Typography ml={1}> Re-Submit</Typography> | |||
| </Button> | |||
| <Button | |||
| // size="large" | |||
| variant="contained" | |||
| onClick={rejectedClick()} | |||
| onClick={notAcceptedClick()} | |||
| color="error" | |||
| sx={{ | |||
| textTransform: 'capitalize', | |||
| alignItems: 'end', | |||
| backgroundColor: '#ffa733' | |||
| }}> | |||
| <CloseIcon /> | |||
| <Typography ml={1}> Reject</Typography> | |||
| <Typography ml={1}>Not accepted</Typography> | |||
| </Button> | |||
| </> : | |||
| currentApplicationDetailData.status == "paid" ? | |||
| @@ -410,7 +306,7 @@ const ApplicationDetailCard = ( | |||
| <Grid item xs={12} md={8} lg={8}> | |||
| <Stack direction="row"> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled={!editMode} > | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled > | |||
| <OutlinedInput | |||
| size="small" | |||
| {...register("contactTelNo.countryCode", | |||
| @@ -429,7 +325,7 @@ const ApplicationDetailCard = ( | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled={!editMode} > | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled > | |||
| <OutlinedInput | |||
| size="small" | |||
| type="tel" | |||
| @@ -464,7 +360,7 @@ const ApplicationDetailCard = ( | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled={!editMode}> | |||
| <FormControl variant="outlined" fullWidth disabled> | |||
| <OutlinedInput | |||
| fullWidth | |||
| size="small" | |||
| @@ -493,7 +389,7 @@ const ApplicationDetailCard = ( | |||
| <Grid item xs={12} md={8} lg={8}> | |||
| <Stack direction="row"> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled={!editMode}> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| {...register("contactFaxNo.countryCode", | |||
| @@ -509,12 +405,12 @@ const ApplicationDetailCard = ( | |||
| }} | |||
| inputProps={{ | |||
| maxLength: 3, | |||
| type:"tel" | |||
| type: "tel" | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled={!editMode}> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| type="tel" | |||
| @@ -580,46 +476,6 @@ const ApplicationDetailCard = ( | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| {/* <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} md={6} lg={6} mt={1}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={12} lg={12}> | |||
| <Grid container direction="row"> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center top' }}> | |||
| <FormLabel>Remarks:</FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Grid container direction="row" justifyContent="flex-start"> | |||
| <FormControl variant="outlined" fullWidth disabled={!editMode}> | |||
| <OutlinedInput | |||
| fullWidth | |||
| multiline={true} | |||
| // maxRows={4} | |||
| // minRows={4} | |||
| rows={4} | |||
| size="small" | |||
| {...register("remarks", | |||
| { | |||
| value: currentApplicationDetailData.remarks, | |||
| })} | |||
| id='remarks' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> */} | |||
| </Grid> | |||
| </Grid> | |||
| </form> | |||
| @@ -1,7 +1,7 @@ | |||
| import { | |||
| useEffect, | |||
| useState | |||
| } from "react"; | |||
| } from "react"; | |||
| // material-ui | |||
| import { | |||
| @@ -20,138 +20,190 @@ import { | |||
| } from '@mui/material'; | |||
| import { Grid } from "../../../node_modules/@mui/material/index"; | |||
| import * as ComboData from "utils/ComboData"; | |||
| import { useFormik,FormikProvider } from 'formik'; | |||
| import { useFormik, FormikProvider } from 'formik'; | |||
| import * as yup from 'yup'; | |||
| const StatusChangeDialog = (props) => { | |||
| const [status, setStatus] = useState(""); | |||
| const [content, setContent] = useState(); | |||
| const [dialogTitle, setDialogTitle] = useState("Confirm"); | |||
| const [prositiveBtnText, setPrositiveBtnText] = useState("Confirm"); | |||
| const [remarks, setRemarks] = useState(""); | |||
| const [helperText, setHelperText] = useState(""); | |||
| // const [selectedGazetteGroupInputType, setSelectedGazetteGroupInputType] = useState(""); | |||
| const groupTitleComboList = ComboData.groupTitle; | |||
| useEffect(() => { | |||
| // console.log(Object.keys(!props.selectedGazetteGroup).length) | |||
| if(props.getStatus == "accept"){ | |||
| setStatus("Accept") | |||
| }else if (props.getStatus == "reject"){ | |||
| setStatus("Reject") | |||
| }else if (props.getStatus == "complete"){ | |||
| setStatus("Complete") | |||
| }else if (props.getStatus == "withdraw"){ | |||
| setStatus("Withdraw") | |||
| // if (props.getStatus == "resubmit") { | |||
| // setStatus("Accept") | |||
| // } else if (props.getStatus == "reject") { | |||
| // setStatus("Reject") | |||
| // } else if (props.getStatus == "complete") { | |||
| // setStatus("Complete") | |||
| // } else if (props.getStatus == "withdraw") { | |||
| // setStatus("Withdraw") | |||
| // } | |||
| if (props.getStatus == "genGazetteCode") { | |||
| setDialogTitle("Gen Gazette Code"); | |||
| setPrositiveBtnText("Gen"); | |||
| return getGazetteCodeContent() | |||
| } else if (props.getStatus == "notAccepted") { | |||
| setDialogTitle("Not Accept Reason"); | |||
| setPrositiveBtnText("Mark Not Accept"); | |||
| return getNotAcceptedContent(); | |||
| } else { | |||
| setDialogTitle("Action Confirm"); | |||
| setPrositiveBtnText("Confirm"); | |||
| let str = "Are you sure you want to "+props.getStatus+" this application?" | |||
| return getConfirmContent(str); | |||
| } | |||
| }, [props.getStatus]); | |||
| const acceptedHandle = () => () =>{ | |||
| const acceptedHandle = () => () => { | |||
| // console.log(selectedGazetteGroup) | |||
| props.setStatusWindowAccepted(true) | |||
| if(props.getStatus == "notAccepted"){ | |||
| if(!remarks || remarks=="" ) | |||
| setHelperText("Please enter reason"); | |||
| } | |||
| if(!helperText){ | |||
| props.onWindowCallback(props.getStatus,{"reason": remarks}); | |||
| } | |||
| props.setStatusWindowAccepted(true); | |||
| }; | |||
| const formik = useFormik({ | |||
| initialValues:({ | |||
| username:'', | |||
| }), | |||
| validationSchema:yup.object().shape({ | |||
| }), | |||
| initialValues: ({ | |||
| username: '', | |||
| }), | |||
| validationSchema: yup.object().shape({ | |||
| }), | |||
| }); | |||
| // const handleReset = () => { | |||
| // setSelectedGazetteGroupInputType("") | |||
| // selectedGazetteGroup({}); | |||
| // }; | |||
| const getConfirmContent = (text) => { | |||
| setContent(<Grid container direction="row" justifyContent="center" alignItems="center"> | |||
| <FormLabel sx={{ fontSize: "20px", color: "#000000", textAlign: "center" }}> | |||
| {text} | |||
| </FormLabel> | |||
| </Grid>); | |||
| } | |||
| const getNotAcceptedContent = () => { | |||
| setContent(<Grid container direction="row" justifyContent="center" alignItems="center"> | |||
| <Grid item xs={12} md={12} lg={12} sx={{ mb: 1, }}> | |||
| <TextField | |||
| fullWidth | |||
| multiline | |||
| row={10} | |||
| minRows={4} | |||
| maxRows={4} | |||
| inputProps={{ maxLength: 255 }} | |||
| placeholder="Please enter reason" | |||
| helperText={helperText} | |||
| onChange={(newValues)=>{ | |||
| setRemarks(newValues); | |||
| setHelperText(""); | |||
| }} | |||
| > | |||
| </TextField> | |||
| </Grid> | |||
| </Grid> | |||
| ); | |||
| } | |||
| const getGazetteCodeContent = () => { | |||
| setContent(<Grid container direction="row" justifyContent="center" alignItems="center"> | |||
| <Grid item xs={12} md={8} lg={8} sx={{ mb: 1, }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={2} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography>Target Issue:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormLabel> | |||
| {props.gazetteIssue + ", "}{props.issueNum + ", "}{props.issueDate} | |||
| </FormLabel> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={8} lg={8} sx={{ mb: 1, height: "180px" }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <Typography>Grazette Group:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <Autocomplete | |||
| disablePortal | |||
| id="gazetteGroup" | |||
| options={groupTitleComboList} | |||
| filterOptions={(options) => options} | |||
| inputValue={props.selectedGazetteGroupInputType} | |||
| onChange={(event, newValue) => { | |||
| if (newValue != null && newValue != {}) { | |||
| props.setSelectedGazetteGroupInputType(newValue.label); | |||
| props.setSelectedGazetteGroup(newValue); | |||
| formik.setFieldValue("gazetteGroup", "") | |||
| } else { | |||
| props.setSelectedGazetteGroupInputType(""); | |||
| } | |||
| }} | |||
| // sx={{"& .MuiInputBase-root": { height: "41px" },"#idDocType":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}} | |||
| renderInput={(params) => <TextField {...params} placeholder="" />} | |||
| /> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| ); | |||
| } | |||
| return ( | |||
| <Dialog | |||
| open={props.open} | |||
| onClose={props.handleClose} | |||
| fullWidth={true} | |||
| maxWidth={'md'} | |||
| > | |||
| <DialogTitle > | |||
| <Grid container> | |||
| <Grid item> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography variant="h4"> | |||
| {status} Application | |||
| </Typography> | |||
| </Stack> | |||
| </Grid> | |||
| <Dialog | |||
| open={props.open} | |||
| onClose={props.handleClose} | |||
| fullWidth={true} | |||
| maxWidth={'md'} | |||
| > | |||
| <DialogTitle > | |||
| <Grid container> | |||
| <Grid item> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography variant="h4"> | |||
| {dialogTitle} | |||
| </Typography> | |||
| </Stack> | |||
| </Grid> | |||
| </DialogTitle> | |||
| <FormikProvider value={formik}> | |||
| <form> | |||
| <DialogContent> | |||
| <DialogContentText> | |||
| {props.getStatus == "accept"? | |||
| <Grid container direction="row" justifyContent="center" alignItems="center"> | |||
| <Grid item xs={12} md={8} lg={8} sx={{mb: 1,}}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={2} lg={3} | |||
| sx={{display: 'flex', alignItems: 'center'}}> | |||
| <Typography>Target Issue:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormLabel> | |||
| {props.gazetteIssue+", "}{props.issueNum+", "}{props.issueDate} | |||
| </FormLabel> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| <Grid item xs={12} md={8} lg={8} sx={{mb: 1,height:"180px"}}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{display: 'flex', alignItems: 'center'}}> | |||
| <Typography>Grazette Group:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <Autocomplete | |||
| disablePortal | |||
| id="gazetteGroup" | |||
| options={groupTitleComboList} | |||
| filterOptions={(options)=>options} | |||
| inputValue={props.selectedGazetteGroupInputType} | |||
| onChange={(event, newValue) => { | |||
| if (newValue!=null && newValue != {}){ | |||
| props.setSelectedGazetteGroupInputType(newValue.label); | |||
| props.setSelectedGazetteGroup(newValue); | |||
| formik.setFieldValue("gazetteGroup","") | |||
| }else{ | |||
| props.setSelectedGazetteGroupInputType(""); | |||
| } | |||
| }} | |||
| // sx={{"& .MuiInputBase-root": { height: "41px" },"#idDocType":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}} | |||
| renderInput={(params) => <TextField {...params} placeholder=""/>} | |||
| /> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid>: | |||
| <Grid container direction="row" justifyContent="center" alignItems="center"> | |||
| <Grid item xs={12} md={5} lg={5} sx={{mb: 5,}}> | |||
| <FormLabel sx={{fontSize: "20px", color:"#000000",textAlign:"center"}}> | |||
| Are you really {status} the Application? | |||
| </FormLabel> | |||
| </Grid> | |||
| </Grid> | |||
| } | |||
| </DialogContentText> | |||
| </DialogContent> | |||
| </form> | |||
| </FormikProvider> | |||
| <Stack direction="row" justifyContent="space-around"> | |||
| <DialogActions> | |||
| <Button variant="contained" onClick={props.handleClose} autoFocus > | |||
| Cancel | |||
| </Button> | |||
| </DialogActions> | |||
| <DialogActions> | |||
| <Button variant="contained" color="success" onClick={acceptedHandle()} autoFocus disabled={Object.keys(props.selectedGazetteGroup).length === 0&&status==="Accept"}> | |||
| {status==="Accept"?"Confirm":status} | |||
| </Button> | |||
| </DialogActions> | |||
| </Stack> | |||
| </Dialog> | |||
| </Grid> | |||
| </DialogTitle> | |||
| <FormikProvider value={formik}> | |||
| <form> | |||
| <DialogContent> | |||
| <DialogContentText> | |||
| {content} | |||
| </DialogContentText> | |||
| </DialogContent> | |||
| </form> | |||
| </FormikProvider> | |||
| <Stack direction="row" justifyContent="space-around"> | |||
| <DialogActions> | |||
| <Button variant="contained" onClick={props.handleClose} autoFocus > | |||
| Cancel | |||
| </Button> | |||
| </DialogActions> | |||
| <DialogActions> | |||
| <Button variant="contained" color="success" onClick={acceptedHandle()} autoFocus disabled={Object.keys(props.selectedGazetteGroup).length === 0 && status === "Accept"}> | |||
| {prositiveBtnText} | |||
| </Button> | |||
| </DialogActions> | |||
| </Stack> | |||
| </Dialog> | |||
| ); | |||
| }; | |||
| @@ -1,7 +1,7 @@ | |||
| import { | |||
| useEffect, | |||
| useState | |||
| } from "react"; | |||
| } from "react"; | |||
| // material-ui | |||
| import { | |||
| @@ -17,7 +17,7 @@ import { | |||
| useParams | |||
| } from "react-router-dom"; | |||
| import axios from "axios"; | |||
| import * as HttpUtils from "utils/HttpUtils"; | |||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||
| const ApplicationDetailCard = Loadable(lazy(() => import('./ApplicationDetailCard'))); | |||
| const GazetteDetailCard = Loadable(lazy(() => import('./GazetteDetailCard'))); | |||
| @@ -27,7 +27,7 @@ import { | |||
| GET_PUBLIC_NOTICE_APPLY_DETAIL, | |||
| UPDATE_PUBLIC_NOTICE_APPLY_DETAIL, | |||
| SET_PUBLIC_NOTICE_STATUS_ACCEPTED, | |||
| SET_PUBLIC_NOTICE_STATUS_REJRCTED, | |||
| SET_PUBLIC_NOTICE_STATUS_NOT_ACCEPT, | |||
| SET_PUBLIC_NOTICE_STATUS_COMPLATED, | |||
| SET_PUBLIC_NOTICE_STATUS_WITHDRAW | |||
| } from "utils/ApiPathConst"; | |||
| @@ -42,24 +42,24 @@ const PublicNoticeDetail_GLD = () => { | |||
| // const navigate = useNavigate() | |||
| const [applicationDetailData, setApplicationDetailData] = useState({}); | |||
| // const [refApplicationDetailData, setRefApplicationDetailData] = React.useState({}); | |||
| const [isLoading,setLoading] = useState(false); | |||
| const [isLoading, setLoading] = useState(false); | |||
| const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); | |||
| //pageTitle | |||
| const [appNo, setAapNo] = useState(""); | |||
| const [gazetteIssue, setGazetteIssue] = useState(""); | |||
| const [issueDate,setIssueDate] = useState(""); | |||
| const [issueNum,setIssueNum] = useState(""); | |||
| const [issueDate, setIssueDate] = useState(""); | |||
| const [issueNum, setIssueNum] = useState(""); | |||
| const [groupNo, setGroupNo] = useState(""); | |||
| // const [groupTitle, setGroupTitle] = useState(""); | |||
| //statusWindow | |||
| const [open, setOpen] = useState(false); | |||
| const [getStatus, setStatus] = useState(""); | |||
| const [statusWindowAccepted, setStatusWindowAccepted] = useState(false); | |||
| const [selectedGazetteGroup, setSelectedGazetteGroup] = useState({}); | |||
| const [selectedGazetteGroupInputType, setSelectedGazetteGroupInputType] = useState(""); | |||
| //editMode | |||
| const [updateApplicationObject, setUpdateApplicationObject] = useState({}); | |||
| const [editMode, isEditMode] = useState(false); | |||
| @@ -70,78 +70,78 @@ const PublicNoticeDetail_GLD = () => { | |||
| backgroundImage: `url(${titleBackgroundImg})`, | |||
| width: '100%', | |||
| height: '100%', | |||
| backgroundSize:'contain', | |||
| backgroundSize: 'contain', | |||
| backgroundRepeat: 'no-repeat', | |||
| backgroundColor: '#0C489E', | |||
| backgroundPosition: 'right' | |||
| } | |||
| const title = groupNo!=null?("Application / "+appNo+", "+gazetteIssue+", "+issueNum+" , "+groupNo):("Application / "+appNo+", "+gazetteIssue+", "+issueNum) | |||
| const title = groupNo != null ? ("Application / " + appNo + ", " + gazetteIssue + ", " + issueNum + " , " + groupNo) : ("Application / " + appNo + ", " + gazetteIssue + ", " + issueNum) | |||
| useEffect(() => { | |||
| loadApplicationDetail() | |||
| loadApplicationDetail() | |||
| }, []); | |||
| // useEffect(() => { | |||
| // if (reload){ | |||
| // loadApplicationDetail() | |||
| // } | |||
| // }, [reload]); | |||
| useEffect(() => { | |||
| if(editMode&&isSave){ | |||
| onUpdateClick(updateApplicationObject) | |||
| } | |||
| if (editMode && isSave) { | |||
| onUpdateClick(updateApplicationObject) | |||
| } | |||
| }, [updateApplicationObject]); | |||
| const loadApplicationDetail = () => { | |||
| if(params.id > 0){ | |||
| if (params.id > 0) { | |||
| axios.get(`${GET_PUBLIC_NOTICE_APPLY_DETAIL}/${params.id}`) | |||
| .then((response) => { | |||
| if (response.status === 200) { | |||
| setApplicationDetailData(response.data); | |||
| const gazetteIssueDetail = response.data.gazetteIssueDetail; | |||
| setAapNo(response.data.data.appNo); | |||
| setGazetteIssue(gazetteIssueDetail.year +" Vol "+gazetteIssueDetail.volume); | |||
| setIssueNum(" No. "+gazetteIssueDetail.issueNo); | |||
| setIssueDate(DateUtils.dateFormat(gazetteIssueDetail.issueDate, "D MMM YYYY (ddd)")); | |||
| setGroupNo(response.data.data.groupNo); | |||
| setLoading(false); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| .then((response) => { | |||
| if (response.status === 200) { | |||
| setApplicationDetailData(response.data); | |||
| const gazetteIssueDetail = response.data.gazetteIssueDetail; | |||
| setAapNo(response.data.data.appNo); | |||
| setGazetteIssue(gazetteIssueDetail.year + " Vol " + gazetteIssueDetail.volume); | |||
| setIssueNum(" No. " + gazetteIssueDetail.issueNo); | |||
| setIssueDate(DateUtils.dateFormat(gazetteIssueDetail.issueDate, "D MMM YYYY (ddd)")); | |||
| setGroupNo(response.data.data.groupNo); | |||
| setLoading(false); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| } | |||
| } | |||
| const onUpdateClick = (updateApplicationObject) => { | |||
| const data = updateApplicationObject.objectData | |||
| if(params.id > 0 ){ | |||
| setLoading(true); | |||
| axios.post(`${UPDATE_PUBLIC_NOTICE_APPLY_DETAIL}/${params.id}`, | |||
| { | |||
| contactPerson:data.contactPerson, | |||
| contactFaxNo:data.contactFaxNo, | |||
| contactTelNo:data.contactTelNo, | |||
| if (params.id > 0) { | |||
| setLoading(true); | |||
| axios.post(`${UPDATE_PUBLIC_NOTICE_APPLY_DETAIL}/${params.id}`, | |||
| { | |||
| contactPerson: data.contactPerson, | |||
| contactFaxNo: data.contactFaxNo, | |||
| contactTelNo: data.contactTelNo, | |||
| } | |||
| ) | |||
| .then((response) => { | |||
| if (response.status === 200) { | |||
| location.reload(); | |||
| } | |||
| ) | |||
| .then((response) => { | |||
| if (response.status === 200) { | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| } | |||
| }; | |||
| useEffect(() => { | |||
| // console.log(getStatus) | |||
| if(getStatus!==""){ | |||
| if (getStatus !== "") { | |||
| setOpen(true) | |||
| } | |||
| }, [getStatus]); | |||
| @@ -159,99 +159,128 @@ const PublicNoticeDetail_GLD = () => { | |||
| }; | |||
| useEffect(() => { | |||
| if(statusWindowAccepted){ | |||
| if(getStatus == "accept"){ | |||
| if (statusWindowAccepted) { | |||
| if (getStatus == "accept") { | |||
| onAcceptedClick() | |||
| }else if (getStatus== "reject"){ | |||
| onRejectedClick() | |||
| }else if (getStatus == "complete"){ | |||
| } else if (getStatus == "reject") { | |||
| onNotAcceptClick() | |||
| } else if (getStatus == "complete") { | |||
| onComplatedClick() | |||
| }else if (getStatus == "withdraw"){ | |||
| } else if (getStatus == "withdraw") { | |||
| onWithdrawnClick() | |||
| } | |||
| } | |||
| }, [statusWindowAccepted]); | |||
| const onWindowCallback = (status, data) => { | |||
| if (status == "genGazetteCode") { | |||
| onAcceptedClick() | |||
| } else if (getStatus == "notAccepted") { | |||
| onNotAcceptClick(data.reason); | |||
| } else if (getStatus == "complete") { | |||
| onComplatedClick() | |||
| } else if (getStatus == "withdraw") { | |||
| onWithdrawnClick() | |||
| } | |||
| } | |||
| const onAcceptedClick = () => { | |||
| if(params.id > 0 ){ | |||
| axios.post(`${SET_PUBLIC_NOTICE_STATUS_ACCEPTED}/${params.id}`, | |||
| { | |||
| "groupTitle": selectedGazetteGroup.title, | |||
| "groupNo": selectedGazetteGroup.type, | |||
| if (params.id > 0) { | |||
| axios.post(`${SET_PUBLIC_NOTICE_STATUS_ACCEPTED}/${params.id}`, | |||
| { | |||
| "groupTitle": selectedGazetteGroup.title, | |||
| "groupNo": selectedGazetteGroup.type, | |||
| } | |||
| ) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| ) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| } | |||
| }; | |||
| const onRejectedClick = () => { | |||
| if(params.id > 0 ){ | |||
| axios.get(`${SET_PUBLIC_NOTICE_STATUS_REJRCTED}/${params.id}`) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| } | |||
| }; | |||
| const onNotAcceptClick = (reason) => { | |||
| if (params.id <= 0) return; | |||
| HttpUtils.post({ | |||
| url: `${SET_PUBLIC_NOTICE_STATUS_NOT_ACCEPT}/${params.id}`, | |||
| params: { | |||
| reason: reason | |||
| }, | |||
| onSuccess: function () { | |||
| location.reload(); | |||
| } | |||
| }); | |||
| // axios.get(`${SET_PUBLIC_NOTICE_STATUS_REJRCTED}/${params.id}`) | |||
| // .then((response) => { | |||
| // if (response.status === 204) { | |||
| // setOpen(false); | |||
| // handleClose(); | |||
| // location.reload(); | |||
| // } | |||
| // }) | |||
| // .catch(error => { | |||
| // console.log(error); | |||
| // return false; | |||
| // }); | |||
| // } | |||
| } | |||
| const onComplatedClick = () => { | |||
| if(params.id > 0 ){ | |||
| axios.get(`${SET_PUBLIC_NOTICE_STATUS_COMPLATED}/${params.id}`) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| if (params.id > 0) { | |||
| axios.get(`${SET_PUBLIC_NOTICE_STATUS_COMPLATED}/${params.id}`) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| } | |||
| }; | |||
| const onWithdrawnClick = () => { | |||
| if(params.id > 0 ){ | |||
| axios.get(`${SET_PUBLIC_NOTICE_STATUS_WITHDRAW}/${params.id}`) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| if (params.id > 0) { | |||
| axios.get(`${SET_PUBLIC_NOTICE_STATUS_WITHDRAW}/${params.id}`) | |||
| .then((response) => { | |||
| if (response.status === 204) { | |||
| setOpen(false); | |||
| handleClose(); | |||
| location.reload(); | |||
| } | |||
| }) | |||
| .catch(error => { | |||
| console.log(error); | |||
| return false; | |||
| }); | |||
| } | |||
| }; | |||
| return ( | |||
| <Grid container sx={{maxnHeight: '500vh',backgroundColor:'#ffffff'}} direction="column"> | |||
| <StatusChangeDialog open={open} handleClose={handleClose} setStatusWindowAccepted={setStatusWindowAccepted} | |||
| getStatus={getStatus} issueDate={issueDate} issueNum={issueNum} gazetteIssue={gazetteIssue} | |||
| selectedGazetteGroup={selectedGazetteGroup} setSelectedGazetteGroup={setSelectedGazetteGroup} | |||
| selectedGazetteGroupInputType={selectedGazetteGroupInputType} setSelectedGazetteGroupInputType={setSelectedGazetteGroupInputType} | |||
| /> | |||
| <Grid container sx={{ maxnHeight: '500vh', backgroundColor: '#ffffff' }} direction="column"> | |||
| <StatusChangeDialog open={open} | |||
| handleClose={handleClose} | |||
| onWindowCallback={onWindowCallback} | |||
| setStatusWindowAccepted={setStatusWindowAccepted} | |||
| getStatus={getStatus} | |||
| issueDate={issueDate} | |||
| issueNum={issueNum} | |||
| gazetteIssue={gazetteIssue} | |||
| selectedGazetteGroup={selectedGazetteGroup} | |||
| setSelectedGazetteGroup={setSelectedGazetteGroup} | |||
| selectedGazetteGroupInputType={selectedGazetteGroupInputType} | |||
| setSelectedGazetteGroupInputType={setSelectedGazetteGroupInputType} | |||
| /> | |||
| <Grid item xs={12}> | |||
| <div style={BackgroundHead}> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| @@ -260,43 +289,43 @@ const PublicNoticeDetail_GLD = () => { | |||
| </div> | |||
| </Grid> | |||
| <Grid item xs={12} > | |||
| <Stack direction="row" height='20px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography ml={4} mt={3} variant="h4">{title}</Typography> | |||
| </Stack> | |||
| <Stack direction="row" height='20px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography ml={4} mt={3} variant="h4">{title}</Typography> | |||
| </Stack> | |||
| </Grid> | |||
| <Grid item xs={12} > | |||
| <Grid container direction="row"> | |||
| <Grid item xs={12} md={10}> | |||
| <Grid container direction="column"> | |||
| <Grid item xs={12} md={10}> | |||
| <Box xs={12} ml={4} mt={3} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px'}}> | |||
| {isLoading&&editMode? | |||
| <LoadingComponent/>: | |||
| <ApplicationDetailCard | |||
| applicationDetailData={applicationDetailData} | |||
| setStatus = {setStatus} | |||
| // setReload = {setReload} | |||
| setUpdateApplicationObject={setUpdateApplicationObject} | |||
| isEditMode = {isEditMode} | |||
| setiIsSave={setiIsSave} | |||
| <Box xs={12} ml={4} mt={3} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | |||
| {isLoading && editMode ? | |||
| <LoadingComponent /> : | |||
| <ApplicationDetailCard | |||
| applicationDetailData={applicationDetailData} | |||
| setStatus={setStatus} | |||
| // setReload = {setReload} | |||
| setUpdateApplicationObject={setUpdateApplicationObject} | |||
| isEditMode={isEditMode} | |||
| setiIsSave={setiIsSave} | |||
| // isNewRecord={isNewRecord} | |||
| /> | |||
| } | |||
| </Box> | |||
| </Grid> | |||
| <Grid item xs={12} md={10}> | |||
| <Box xs={12} ml={4} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px'}}> | |||
| <GazetteDetailCard | |||
| <Box xs={12} ml={4} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | |||
| <GazetteDetailCard | |||
| // updateUserObject={updateUserObject} | |||
| applicationDetailData={applicationDetailData} | |||
| // isCollectData={isCollectData} | |||
| // isNewRecord={isNewRecord} | |||
| // isCollectData={isCollectData} | |||
| // isNewRecord={isNewRecord} | |||
| /> | |||
| </Box> | |||
| </Grid> | |||
| <Grid item xs={12} md={10}> | |||
| <Box xs={12} ml={4} mt={3}> | |||
| <TabTableDetail applicationDetailData={applicationDetailData}/> | |||
| <TabTableDetail applicationDetailData={applicationDetailData} /> | |||
| </Box> | |||
| </Grid> | |||
| </Grid> | |||
| @@ -304,18 +333,18 @@ const PublicNoticeDetail_GLD = () => { | |||
| <Grid item xs={12} md={2} lg={2}> | |||
| <Grid container> | |||
| <Grid item xs={12} md={12}> | |||
| <Box xs={12} md={12} ml={1} mt={3} mr={1} height='800px' sx={{ p: 2, border: '3px groove grey', borderRadius: '10px'}}> | |||
| <ClientDetailCard | |||
| <Box xs={12} md={12} ml={1} mt={3} mr={1} height='800px' sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | |||
| <ClientDetailCard | |||
| // updateUserObject={updateUserObject} | |||
| applicationDetailData={applicationDetailData} | |||
| // isCollectData={isCollectData} | |||
| // isNewRecord={isNewRecord} | |||
| // isCollectData={isCollectData} | |||
| // isNewRecord={isNewRecord} | |||
| /> | |||
| </Box> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| ); | |||
| @@ -167,7 +167,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||
| disablePortal | |||
| id="status" | |||
| filterOptions={(options) => options} | |||
| options={ComboData.publicNoticeStaticEng} | |||
| options={ComboData.publicNoticeStatic_GLD} | |||
| value={status} | |||
| inputValue={status?.label} | |||
| onChange={(event, newValue) => { | |||
| @@ -10,6 +10,7 @@ const DashboardDefault = Loadable(lazy(() => import('pages/gldDashboard'))); | |||
| const ApplicationDetail = Loadable(lazy(() => import('pages/PublicNoticeDetail_GLD'))); | |||
| const ApplicationSearch = Loadable(lazy(() => import('pages/PublicNoticeSearch_GLD'))); | |||
| const ProofSearch = Loadable(lazy(() => import('pages/ProofSearch'))); | |||
| const ProofCreate_FromApp = Loadable(lazy(() => import('pages/ProofCreate_FromApp'))); | |||
| // ==============================|| MAIN ROUTING ||============================== // | |||
| const GLDUserRoutes = { | |||
| @@ -38,6 +39,10 @@ const GLDUserRoutes = { | |||
| { | |||
| path: '/proof/search', | |||
| element: <ProofSearch/> | |||
| }, | |||
| { | |||
| path: '/proof/create/:id', | |||
| element: <ProofCreate_FromApp/> | |||
| } | |||
| ] | |||
| }, | |||
| @@ -52,7 +52,31 @@ const Palette = (mode) => { | |||
| background: { | |||
| paper: paletteColor.grey[0], | |||
| default: paletteColor.grey.A50 | |||
| } | |||
| }, | |||
| ochre: { | |||
| main: '#E3D026', | |||
| light: '#E9DB5D', | |||
| dark: '#A29415', | |||
| contrastText: '#242105', | |||
| }, | |||
| red: { | |||
| main: '#f05b5b', | |||
| light: '#ff5e5e', | |||
| dark: '#c91616', | |||
| contrastText: '#fff', | |||
| }, | |||
| pink: { | |||
| main: '#ed138a', | |||
| light: '#ff5e5e', | |||
| dark: '#ba1c73', | |||
| contrastText: '#fff', | |||
| }, | |||
| orange: { | |||
| main: '#ed9740', | |||
| light: '#ff5e5e', | |||
| dark: '#b0671e', | |||
| contrastText: '#fff', | |||
| }, | |||
| } | |||
| }); | |||
| }; | |||
| @@ -59,7 +59,7 @@ export const POST_ADMIN_USER_REGISTER = apiPath+'/user/registry'; | |||
| export const DELETE_USER = apiPath+'/user'; | |||
| export const GET_PUBLIC_NOTICE_APPLY_DETAIL = apiPath+'/application/application-detail'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_ACCEPTED = apiPath+'/application/application-detail-status-accepted'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_REJRCTED = apiPath+'/application/application-detail-status-rejected'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_NOT_ACCEPT = apiPath+'/application/application-detail-status-not-accept'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_CANCELLED = apiPath+'/application/application-detail-status-cancelled'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_COMPLATED = apiPath+'/application/application-detail-status-complated'; | |||
| export const SET_PUBLIC_NOTICE_STATUS_WITHDRAW = apiPath+'/application/application-detail-status-withdrawn'; | |||
| @@ -13,28 +13,67 @@ export const accountFilter = [{ id: 1, key: 1, label: 'Active', type: 'active' | |||
| export const publicNoticeStatic = [ | |||
| { key: 0, label: '全部', type: 'all' }, | |||
| { key: 1, label: '已提交', type: 'submitted' }, | |||
| { key: 2, label: '已拒絕', type: 'rejected' }, | |||
| { key: 3, label: '已取消', type: 'cancelled' }, | |||
| { key: 4, label: '已接受', type: 'accepted' }, | |||
| { key: 5, label: '已確認', type: 'confirmed' }, | |||
| { key: 6, label: '已付費', type: 'paid' }, | |||
| { key: 7, label: '已發表', type: 'published' }, | |||
| { key: 1, label: '處理中', type: 'processing' }, // submitted and reviewed | |||
| { key: 2, label: '待付款', type: 'confirmed' }, | |||
| { key: 3, label: '待發布', type: 'paid' }, | |||
| { key: 4, label: '已完成', type: 'completed' }, | |||
| { key: 5, label: '不接受', type: 'notAccepted' }, | |||
| { key: 6, label: '需重新提交', type: 'resubmit' }, | |||
| { key: 7, label: '已取消', type: 'cancelled' }, | |||
| { key: 8, label: '已撤銷', type: 'withdrawn' }, | |||
| ]; | |||
| export const publicNoticeStatic_Creditor = [ | |||
| { key: 0, label: '全部', type: 'all' }, | |||
| { key: 1, label: '處理中', type: 'processing' }, // submitted and reviewed | |||
| { key: 2, label: '待發布', type: 'confirmed' }, | |||
| { key: 3, label: '待付款', type: 'published' }, | |||
| { key: 4, label: '已完成', type: 'completed' }, | |||
| { key: 5, label: '不接受', type: 'notAccepted' }, | |||
| { key: 6, label: '需重新提交', type: 'resubmit' }, | |||
| { key: 7, label: '已取消', type: 'cancelled' }, | |||
| { key: 8, label: '已撤銷', type: 'withdrawn' }, | |||
| ]; | |||
| export const publicNoticeStaticEng = [ | |||
| { key: 0, label: 'All', type: 'all' }, | |||
| { key: 1, label: 'Submitted', type: 'submitted' }, | |||
| { key: 2, label: 'Rejected', type: 'rejected' }, | |||
| { key: 3, label: 'Cancelled', type: 'cancelled' }, | |||
| { key: 4, label: 'Accepted', type: 'accepted' }, | |||
| { key: 5, label: 'Confirmed', type: 'confirmed' }, | |||
| { key: 6, label: 'Paid', type: 'paid' }, | |||
| { key: 7, label: 'Published', type: 'published' }, | |||
| { key: 1, label: 'Processing', type: 'processing' }, // submitted and reviewed | |||
| { key: 2, label: 'Pending Payment', type: 'confirmed' }, | |||
| { key: 3, label: 'To be published', type: 'paid' }, | |||
| { key: 4, label: 'Completed', type: 'completed' }, | |||
| { key: 5, label: 'Not accepted', type: 'notAccepted' }, | |||
| { key: 6, label: 'Re-submit Required', type: 'resubmit' }, | |||
| { key: 7, label: 'Cancelled', type: 'cancelled' }, | |||
| { key: 8, label: 'Withdrawn', type: 'withdrawn' }, | |||
| ]; | |||
| export const publicNoticeStaticEng_Creditor = [ | |||
| { key: 0, label: 'All', type: 'all' }, | |||
| { key: 1, label: 'Processing', type: 'processing' }, // submitted and reviewed | |||
| { key: 2, label: 'To be published', type: 'confirmed' }, | |||
| { key: 3, label: 'Pending Payment', type: 'published' }, | |||
| { key: 4, label: 'Completed', type: 'completed' }, | |||
| { key: 5, label: 'Not accepted', type: 'notAccepted' }, | |||
| { key: 6, label: 'Re-submit Required', type: 'resubmit' }, | |||
| { key: 7, label: 'Cancelled', type: 'cancelled' }, | |||
| { key: 8, label: 'Withdrawn', type: 'withdrawn' }, | |||
| ]; | |||
| export const publicNoticeStatic_GLD = [ | |||
| { key: 0, label: 'All', type: 'all' }, | |||
| { key: 1, label: 'Submitted', type: 'submitted' }, | |||
| { key: 2, label: 'Reviewed', type: 'reviewed' }, | |||
| { key: 3, label: 'Confirmed', type: 'confirmed' }, | |||
| { key: 3, label: 'Paid', type: 'paid' }, | |||
| { key: 4, label: 'Published', type: 'published' }, | |||
| { key: 5, label: 'Completed', type: 'completed' }, | |||
| { key: 6, label: 'Not accepted', type: 'notAccepted' }, | |||
| { key: 7, label: 'Re-submit required', type: 'resubmit' }, | |||
| { key: 8, label: 'Cancelled', type: 'cancelled' }, | |||
| { key: 9, label: 'Withdrawn', type: 'withdrawn' }, | |||
| ]; | |||
| export const groupTitle = [ | |||
| { key: 1, label: 'A - Private Bill', title: 'Private Bill', type: 'A'}, | |||
| { key: 2, label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B' }, | |||