Anna Ho 1 rok temu
rodzic
commit
53b077eb52
3 zmienionych plików z 39 dodań i 13 usunięć
  1. +31
    -12
      src/pages/Organization/SearchPage/OrganizationSearchForm.js
  2. +2
    -1
      src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js
  3. +6
    -0
      src/utils/ComboData.js

+ 31
- 12
src/pages/Organization/SearchPage/OrganizationSearchForm.js Wyświetl plik

@@ -4,23 +4,24 @@ import {
CardContent,
Grid, TextField,
Typography,
Checkbox, FormControlLabel,
Autocomplete,
} from '@mui/material';
import MainCard from "../../../components/MainCard";
import MainCard from "components/MainCard";
import { useForm } from "react-hook-form";

import { useState } from "react";
import * as React from "react";

import * as UrlUtils from "../../../utils/ApiPathConst";
import * as HttpUtils from "../../../utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst";
import * as HttpUtils from "utils/HttpUtils";
import * as ComboData from "utils/ComboData";
// ==============================|| DASHBOARD - DEFAULT ||============================== //


const OrganizationSearchForm = ({ applySearch }) => {

const [type, setType] = useState([]);
const [creditorSelected, setCreditorSelected] = React.useState({ key: 0, labelCht: '全部', label: 'All', type: 'all' });
const { reset, register, handleSubmit } = useForm()
const onSubmit = (data) => {

@@ -34,8 +35,12 @@ const OrganizationSearchForm = ({ applySearch }) => {
brNo: data.brNo,
enCompanyName: data.enCompanyName,
chCompanyName: data.chCompanyName,
searchCreditor: data.searchCreditor
};
if(creditorSelected.type == 'true'){
temp["creditor"] = true;
}else if(creditorSelected.type == 'false'){
temp["creditor"] = false;
}
applySearch(temp);
};

@@ -102,12 +107,26 @@ const OrganizationSearchForm = ({ applySearch }) => {
</Grid>

<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3}}>
<FormControlLabel
{...register("searchCreditor")}
control={<Checkbox/>}
label="Search Creditor Only"
id="searchCreditor"
/>
<Autocomplete
{...register("searchCreditor")}
id="searchCreditor"
size="small"
options={ComboData.CreditorStatus}
value={creditorSelected}
onChange={(event, newValue) => {
setCreditorSelected(newValue);
}}
getOptionLabel={(option) => option.label}
renderInput={(params) => (
<TextField
{...params}
label="Status"
InputLabelProps={{
shrink: true
}}
/>
)}
/>
</Grid>

</Grid>


+ 2
- 1
src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js Wyświetl plik

@@ -148,7 +148,8 @@ const ApplicationDetailCard = (
onClick={() => { checkExprityDate(true) }}
disabled={currentApplicationDetailData.status == "rejected"
|| currentApplicationDetailData.status == "cancelled"
|| currentApplicationDetailData.status == "paid"}
|| currentApplicationDetailData.status == "paid"
|| currentApplicationDetailData.creditor}
sx={{
textTransform: 'capitalize',
alignItems: 'end'


+ 6
- 0
src/utils/ComboData.js Wyświetl plik

@@ -86,4 +86,10 @@ export const denmandNoteStatus = [
{ key: 2, labelCht: '待支付', label:'To be Paid', type: 'to be paid' },
{ key: 3, labelCht: '已付費', label:'Paid', type: 'paid' },

];

export const CreditorStatus = [
{ key: 0, labelCht: '全部', label: 'All', type: 'all' },
{ key: 1, labelCht: '債權人', label:'Creditor', type: 'true' },
{ key: 2, labelCht: '非債權人', label:'No-Creditor', type: 'false' },
];

Ładowanie…
Anuluj
Zapisz