| @@ -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 }) => { | |||
| /> | |||
| </Grid> | |||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||
| <Autocomplete | |||
| {...register("status")} | |||
| disablePortal={false} | |||
| id="status" | |||
| filterOptions={(options) => 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) => ( | |||
| <TextField {...params} | |||
| label="Status" | |||
| /> | |||
| )} | |||
| InputLabelProps={{ | |||
| shrink: true | |||
| }} | |||
| /> | |||
| </Grid> | |||
| </Grid> | |||
| @@ -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 }) => { | |||
| /> | |||
| </Grid> | |||
| <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||
| <Autocomplete | |||
| {...register("status")} | |||
| disablePortal={false} | |||
| id="status" | |||
| filterOptions={(options) => 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) => ( | |||
| <TextField {...params} | |||
| label="狀態" | |||
| /> | |||
| )} | |||
| InputLabelProps={{ | |||
| shrink: true | |||
| }} | |||
| /> | |||
| </Grid> | |||
| </Grid> | |||
| @@ -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', | |||
| @@ -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' }, | |||
| ]; | |||