| @@ -48,6 +48,7 @@ | |||||
| "react-scripts": "^5.0.1", | "react-scripts": "^5.0.1", | ||||
| "react-syntax-highlighter": "^15.5.0", | "react-syntax-highlighter": "^15.5.0", | ||||
| "react-to-print": "^2.14.13", | "react-to-print": "^2.14.13", | ||||
| "react-toastify": "^9.1.3", | |||||
| "react-window": "^1.8.7", | "react-window": "^1.8.7", | ||||
| "redux": "^4.2.0", | "redux": "^4.2.0", | ||||
| "simplebar": "^5.3.8", | "simplebar": "^5.3.8", | ||||
| @@ -2,6 +2,8 @@ | |||||
| import Routes from 'routes'; | import Routes from 'routes'; | ||||
| import ThemeCustomization from 'themes'; | import ThemeCustomization from 'themes'; | ||||
| import ScrollTop from 'components/ScrollTop'; | import ScrollTop from 'components/ScrollTop'; | ||||
| import {ToastContainer} from "react-toastify"; | |||||
| import 'react-toastify/dist/ReactToastify.css'; | |||||
| //import {isUserLoggedIn} from 'utils/Utils'; | //import {isUserLoggedIn} from 'utils/Utils'; | ||||
| //import {DefaultRoute} from 'routes/index' | //import {DefaultRoute} from 'routes/index' | ||||
| // ==============================|| APP - THEME, ROUTER, LOCAL ||============================== // | // ==============================|| APP - THEME, ROUTER, LOCAL ||============================== // | ||||
| @@ -12,6 +14,7 @@ const App = () => ( | |||||
| <Routes> | <Routes> | ||||
| </Routes> | </Routes> | ||||
| </ScrollTop> | </ScrollTop> | ||||
| <ToastContainer/> | |||||
| </ThemeCustomization> | </ThemeCustomization> | ||||
| ); | ); | ||||
| @@ -15,6 +15,7 @@ import * as ComboData from "../../utils/ComboData"; | |||||
| const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| import { notifySaveSuccess } from 'utils/CommonFunction'; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -83,6 +84,7 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => { | |||||
| creditor: vaule.creditor, | creditor: vaule.creditor, | ||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| setEditMode(false); | setEditMode(false); | ||||
| } | } | ||||
| @@ -15,6 +15,7 @@ import { useFormik } from 'formik'; | |||||
| const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| import { notifyCreateSuccess } from 'utils/CommonFunction'; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -81,6 +82,7 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
| }, | }, | ||||
| onSuccess: function (responseData) { | onSuccess: function (responseData) { | ||||
| navigate('/org/' + responseData.id); | navigate('/org/' + responseData.id); | ||||
| notifyCreateSuccess() | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| @@ -84,6 +84,10 @@ export default function OrganizationTable({ recordList }) { | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/org/' + params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{ height: "fit-content", width: '100%' }}> | <div style={{ height: "fit-content", width: '100%' }}> | ||||
| <FiDataGrid | <FiDataGrid | ||||
| @@ -94,6 +98,7 @@ export default function OrganizationTable({ recordList }) { | |||||
| paginationModel: { page: 0, pageSize: 5 }, | paginationModel: { page: 0, pageSize: 5 }, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -18,6 +18,7 @@ import * as React from "react"; | |||||
| import { useFormik } from 'formik'; | import { useFormik } from 'formik'; | ||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { notifySaveSuccess } from 'utils/CommonFunction'; | |||||
| const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -118,6 +119,7 @@ const FormPanel = ({ formData }) => { | |||||
| }, | }, | ||||
| files: attachments, | files: attachments, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess() | |||||
| navigate("/proof/search"); | navigate("/proof/search"); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -21,6 +21,7 @@ import { useFormik } from 'formik'; | |||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| import * as DateUtils from "utils/DateUtils" | import * as DateUtils from "utils/DateUtils" | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { notifyActionSuccess } from 'utils/CommonFunction'; | |||||
| const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -76,8 +77,10 @@ const FormPanel = ({ formData }) => { | |||||
| files: attachments ? attachments : [], | files: attachments ? attachments : [], | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| if (actionValue) { | if (actionValue) { | ||||
| notifyActionSuccess("提交成功!") | |||||
| navigate("/proof/pay/"+params.id); | navigate("/proof/pay/"+params.id); | ||||
| } else { | } else { | ||||
| notifyActionSuccess("提交成功!") | |||||
| navigate("/proof/search"); | navigate("/proof/search"); | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -125,6 +125,10 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| var zero = places - num.toString().length + 1; | var zero = places - num.toString().length + 1; | ||||
| return Array(+(zero > 0 && zero)).join("0") + num; | return Array(+(zero > 0 && zero)).join("0") + num; | ||||
| } | } | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/proof/reply/' + params.row.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{ height: 400, width: '100%' }}> | <div style={{ height: 400, width: '100%' }}> | ||||
| @@ -138,6 +142,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| paginationModel: { page: 0, pageSize: 5 }, | paginationModel: { page: 0, pageSize: 5 }, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -126,6 +126,10 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| return Array(+(zero > 0 && zero)).join("0") + num; | return Array(+(zero > 0 && zero)).join("0") + num; | ||||
| } | } | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/proof/reply/' + params.row.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{ height: 400, width: '100%' }}> | <div style={{ height: 400, width: '100%' }}> | ||||
| @@ -138,6 +142,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| paginationModel: { page: 0, pageSize: 5 }, | paginationModel: { page: 0, pageSize: 5 }, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -17,6 +17,7 @@ import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| import { notifyActionSuccess } from 'utils/CommonFunction'; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -90,6 +91,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
| }, | }, | ||||
| files: [attachment], | files: [attachment], | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyActionSuccess('申請成功!') | |||||
| navigate("/publicNotice"); | navigate("/publicNotice"); | ||||
| // location.reload(); | // location.reload(); | ||||
| } | } | ||||
| @@ -27,6 +27,7 @@ import CloseIcon from '@mui/icons-material/Close'; | |||||
| import EditNoteIcon from '@mui/icons-material/EditNote'; | import EditNoteIcon from '@mui/icons-material/EditNote'; | ||||
| import DownloadIcon from '@mui/icons-material/Download'; | import DownloadIcon from '@mui/icons-material/Download'; | ||||
| import ReplayIcon from '@mui/icons-material/Replay'; | import ReplayIcon from '@mui/icons-material/Replay'; | ||||
| import { notifyDownloadSuccess } from 'utils/CommonFunction'; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| const ApplicationDetailCard = ( | const ApplicationDetailCard = ( | ||||
| @@ -77,6 +78,7 @@ const ApplicationDetailCard = ( | |||||
| skey: fileDetail.skey, | skey: fileDetail.skey, | ||||
| filename: fileDetail.filename, | filename: fileDetail.filename, | ||||
| }); | }); | ||||
| notifyDownloadSuccess() | |||||
| setUploadStatus(true) | setUploadStatus(true) | ||||
| }; | }; | ||||
| @@ -59,6 +59,7 @@ const GazetteDetailCard = ( | |||||
| +" No. "+applicationDetailData.gazetteIssueDetail.issueNo); | +" No. "+applicationDetailData.gazetteIssueDetail.issueNo); | ||||
| setIssueDate(DateUtils.dateFormat(applicationDetailData.gazetteIssueDetail.issueDate, "D MMM YYYY (ddd)")); | setIssueDate(DateUtils.dateFormat(applicationDetailData.gazetteIssueDetail.issueDate, "D MMM YYYY (ddd)")); | ||||
| setGazetteCode(applicationDetailData.data.groupNo) | setGazetteCode(applicationDetailData.data.groupNo) | ||||
| console.log(gazetteCode) | |||||
| setGroupTitle(applicationDetailData.data.groupTitle) | setGroupTitle(applicationDetailData.data.groupTitle) | ||||
| } | } | ||||
| }, [applicationDetailData]); | }, [applicationDetailData]); | ||||
| @@ -153,6 +154,7 @@ const GazetteDetailCard = ( | |||||
| { | { | ||||
| value: issueNum, | value: issueNum, | ||||
| })} | })} | ||||
| value={issueNum} | |||||
| id='issueNum' | id='issueNum' | ||||
| sx={{ | sx={{ | ||||
| "& .MuiInputBase-input.Mui-disabled": { | "& .MuiInputBase-input.Mui-disabled": { | ||||
| @@ -181,6 +183,7 @@ const GazetteDetailCard = ( | |||||
| { | { | ||||
| value: gazetteCode, | value: gazetteCode, | ||||
| })} | })} | ||||
| value={gazetteCode} | |||||
| id='gazetteCode' | id='gazetteCode' | ||||
| sx={{ | sx={{ | ||||
| "& .MuiInputBase-input.Mui-disabled": { | "& .MuiInputBase-input.Mui-disabled": { | ||||
| @@ -212,6 +215,7 @@ const GazetteDetailCard = ( | |||||
| { | { | ||||
| value: issueDate, | value: issueDate, | ||||
| })} | })} | ||||
| value={issueDate} | |||||
| id='issueDate' | id='issueDate' | ||||
| sx={{ | sx={{ | ||||
| "& .MuiInputBase-input.Mui-disabled": { | "& .MuiInputBase-input.Mui-disabled": { | ||||
| @@ -240,6 +244,7 @@ const GazetteDetailCard = ( | |||||
| { | { | ||||
| value: groupTitle, | value: groupTitle, | ||||
| })} | })} | ||||
| value={groupTitle} | |||||
| id='groupTitle' | id='groupTitle' | ||||
| sx={{ | sx={{ | ||||
| "& .MuiInputBase-input.Mui-disabled": { | "& .MuiInputBase-input.Mui-disabled": { | ||||
| @@ -23,7 +23,6 @@ import * as ComboData from "utils/ComboData"; | |||||
| import { useFormik, FormikProvider } from 'formik'; | import { useFormik, FormikProvider } from 'formik'; | ||||
| import * as yup from 'yup'; | import * as yup from 'yup'; | ||||
| const StatusChangeDialog = (props) => { | const StatusChangeDialog = (props) => { | ||||
| const [content, setContent] = useState(); | const [content, setContent] = useState(); | ||||
| const [dialogTitle, setDialogTitle] = useState("Confirm"); | const [dialogTitle, setDialogTitle] = useState("Confirm"); | ||||
| @@ -35,6 +35,7 @@ import { | |||||
| } from "utils/ApiPathConst"; | } from "utils/ApiPathConst"; | ||||
| const StatusChangeDialog = Loadable(lazy(() => import('./StatusChangeDialog'))); | const StatusChangeDialog = Loadable(lazy(() => import('./StatusChangeDialog'))); | ||||
| import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
| import { notifyActionSuccess, notifySaveSuccess } from "utils/CommonFunction"; | |||||
| // ==============================|| Body - DEFAULT ||============================== // | // ==============================|| Body - DEFAULT ||============================== // | ||||
| @@ -193,7 +194,9 @@ const PublicNoticeDetail_GLD = () => { | |||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| setOpen(false); | setOpen(false); | ||||
| handleClose(); | handleClose(); | ||||
| location.reload(); | |||||
| // location.reload(); | |||||
| loadApplicationDetail() | |||||
| notifyActionSuccess("Gen Gazette Code Success!") | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(error => { | .catch(error => { | ||||
| @@ -211,7 +214,9 @@ const PublicNoticeDetail_GLD = () => { | |||||
| onSuccess: function () { | onSuccess: function () { | ||||
| setOpen(false); | setOpen(false); | ||||
| handleClose(); | handleClose(); | ||||
| location.reload(); | |||||
| // location.reload(); | |||||
| loadApplicationDetail() | |||||
| notifySaveSuccess() | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| @@ -223,7 +228,9 @@ const PublicNoticeDetail_GLD = () => { | |||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| setOpen(false); | setOpen(false); | ||||
| handleClose(); | handleClose(); | ||||
| location.reload(); | |||||
| // location.reload(); | |||||
| loadApplicationDetail() | |||||
| notifySaveSuccess() | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(error => { | .catch(error => { | ||||
| @@ -240,7 +247,8 @@ const PublicNoticeDetail_GLD = () => { | |||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| setOpen(false); | setOpen(false); | ||||
| handleClose(); | handleClose(); | ||||
| location.reload(); | |||||
| loadApplicationDetail() | |||||
| notifyActionSuccess("Withdrawn Success!") | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(error => { | .catch(error => { | ||||
| @@ -257,7 +265,9 @@ const PublicNoticeDetail_GLD = () => { | |||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| setOpen(false); | setOpen(false); | ||||
| handleClose(); | handleClose(); | ||||
| location.reload(); | |||||
| // location.reload(); | |||||
| loadApplicationDetail() | |||||
| notifySaveSuccess() | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(error => { | .catch(error => { | ||||
| @@ -83,6 +83,10 @@ export default function BaseGrid({rows}) { | |||||
| }, | }, | ||||
| } | } | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/publicNotice/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{height: 400, width: '100%', padding: 4}}> | <div style={{height: 400, width: '100%', padding: 4}}> | ||||
| @@ -94,6 +98,7 @@ export default function BaseGrid({rows}) { | |||||
| paginationModel: {page: 0, pageSize: 5}, | paginationModel: {page: 0, pageSize: 5}, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -106,6 +106,10 @@ export default function SubmittedTab({ rows }) { | |||||
| return content; | return content; | ||||
| } | } | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/publicNotice/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <> | <> | ||||
| <div style={{ height: 400, width: '100%', padding: 4 }}> | <div style={{ height: 400, width: '100%', padding: 4 }}> | ||||
| @@ -122,6 +126,7 @@ export default function SubmittedTab({ rows }) { | |||||
| onRowSelectionModelChange={(newSelection) => { | onRowSelectionModelChange={(newSelection) => { | ||||
| setSelectedRowItems(newSelection); | setSelectedRowItems(newSelection); | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| <Button variant="contained" onClick={() => { setIsPopUp(true) }}>付款</Button> | <Button variant="contained" onClick={() => { setIsPopUp(true) }}>付款</Button> | ||||
| </div> | </div> | ||||
| @@ -16,14 +16,15 @@ import * as DateUtils from "utils/DateUtils"; | |||||
| const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | ||||
| const [type, setType] = React.useState([]); | const [type, setType] = React.useState([]); | ||||
| const [status, setStatus] = React.useState({ key: 0, label: '全部', type: 'all' }); | |||||
| const [status, setStatus] = React.useState([{ key: 0, label: 'All', labelCht: "全部", type: 'all' }]); | |||||
| const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | ||||
| const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | ||||
| const [selectedLabelsString, setSelectedLabelsString] = React.useState(''); | |||||
| const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
| const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
| data.status = selectedLabelsString | |||||
| let typeArray = []; | let typeArray = []; | ||||
| for (let i = 0; i < type.length; i++) { | for (let i = 0; i < type.length; i++) { | ||||
| @@ -35,14 +36,14 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
| dateFrom: data.dateFrom, | dateFrom: data.dateFrom, | ||||
| dateTo: data.dateTo, | dateTo: data.dateTo, | ||||
| contact: data.contact, | contact: data.contact, | ||||
| status: (status?.type&&status?.type!= 'all')?status?.type:"", | |||||
| status: (data.status === "" || data.status.includes('all')) ? "" : data.status, | |||||
| }; | }; | ||||
| applySearch(temp); | applySearch(temp); | ||||
| }; | }; | ||||
| function resetForm() { | function resetForm() { | ||||
| setType([]); | setType([]); | ||||
| setStatus({ key: 0, label: '全部', type: 'all' }); | |||||
| setStatus({ key: 0, label: 'All', labelCht: "全部", type: 'all' }); | |||||
| reset(); | reset(); | ||||
| } | } | ||||
| @@ -125,31 +126,45 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
| <Autocomplete | <Autocomplete | ||||
| multiple | |||||
| {...register("status")} | {...register("status")} | ||||
| disablePortal | |||||
| id="status" | id="status" | ||||
| filterOptions={(options)=>options} | |||||
| // filterOptions={(options)=>options} | |||||
| options={ | options={ | ||||
| localStorage.getItem('userData').creditor? | localStorage.getItem('userData').creditor? | ||||
| ComboData.publicNoticeStatic_Creditor: | ComboData.publicNoticeStatic_Creditor: | ||||
| ComboData.publicNoticeStatic | ComboData.publicNoticeStatic | ||||
| } | } | ||||
| values={status} | values={status} | ||||
| inputValue={status?.labelCht} | |||||
| // inputValue={status?.labelCht} | |||||
| getOptionLabel={(option)=>option.labelCht} | getOptionLabel={(option)=>option.labelCht} | ||||
| onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
| if (newValue !== null) { | |||||
| setStatus(newValue); | |||||
| console.log(newValue) | |||||
| const findAllIndex = newValue.findIndex((ele) => { | |||||
| return ele.type === "all" | |||||
| }) | |||||
| if (findAllIndex > -1) { | |||||
| setStatus([newValue[findAllIndex]]); | |||||
| setSelectedLabelsString('all') | |||||
| } else { | |||||
| const selectedLabels = newValue.map(option => option.type); | |||||
| const selectedLabelsString = `${selectedLabels.join(',')}`; | |||||
| setStatus(newValue); | |||||
| console.log(newValue) | |||||
| setSelectedLabelsString(selectedLabelsString); | |||||
| } | } | ||||
| console.log(selectedLabelsString) | |||||
| console.log(status) | |||||
| }} | }} | ||||
| renderInput={(params) => ( | renderInput={(params) => ( | ||||
| <TextField {...params} | <TextField {...params} | ||||
| label="狀態" | label="狀態" | ||||
| /> | /> | ||||
| )} | )} | ||||
| InputLabelProps={{ | |||||
| shrink: true | |||||
| }} | |||||
| // InputLabelProps={{ | |||||
| // shrink: true | |||||
| // }} | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| {/*<Grid item xs={9} s={6} md={5} lg={3} sx={{ml:3, mr:3, mb:3}}>*/} | {/*<Grid item xs={9} s={6} md={5} lg={3} sx={{ml:3, mr:3, mb:3}}>*/} | ||||
| @@ -90,6 +90,9 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| } | } | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/publicNotice/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{ height: 400, width: '100%' }}> | <div style={{ height: 400, width: '100%' }}> | ||||
| @@ -102,6 +105,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| paginationModel: { page: 0, pageSize: 5 }, | paginationModel: { page: 0, pageSize: 5 }, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -107,6 +107,11 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| return Array(+(zero > 0 && zero)).join("0") + num; | return Array(+(zero > 0 && zero)).join("0") + num; | ||||
| } | } | ||||
| function handleRowDoubleClick(params) { | |||||
| // handleEditClick(params) | |||||
| navigate('/application/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{ height: 400, width: '100%' }}> | <div style={{ height: 400, width: '100%' }}> | ||||
| @@ -118,6 +123,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| paginationModel: { page: 0, pageSize: 5 }, | paginationModel: { page: 0, pageSize: 5 }, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -7,7 +7,7 @@ import { | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import MainCard from "components/MainCard"; | import MainCard from "components/MainCard"; | ||||
| import { useForm } from "react-hook-form"; | import { useForm } from "react-hook-form"; | ||||
| import * as React from "react"; | |||||
| import * as React from "react"; | |||||
| import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
| import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -17,11 +17,13 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||||
| }) => { | }) => { | ||||
| const [type, setType] = React.useState([]); | const [type, setType] = React.useState([]); | ||||
| const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' }); | |||||
| // const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' }); | |||||
| const [orgSelected, setOrgSelected] = React.useState({}); | const [orgSelected, setOrgSelected] = React.useState({}); | ||||
| const [orgCombo, setOrgCombo] = React.useState(); | const [orgCombo, setOrgCombo] = React.useState(); | ||||
| const [issueSelected, setIssueSelected] = React.useState({}); | const [issueSelected, setIssueSelected] = React.useState({}); | ||||
| const [issueCombo, setIssueCombo] = React.useState([]); | const [issueCombo, setIssueCombo] = React.useState([]); | ||||
| const [selectedStatus, setSelectedStatus] = React.useState([]); | |||||
| const [selectedLabelsString, setSelectedLabelsString] = React.useState(''); | |||||
| const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | ||||
| const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | ||||
| @@ -29,7 +31,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||||
| const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
| const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
| data.status = selectedLabelsString | |||||
| let typeArray = []; | let typeArray = []; | ||||
| for (let i = 0; i < type.length; i++) { | for (let i = 0; i < type.length; i++) { | ||||
| @@ -41,7 +43,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||||
| dateFrom: data.dateFrom, | dateFrom: data.dateFrom, | ||||
| dateTo: data.dateTo, | dateTo: data.dateTo, | ||||
| contact: data.contact, | contact: data.contact, | ||||
| status: (status?.type && status?.type != 'all') ? status?.type : "", | |||||
| status: (data.status === '' || data.status.includes("all")) ? "" : data.status, | |||||
| orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", | orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", | ||||
| issueId: issueSelected?.id, | issueId: issueSelected?.id, | ||||
| groupNo: data.groupNo, | groupNo: data.groupNo, | ||||
| @@ -63,7 +65,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||||
| function resetForm() { | function resetForm() { | ||||
| setType([]); | setType([]); | ||||
| setStatus({ key: 0, label: 'All', type: 'all' }); | |||||
| // setStatus({ key: 0, label: 'All', type: 'all' }); | |||||
| setOrgSelected({}); | setOrgSelected({}); | ||||
| setIssueSelected({}); | setIssueSelected({}); | ||||
| reset(); | reset(); | ||||
| @@ -162,7 +164,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||||
| </Grid> | </Grid> | ||||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
| <Autocomplete | |||||
| {/* <Autocomplete | |||||
| {...register("status")} | {...register("status")} | ||||
| disablePortal | disablePortal | ||||
| id="status" | id="status" | ||||
| @@ -183,6 +185,35 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu | |||||
| InputLabelProps={{ | InputLabelProps={{ | ||||
| shrink: true | shrink: true | ||||
| }} | }} | ||||
| /> */} | |||||
| <Autocomplete | |||||
| multiple | |||||
| {...register("status")} | |||||
| id="status" | |||||
| options={ComboData.publicNoticeStatic_GLD} | |||||
| value={selectedStatus} | |||||
| onChange={(event, newValue) => { | |||||
| const findAllIndex = newValue.findIndex((ele) => { | |||||
| return ele.type === "all" | |||||
| }) | |||||
| if (findAllIndex > -1) { | |||||
| setSelectedStatus([newValue[findAllIndex]]); | |||||
| setSelectedLabelsString('all') | |||||
| } else { | |||||
| const selectedLabels = newValue.map(option => option.type); | |||||
| const selectedLabelsString = `${selectedLabels.join(',')}`; | |||||
| setSelectedStatus(newValue); | |||||
| setSelectedLabelsString(selectedLabelsString); | |||||
| } | |||||
| }} | |||||
| getOptionLabel={(option) => option.label} | |||||
| renderInput={(params) => ( | |||||
| <TextField | |||||
| {...params} | |||||
| label="Status" | |||||
| /> | |||||
| )} | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| @@ -20,6 +20,8 @@ const UserAuthorityCard = Loadable(lazy(() => import('./UserAuthorityCard'))); | |||||
| import { | import { | ||||
| GeneralConfirmWindow, | GeneralConfirmWindow, | ||||
| getDeletedRecordWithRefList, | getDeletedRecordWithRefList, | ||||
| notifyDeleteSuccess, | |||||
| notifySaveSuccess, | |||||
| } from "../../../utils/CommonFunction"; | } from "../../../utils/CommonFunction"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -71,7 +73,7 @@ const UserMaintainPage = () => { | |||||
| ) | ) | ||||
| .then((response) => { | .then((response) => { | ||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| // notifyDeleteSuccess(); | |||||
| notifyDeleteSuccess(); | |||||
| setIsWindowOpen(false); | setIsWindowOpen(false); | ||||
| navigate('/userSearchview'); | navigate('/userSearchview'); | ||||
| } | } | ||||
| @@ -148,7 +150,7 @@ const UserMaintainPage = () => { | |||||
| }, | }, | ||||
| ).then((response) => { | ).then((response) => { | ||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| // notifySaveSuccess(); | |||||
| notifySaveSuccess(); | |||||
| navigate('/userSearchview'); | navigate('/userSearchview'); | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -173,7 +175,7 @@ const UserMaintainPage = () => { | |||||
| }, | }, | ||||
| ).then((response) => { | ).then((response) => { | ||||
| if (response.status === 200) { | if (response.status === 200) { | ||||
| // notifySaveSuccess(); | |||||
| notifySaveSuccess(); | |||||
| navigate('/userSearchview'); | navigate('/userSearchview'); | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -15,6 +15,7 @@ import * as ComboData from "../../../utils/ComboData"; | |||||
| const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -80,6 +81,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| }, | }, | ||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess(); | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -106,6 +108,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| HttpUtils.get({ | HttpUtils.get({ | ||||
| url: UrlUtils.GET_IND_USER_VERIFY + "/" + formData.id, | url: UrlUtils.GET_IND_USER_VERIFY + "/" + formData.id, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyVerifySuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -115,6 +118,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| HttpUtils.get({ | HttpUtils.get({ | ||||
| url: UrlUtils.GET_USER_LOCK + "/" + formData.id, | url: UrlUtils.GET_USER_LOCK + "/" + formData.id, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyLockSuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -124,6 +128,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| HttpUtils.get({ | HttpUtils.get({ | ||||
| url: UrlUtils.GET_USER_UNLOCK + "/" + formData.id, | url: UrlUtils.GET_USER_UNLOCK + "/" + formData.id, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyActiveSuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -16,6 +16,7 @@ import * as yup from 'yup'; | |||||
| const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
| import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -86,6 +87,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifySaveSuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -119,6 +121,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| HttpUtils.get({ | HttpUtils.get({ | ||||
| url: UrlUtils.GET_IND_USER_VERIFY + "/" + userData.id, | url: UrlUtils.GET_IND_USER_VERIFY + "/" + userData.id, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyVerifySuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -136,6 +139,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| HttpUtils.get({ | HttpUtils.get({ | ||||
| url: UrlUtils.GET_USER_LOCK + "/" + userData.id, | url: UrlUtils.GET_USER_LOCK + "/" + userData.id, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyLockSuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -152,6 +156,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| HttpUtils.get({ | HttpUtils.get({ | ||||
| url: UrlUtils.GET_USER_UNLOCK + "/" + userData.id, | url: UrlUtils.GET_USER_UNLOCK + "/" + userData.id, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| notifyActiveSuccess() | |||||
| loadDataFun(); | loadDataFun(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -31,9 +31,9 @@ const UserMaintainPage_Organization = () => { | |||||
| loadData(); | loadData(); | ||||
| },[]); | },[]); | ||||
| const reloadPage=()=>{ | |||||
| window.location.reload(false); | |||||
| } | |||||
| // const reloadPage=()=>{ | |||||
| // window.location.reload(false); | |||||
| // } | |||||
| const loadData = ()=>{ | const loadData = ()=>{ | ||||
| setLoding(true); | setLoding(true); | ||||
| @@ -107,7 +107,7 @@ const UserMaintainPage_Organization = () => { | |||||
| <Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
| <UserInformationCard | <UserInformationCard | ||||
| userData={userData} | userData={userData} | ||||
| loadDataFun={reloadPage} | |||||
| loadDataFun={loadData} | |||||
| orgData={orgData} | orgData={orgData} | ||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| @@ -121,6 +121,10 @@ export default function UserTable({recordList,setChangeLocked}) { | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/user/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{height: "fit-content", width: '100%'}}> | <div style={{height: "fit-content", width: '100%'}}> | ||||
| <FiDataGrid | <FiDataGrid | ||||
| @@ -130,7 +134,8 @@ export default function UserTable({recordList,setChangeLocked}) { | |||||
| pagination: { | pagination: { | ||||
| paginationModel: {page: 0, pageSize: 5}, | paginationModel: {page: 0, pageSize: 5}, | ||||
| }, | }, | ||||
| }} | |||||
| }} | |||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -129,6 +129,10 @@ export default function UserTable_Individual({ recordList }) { | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/indUser/' + params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{ height: "fit-content", width: '100%' }}> | <div style={{ height: "fit-content", width: '100%' }}> | ||||
| <FiDataGrid | <FiDataGrid | ||||
| @@ -139,7 +143,7 @@ export default function UserTable_Individual({ recordList }) { | |||||
| paginationModel: { page: 0, pageSize: 5 }, | paginationModel: { page: 0, pageSize: 5 }, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -126,6 +126,10 @@ export default function UserTable_Organization({recordList}) { | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/orgUser/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{height: "fit-content", width: '100%'}}> | <div style={{height: "fit-content", width: '100%'}}> | ||||
| <FiDataGrid | <FiDataGrid | ||||
| @@ -136,6 +140,7 @@ export default function UserTable_Organization({recordList}) { | |||||
| paginationModel: {page: 0, pageSize: 5}, | paginationModel: {page: 0, pageSize: 5}, | ||||
| }, | }, | ||||
| }} | }} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -34,6 +34,7 @@ import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; | |||||
| import axios from "axios"; | import axios from "axios"; | ||||
| import {useDispatch} from "react-redux"; | import {useDispatch} from "react-redux"; | ||||
| import {handleLogin} from "auth/index"; | import {handleLogin} from "auth/index"; | ||||
| import { notifyActionSuccess } from 'utils/CommonFunction'; | |||||
| // ============================|| FIREBASE - LOGIN ||============================ // | // ============================|| FIREBASE - LOGIN ||============================ // | ||||
| const AuthLogin = () => { | const AuthLogin = () => { | ||||
| @@ -83,7 +84,6 @@ const AuthLogin = () => { | |||||
| const data = {...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken} | const data = {...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken} | ||||
| dispatch(handleLogin(data)) | dispatch(handleLogin(data)) | ||||
| navigate('/dashboard'); | navigate('/dashboard'); | ||||
| //history.push(getHomeRouteForLoggedInUser("user")) | //history.push(getHomeRouteForLoggedInUser("user")) | ||||
| @@ -136,8 +136,8 @@ const BusCustomFormWizard = (props) => { | |||||
| data.password !==""&& | data.password !==""&& | ||||
| data.confirmPassword !==""&& | data.confirmPassword !==""&& | ||||
| data.password == data.confirmPassword&& | data.password == data.confirmPassword&& | ||||
| (data.enCompanyName !=="" || selectedAddress5 ==="內地")&& | |||||
| data.chCompanyName !==""&& | |||||
| // (data.enCompanyName !=="" || selectedAddress5 ==="內地")&& | |||||
| (data.chCompanyName !=="" || data.enCompanyName !== "")&& | |||||
| data.enName !==""&& | data.enName !==""&& | ||||
| data.chName !==""&& | data.chName !==""&& | ||||
| data.address1 !==""&& | data.address1 !==""&& | ||||
| @@ -400,6 +400,7 @@ const BusCustomFormWizard = (props) => { | |||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| const formik = useFormik({ | const formik = useFormik({ | ||||
| initialValues:({ | initialValues:({ | ||||
| @@ -423,6 +424,7 @@ const BusCustomFormWizard = (props) => { | |||||
| emailConfirm:'', | emailConfirm:'', | ||||
| captchaField:'' | captchaField:'' | ||||
| }), | }), | ||||
| validationSchema:yup.object().shape({ | validationSchema:yup.object().shape({ | ||||
| username: yup.string().min(6,'用戶名稱最少6位').required('請輸入用戶名稱') | username: yup.string().min(6,'用戶名稱最少6位').required('請輸入用戶名稱') | ||||
| .matches(/^[aA-zZ0-9\s]+$/, "用戶名稱不包含特殊字符") | .matches(/^[aA-zZ0-9\s]+$/, "用戶名稱不包含特殊字符") | ||||
| @@ -435,8 +437,14 @@ const BusCustomFormWizard = (props) => { | |||||
| .matches(/^(?=.*[!@#%&])/, '請包括最少1個特殊字符'), | .matches(/^(?=.*[!@#%&])/, '請包括最少1個特殊字符'), | ||||
| confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'), | confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'), | ||||
| enName: yup.string().max(255).required('請輸入英文姓名'), | enName: yup.string().max(255).required('請輸入英文姓名'), | ||||
| enCompanyName: yup.string().max(255).required('請輸入英文名稱'), | |||||
| chCompanyName: yup.string().max(255).required('請輸入中文名稱'), | |||||
| enCompanyName: yup.string().matches(/^[^$^*()]+$/, 'No special characters $/^/*/(/)').when('chCompanyName', { | |||||
| is: (chCompanyName) => !chCompanyName || chCompanyName.length === 0, | |||||
| then: yup.string().required('Please enter either English or Chinese name'), | |||||
| }), | |||||
| chCompanyName: yup.string().matches(/^[^$^*()]+$/, '不包含特殊字符 $/^/*/(/)').when('enCompanyName', { | |||||
| is: (enCompanyName) => !enCompanyName || enCompanyName.length === 0, | |||||
| then: yup.string().required('請輸入英文或中文名稱'), | |||||
| }), | |||||
| chName: yup.string().max(255).required('請輸入中文姓名'), | chName: yup.string().max(255).required('請輸入中文姓名'), | ||||
| address1: yup.string().max(255).required('請輸入第一行地址'), | address1: yup.string().max(255).required('請輸入第一行地址'), | ||||
| address2: yup.string().max(255).required('請輸入第二行地址'), | address2: yup.string().max(255).required('請輸入第二行地址'), | ||||
| @@ -450,7 +458,7 @@ const BusCustomFormWizard = (props) => { | |||||
| brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], '請輸入商業登記證有效日期').max("2099-12-31", '請輸入商業登記證有效日期').required('請輸入商業登記證有效日期'), | brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], '請輸入商業登記證有效日期').max("2099-12-31", '請輸入商業登記證有效日期').required('請輸入商業登記證有效日期'), | ||||
| brNo: yup.string().min(8,'請輸入商業登記證號碼').required('請輸入商業登記證號碼'), | brNo: yup.string().min(8,'請輸入商業登記證號碼').required('請輸入商業登記證號碼'), | ||||
| captchaField: yup.string().required('請輸入驗證').oneOf([captcha], '請輸入有效驗證'), | captchaField: yup.string().required('請輸入驗證').oneOf([captcha], '請輸入有效驗證'), | ||||
| }) | |||||
| }, ['enCompanyName', 'chCompanyName']), | |||||
| }); | }); | ||||
| @@ -650,10 +658,16 @@ const BusCustomFormWizard = (props) => { | |||||
| </Stack> | </Stack> | ||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12} md={12}> | |||||
| <Typography fontSize="0.75rem"> | |||||
| <br/> | |||||
| •請輸入機構/公司英文名稱或中文名稱<br/> | |||||
| •Please enter the English/Chinese name of the organisation/company | |||||
| </Typography> | |||||
| </Grid> | |||||
| <Grid item xs={12} md={6}> | <Grid item xs={12} md={6}> | ||||
| <Stack spacing={1}> | <Stack spacing={1}> | ||||
| <InputLabel htmlFor="enCompanyName-signup">機構/公司英文名稱 | <InputLabel htmlFor="enCompanyName-signup">機構/公司英文名稱 | ||||
| {selectedAddress5 === "內地" ? "" : <span style={{color: '#f10000'}}>*</span>} | |||||
| </InputLabel> | </InputLabel> | ||||
| <OutlinedInput | <OutlinedInput | ||||
| id="enCompanyName-login" | id="enCompanyName-login" | ||||
| @@ -683,7 +697,6 @@ const BusCustomFormWizard = (props) => { | |||||
| <Grid item xs={12} md={6}> | <Grid item xs={12} md={6}> | ||||
| <Stack spacing={1}> | <Stack spacing={1}> | ||||
| <InputLabel htmlFor="chCompanyName-signup">機構/公司中文名稱 | <InputLabel htmlFor="chCompanyName-signup">機構/公司中文名稱 | ||||
| <span style={{color: '#f10000'}}>*</span> | |||||
| </InputLabel> | </InputLabel> | ||||
| <OutlinedInput | <OutlinedInput | ||||
| fullWidth | fullWidth | ||||
| @@ -12,8 +12,9 @@ import { | |||||
| GeneralConfirmWindow, | GeneralConfirmWindow, | ||||
| getDeletedRecordWithRefList, | getDeletedRecordWithRefList, | ||||
| getIdList, | getIdList, | ||||
| notifyDeleteSuccess, | |||||
| // notifyDeleteSuccess, | // notifyDeleteSuccess, | ||||
| // notifySaveSuccess | |||||
| notifySaveSuccess | |||||
| } from "../../utils/CommonFunction"; | } from "../../utils/CommonFunction"; | ||||
| import {POST_AND_UPDATE_USER_GROUP,GET_GROUP_LIST_PATH } from "../../utils/ApiPathConst"; | import {POST_AND_UPDATE_USER_GROUP,GET_GROUP_LIST_PATH } from "../../utils/ApiPathConst"; | ||||
| @@ -58,7 +59,7 @@ const UserMaintainPage = () => { | |||||
| ) | ) | ||||
| .then((response) => { | .then((response) => { | ||||
| if (response.status === 204) { | if (response.status === 204) { | ||||
| // notifyDeleteSuccess(); | |||||
| notifyDeleteSuccess() | |||||
| setIsWindowOpen(false); | setIsWindowOpen(false); | ||||
| navigate('/usergroupSearchview'); | navigate('/usergroupSearchview'); | ||||
| } | } | ||||
| @@ -142,8 +143,8 @@ const UserMaintainPage = () => { | |||||
| ) | ) | ||||
| .then((response) => { | .then((response) => { | ||||
| if (response.status === 200) { | if (response.status === 200) { | ||||
| // notifySaveSuccess(); | |||||
| navigate('/usergroupSearchview'); | navigate('/usergroupSearchview'); | ||||
| notifySaveSuccess() | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(error => { | .catch(error => { | ||||
| @@ -54,6 +54,10 @@ export default function UserGroupTable({recordList}) { | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| function handleRowDoubleClick(params) { | |||||
| navigate('/userGroup/'+ params.id); | |||||
| } | |||||
| return ( | return ( | ||||
| <div style={{height: "fit-content", width: '100%'}}> | <div style={{height: "fit-content", width: '100%'}}> | ||||
| <FiDataGrid | <FiDataGrid | ||||
| @@ -65,6 +69,7 @@ export default function UserGroupTable({recordList}) { | |||||
| }, | }, | ||||
| }} | }} | ||||
| pageSizeOptions={[10, 15, 20]} | pageSizeOptions={[10, 15, 20]} | ||||
| onRowDoubleClick={handleRowDoubleClick} | |||||
| /> | /> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -6,6 +6,7 @@ import DialogActions from "@mui/material/DialogActions"; | |||||
| import {Button} from "@mui/material"; | import {Button} from "@mui/material"; | ||||
| import Dialog from "@mui/material/Dialog"; | import Dialog from "@mui/material/Dialog"; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| import { toast } from "react-toastify"; | |||||
| export function getDeletedRecordWithRefList(referenceList, updatedList){ | export function getDeletedRecordWithRefList(referenceList, updatedList){ | ||||
| return referenceList.filter(x => !updatedList.includes(x)) ; | return referenceList.filter(x => !updatedList.includes(x)) ; | ||||
| @@ -48,18 +49,97 @@ export function getDateString(queryDateArray) { | |||||
| ) | ) | ||||
| } | } | ||||
| // export const notifySaveSuccess = () => toast.success('Save success!', { | |||||
| // position: "bottom-right", | |||||
| // autoClose: 5000, | |||||
| // hideProgressBar: false, | |||||
| // closeOnClick: true, | |||||
| // pauseOnHover: true, | |||||
| // draggable: true, | |||||
| // progress: undefined, | |||||
| // theme: "light", | |||||
| // }); | |||||
| export const notifySaveSuccess = () => { | |||||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||||
| toast.success(userType === "GLD" ? 'Save success!' : "儲存成功!", { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyDeleteSuccess = () => toast.success('Delete Success!', { | |||||
| export const notifyCreateSuccess = () => { | |||||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||||
| toast.success(userType === "GLD" ? 'Create success!' : "創建成功!", { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyVerifySuccess = () => { | |||||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||||
| toast.success(userType === "GLD" ? 'Verify success!' : "驗證成功!", { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyDeleteSuccess = () => { | |||||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||||
| toast.success(userType === "GLD" ? 'Delete success!' : "刪除成功!", { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyLockSuccess = () => { | |||||
| toast.success('Lock success!', { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyActiveSuccess = () => { | |||||
| toast.success('Active success!', { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyDownloadSuccess = () => { | |||||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||||
| toast.success(userType === "GLD" ? 'Download success!' : "下載成功!", { | |||||
| position: "bottom-right", | |||||
| autoClose: 5000, | |||||
| hideProgressBar: false, | |||||
| closeOnClick: true, | |||||
| pauseOnHover: true, | |||||
| draggable: true, | |||||
| progress: undefined, | |||||
| theme: "light", | |||||
| })}; | |||||
| export const notifyActionSuccess = (actionMsg) => { | |||||
| toast.success(`${actionMsg}`, { | |||||
| position: "bottom-right", | position: "bottom-right", | ||||
| autoClose: 5000, | autoClose: 5000, | ||||
| hideProgressBar: false, | hideProgressBar: false, | ||||
| @@ -68,7 +148,7 @@ export const notifyDeleteSuccess = () => toast.success('Delete Success!', { | |||||
| draggable: true, | draggable: true, | ||||
| progress: undefined, | progress: undefined, | ||||
| theme: "light", | theme: "light", | ||||
| }); | |||||
| })}; | |||||
| export function prettyJson(json){ | export function prettyJson(json){ | ||||
| console.log(json); | console.log(json); | ||||