|
|
|
@ -18,12 +18,12 @@ import CmmModal from 'views/form/Modal/CmmModal';
|
|
|
|
|
import SaveResidentTargetForm from './SaveResidentTargetForm';
|
|
|
|
|
import NumberFormat from 'react-number-format';
|
|
|
|
|
import ExcelDownload from 'views/form/ExcelDownload';
|
|
|
|
|
import { findParkingTargets, saveParkingTargets } from 'apis/parking';
|
|
|
|
|
import { findResidentJudgeTargets, saveResidentJudgeTargets } from 'apis/resident';
|
|
|
|
|
|
|
|
|
|
const ResidentRegister = () => {
|
|
|
|
|
const [rcIrTransfer, setRcIrTransfer] = useState('1');
|
|
|
|
|
const [rcSeq1, setRcSeq1] = useState('2022200801');
|
|
|
|
|
const [rcSeq2, setRcSeq2] = useState('2022200899');
|
|
|
|
|
const [scTransfer, setScTransfer] = useState('1');
|
|
|
|
|
const [scSeq1, setScSeq1] = useState(2022000001);
|
|
|
|
|
const [scSeq2, setScSeq2] = useState(2022000899);
|
|
|
|
|
const [selectionModel, setSelectionModel] = useState([]);
|
|
|
|
|
const [totalCount, setTotalCount] = useState(0);
|
|
|
|
|
const [rowsStatus, setRowsStatus] = useState({
|
|
|
|
@ -35,30 +35,29 @@ const ResidentRegister = () => {
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{ headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
|
|
|
|
|
{ headerName: '접수번호', headerAlign: 'center', field: 'rcSeq', align: 'center' },
|
|
|
|
|
{ headerName: '최초차량번호', headerAlign: 'center', field: 'mmOcarno', align: 'center', minWidth: 110 },
|
|
|
|
|
{ headerName: '최종차량번호', headerAlign: 'center', field: 'mmNcarno', align: 'center', minWidth: 110 },
|
|
|
|
|
{ headerName: '성명', headerAlign: 'center', field: 'rcName', minWidth: 150 },
|
|
|
|
|
{ headerName: '진술유형', headerAlign: 'center', field: 'rcContDocNm', minWidth: 130 },
|
|
|
|
|
{ headerName: '접수번호', headerAlign: 'center', field: 'scSeq', align: 'center' },
|
|
|
|
|
{ headerName: '차량번호', headerAlign: 'center', field: 'scCarnum', align: 'center', minWidth: 110 },
|
|
|
|
|
{ headerName: '성명', headerAlign: 'center', field: 'scName', minWidth: 150 },
|
|
|
|
|
{ headerName: '진술유형', headerAlign: 'center', field: 'scContDocNm', minWidth: 130 },
|
|
|
|
|
{
|
|
|
|
|
headerName: '접수일자',
|
|
|
|
|
headerAlign: 'center',
|
|
|
|
|
field: 'rcDate',
|
|
|
|
|
field: 'scCdate',
|
|
|
|
|
align: 'center',
|
|
|
|
|
format: '####-##-##'
|
|
|
|
|
// valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`
|
|
|
|
|
},
|
|
|
|
|
{ headerName: '접수방법', headerAlign: 'center', field: 'rcIngbNm', align: 'center' }
|
|
|
|
|
{ headerName: '접수방법', headerAlign: 'center', field: 'scIngbNm', align: 'center' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const search = () => {
|
|
|
|
|
const params = {
|
|
|
|
|
rcIrTransfer,
|
|
|
|
|
rcSeq1,
|
|
|
|
|
rcSeq2
|
|
|
|
|
scTransfer,
|
|
|
|
|
scSeq1,
|
|
|
|
|
scSeq2
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
findParkingTargets(params).then((response) => {
|
|
|
|
|
findResidentJudgeTargets(params).then((response) => {
|
|
|
|
|
if (response && response.data) {
|
|
|
|
|
setSelectionModel([]);
|
|
|
|
|
setTotalCount(response.count);
|
|
|
|
@ -79,28 +78,28 @@ const ResidentRegister = () => {
|
|
|
|
|
const submitResidentTargets = (params) => {
|
|
|
|
|
const param = {
|
|
|
|
|
...params,
|
|
|
|
|
rcIrTransfer,
|
|
|
|
|
rcSeq1,
|
|
|
|
|
rcSeq2,
|
|
|
|
|
rcCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].rcCode)
|
|
|
|
|
scTransfer,
|
|
|
|
|
scSeq1,
|
|
|
|
|
scSeq2,
|
|
|
|
|
scCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].scCode)
|
|
|
|
|
};
|
|
|
|
|
setOpen(false);
|
|
|
|
|
// return false;
|
|
|
|
|
console.log(param);
|
|
|
|
|
|
|
|
|
|
saveParkingTargets(param).then(() => {
|
|
|
|
|
saveResidentJudgeTargets(param).then(() => {
|
|
|
|
|
setSelectionModel([]);
|
|
|
|
|
search();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
|
|
if (rcSeq1 && rcSeq2) {
|
|
|
|
|
if (scSeq1 && scSeq2) {
|
|
|
|
|
search();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleOnKeyDown = (event) => {
|
|
|
|
|
if (event.type === 'keydown' && event.key === 'Enter' && rcSeq1 && rcSeq2) {
|
|
|
|
|
if (event.type === 'keydown' && event.key === 'Enter' && scSeq1 && scSeq2) {
|
|
|
|
|
search();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -123,8 +122,8 @@ const ResidentRegister = () => {
|
|
|
|
|
row
|
|
|
|
|
aria-label="category"
|
|
|
|
|
name="row-radio-buttons-group"
|
|
|
|
|
value={rcIrTransfer}
|
|
|
|
|
onChange={(e) => setRcIrTransfer(e.target.value)}
|
|
|
|
|
value={scTransfer}
|
|
|
|
|
onChange={(e) => setScTransfer(e.target.value)}
|
|
|
|
|
>
|
|
|
|
|
<FormControlLabel value="1" control={<Radio />} label="미등록" />
|
|
|
|
|
<FormControlLabel value="2" control={<Radio />} label="등록" />
|
|
|
|
@ -138,8 +137,8 @@ const ResidentRegister = () => {
|
|
|
|
|
required
|
|
|
|
|
id="rcSeq1"
|
|
|
|
|
name="rcSeq1"
|
|
|
|
|
value={rcSeq1}
|
|
|
|
|
onChange={(e) => setRcSeq1(e.target.value.replace(/-/g, ''))}
|
|
|
|
|
value={scSeq1}
|
|
|
|
|
onChange={(e) => setScSeq1(e.target.value.replace(/-/g, ''))}
|
|
|
|
|
placeholder="yyyy-MM-9999"
|
|
|
|
|
onKeyDown={handleOnKeyDown}
|
|
|
|
|
label="접수번호(시작)"
|
|
|
|
@ -152,8 +151,8 @@ const ResidentRegister = () => {
|
|
|
|
|
required
|
|
|
|
|
id="rcSeq2"
|
|
|
|
|
name="rcSeq2"
|
|
|
|
|
value={rcSeq2}
|
|
|
|
|
onChange={(e) => setRcSeq2(e.target.value.replace(/-/g, ''))}
|
|
|
|
|
value={scSeq2}
|
|
|
|
|
onChange={(e) => setScSeq2(e.target.value.replace(/-/g, ''))}
|
|
|
|
|
placeholder="yyyy-MM-9999"
|
|
|
|
|
onKeyDown={handleOnKeyDown}
|
|
|
|
|
label="접수번호(종료)"
|
|
|
|
@ -198,6 +197,7 @@ const ResidentRegister = () => {
|
|
|
|
|
totalCount={totalCount}
|
|
|
|
|
setRowsStatus={setRowsStatus}
|
|
|
|
|
handleSelection={handleSelection}
|
|
|
|
|
selectionModel={selectionModel}
|
|
|
|
|
/>
|
|
|
|
|
<CmmModal isBackdrop title="심의등록" open={open} setOpen={setOpen}>
|
|
|
|
|
<SaveResidentTargetForm isDisabled={selectionModel.length === 0} handleModalSave={submitResidentTargets} />
|
|
|
|
|