|
|
@@ -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> |
|
|
|