diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index a9b80fb..5d6eba1 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -121,6 +121,12 @@ function Header(props) {
  • Download XML
  • +
  • + Create DN +
  • +
  • + Demand Note +
  • diff --git a/src/pages/DemandNote/Create/DataGrid.js b/src/pages/DemandNote/Create/DataGrid.js new file mode 100644 index 0000000..3747f8b --- /dev/null +++ b/src/pages/DemandNote/Create/DataGrid.js @@ -0,0 +1,120 @@ +// material-ui +import * as React from 'react'; +import { + Button +} from '@mui/material'; +import * as DateUtils from "utils/DateUtils"; +import * as PublicNoteStatusUtils from "utils/statusUtils/PublicNoteStatusUtils" +import { FiDataGrid } from "components/FiDataGrid"; +// ==============================|| EVENT TABLE ||============================== // + +export default function SearchPublicNoticeTable({ recordList }) { + const [rows, setRows] = React.useState(recordList); + + const _sx = { + padding: "4 2 4 2", + boxShadow: 1, + border: 1, + borderColor: '#DDD', + '& .MuiDataGrid-cell': { + borderTop: 1, + borderBottom: 1, + borderColor: "#EEE" + }, + '& .MuiDataGrid-footerContainer': { + border: 1, + borderColor: "#EEE" + } + } + + React.useEffect(() => { + setRows(recordList); + }, [recordList]); + + const handleEditClick = (params) => () => { + window.open('/application/' + params.row.id); + }; + + const columns = [ + { + id: 'appNo', + field: 'appNo', + headerName: 'App No.', + flex: 1, + renderCell: (params) => { + return ; + }, + }, + { + field: 'status', + headerName: 'Status', + flex: 1, + renderCell: (params) => { + return PublicNoteStatusUtils.getStatusByTextEng(params.row.status); + } + }, + { + field: 'date', + headerName: 'Submit Date', + flex: 1, + renderCell: (params) => { + return DateUtils.datetimeStr(params.row.created); + } + }, + { + id: 'contactPerson', + field: 'contactPerson', + headerName: 'Contact Person', + flex: 1, + valueGetter: (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}
    + {contact} + ); + } + }, + { + id: 'groupNo', + field: 'groupNo', + headerName: 'Gazette Group', + flex: 1, + valueGetter: (params) => { + return (params?.value) ? (params?.value) : ""; + } + }, + ]; + + return ( +
    + + +
    + ); +} diff --git a/src/pages/DemandNote/Create/SearchForm.js b/src/pages/DemandNote/Create/SearchForm.js new file mode 100644 index 0000000..cc648fa --- /dev/null +++ b/src/pages/DemandNote/Create/SearchForm.js @@ -0,0 +1,178 @@ +// material-ui +import { + Button, + CardContent, + Grid, TextField, + Autocomplete, + Typography, + Dialog, DialogTitle, DialogContent, DialogActions, +} from '@mui/material'; +import MainCard from "components/MainCard"; +import * as React from "react"; +import * as FormatUtils from "utils/FormatUtils"; +import * as DateUtils from "utils/DateUtils"; +import * as UrlUtils from "utils/ApiPathConst"; +import * as HttpUtils from "utils/HttpUtils"; +import { useNavigate } from "react-router-dom"; +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const SearchPublicNoticeForm = ({ applySearch, issueComboData }) => { + + const [isFailPopUp, setIsFailPopUp] = React.useState(false); + const [failText, setFailText] = React.useState(""); + + const [issueSelected, setIssueSelected] = React.useState({}); + const [issueCombo, setIssueCombo] = React.useState([]); + const navigate = useNavigate() + + const _sx = { + padding: "4 2 4 2", + boxShadow: 1, + border: 1, + borderColor: '#DDD', + '& .MuiDataGrid-cell': { + borderTop: 1, + borderBottom: 1, + borderColor: "#EEE" + }, + '& .MuiDataGrid-footerContainer': { + border: 1, + borderColor: "#EEE" + } + } + + React.useEffect(() => { + if (issueComboData && issueComboData.length > 0) { + setIssueCombo(issueComboData); + } + }, [issueComboData]); + + function getIssueLabel(data) { + if (data == {}) return ""; + return data.year + + " Vol. " + FormatUtils.zeroPad(data.volume, 3) + + ", No. " + FormatUtils.zeroPad(data.issueNo, 2) + + ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); + } + + const onSubmit = () => { + if (!issueSelected?.id) { + setFailText("Fail Create: Please select Gazette Issue."); + setIsFailPopUp(true); + return; + } else { + HttpUtils.post({ + url: UrlUtils.DEMAND_NOTE_CREATE + "/" + issueSelected.id, + onSuccess: function () { + navigate('/paymentPage/demandNote'); + } + }); + } + + }; + + const onPreView = () => { + if (!issueSelected?.id) { + setFailText("Fail Preview : Please select Gazette Issue."); + setIsFailPopUp(true); + return; + } + const temp = { + issueId: issueSelected.id, + }; + applySearch(temp); + }; + + return ( + + +
    + {/*row 1*/} + + + Create + + + + {/*row 2*/} + + + + + getIssueLabel(option)} + onChange={(event, newValue) => { + if (newValue !== null) { + setIssueSelected(newValue); + } + }} + renderInput={(params) => ( + + )} + /> + + + + + + {/*last row*/} + + + + + + + + + +
    +
    + setIsFailPopUp(false)} > + Action Fail + + {failText} + + + + + +
    +
    + ); +}; + +export default SearchPublicNoticeForm; diff --git a/src/pages/DemandNote/Create/index.js b/src/pages/DemandNote/Create/index.js new file mode 100644 index 0000000..1c6cafe --- /dev/null +++ b/src/pages/DemandNote/Create/index.js @@ -0,0 +1,108 @@ +// material-ui +import { + Grid, + Typography, + Stack +} from '@mui/material'; +import MainCard from "components/MainCard"; +import * as UrlUtils from "utils/ApiPathConst"; +import * as HttpUtils from "utils/HttpUtils"; +import * as React from "react"; + + +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); +const SearchForm = Loadable(React.lazy(() => import('./SearchForm'))); +const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' + +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize:'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const Index = () => { + + const [record,setRecord] = React.useState([]); + const [issueCombo, setIssueCombo] = React.useState([]); + const [searchCriteria, setSearchCriteria] = React.useState({}); + const [onReady, setOnReady] = React.useState(false); + + React.useEffect(()=>{ + getIssueCombo(); + },[]); + + React.useEffect(() => { + setOnReady(true); + }, [record]); + + React.useEffect(() => { + loadGrid(); + }, [searchCriteria]); + + function loadGrid(){ + HttpUtils.get({ + url: UrlUtils.DEMAND_NOTE_PREVIEW+"/"+searchCriteria.issueId, + onSuccess: function(responseData){ + setRecord(responseData); + } + }); + } + + function getIssueCombo() { + HttpUtils.get({ + url: UrlUtils.GET_ISSUE_COMBO, + onSuccess: function (responseData) { + let combo = responseData; + setIssueCombo(combo); + } + }); + } + + + function applySearch(input) { + setSearchCriteria(input); + } + + return ( + !onReady ? + + : + + +
    + + Create DN + +
    +
    + {/*row 1*/} + + + + {/*row 2*/} + + + + + +
    + ); +}; + +export default Index; diff --git a/src/pages/DemandNote/Search/DataGrid.js b/src/pages/DemandNote/Search/DataGrid.js new file mode 100644 index 0000000..d0bd26d --- /dev/null +++ b/src/pages/DemandNote/Search/DataGrid.js @@ -0,0 +1,128 @@ +// material-ui +import * as React from 'react'; +import { + Button, + Box +} from '@mui/material'; +import * as DateUtils from "utils/DateUtils"; +import * as FormatUtils from "utils/FormatUtils"; +import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; +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: 'App No.', + width: 150, + cellClassName: 'actions', + renderCell: (params) => { + return ; + }, + }, + { + id: 'status', + field: 'status', + headerName: 'Status', + width: 175, + renderCell: (params) => { + return [StatusUtils.getStatusEng(params)] + }, + }, + { + id: 'created', + field: 'created', + headerName: 'Submit Date', + flex: 1, + valueGetter: (params) => { + return DateUtils.datetimeStr(params?.value); + } + }, + { + id: 'contactPerson', + field: 'contactPerson', + headerName: 'Contact Person', + flex: 2, + 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}
    + {contact} + ); + } + }, + { + id: 'groupNo', + field: 'groupNo', + headerName: 'Gazette Group', + flex: 1, + valueGetter: (params) => { + return (params?.value) ? (params?.value) : ""; + } + }, + { + id: 'issueId', + field: 'issueId', + headerName: 'Issue No', + flex: 1, + valueGetter: (params) => { + return params.row.issueYear + + " Vol. " + FormatUtils.zeroPad(params.row.issueVolume, 3) + + ", No. " + FormatUtils.zeroPad(params.row.issueNo, 2) + + ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); + } + }, + ]; + + function handleRowDoubleClick(params) { + // handleEditClick(params) + navigate('/application/' + params.id); + } + + return ( +
    + + 'auto'} + onRowDoubleClick={handleRowDoubleClick} + /> + +
    + ); +} diff --git a/src/pages/DemandNote/Search/SearchForm.js b/src/pages/DemandNote/Search/SearchForm.js new file mode 100644 index 0000000..76f25ad --- /dev/null +++ b/src/pages/DemandNote/Search/SearchForm.js @@ -0,0 +1,293 @@ +// material-ui +import { + Button, + CardContent, + Grid, TextField, + Autocomplete, + Typography +} from '@mui/material'; +import MainCard from "components/MainCard"; +import { useForm } from "react-hook-form"; +import * as React from "react"; +import * as ComboData from "utils/ComboData"; +import * as DateUtils from "utils/DateUtils"; +import * as FormatUtils from "utils/FormatUtils"; +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issueComboData +}) => { + + const [type, setType] = React.useState([]); + // const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' }); + const [orgSelected, setOrgSelected] = React.useState({}); + const [orgCombo, setOrgCombo] = React.useState(); + const [issueSelected, setIssueSelected] = 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 [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); + + const { reset, register, handleSubmit } = useForm() + const onSubmit = (data) => { + data.status = selectedLabelsString + let typeArray = []; + + for (let i = 0; i < type.length; i++) { + typeArray.push(type[i].label); + } + + const temp = { + appNo: data.appNo, + issueId: issueSelected?.id, + orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", + dnNo: data.dnNo, + dateFrom: data.dateFrom, + dateTo: data.dateTo, + status: (data.status === '' || data.status.includes("all")) ? "" : data.status, + }; + applySearch(temp); + }; + + React.useEffect(() => { + if (orgComboData && orgComboData.length > 0) { + setOrgCombo(orgComboData); + } + }, [orgComboData]); + + React.useEffect(() => { + if (issueComboData && issueComboData.length > 0) { + setIssueCombo(issueComboData); + } + }, [issueComboData]); + + function resetForm() { + setType([]); + // setStatus({ key: 0, label: 'All', type: 'all' }); + setOrgSelected({}); + setIssueSelected({}); + reset(); + } + + function getIssueLabel(data) { + if (data == {}) return ""; + return data.year + + " Vol. " + FormatUtils.zeroPad(data.volume, 3) + + ", No. " + FormatUtils.zeroPad(data.issueNo, 2) + + ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); + } + + return ( + + +
    + + {/*row 1*/} + + + + Search Form + + + + {/*row 2*/} + + + + getIssueLabel(option)} + onChange={(event, newValue) => { + if (newValue !== null) { + setIssueSelected(newValue); + } + }} + renderInput={(params) => ( + + )} + /> + + + + + + + { + orgCombo ? + + { + if (newValue !== null) { + setOrgSelected(newValue); + } + }} + renderInput={(params) => ( + + )} + /> + + : <> + } + + + + + + + + { + setMinDate(DateUtils.dateStr(newValue)); + }} + InputLabelProps={{ + shrink: true + }} + /> + + + + { + setMaxDate(DateUtils.dateStr(newValue)); + }} + id="dateTo" + type="date" + label={"Issue Date(To)"} + defaultValue={searchCriteria.dateTo} + /> + + + + + { + 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) => ( + + )} + /> + + + + + + + {/*last row*/} + + + + + + + + + + + +
    +
    + ); +}; + +export default SearchDemandNoteForm; diff --git a/src/pages/DemandNote/Search/index.js b/src/pages/DemandNote/Search/index.js new file mode 100644 index 0000000..236b99d --- /dev/null +++ b/src/pages/DemandNote/Search/index.js @@ -0,0 +1,127 @@ +// material-ui +import { + Grid, + Typography, + Stack +} 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 * as DateUtils from "utils/DateUtils"; + +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); +const SearchForm = Loadable(React.lazy(() => import('./SearchForm'))); +const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' + +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const UserSearchPage_Individual = () => { + + const [record, setRecord] = React.useState([]); + const [orgCombo, setOrgCombo] = React.useState([]); + const [issueCombo, setIssueCombo] = React.useState([]); + const [searchCriteria, setSearchCriteria] = React.useState({ + dateTo: DateUtils.dateStr(new Date()), + dateFrom: DateUtils.dateStr(new Date().setDate(new Date().getDate() - 14)), + }); + const [onReady, setOnReady] = React.useState(false); + + React.useEffect(() => { + getUserList(); + getOrgCombo(); + getIssueCombo(); + }, []); + + React.useEffect(() => { + setOnReady(true); + }, [record]); + + React.useEffect(() => { + getUserList(); + }, [searchCriteria]); + + function getUserList() { + HttpUtils.get({ + url: UrlUtils.GET_PUBLIC_NOTICE_LIST, + params: searchCriteria, + onSuccess: function (responseData) { + setRecord(responseData); + } + }); + } + + function getOrgCombo() { + HttpUtils.get({ + url: UrlUtils.GET_ORG_COMBO, + onSuccess: function (responseData) { + let combo = responseData; + setOrgCombo(combo); + } + }); + } + + function getIssueCombo() { + HttpUtils.get({ + url: UrlUtils.GET_ISSUE_COMBO, + onSuccess: function (responseData) { + let combo = responseData; + setIssueCombo(combo); + } + }); + } + + + function applySearch(input) { + setSearchCriteria(input); + } + + return ( + !onReady ? + + : + + +
    + + Application + +
    +
    + {/*row 1*/} + + + + {/*row 2*/} + + + + + +
    + ); +} +export default UserSearchPage_Individual; diff --git a/src/pages/OrganizationDetailPage/OrganizationCard.js b/src/pages/Organization/DetailPage/OrganizationCard.js similarity index 97% rename from src/pages/OrganizationDetailPage/OrganizationCard.js rename to src/pages/Organization/DetailPage/OrganizationCard.js index 6911dd7..15527aa 100644 --- a/src/pages/OrganizationDetailPage/OrganizationCard.js +++ b/src/pages/Organization/DetailPage/OrganizationCard.js @@ -3,16 +3,16 @@ import { Grid, Button, Checkbox, FormControlLabel, Typography } from '@mui/material'; // import { FormControlLabel } from '@material-ui/core'; -import MainCard from "../../components/MainCard"; +import MainCard from "../../../components/MainCard"; import * as React from "react"; import { useFormik } from 'formik'; import * as yup from 'yup'; import { useEffect, useState } from "react"; -import * as HttpUtils from '../../utils/HttpUtils'; -import * as UrlUtils from "../../utils/ApiPathConst"; -import * as FieldUtils from "../../utils/FieldUtils"; -import * as ComboData from "../../utils/ComboData"; -const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); +import * as HttpUtils from '../../../utils/HttpUtils'; +import * as UrlUtils from "../../../utils/ApiPathConst"; +import * as FieldUtils from "../../../utils/FieldUtils"; +import * as ComboData from "../../../utils/ComboData"; +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); import Loadable from 'components/Loadable'; import { lazy } from 'react'; import { notifySaveSuccess } from 'utils/CommonFunction'; diff --git a/src/pages/OrganizationDetailPage/index.js b/src/pages/Organization/DetailPage/index.js similarity index 94% rename from src/pages/OrganizationDetailPage/index.js rename to src/pages/Organization/DetailPage/index.js index 8be47cf..ad864a9 100644 --- a/src/pages/OrganizationDetailPage/index.js +++ b/src/pages/Organization/DetailPage/index.js @@ -2,15 +2,15 @@ import { Grid, Typography, Stack, Box, Button } from '@mui/material'; import { useEffect, useState } from "react"; import * as React from "react"; -import * as HttpUtils from "../../utils/HttpUtils"; +import * as HttpUtils from "../../../utils/HttpUtils"; import { useParams } from "react-router-dom"; -import * as UrlUtils from "../../utils/ApiPathConst"; -import * as DateUtils from "../../utils/DateUtils"; +import * as UrlUtils from "../../../utils/ApiPathConst"; +import * as DateUtils from "../../../utils/DateUtils"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; const InfoCard = Loadable(lazy(() => import('./OrganizationCard'))); -const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); import ForwardIcon from '@mui/icons-material/Forward'; import { useNavigate } from 'react-router-dom'; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' diff --git a/src/pages/OrganizationDetailPage_FromUser/OrganizationCard_loadFromUser.js b/src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js similarity index 96% rename from src/pages/OrganizationDetailPage_FromUser/OrganizationCard_loadFromUser.js rename to src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js index ce48d00..ccd54ae 100644 --- a/src/pages/OrganizationDetailPage_FromUser/OrganizationCard_loadFromUser.js +++ b/src/pages/Organization/DetailPage_FromUser/OrganizationCard_loadFromUser.js @@ -3,17 +3,17 @@ import { Grid, Button, Typography, Dialog, DialogTitle, DialogContent, DialogActions, } from '@mui/material'; -import MainCard from "../../components/MainCard"; +import MainCard from "../../../components/MainCard"; import * as React from "react"; import * as yup from 'yup'; import { useEffect, useState } from "react"; -import * as HttpUtils from '../../utils/HttpUtils'; -import * as UrlUtils from "../../utils/ApiPathConst"; -import * as FieldUtils from "../../utils/FieldUtils"; -import * as ComboData from "../../utils/ComboData"; +import * as HttpUtils from '../../../utils/HttpUtils'; +import * as UrlUtils from "../../../utils/ApiPathConst"; +import * as FieldUtils from "../../../utils/FieldUtils"; +import * as ComboData from "../../../utils/ComboData"; import { useNavigate } from "react-router-dom"; 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 { lazy } from 'react'; import { notifyCreateSuccess } from 'utils/CommonFunction'; diff --git a/src/pages/OrganizationDetailPage_FromUser/index.js b/src/pages/Organization/DetailPage_FromUser/index.js similarity index 92% rename from src/pages/OrganizationDetailPage_FromUser/index.js rename to src/pages/Organization/DetailPage_FromUser/index.js index 57f3bd5..b22849a 100644 --- a/src/pages/OrganizationDetailPage_FromUser/index.js +++ b/src/pages/Organization/DetailPage_FromUser/index.js @@ -2,16 +2,16 @@ import {Grid, Typography} from '@mui/material'; import {useEffect, useState} from "react"; import * as React from "react"; -import * as HttpUtils from "../../utils/HttpUtils"; +import * as HttpUtils from "../../../utils/HttpUtils"; import {useParams} from "react-router-dom"; import {useNavigate} from "react-router-dom"; -import * as UrlUtils from "../../utils/ApiPathConst"; -import * as DateUtils from "../../utils/DateUtils"; +import * as UrlUtils from "../../../utils/ApiPathConst"; +import * as DateUtils from "../../../utils/DateUtils"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; const InfoCard = Loadable(lazy(() => import('./OrganizationCard_loadFromUser'))); -const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); // ==============================|| DASHBOARD - DEFAULT ||============================== // diff --git a/src/pages/OrganizationSearchPage/OrganizationSearchForm.js b/src/pages/Organization/SearchPage/OrganizationSearchForm.js similarity index 98% rename from src/pages/OrganizationSearchPage/OrganizationSearchForm.js rename to src/pages/Organization/SearchPage/OrganizationSearchForm.js index 1756f9d..3f03328 100644 --- a/src/pages/OrganizationSearchPage/OrganizationSearchForm.js +++ b/src/pages/Organization/SearchPage/OrganizationSearchForm.js @@ -5,7 +5,7 @@ import { Grid, TextField, Typography } from '@mui/material'; -import MainCard from "../../components/MainCard"; +import MainCard from "../../../components/MainCard"; import {useForm} from "react-hook-form"; import { useState} from "react"; diff --git a/src/pages/OrganizationSearchPage/OrganizationTable.js b/src/pages/Organization/SearchPage/OrganizationTable.js similarity index 100% rename from src/pages/OrganizationSearchPage/OrganizationTable.js rename to src/pages/Organization/SearchPage/OrganizationTable.js diff --git a/src/pages/OrganizationSearchPage/index.js b/src/pages/Organization/SearchPage/index.js similarity index 91% rename from src/pages/OrganizationSearchPage/index.js rename to src/pages/Organization/SearchPage/index.js index 3995a76..5660b12 100644 --- a/src/pages/OrganizationSearchPage/index.js +++ b/src/pages/Organization/SearchPage/index.js @@ -2,19 +2,19 @@ import { Grid, Typography, Stack } from '@mui/material'; -import MainCard from "../../components/MainCard"; +import MainCard from "../../../components/MainCard"; import { useEffect, useState } from "react"; -import * as UrlUtils from "../../utils/ApiPathConst"; +import * as UrlUtils from "../../../utils/ApiPathConst"; import * as React from "react"; -import * as HttpUtils from "../../utils/HttpUtils"; +import * as HttpUtils from "../../../utils/HttpUtils"; // import LoadingComponent from "../extra-pages/LoadingComponent"; // import SearchForm from "./OrganizationSearchForm"; // import EventTable from "./OrganizationTable"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; -const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); const SearchForm = Loadable(lazy(() => import('./OrganizationSearchForm'))); const EventTable = Loadable(lazy(() => import('./OrganizationTable'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' diff --git a/src/routes/GLDUserRoutes.js b/src/routes/GLDUserRoutes.js index cf4ece2..6cc4f70 100644 --- a/src/routes/GLDUserRoutes.js +++ b/src/routes/GLDUserRoutes.js @@ -14,6 +14,8 @@ const ProofCreate_FromApp = Loadable(lazy(() => import('pages/Proof/Create_FromA const ProofReply_GLD = Loadable(lazy(() => import('pages/Proof/Reply_GLD'))); const PaymentSearch_GLD = Loadable(lazy(() => import('pages/Payment/Search_GLD'))); const PaymentDetails_GLD = Loadable(lazy(() => import('pages/Payment/Details_GLD'))); +const DemandNote_Create = Loadable(lazy(() => import('pages/DemandNote/Create'))); +const DemandNote_Search = Loadable(lazy(() => import('pages/DemandNote/Search'))); // ==============================|| MAIN ROUTING ||============================== // const GLDUserRoutes = { @@ -58,6 +60,14 @@ const GLDUserRoutes = { { path: '/paymentPage/details/:id', element: + }, + { + path: '/paymentPage/createDemandNote', + element: + }, + { + path: '/paymentPage/demandNote', + element: } ] }, diff --git a/src/routes/SettingRoutes.js b/src/routes/SettingRoutes.js index 1e712c4..6cf81c8 100644 --- a/src/routes/SettingRoutes.js +++ b/src/routes/SettingRoutes.js @@ -17,9 +17,9 @@ const UserSearchPage_Organization= Loadable(lazy(()=>import ('pages/User/SearchP const UserMaintainPage_Organization = Loadable(lazy(() => import('pages/User/DetailsPage_Organization'))); const UserGroupSearchPage = Loadable(lazy(() => import('pages/pnspsUserGroupSearchPage'))); const UserGroupDetailPage = Loadable(lazy(() => import('pages/pnspsUserGroupDetailPage'))); -const OrganizationSearchPage = Loadable(lazy(() => import('pages/OrganizationSearchPage'))); -const OrganizationDetailPage = Loadable(lazy(() => import('pages/OrganizationDetailPage'))); -const OrganizationDetailPage_fromUser = Loadable(lazy(() => import('pages/OrganizationDetailPage_FromUser'))); +const OrganizationSearchPage = Loadable(lazy(() => import('pages/Organization/SearchPage'))); +const OrganizationDetailPage = Loadable(lazy(() => import('pages/Organization/DetailPage'))); +const OrganizationDetailPage_fromUser = Loadable(lazy(() => import('pages/Organization/DetailPage_FromUser'))); const EmailTemplatePage = Loadable(lazy(() => import('pages/EmailTemplate/Search_GLD'))); const EmailTemplateDetailPage = Loadable(lazy(() => import('pages/EmailTemplate/Detail_GLD'))); diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index f1c4256..031e8b9 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -94,6 +94,9 @@ export const PAYMENT_LIST = apiPath+'/payment/list';//GET export const PAYMENT_LOAD = apiPath+'/payment/load';//GET export const PAYMENT_APP_LIST = apiPath+'/payment/applist';//POST +export const DEMAND_NOTE_PREVIEW = apiPath+'/demandNote/preview';//GET +export const DEMAND_NOTE_CREATE = apiPath+'/demandNote/create';//POST + diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index 0ca9d60..fd5c65e 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -75,6 +75,15 @@ export const paymentStatus = [ { key: 0, labelCht: '全部', label: 'All', type: 'all' }, { key: 1, labelCht: '成功', label:'Success', type: 'APPR' }, { key: 2, labelCht: '拒絕', label:'Reject', type: 'REJT' }, - { key: 2, labelCht: '取消', label:'Cancelled', type: 'CANC' }, - { key: 2, labelCht: '進行中', label:'In Progress', type: 'INPR' }, + { key: 3, labelCht: '取消', label:'Cancelled', type: 'CANC' }, + { key: 4, labelCht: '進行中', label:'In Progress', type: 'INPR' }, +]; + + +export const denmandNoteStatus = [ + { key: 0, labelCht: '全部', label: 'All', type: 'all' }, + { key: 1, labelCht: '待辦', label:'Pending', type: 'pending' }, + { key: 2, labelCht: '待支付', label:'To be Paid', type: 'to be paid' }, + { key: 3, labelCht: '已付費', label:'Paid', type: 'paid' }, + ]; \ No newline at end of file