diff --git a/src/pages/Payment/Search_GLD/SearchForm.js b/src/pages/Payment/Search_GLD/SearchForm.js index d348365..f9620c4 100644 --- a/src/pages/Payment/Search_GLD/SearchForm.js +++ b/src/pages/Payment/Search_GLD/SearchForm.js @@ -3,12 +3,14 @@ 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 DateUtils from "utils/DateUtils"; +import * as ComboData from "utils/ComboData"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -16,6 +18,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); + const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); const _sx = { padding: "4 2 4 2", @@ -40,6 +43,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { code: data.code, dateFrom: data.dateFrom, dateTo: data.dateTo, + status : (status?.type && status?.type != 'all') ? status?.type : "", }; applySearch(temp); }; @@ -116,6 +120,33 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { /> + + options} + options={ComboData.paymentStatus} + value={status} + getOptionLabel={(option) => option.label} + inputValue={status?.label ? status?.label : ""} + onChange={(event, newValue) => { + if (newValue !== null) { + setStatus(newValue); + } + }} + renderInput={(params) => ( + + )} + InputLabelProps={{ + shrink: true + }} + /> + + + diff --git a/src/pages/Payment/Search_Public/SearchForm.js b/src/pages/Payment/Search_Public/SearchForm.js index 5346721..9367215 100644 --- a/src/pages/Payment/Search_Public/SearchForm.js +++ b/src/pages/Payment/Search_Public/SearchForm.js @@ -3,12 +3,14 @@ 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 DateUtils from "utils/DateUtils"; +import * as ComboData from "utils/ComboData"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -16,6 +18,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); + const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); const _sx = { padding: "4 2 4 2", @@ -40,6 +43,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { code: data.code, dateFrom: data.dateFrom, dateTo: data.dateTo, + status : (status?.type && status?.type != 'all') ? status?.type : "", }; applySearch(temp); }; @@ -116,6 +120,32 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { /> + + options} + options={ComboData.paymentStatus} + value={status} + getOptionLabel={(option) => option.labelCht} + inputValue={status?.labelCht ? status?.labelCht : ""} + onChange={(event, newValue) => { + if (newValue !== null) { + setStatus(newValue); + } + }} + renderInput={(params) => ( + + )} + InputLabelProps={{ + shrink: true + }} + /> + + diff --git a/src/pages/Proof/Search_Public/DataGrid.js b/src/pages/Proof/Search_Public/DataGrid.js index 72de2eb..004a483 100644 --- a/src/pages/Proof/Search_Public/DataGrid.js +++ b/src/pages/Proof/Search_Public/DataGrid.js @@ -5,6 +5,7 @@ import { } from '@mui/material'; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils" +import * as ProofStatus from "utils/statusUtils/ProofStatus"; import { useNavigate } from "react-router-dom"; import { FiDataGrid } from "components/FiDataGrid"; // ==============================|| EVENT TABLE ||============================== // @@ -110,15 +111,14 @@ export default function SearchPublicNoticeTable({ recordList }) { return params?.value ? DateUtils.datetimeStr(params?.value) : ""; } }, - // { - // id: 'groupTitle', - // field: 'groupTitle', - // headerName: '憲報類型', - // flex: 1, - // valueGetter: (params) => { - // return getGroupTitle(params?.value); - // } - // }, + { + id: 'actions', + headerName: '狀態', + flex: 1, + renderCell: (params) => { + return ProofStatus.getStatus_Cht(params); + }, + }, { id: 'fee', field: 'fee', diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index f49361d..0ca9d60 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -69,4 +69,12 @@ export const proofStatus = [ { key: 0, labelCht: '全部', label: 'All', type: 'all' }, { key: 1, labelCht: '已回覆', label:'Replied', type: 'T' }, // submitted and reviewed { key: 2, labelCht: '未回覆', label:'Pending Reply', type: 'F' }, +]; + +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' }, ]; \ No newline at end of file