feat: 주정차의견진술 자료 등록 반영

소스 정리
main
minuk926 3 years ago
parent ef2476b74f
commit f6366a6818

@ -7,7 +7,7 @@ import { GET_BOARD_LIST } from 'commons/ApiUrl';
import { setRowId } from './common';
// eslint-disable-next-line import/prefer-default-export
export async function getBoardList(params) {
export async function findBoars(params) {
const res = await axios.get(GET_BOARD_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));

@ -3,17 +3,12 @@
//----------------------------------------------------------------------------
import axios from 'utils/axios';
import {
GET_PARKING_SIMSA_DETAILS_LIST,
GET_PARKING_SIMSA_LIST,
GET_PARKING_SIMSA_TARGET_LIST,
SAVE_PARKING_SIMSA_TARGET
} from 'commons/ApiUrl';
import { GET_PARKING_LIST, GET_PARKING_TARGET_LIST, SAVE_PARKING_TARGET_LIST } from 'commons/ApiUrl';
import { setRowId } from './common';
// eslint-disable-next-line no-return-await
export async function getSimsa680GroupList(params) {
const res = await axios.get(GET_PARKING_SIMSA_LIST, { params });
export async function findParkings(params) {
const res = await axios.get(GET_PARKING_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
@ -21,8 +16,8 @@ export async function getSimsa680GroupList(params) {
return res;
}
export async function getSimsa680DetailList(params) {
const res = await axios.get(GET_PARKING_SIMSA_DETAILS_LIST, { params });
export async function findParkingTargets(params) {
const res = await axios.get(GET_PARKING_TARGET_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
@ -30,20 +25,19 @@ export async function getSimsa680DetailList(params) {
return res;
}
export async function getSimsaTargetList(params) {
const res = await axios.get(GET_PARKING_SIMSA_TARGET_LIST, { params });
export async function saveParkingTargets(params) {
const res = await axios.post(SAVE_PARKING_TARGET_LIST, params);
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
export async function saveSimsaTargetList(params) {
const res = await axios.post(SAVE_PARKING_SIMSA_TARGET, params);
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
// export async function findParkingDetails(params) {
// const res = await axios.get(GET_PARKING_DETAILS_LIST, { params });
// if (res.success) {
// res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
// return res;
// }
// return res;
// }

@ -6,7 +6,7 @@ import axios from 'utils/axios';
import { DELETE_PUBLIC_BOARD, GET_PUBLIC_BOARD_LIST, SAVE_PUBLIC_BOARD, SAVE_PUBLIC_BOARD_HIT_CNT } from 'commons/ApiUrl';
import { setRowId } from './common';
export async function getPublicBoardList(params) {
export async function findPublicBoards(params) {
// return async () => {
const res = await axios.get(GET_PUBLIC_BOARD_LIST, { params });
if (res.success) {

@ -7,7 +7,7 @@ import { GET_RESIDENT, GET_RESIDENT_DATA_LIST, SAVE_RESIDENT_DATA } from 'common
import { setRowId } from './common';
// eslint-disable-next-line no-return-await
export async function getResidents(params) {
export async function findResidents(params) {
const res = await axios.get(GET_RESIDENT_DATA_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
@ -25,7 +25,7 @@ export async function saveResidentData(formData) {
});
}
export async function getResident(scCode) {
export async function findResident(scCode) {
const res = await axios.get(GET_RESIDENT + scCode);
if (res.success) {
return res;

@ -15,10 +15,10 @@ export const DELETE_PUBLIC_BOARD = '/api/v1/ctgy/file/pboard/';
export const GET_BOARD_LIST = '/api/v1/ctgy/board';
// 주정차 의견 진술
export const GET_PARKING_SIMSA_LIST = '/api/v1/ctgy/parking';
export const GET_PARKING_SIMSA_DETAILS_LIST = '/api/v1/ctgy/parking/details';
export const GET_PARKING_SIMSA_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const SAVE_PARKING_SIMSA_TARGET = '/api/v1/ctgy/parking/target';
export const GET_PARKING_LIST = '/api/v1/ctgy/parking';
export const GET_PARKING_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const SAVE_PARKING_TARGET_LIST = '/api/v1/ctgy/parking/target';
// export const GET_PARKING_DETAILS_LIST = '/api/v1/ctgy/parking/details';
// 거주자 의견 진술
export const GET_RESIDENT_DATA_LIST = '/api/v1/ctgy/resident/data';

@ -11,7 +11,7 @@ import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/form/MuiDataGrid';
import { getBoardList } from '../../../apis/board';
import { findBoars } from '../../../apis/board';
const Board = () => {
const [category, setCategory] = useState('ciTitle');
@ -63,7 +63,7 @@ const Board = () => {
};
}
getBoardList(params).then((response) => {
findBoars(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data }));

@ -13,7 +13,7 @@ import MainCard from 'ui-component/cards/MainCard';
import MuiDataGrid from 'views/form/MuiDataGrid';
import CmmModal from '../../form/Modal/CmmModal';
import PublicBoardForm from './PublicBoardForm';
import { deletePublicBoard, getPublicBoardList, modifyPublicBoardHitCount, savePublicBoard } from '../../../apis/public';
import { deletePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from '../../../apis/public';
const PublicBoard = () => {
const [totalCount, setTotalCount] = useState(0);
@ -67,7 +67,7 @@ const PublicBoard = () => {
size: rowsState.pageSize
};
getPublicBoardList(params).then((response) => {
findPublicBoards(params).then((response) => {
// console.log(response);
if (response && response.data) {
setTotalCount(response.count);

@ -18,7 +18,7 @@ import CmmModal from 'views/form/Modal/CmmModal';
import SaveParkingSimsaForm from './SaveParkingSimsaForm';
import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/form/ExcelDownload';
import { getSimsaTargetList, saveSimsaTargetList } from 'apis/parking';
import { findParkingTargets, saveParkingTargets } from 'apis/parking';
const ParkingRegister = () => {
const [rcIrTransfer, setRcIrTransfer] = useState('1');
@ -58,7 +58,7 @@ const ParkingRegister = () => {
rcSeq2
};
getSimsaTargetList(params).then((response) => {
findParkingTargets(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
@ -86,7 +86,7 @@ const ParkingRegister = () => {
setOpen(false);
// return false;
saveSimsaTargetList(param).then(() => {
saveParkingTargets(param).then(() => {
setSelection([]);
search();
});

@ -18,7 +18,7 @@ import MainCard from 'ui-component/cards/MainCard';
import MuiDataGrid from 'views/form/MuiDataGrid';
import xitCmm from 'commons/XitCmm';
import ModalDetails from './ModalDetails';
import { getSimsa680GroupList } from 'apis/parking';
import { findParkings } from 'apis/parking';
import InputLabel from '../../../ui-component/extended/Form/InputLabel';
const ParkingReview = () => {
@ -115,7 +115,7 @@ const ParkingReview = () => {
size: rowsState.pageSize
};
getSimsa680GroupList({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
findParkings({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data }));

@ -0,0 +1,454 @@
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;

@ -14,7 +14,7 @@ import FileInputForms from 'views/form/FileInputForms';
const toDate = new Date();
const SaveResidentDataForm = ({ handleModalSave }) => {
const NewResidentDataForm = ({ handleModalSave }) => {
const alert = useAlert();
const [scCarnum, setScCarnum] = useState('');
@ -30,6 +30,7 @@ const SaveResidentDataForm = ({ handleModalSave }) => {
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({});
@ -46,6 +47,7 @@ const SaveResidentDataForm = ({ handleModalSave }) => {
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);
@ -189,6 +191,11 @@ const SaveResidentDataForm = ({ handleModalSave }) => {
/>
</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
@ -425,7 +432,7 @@ const SaveResidentDataForm = ({ handleModalSave }) => {
</>
);
};
SaveResidentDataForm.propTypes = {
NewResidentDataForm.propTypes = {
handleModalSave: PropTypes.func.isRequired
};
export default SaveResidentDataForm;
export default NewResidentDataForm;

@ -0,0 +1,207 @@
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 SaveResidentSimsaForm from './SaveResidentSimsaForm';
import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/form/ExcelDownload';
import { findParkingTargets, saveParkingTargets } from 'apis/parking';
const ResidentRegister = () => {
const [rcIrTransfer, setRcIrTransfer] = useState('1');
const [rcSeq1, setRcSeq1] = useState('2022200801');
const [rcSeq2, setRcSeq2] = useState('2022200899');
const [selection, setSelection] = 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
};
findParkingTargets(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
}
});
};
const handleSave = () => {
if (selection.length === 0) {
xitCmm.alertParam(`처리할 데이타가 없습니다`);
} else {
setOpen(true);
// alert(` => ${selectRows}`);
}
};
const submitParkingSimsa = (params) => {
const param = {
...params,
rcIrTransfer,
rcSeq1,
rcSeq2,
rcCodes: selection.map((d) => rowsStatus.rows[d - 1].rcCode)
};
setOpen(false);
// return false;
saveParkingTargets(param).then(() => {
setSelection([]);
search();
});
};
const handleSearch = () => {
if (rcSeq1 && rcSeq2) {
search();
}
};
const handleOnKeyDown = (event) => {
if (event.type === 'keydown' && event.key === 'Enter' && rcSeq1 && rcSeq2) {
search();
}
};
const handleSelection = (newSelection) => {
setSelection(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="####-######"
/>
&nbsp;-&nbsp;
<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={selection.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}>
<SaveResidentSimsaForm isDisabled={selection.length === 0} handleModalSave={submitResidentSimsa} />
</CmmModal>
</MainCard>
);
};
export default ResidentRegister;

@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { Button, Divider, Grid } from '@mui/material';
import { Button, Divider, Grid, Link } from '@mui/material';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
@ -8,13 +8,16 @@ import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/form/MuiDataGrid';
import CmmModal from 'views/form/Modal/CmmModal';
import { getResidents, saveResidentData } from 'apis/resident';
import SaveResidentDataForm from './SaveResidentDataForm';
import { findResident, findResidents, saveResidentData } from 'apis/resident';
import NewResidentDataForm from './NewResidentDataForm';
import ModifyResidentDataForm from './ModifyResidentDataForm';
const ResidentDataReview = () => {
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({
@ -27,7 +30,16 @@ const ResidentDataReview = () => {
const columns = [
{ headerName: 'No.', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
{ headerName: '심사코드?', field: 'scCode', hide: true },
{ headerName: '접수번호', headerAlign: 'center', field: 'scSeq' },
{
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' },
@ -48,7 +60,7 @@ const ResidentDataReview = () => {
size: rowsState.pageSize
};
getResidents(params).then((response) => {
findResidents(params).then((response) => {
console.log(response);
if (response && response.data) {
setTotalCount(response.count);
@ -69,6 +81,17 @@ const ResidentDataReview = () => {
setOpen(true);
};
const handleOnCellClick = (e) => {
if (e?.field === 'scSeq') {
findResident(e.row?.scCode).then((res) => {
setRowData(res.data);
setCreate(false);
setTitle('거주자 의견진술 자료 변경');
setOpen(true);
});
}
};
const handleSaveResident = (payload) => {
saveResidentData(payload).then(() => {
search();
@ -91,9 +114,16 @@ const ResidentDataReview = () => {
<Grid item xs={12}>
<Divider />
</Grid>
<MuiDataGrid columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
<MuiDataGrid
columns={columns}
rowsState={rowsState}
totalCount={totalCount}
setRowsState={setRowsState}
handleCellClick={handleOnCellClick}
/>
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
<SaveResidentDataForm handleModalSave={handleSaveResident} />
{create && <NewResidentDataForm handleModalSave={handleSaveResident} />}
{!create && <ModifyResidentDataForm handleModalSave={handleSaveResident} rowData={rowData} />}
</CmmModal>
</MainCard>
);

@ -0,0 +1,172 @@
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 SaveResidentSimsaForm = ({ 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>
</>
);
};
SaveResidentSimsaForm.propTypes = {
handleModalSave: PropTypes.func.isRequired
// isDisabled: PropTypes.bool.isRequired
};
export default SaveResidentSimsaForm;

@ -2,7 +2,7 @@ import { Button, Grid, TextField } from '@mui/material';
import { FileUpload } from '@mui/icons-material';
import PropTypes from 'prop-types';
const FileInputForms = ({ fieldName, index, labelName, selectedFile, handleChangeFile, alert, isDisabled = true }) => {
const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, handleChangeFile, alert, isDisabled = true }) => {
const onChangeFile = (e) => {
const file = e.target.files[0];
if (file.type.includes('image')) {
@ -14,7 +14,7 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, handleChang
return (
<Grid container item spacing={0.5}>
<Grid item xs={12} sm={7.5}>
<TextField placeholder={labelName} value={selectedFile} size="small" startIcon={<FileUpload />} onClick={() => {}} />
<TextField placeholder={labelName} value={fileName ?? selectedFile} size="small" startIcon={<FileUpload />} onClick={() => {}} />
</Grid>
<Grid item xs={12} sm={4.5}>
<Button disabled={isDisabled} variant="contained" component="label" color="primary" size="small" startIcon={<FileUpload />}>
@ -31,6 +31,7 @@ FileInputForms.propTypes = {
index: PropTypes.number.isRequired,
labelName: PropTypes.number.isRequired,
selectedFile: PropTypes.string,
fileName: PropTypes.string,
isDisabled: PropTypes.bool.isRequired,
handleChangeFile: PropTypes.func.isRequired,
alert: PropTypes.func.isRequired

Loading…
Cancel
Save