fix: 거주자 / 장애인 의견진술 공통화 진행
parent
29e279c0ca
commit
584cbe8cca
@ -1,43 +0,0 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// Parking : 주정차의견진술관리
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
import axios from 'utils/axios';
|
||||
import { GET_DISABLED, GET_DISABLED_DATA_LIST, GET_DISABLED_LIST, SAVE_DISABLED_DATA } from 'commons/ApiUrl';
|
||||
import { setRowId } from './common';
|
||||
|
||||
// eslint-disable-next-line no-return-await
|
||||
export async function findDisabledDatas(params) {
|
||||
const res = await axios.get(GET_DISABLED_DATA_LIST, { params });
|
||||
if (res.success) {
|
||||
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function saveDisabledData(formData) {
|
||||
// eslint-disable-next-line no-return-await
|
||||
return await axios(SAVE_DISABLED_DATA, {
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' } // , Authorization: localStorage.getItem('access_token') }
|
||||
});
|
||||
}
|
||||
|
||||
export async function findDisabled(scCode) {
|
||||
const res = await axios.get(GET_DISABLED + scCode);
|
||||
if (res.success) {
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function findDisableds(params) {
|
||||
const res = await axios.get(GET_DISABLED_LIST, { params });
|
||||
if (res.success) {
|
||||
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { Button, Divider, Grid, Link } from '@mui/material';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiDataGrid from 'views/form/MuiDataGrid';
|
||||
import CmmModal from 'views/form/Modal/CmmModal';
|
||||
import { findDisabled, findDisabledDatas, saveDisabledData } from 'apis/disabled';
|
||||
import NewDisabledDataForm from './NewDisabledDataForm';
|
||||
import ModifyDisabledDataForm from './ModifyDisabledDataForm';
|
||||
|
||||
const DisabledDataReview = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [create, setCreate] = useState(false);
|
||||
// const [selectedRow, setSelectedRow] = useState({});
|
||||
const [title, setTitle] = useState();
|
||||
const [rowData, setRowData] = useState({});
|
||||
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 20,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
|
||||
const columns = [
|
||||
{ headerName: 'No.', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
|
||||
{ headerName: '심사코드?', field: 'scCode', hide: true },
|
||||
{
|
||||
headerName: '접수번호',
|
||||
headerAlign: 'center',
|
||||
field: 'scSeq',
|
||||
renderCell: (params) => (
|
||||
<Link underline="hover" href="#">
|
||||
{params.value}
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
{ headerName: '동명', headerAlign: 'center', field: 'scDong' },
|
||||
{ headerName: '차량번호', headerAlign: 'center', field: 'scCarnum' },
|
||||
{ headerName: '성명', headerAlign: 'center', field: 'scName' },
|
||||
{ headerName: '진술유형', headerAlign: 'center', field: 'scContDocNm' },
|
||||
{
|
||||
headerName: '접수일자',
|
||||
headerAlign: 'center',
|
||||
field: 'scCdate'
|
||||
// type: 'date',
|
||||
// valueGetter: ({ value }) => value && new Date(value)
|
||||
},
|
||||
{ headerName: '접수방법', headerAlign: 'center', field: 'scIngbNm' }
|
||||
];
|
||||
|
||||
const search = useCallback(() => {
|
||||
const params = {
|
||||
page: rowsState.page,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
findDisabledDatas(params).then((response) => {
|
||||
console.log(response);
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
// apiRef.current.forceUpdate(); // .updateRowData([]);
|
||||
// apiRef.current.updateRowData([]);
|
||||
}
|
||||
});
|
||||
}, [rowsState.page, rowsState.pageSize]);
|
||||
|
||||
useEffect(() => {
|
||||
search();
|
||||
}, [search]); // search, rowsState.page, rowsState.pageSize]);
|
||||
|
||||
const handleCreate = () => {
|
||||
setTitle('장애인 의견진술 자료 신규 등록');
|
||||
setCreate(true);
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
const handleOnCellClick = (e) => {
|
||||
if (e?.field === 'scSeq') {
|
||||
findDisabled(e.row?.scCode).then((res) => {
|
||||
setRowData(res.data);
|
||||
setCreate(false);
|
||||
setTitle('장애인 의견진술 자료 변경');
|
||||
setOpen(true);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const handleSaveResident = (payload) => {
|
||||
saveDisabledData(payload).then(() => {
|
||||
search();
|
||||
setOpen(false);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container alignItems="right">
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" onClick={handleCreate}>
|
||||
의견진술 자료 등록
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<MuiDataGrid
|
||||
columns={columns}
|
||||
rowsState={rowsState}
|
||||
totalCount={totalCount}
|
||||
setRowsState={setRowsState}
|
||||
handleCellClick={handleOnCellClick}
|
||||
/>
|
||||
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
|
||||
{create && <NewDisabledDataForm handleModalSave={handleSaveResident} />}
|
||||
{!create && <ModifyDisabledDataForm handleModalSave={handleSaveResident} rowData={rowData} />}
|
||||
</CmmModal>
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default DisabledDataReview;
|
@ -1,208 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
// material-ui
|
||||
import { Button, Divider, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from '@mui/material';
|
||||
|
||||
// assets
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiDataGrid from 'views/form/MuiDataGrid';
|
||||
|
||||
import xitCmm from 'commons/XitCmm';
|
||||
import CmmModal from 'views/form/Modal/CmmModal';
|
||||
import SaveDisabledTargetForm from './SaveDisabledTargetForm';
|
||||
import NumberFormat from 'react-number-format';
|
||||
import ExcelDownload from 'views/form/ExcelDownload';
|
||||
import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking';
|
||||
|
||||
const DisabledRegister = () => {
|
||||
const [rcIrTransfer, setRcIrTransfer] = useState('1');
|
||||
const [rcSeq1, setRcSeq1] = useState('2022200801');
|
||||
const [rcSeq2, setRcSeq2] = useState('2022200899');
|
||||
const [selectionModel, setSelectionModel] = useState([]);
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsStatus, setRowsStatus] = useState({
|
||||
page: 0,
|
||||
pageSize: 100,
|
||||
rows: []
|
||||
});
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
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: 'rcDate',
|
||||
align: 'center',
|
||||
format: '####-##-##'
|
||||
// valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`
|
||||
},
|
||||
{ headerName: '접수방법', headerAlign: 'center', field: 'rcIngbNm', align: 'center' }
|
||||
];
|
||||
|
||||
const search = () => {
|
||||
const params = {
|
||||
rcIrTransfer,
|
||||
rcSeq1,
|
||||
rcSeq2
|
||||
};
|
||||
|
||||
findParkingJudgeTargets(params).then((response) => {
|
||||
if (response && response.data) {
|
||||
setSelectionModel([]);
|
||||
setTotalCount(response.count);
|
||||
setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
if (selectionModel.length === 0) {
|
||||
xitCmm.alertParam(`처리할 데이타가 없습니다`);
|
||||
} else {
|
||||
setOpen(true);
|
||||
// alert(`저장할 데이타 => ${selectRows}`);
|
||||
}
|
||||
};
|
||||
|
||||
const submitDisabledTargets = (params) => {
|
||||
const param = {
|
||||
...params,
|
||||
rcIrTransfer,
|
||||
rcSeq1,
|
||||
rcSeq2,
|
||||
rcCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].rcCode)
|
||||
};
|
||||
setOpen(false);
|
||||
// return false;
|
||||
|
||||
saveParkingJudgeTargets(param).then(() => {
|
||||
setSelectionModel([]);
|
||||
search();
|
||||
});
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
if (rcSeq1 && rcSeq2) {
|
||||
search();
|
||||
}
|
||||
};
|
||||
|
||||
const handleOnKeyDown = (event) => {
|
||||
if (event.type === 'keydown' && event.key === 'Enter' && rcSeq1 && rcSeq2) {
|
||||
search();
|
||||
}
|
||||
};
|
||||
|
||||
const handleSelection = (newSelection) => {
|
||||
setSelectionModel(newSelection);
|
||||
};
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={1}>
|
||||
<Grid item>
|
||||
<FormControl>
|
||||
<FormLabel component="legend" required>
|
||||
자료등록여부
|
||||
</FormLabel>
|
||||
<RadioGroup
|
||||
row
|
||||
aria-label="category"
|
||||
name="row-radio-buttons-group"
|
||||
value={rcIrTransfer}
|
||||
onChange={(e) => setRcIrTransfer(e.target.value)}
|
||||
>
|
||||
<FormControlLabel value="1" control={<Radio />} label="미등록" />
|
||||
<FormControlLabel value="2" control={<Radio />} label="등록" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<NumberFormat
|
||||
customInput={TextField}
|
||||
size="small"
|
||||
required
|
||||
id="rcSeq1"
|
||||
name="rcSeq1"
|
||||
value={rcSeq1}
|
||||
onChange={(e) => setRcSeq1(e.target.value.replace(/-/g, ''))}
|
||||
placeholder="yyyy-MM-9999"
|
||||
onKeyDown={handleOnKeyDown}
|
||||
label="접수번호(시작)"
|
||||
format="####-######"
|
||||
/>
|
||||
-
|
||||
<NumberFormat
|
||||
customInput={TextField}
|
||||
size="small"
|
||||
required
|
||||
id="rcSeq2"
|
||||
name="rcSeq2"
|
||||
value={rcSeq2}
|
||||
onChange={(e) => setRcSeq2(e.target.value.replace(/-/g, ''))}
|
||||
placeholder="yyyy-MM-9999"
|
||||
onKeyDown={handleOnKeyDown}
|
||||
label="접수번호(종료)"
|
||||
format="####-######"
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button variant="contained" color="primary" size="small" startIcon={<IconSearch />} onClick={handleSearch}>
|
||||
검색
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button
|
||||
disabled={selectionModel.length === 0}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
size="small"
|
||||
startIcon={<PersonAddTwoToneIcon />}
|
||||
onClick={handleSave}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<ExcelDownload fileName="심사등록대상" gridColumns={columns} excelDatas={rowsStatus.rows} isDisabled={totalCount === 0} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<MuiDataGrid
|
||||
// apiRef={apiRef}
|
||||
isCheckbox
|
||||
isHideFooter
|
||||
columns={columns}
|
||||
rowsState={rowsStatus}
|
||||
totalCount={totalCount}
|
||||
setRowsStatus={setRowsStatus}
|
||||
handleSelection={handleSelection}
|
||||
/>
|
||||
<CmmModal isBackdrop title="심의등록" open={open} setOpen={setOpen}>
|
||||
<SaveDisabledTargetForm isDisabled={selectionModel.length === 0} handleModalSave={submitDisabledTargets} />
|
||||
</CmmModal>
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default DisabledRegister;
|
@ -1,198 +0,0 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import _ from 'lodash';
|
||||
import getYear from 'date-fns/getYear';
|
||||
|
||||
// material-ui
|
||||
import { GridActionsCellItem } from '@mui/x-data-grid';
|
||||
import { Divider, FormControl, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select } from '@mui/material';
|
||||
import DeleteIcon from '@mui/icons-material/Delete';
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiDataGrid from 'views/form/MuiDataGrid';
|
||||
import xitCmm from 'commons/XitCmm';
|
||||
import InputLabel from 'ui-component/extended/Form/InputLabel';
|
||||
import { findDisableds } from 'apis/disabled';
|
||||
|
||||
const DisabledReview = () => {
|
||||
const isInit = useRef(true);
|
||||
const year = getYear(new Date());
|
||||
console.log(typeof year);
|
||||
const years = _.range(year, year - 14, -1);
|
||||
|
||||
const [selectedYear, setSelectedYear] = useState(year);
|
||||
const [searchTxt, setSearchTxt] = useState('');
|
||||
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 20,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
const removeSimsa = useCallback(
|
||||
(row) => () => {
|
||||
// setTimeout(() => {
|
||||
// setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId));
|
||||
// });
|
||||
xitCmm.alertParam(`삭제대상<br>${JSON.stringify(row)}`);
|
||||
console.log(row);
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
const openModalDetails = () => {};
|
||||
|
||||
/*
|
||||
ms_maincode : '민원코드'
|
||||
ms_seq : '접수번호'
|
||||
ms_carnum : '차량번호'
|
||||
ms_year : '년도'
|
||||
ms_chasu : '차수'
|
||||
ms_sdate : '심사시작일시'
|
||||
ms_startsi : '심사시작시간'
|
||||
ms_edate : '심사종료일시'
|
||||
ms_cdate : '심사마감일시'
|
||||
ms_closesi : '심사마감시간'
|
||||
ms_wdate : '단속일자'
|
||||
ms_pos : '단속장소'
|
||||
ms_result : '결과코드'
|
||||
ms_jbtime : '단속시간'
|
||||
*/
|
||||
const columns = [
|
||||
// { headerName: 'rowId', field: 'rowId' },
|
||||
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu' },
|
||||
{ headerName: '심사건수', headerAlign: 'center', field: 'cnt' },
|
||||
{
|
||||
headerName: '심사기간',
|
||||
headerAlign: 'center',
|
||||
field: 'msDate',
|
||||
minWidth: 180,
|
||||
description: '심사기간',
|
||||
valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`,
|
||||
renderCell: (params) => (
|
||||
// <Link underline="hover" href="/parking/details" rel="noopener">
|
||||
<Link
|
||||
underline="hover"
|
||||
// onClick={() => navigate(`/parking/details?msChasu=${params.msChasu}&msSdate=${params.msSdate}&msEdate=${params.msEdate}`)}
|
||||
onClick={openModalDetails}
|
||||
data-target="modalDetails"
|
||||
rel="noopener"
|
||||
>
|
||||
{/* <Link underline="hover" href="#" onClick={() => <ModalDetails />}> */}
|
||||
{/* <Link underline="hover" onClick={() => <ModalDetails />}> */}
|
||||
{params.value}
|
||||
</Link>
|
||||
// <ModalDetails />
|
||||
)
|
||||
},
|
||||
{
|
||||
headerName: '심사마감일시',
|
||||
headerAlign: 'center',
|
||||
field: 'msCdate',
|
||||
type: 'dateTime',
|
||||
minWidth: 125,
|
||||
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`
|
||||
},
|
||||
{ headerName: '상태', field: 'msResult', renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'}</> },
|
||||
{
|
||||
headerName: '삭제',
|
||||
headerAlign: 'center',
|
||||
field: 'actions',
|
||||
type: 'actions',
|
||||
width: 80,
|
||||
getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeSimsa(params.row)} />]
|
||||
}
|
||||
];
|
||||
|
||||
const search = useCallback(() => {
|
||||
const params = {
|
||||
page: rowsState.page,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
findDisableds({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
// apiRef.current.forceUpdate(); // .updateRowData([]);
|
||||
// apiRef.current.updateRowData([]);
|
||||
}
|
||||
});
|
||||
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
||||
|
||||
const handleSearch = async (event) => {
|
||||
if (!selectedYear) return;
|
||||
|
||||
if (event.type === 'keydown' && event.key === 'Enter') {
|
||||
const newString = event?.target.value;
|
||||
setSearchTxt(newString);
|
||||
search();
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (isInit.current) {
|
||||
isInit.current = false;
|
||||
return;
|
||||
}
|
||||
search();
|
||||
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
|
||||
}, [search]);
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={1}>
|
||||
<Grid item xs={2}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>심의 년도</InputLabel>
|
||||
<Select
|
||||
size="small"
|
||||
id="reviewYear"
|
||||
name="reviewYear"
|
||||
defaultValue={year}
|
||||
onChange={(e) => setSelectedYear(e.target.value)}
|
||||
>
|
||||
{years.map((year, idx) => (
|
||||
<MenuItem key={idx} value={year}>
|
||||
{year}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<OutlinedInput
|
||||
required
|
||||
placeholder="심의차수"
|
||||
onKeyDown={handleSearch}
|
||||
size="small"
|
||||
autoComplete
|
||||
autoFocus
|
||||
endAdornment={
|
||||
<InputAdornment position="end">
|
||||
<IconSearch stroke={1.5} size="1rem" />
|
||||
</InputAdornment>
|
||||
}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<MuiDataGrid columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
export default DisabledReview;
|
@ -1,438 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import NumberFormat from 'react-number-format';
|
||||
import { useAlert } from 'react-alert';
|
||||
import format from 'date-fns/format';
|
||||
|
||||
import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornment } from '@mui/material';
|
||||
import Button from '@mui/material/Button';
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
|
||||
import { getComboCodeList } from 'apis/common';
|
||||
import FileInputForms from 'views/form/FileInputForms';
|
||||
|
||||
const toDate = new Date();
|
||||
|
||||
const NewDisabledDataForm = ({ handleModalSave }) => {
|
||||
const alert = useAlert();
|
||||
|
||||
const [scCarnum, setScCarnum] = useState('');
|
||||
const [scName, setScName] = useState('');
|
||||
const [scDong, setScDong] = useState('');
|
||||
const [scContDoc, setScContDoc] = useState();
|
||||
const [selectedContDoc, setSelectedContDoc] = useState('11');
|
||||
const [scIngb, setScIngb] = useState();
|
||||
const [selectedIngb, setSelectedIngb] = useState('1');
|
||||
const [zippost1, setZippost1] = useState(null);
|
||||
const [scJuso, setScJuso] = useState('');
|
||||
const [scBunji, setScBunji] = useState('');
|
||||
const [scWdate, setScWdate] = useState(null);
|
||||
const [scCdate, setScCdate] = useState(format(toDate, 'yyyyMMdd'));
|
||||
const [scJbtime, setScJbtime] = useState(null);
|
||||
const [scPos, setScPos] = useState('');
|
||||
|
||||
const [picads, setPicads] = useState({});
|
||||
const [frecads, setFrecads] = useState({});
|
||||
const [contads, setContads] = useState({});
|
||||
|
||||
const onSave = () => {
|
||||
// TODO : validation check 추가
|
||||
const formData = new FormData();
|
||||
formData.append('scCarnum', scCarnum);
|
||||
formData.append('scName', scName);
|
||||
formData.append('scDong', scDong);
|
||||
formData.append('scContDoc', selectedContDoc);
|
||||
formData.append('scCdate', scCdate);
|
||||
formData.append('scIngb', selectedIngb);
|
||||
formData.append('scWdate', scWdate);
|
||||
formData.append('scJbtime', scJbtime);
|
||||
formData.append('scPos', scPos);
|
||||
formData.append('zippost1', zippost1);
|
||||
formData.append('scJuso', scJuso);
|
||||
formData.append('scBunji', scBunji);
|
||||
|
||||
Object.values(picads).forEach((v) => {
|
||||
formData.append('picadFiles', v);
|
||||
});
|
||||
|
||||
Object.values(frecads).forEach((v) => {
|
||||
formData.append('frecadFiles', v);
|
||||
});
|
||||
|
||||
Object.values(contads).forEach((v) => {
|
||||
formData.append('contadFiles', v);
|
||||
});
|
||||
|
||||
handleModalSave(formData);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// setSelectedContDoc('11');
|
||||
setScContDoc([]);
|
||||
getComboCodeList({ codeMcd: 'SC_CONT_DOC' }).then((res) => {
|
||||
console.log(res);
|
||||
setScContDoc(res.data);
|
||||
});
|
||||
getComboCodeList({ codeMcd: 'RC_INGB' }).then((res) => {
|
||||
console.log(res);
|
||||
setScIngb(res.data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleChangeFile = (e) => {
|
||||
const fileKey = e.target.name;
|
||||
const fileArrKey = fileKey + e.target.dataset.index;
|
||||
|
||||
if (fileKey === 'scPicad') {
|
||||
setPicads((picads) => {
|
||||
const updated = { ...picads };
|
||||
updated[fileArrKey] = e.target.files[0];
|
||||
return updated;
|
||||
});
|
||||
} else if (fileKey === 'scFrecad') {
|
||||
setFrecads((frecads) => {
|
||||
const updated = { ...frecads };
|
||||
updated[fileArrKey] = e.target.files[0];
|
||||
return updated;
|
||||
});
|
||||
} else if (fileKey === 'scContad') {
|
||||
setContads((contads) => {
|
||||
const updated = { ...contads };
|
||||
updated[fileArrKey] = e.target.files[0];
|
||||
return updated;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid mt={2}>
|
||||
<Grid container spacing={0.5} item xs={12} mb={1.5}>
|
||||
<Grid item sm={3}>
|
||||
<TextField
|
||||
required
|
||||
label="차량번호"
|
||||
size="small"
|
||||
fullWidth
|
||||
value={scCarnum}
|
||||
onChange={(e) => setScCarnum(e?.target?.value)}
|
||||
autoFocus
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField required label="성명" size="small" fullWidth value={scName} onChange={(e) => setScName(e?.target?.value)} />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField required label="동명" size="small" fullWidth value={scDong} onChange={(e) => setScDong(e?.target?.value)} />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>진술유형</InputLabel>
|
||||
<Select size="small" defaultValue="11" onChange={(e) => setSelectedContDoc(e?.target?.value)}>
|
||||
{scContDoc &&
|
||||
scContDoc.map((contDoc) => (
|
||||
<MenuItem key={contDoc.code} value={contDoc.code}>
|
||||
{contDoc.value}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={0.5} item xs={12} mb={1.5}>
|
||||
<Grid item sm={3}>
|
||||
<NumberFormat
|
||||
size="small"
|
||||
customInput={TextField}
|
||||
required
|
||||
label="접수일자"
|
||||
format="########"
|
||||
fullWidth
|
||||
value={scCdate}
|
||||
onChange={(e) => setScCdate(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>접수방법</InputLabel>
|
||||
<Select size="small" defaultValue="1" onChange={(e) => setSelectedIngb(e?.target?.value)}>
|
||||
{scIngb &&
|
||||
scIngb.map((ingb) => (
|
||||
<MenuItem key={ingb.code} value={ingb.code}>
|
||||
{ingb.value}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<NumberFormat
|
||||
size="small"
|
||||
customInput={TextField}
|
||||
required
|
||||
label="위반일자"
|
||||
format="########"
|
||||
fullWidth
|
||||
value={scWdate}
|
||||
onChange={(e) => setScWdate(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<NumberFormat
|
||||
size="small"
|
||||
customInput={TextField}
|
||||
required
|
||||
label="위반시간"
|
||||
format="####"
|
||||
fullWidth
|
||||
value={scJbtime}
|
||||
onChange={(e) => setScJbtime(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={0.5} item xs={12} mb={2}>
|
||||
<Grid item sm={12}>
|
||||
<TextField size="small" required label="위반장소" fullWidth value={scPos} onChange={(e) => setScPos(e?.target?.value)} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={0.5} item xs={12} mb={2}>
|
||||
<Grid item sm={1.7}>
|
||||
<TextField
|
||||
size="small"
|
||||
fullWidth
|
||||
required
|
||||
label="우편번호"
|
||||
value={zippost1}
|
||||
onChange={(e) => setZippost1(e?.target?.value)}
|
||||
InputProps={{
|
||||
display: 'none',
|
||||
readOnly: true,
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconSearch stroke={1.5} size="1rem" cursor="pointer" />
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={7}>
|
||||
<TextField
|
||||
size="small"
|
||||
required
|
||||
label="주소"
|
||||
fullWidth
|
||||
value={scJuso}
|
||||
onChange={(e) => setScJuso(e?.target?.value)}
|
||||
InputProps={{ readOnly: true }}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3.3}>
|
||||
<TextField size="small" required label="번지" fullWidth value={scBunji} onChange={(e) => setScBunji(e?.target?.value)} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={false}
|
||||
fieldName="scPicad"
|
||||
index={1}
|
||||
labelName="단속사진1"
|
||||
selectedFile={picads.scPicad1?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof picads.scPicad1 === 'undefined'}
|
||||
fieldName="scPicad"
|
||||
labelName="단속사진2"
|
||||
index={2}
|
||||
selectedFile={picads.scPicad2?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof picads.scPicad2 === 'undefined'}
|
||||
fieldName="scPicad"
|
||||
labelName="단속사진3"
|
||||
index={3}
|
||||
selectedFile={picads.scPicad3?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof picads.scPicad3 === 'undefined'}
|
||||
fieldName="scPicad"
|
||||
labelName="단속사진4"
|
||||
index={4}
|
||||
selectedFile={picads.scPicad4?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={false}
|
||||
fieldName="scFrecad"
|
||||
index={1}
|
||||
labelName="진술서1"
|
||||
selectedFile={frecads.scFrecad1?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof frecads.scFrecad1 === 'undefined'}
|
||||
fieldName="scFrecad"
|
||||
labelName="진술서2"
|
||||
index={2}
|
||||
selectedFile={frecads.scFrecad2?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof frecads.scFrecad2 === 'undefined'}
|
||||
fieldName="scFrecad"
|
||||
labelName="진술서3"
|
||||
index={3}
|
||||
selectedFile={frecads.scFrecad3?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof frecads.scFrecad3 === 'undefined'}
|
||||
fieldName="scFrecad"
|
||||
labelName="진술서4"
|
||||
index={4}
|
||||
selectedFile={frecads.scFrecad4?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={false}
|
||||
fieldName="scContad"
|
||||
index={1}
|
||||
labelName="첨부자료1"
|
||||
selectedFile={contads.scContad1?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad1 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료2"
|
||||
index={2}
|
||||
selectedFile={contads.scContad2?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad2 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료3"
|
||||
index={3}
|
||||
selectedFile={contads.scContad3?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad3 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료4"
|
||||
index={4}
|
||||
selectedFile={contads.scContad4?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad4 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
index={5}
|
||||
labelName="첨부자료5"
|
||||
selectedFile={contads.scContad5?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad5 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료6"
|
||||
index={6}
|
||||
selectedFile={contads.scContad6?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad6 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료7"
|
||||
index={7}
|
||||
selectedFile={contads.scContad7?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad7 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료8"
|
||||
index={8}
|
||||
selectedFile={contads.scContad8?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item sx={{ marginTop: 3 }}>
|
||||
{/* <Button variant="contained" color="primary" size="small" startIcon={<IconFileExport />} onClick={onSave}> */}
|
||||
<Button variant="contained" color="primary" size="small" onClick={onSave}>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
NewDisabledDataForm.propTypes = {
|
||||
handleModalSave: PropTypes.func.isRequired
|
||||
};
|
||||
export default NewDisabledDataForm;
|
@ -1,454 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import NumberFormat from 'react-number-format';
|
||||
import { useAlert } from 'react-alert';
|
||||
// import format from 'date-fns/format';
|
||||
|
||||
import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornment } from '@mui/material';
|
||||
import Button from '@mui/material/Button';
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
|
||||
import { getComboCodeList } from 'apis/common';
|
||||
import FileInputForms from 'views/form/FileInputForms';
|
||||
|
||||
// const toDate = new Date();
|
||||
|
||||
const ModifyResidentDataForm = ({ rowData, handleModalSave }) => {
|
||||
const alert = useAlert();
|
||||
|
||||
const [scCarnum, setScCarnum] = useState(rowData.scCarnum);
|
||||
const [scName, setScName] = useState(rowData.scName);
|
||||
const [scDong, setScDong] = useState(rowData.scDong);
|
||||
const [scContDoc, setScContDoc] = useState();
|
||||
const [selectedContDoc, setSelectedContDoc] = useState(rowData.scContDoc);
|
||||
const [scIngb, setScIngb] = useState();
|
||||
const [selectedIngb, setSelectedIngb] = useState(rowData.scIngb);
|
||||
const [zippost1, setZippost1] = useState(`${rowData.zippost1}${rowData.zippost2}`);
|
||||
const [scJuso, setScJuso] = useState(rowData.scJuso);
|
||||
const [scBunji, setScBunji] = useState(rowData.scBunji);
|
||||
const [scWdate, setScWdate] = useState(rowData.scWdate);
|
||||
const [scCdate, setScCdate] = useState(rowData.scCdate);
|
||||
const [scJbtime, setScJbtime] = useState(rowData.scJbtime);
|
||||
const [scPos, setScPos] = useState('');
|
||||
|
||||
const [picads, setPicads] = useState({});
|
||||
const [frecads, setFrecads] = useState({});
|
||||
const [contads, setContads] = useState({});
|
||||
|
||||
const onSave = () => {
|
||||
// TODO : validation check 추가
|
||||
const formData = new FormData();
|
||||
formData.append('scCarnum', scCarnum);
|
||||
formData.append('scName', scName);
|
||||
formData.append('scDong', scDong);
|
||||
formData.append('scContDoc', selectedContDoc);
|
||||
formData.append('scCdate', scCdate);
|
||||
formData.append('scIngb', selectedIngb);
|
||||
formData.append('scWdate', scWdate);
|
||||
formData.append('scJbtime', scJbtime);
|
||||
formData.append('scPos', scPos);
|
||||
formData.append('zippost1', zippost1);
|
||||
formData.append('scJuso', scJuso);
|
||||
formData.append('scBunji', scBunji);
|
||||
|
||||
Object.values(picads).forEach((v) => {
|
||||
formData.append('picadFiles', v);
|
||||
});
|
||||
|
||||
Object.values(frecads).forEach((v) => {
|
||||
formData.append('frecadFiles', v);
|
||||
});
|
||||
|
||||
Object.values(contads).forEach((v) => {
|
||||
formData.append('contadFiles', v);
|
||||
});
|
||||
|
||||
handleModalSave(formData);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// setSelectedContDoc('11');
|
||||
setScContDoc([]);
|
||||
getComboCodeList({ codeMcd: 'SC_CONT_DOC' }).then((res) => {
|
||||
console.log(res);
|
||||
setScContDoc(res.data);
|
||||
});
|
||||
getComboCodeList({ codeMcd: 'RC_INGB' }).then((res) => {
|
||||
console.log(res);
|
||||
setScIngb(res.data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleChangeFile = (e) => {
|
||||
const fileKey = e.target.name;
|
||||
const fileArrKey = fileKey + e.target.dataset.index;
|
||||
|
||||
if (fileKey === 'scPicad') {
|
||||
setPicads((picads) => {
|
||||
const updated = { ...picads };
|
||||
updated[fileArrKey] = e.target.files[0];
|
||||
return updated;
|
||||
});
|
||||
} else if (fileKey === 'scFrecad') {
|
||||
setFrecads((frecads) => {
|
||||
const updated = { ...frecads };
|
||||
updated[fileArrKey] = e.target.files[0];
|
||||
return updated;
|
||||
});
|
||||
} else if (fileKey === 'scContad') {
|
||||
setContads((contads) => {
|
||||
const updated = { ...contads };
|
||||
updated[fileArrKey] = e.target.files[0];
|
||||
return updated;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid mt={2}>
|
||||
<Grid container spacing={0.5} item xs={12} mb={1.5}>
|
||||
<Grid item sm={3}>
|
||||
<TextField
|
||||
required
|
||||
label="차량번호"
|
||||
size="small"
|
||||
fullWidth
|
||||
value={scCarnum}
|
||||
onChange={(e) => setScCarnum(e?.target?.value)}
|
||||
autoFocus
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField required label="성명" size="small" fullWidth value={scName} onChange={(e) => setScName(e?.target?.value)} />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField required label="동명" size="small" fullWidth value={scDong} onChange={(e) => setScDong(e?.target?.value)} />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>진술유형</InputLabel>
|
||||
<Select size="small" defaultValue="11" onChange={(e) => setSelectedContDoc(e?.target?.value)}>
|
||||
{scContDoc &&
|
||||
scContDoc.map((contDoc) => (
|
||||
<MenuItem key={contDoc.code} value={contDoc.code}>
|
||||
{contDoc.value}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={0.5} item xs={12} mb={1.5}>
|
||||
<Grid item sm={3}>
|
||||
<NumberFormat
|
||||
size="small"
|
||||
customInput={TextField}
|
||||
required
|
||||
label="접수일자"
|
||||
format="########"
|
||||
fullWidth
|
||||
value={scCdate}
|
||||
onChange={(e) => setScCdate(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>접수방법</InputLabel>
|
||||
<Select size="small" defaultValue="1" onChange={(e) => setSelectedIngb(e?.target?.value)}>
|
||||
{scIngb &&
|
||||
scIngb.map((ingb) => (
|
||||
<MenuItem key={ingb.code} value={ingb.code}>
|
||||
{ingb.value}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<NumberFormat
|
||||
size="small"
|
||||
customInput={TextField}
|
||||
required
|
||||
label="위반일자"
|
||||
format="########"
|
||||
fullWidth
|
||||
value={scWdate}
|
||||
onChange={(e) => setScWdate(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<NumberFormat
|
||||
size="small"
|
||||
customInput={TextField}
|
||||
required
|
||||
label="위반시간"
|
||||
format="####"
|
||||
fullWidth
|
||||
value={scJbtime}
|
||||
onChange={(e) => setScJbtime(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={0.5} item xs={12} mb={2}>
|
||||
<Grid item sm={12}>
|
||||
<TextField
|
||||
size="small"
|
||||
required
|
||||
label="위반장소"
|
||||
fullWidth
|
||||
value={rowData.scPos}
|
||||
onChange={(e) => setScPos(e?.target?.value)}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={0.5} item xs={12} mb={2}>
|
||||
<Grid item sm={1.7}>
|
||||
<TextField
|
||||
size="small"
|
||||
fullWidth
|
||||
required
|
||||
label="우편번호"
|
||||
value={zippost1}
|
||||
onChange={(e) => setZippost1(e?.target?.value)}
|
||||
InputProps={{
|
||||
display: 'none',
|
||||
readOnly: true,
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconSearch stroke={1.5} size="1rem" cursor="pointer" />
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={7}>
|
||||
<TextField
|
||||
size="small"
|
||||
required
|
||||
label="주소"
|
||||
fullWidth
|
||||
value={scJuso}
|
||||
onChange={(e) => setScJuso(e?.target?.value)}
|
||||
InputProps={{ readOnly: true }}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3.3}>
|
||||
<TextField size="small" required label="번지" fullWidth value={scBunji} onChange={(e) => setScBunji(e?.target?.value)} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={false}
|
||||
fieldName="scPicad"
|
||||
index={1}
|
||||
labelName="단속사진1"
|
||||
fileName={rowData.scPicad1}
|
||||
selectedFile={picads.scPicad1?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof picads.scPicad1 === 'undefined'}
|
||||
fieldName="scPicad"
|
||||
labelName="단속사진2"
|
||||
index={2}
|
||||
fileName={rowData.scPicad2}
|
||||
selectedFile={picads.scPicad2?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof picads.scPicad2 === 'undefined'}
|
||||
fieldName="scPicad"
|
||||
labelName="단속사진3"
|
||||
index={3}
|
||||
fileName={rowData.scPicad3}
|
||||
selectedFile={picads.scPicad3?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof picads.scPicad3 === 'undefined'}
|
||||
fieldName="scPicad"
|
||||
labelName="단속사진4"
|
||||
index={4}
|
||||
fileName={rowData.scPicad4}
|
||||
selectedFile={picads.scPicad4?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={false}
|
||||
fieldName="scFrecad"
|
||||
index={1}
|
||||
labelName="진술서1"
|
||||
fileName={rowData.scFrecad1}
|
||||
selectedFile={frecads.scFrecad1?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof frecads.scFrecad1 === 'undefined'}
|
||||
fieldName="scFrecad"
|
||||
labelName="진술서2"
|
||||
index={2}
|
||||
fileName={rowData.scFrecad2}
|
||||
selectedFile={frecads.scFrecad2?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof frecads.scFrecad2 === 'undefined'}
|
||||
fieldName="scFrecad"
|
||||
labelName="진술서3"
|
||||
index={3}
|
||||
fileName={rowData.scFrecad3}
|
||||
selectedFile={frecads.scFrecad3?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof frecads.scFrecad3 === 'undefined'}
|
||||
fieldName="scFrecad"
|
||||
labelName="진술서4"
|
||||
index={4}
|
||||
fileName={rowData.scFrecad4}
|
||||
selectedFile={frecads.scFrecad4?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={false}
|
||||
fieldName="scContad"
|
||||
index={1}
|
||||
labelName="첨부자료1"
|
||||
selectedFile={contads.scContad1?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad1 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료2"
|
||||
index={2}
|
||||
selectedFile={contads.scContad2?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad2 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료3"
|
||||
index={3}
|
||||
selectedFile={contads.scContad3?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad3 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료4"
|
||||
index={4}
|
||||
selectedFile={contads.scContad4?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad4 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
index={5}
|
||||
labelName="첨부자료5"
|
||||
selectedFile={contads.scContad5?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad5 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료6"
|
||||
index={6}
|
||||
selectedFile={contads.scContad6?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
isOrgFileInfo
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad6 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료7"
|
||||
index={7}
|
||||
selectedFile={contads.scContad7?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<FileInputForms
|
||||
isDisabled={typeof contads.scContad7 === 'undefined'}
|
||||
fieldName="scContad"
|
||||
labelName="첨부자료8"
|
||||
index={8}
|
||||
selectedFile={contads.scContad8?.name}
|
||||
handleChangeFile={handleChangeFile}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item sx={{ marginTop: 3 }}>
|
||||
{/* <Button variant="contained" color="primary" size="small" startIcon={<IconFileExport />} onClick={onSave}> */}
|
||||
<Button disabled variant="contained" color="primary" size="small" onClick={onSave}>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
ModifyResidentDataForm.propTypes = {
|
||||
rowData: PropTypes.object.isRequired,
|
||||
handleModalSave: PropTypes.func.isRequired
|
||||
};
|
||||
export default ModifyResidentDataForm;
|
@ -1,172 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import NumberFormat from 'react-number-format';
|
||||
import format from 'date-fns/format';
|
||||
import getHours from 'date-fns/getHours';
|
||||
import koLocale from 'date-fns/locale/ko';
|
||||
|
||||
import { Grid, TextField, MenuItem, Select, FormControl, InputLabel } from '@mui/material';
|
||||
import DateAdapter from '@mui/lab/AdapterDateFns';
|
||||
import LocalizationProvider from '@mui/lab/LocalizationProvider';
|
||||
import { DatePicker, TimePicker } from '@mui/lab';
|
||||
import Button from '@mui/material/Button';
|
||||
import PropTypes from 'prop-types';
|
||||
import { IconFileExport } from '@tabler/icons';
|
||||
|
||||
import combo from 'commons/combo_data';
|
||||
|
||||
const toDate = new Date();
|
||||
|
||||
const SaveResidentTargetForm = ({ handleModalSave }) => {
|
||||
const [msuTeam, setMsuTeam] = useState(combo.teams[0].code);
|
||||
const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
||||
const [msStartsi, setMsStartsi] = useState(getHours(toDate));
|
||||
const [msEdate, setMsEdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
||||
const [msChasu, setMsChasu] = useState(99);
|
||||
const [msCdate, setMsCdate] = useState(format(toDate, 'yyyy-MM-dd'));
|
||||
const [msClosesi, setMsClosesi] = useState(getHours(toDate));
|
||||
|
||||
const onSave = () => {
|
||||
// TODO : validation check 추가
|
||||
handleModalSave({
|
||||
msuTeam,
|
||||
msSdate,
|
||||
msStartsi,
|
||||
msEdate,
|
||||
msChasu,
|
||||
msCdate,
|
||||
msClosesi
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid container spacing={2} mt={1.5}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
||||
<DatePicker
|
||||
// size="small"
|
||||
renderInput={(props) => <TextField fullWidth {...props} />}
|
||||
label="심의시작일"
|
||||
value={msSdate}
|
||||
inputFormat="yyyy-MM-dd"
|
||||
mask="____-__-__"
|
||||
onChange={(newValue) => {
|
||||
setMsSdate(format(newValue, 'yyyy-MM-dd'));
|
||||
}}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
{/* <MuiDatePicker label="심의시작일" date={msSdate} setDate={setMsSdate()} /> */}
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
||||
<TimePicker
|
||||
size="small"
|
||||
views={['hours']}
|
||||
renderInput={(props) => <TextField fullWidth {...props} />}
|
||||
label="심의시작시간"
|
||||
value={msStartsi}
|
||||
inputFormat="HH"
|
||||
mask="__"
|
||||
onChange={(newValue) => {
|
||||
// setMsStartsi(format(newValue, 'HH'));
|
||||
setMsStartsi(getHours(newValue));
|
||||
}}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
{/* <MuiTimePicker label="심의시작시간" date={msStartsi} setDate={setMsStartsi()} /> */}
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
||||
<DatePicker
|
||||
size="small"
|
||||
renderInput={(props) => <TextField fullWidth {...props} />}
|
||||
label="심의종료일"
|
||||
value={msEdate}
|
||||
inputFormat="yyyy-MM-dd"
|
||||
mask="____-__-__"
|
||||
onChange={(newValue) => {
|
||||
setMsEdate(format(newValue, 'yyyy-MM-dd'));
|
||||
}}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={2}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>팀</InputLabel>
|
||||
<Select name="reviewYear" defaultValue={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
|
||||
{combo.teams.map((team) => (
|
||||
<MenuItem key={team.code} value={team.code}>
|
||||
{team.value}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={2}>
|
||||
<NumberFormat
|
||||
customInput={TextField}
|
||||
required
|
||||
id="msChasu"
|
||||
name="msChasu"
|
||||
label="차수"
|
||||
format="######"
|
||||
fullWidth
|
||||
value={msChasu}
|
||||
onValueChange={(values) => setMsChasu(values.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
||||
<DatePicker
|
||||
size="small"
|
||||
renderInput={(props) => <TextField fullWidth {...props} />}
|
||||
label="심의마감일"
|
||||
value={msCdate}
|
||||
inputFormat="yyyy-MM-dd"
|
||||
mask="____-__-__"
|
||||
onChange={(newValue) => {
|
||||
setMsCdate(format(newValue, 'yyyy-MM-dd'));
|
||||
}}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
|
||||
{/* <TextField */}
|
||||
{/* type="date" */}
|
||||
{/* value={msCdate} */}
|
||||
{/* defaultValue={msCdate} */}
|
||||
{/* InputLabelProps={{ shrink: true }} */}
|
||||
{/* onChange={(e) => setMsCdate(format(e.target.value), 'yyyy-MM-dd')} */}
|
||||
{/* /> */}
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<LocalizationProvider dateAdapter={DateAdapter} locale={koLocale}>
|
||||
<TimePicker
|
||||
size="small"
|
||||
views={['hours']}
|
||||
// renderInput={(props) => <TextField fullWidth {...props} />}
|
||||
renderInput={(props) => <NumberFormat customInput={TextField} fullWidth {...props} format="##" />}
|
||||
label="심의마감시간"
|
||||
value={msClosesi}
|
||||
inputFormat="HH"
|
||||
mask="__"
|
||||
onChange={(newValue) => {
|
||||
setMsClosesi(getHours(newValue));
|
||||
}}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item sx={{ marginTop: 3 }}>
|
||||
<Button variant="contained" color="primary" size="small" startIcon={<IconFileExport />} onClick={onSave}>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
SaveResidentTargetForm.propTypes = {
|
||||
handleModalSave: PropTypes.func.isRequired
|
||||
// isDisabled: PropTypes.bool.isRequired
|
||||
};
|
||||
export default SaveResidentTargetForm;
|
Loading…
Reference in New Issue