feat: 거주자 심의 반영

main
minuk926 3 years ago
parent 053c1252b0
commit 43f1debfd0

@ -3,7 +3,7 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
import axios from 'utils/axios'; import axios from 'utils/axios';
import { GET_PARKING_LIST, GET_PARKING_TARGET_LIST, SAVE_PARKING_TARGET_LIST } from 'commons/ApiUrl'; import { GET_PARKING_JUDGE_TARGET_LIST, GET_PARKING_LIST, SAVE_PARKING_JUDGE_TARGET_LIST } from 'commons/ApiUrl';
import { setRowId } from './common'; import { setRowId } from './common';
// eslint-disable-next-line no-return-await // eslint-disable-next-line no-return-await
@ -16,8 +16,8 @@ export async function findParkings(params) {
return res; return res;
} }
export async function findParkingTargets(params) { export async function findParkingJudgeTargets(params) {
const res = await axios.get(GET_PARKING_TARGET_LIST, { params }); const res = await axios.get(GET_PARKING_JUDGE_TARGET_LIST, { params });
if (res.success) { if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res; return res;
@ -25,8 +25,8 @@ export async function findParkingTargets(params) {
return res; return res;
} }
export async function saveParkingTargets(params) { export async function saveParkingJudgeTargets(params) {
const res = await axios.post(SAVE_PARKING_TARGET_LIST, params); const res = await axios.post(SAVE_PARKING_JUDGE_TARGET_LIST, params);
if (res.success) { if (res.success) {
return res; return res;
} }

@ -3,7 +3,14 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
import axios from 'utils/axios'; import axios from 'utils/axios';
import { GET_RESIDENT, GET_RESIDENT_DATA_LIST, GET_RESIDENT_LIST, SAVE_RESIDENT_DATA } from 'commons/ApiUrl'; import {
GET_RESIDENT,
GET_RESIDENT_DATA_LIST,
GET_RESIDENT_JUDGE_TARGET_LIST,
GET_RESIDENT_LIST,
SAVE_RESIDENT_DATA,
SAVE_RESIDENT_JUDGE_TARGET_LIST
} from 'commons/ApiUrl';
import { setRowId } from './common'; import { setRowId } from './common';
// eslint-disable-next-line no-return-await // eslint-disable-next-line no-return-await
@ -41,3 +48,20 @@ export async function findResidents(params) {
} }
return res; return res;
} }
export async function findResidentJudgeTargets(params) {
const res = await axios.get(GET_RESIDENT_JUDGE_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 saveResidentJudgeTargets(params) {
const res = await axios.post(SAVE_RESIDENT_JUDGE_TARGET_LIST, params);
if (res.success) {
return res;
}
return res;
}

@ -16,8 +16,8 @@ export const GET_BOARD_LIST = '/api/v1/ctgy/board';
// 주정차 의견 진술 // 주정차 의견 진술
export const GET_PARKING_LIST = '/api/v1/ctgy/parking'; export const GET_PARKING_LIST = '/api/v1/ctgy/parking';
export const GET_PARKING_TARGET_LIST = '/api/v1/ctgy/parking/target'; export const GET_PARKING_JUDGE_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const SAVE_PARKING_TARGET_LIST = '/api/v1/ctgy/parking/target'; export const SAVE_PARKING_JUDGE_TARGET_LIST = '/api/v1/ctgy/parking/target';
// export const GET_PARKING_DETAILS_LIST = '/api/v1/ctgy/parking/details'; // export const GET_PARKING_DETAILS_LIST = '/api/v1/ctgy/parking/details';
// 거주자 의견 진술 // 거주자 의견 진술
@ -25,6 +25,8 @@ export const GET_RESIDENT_DATA_LIST = '/api/v1/ctgy/resident/data';
export const SAVE_RESIDENT_DATA = '/api/v1/ctgy/resident/data'; export const SAVE_RESIDENT_DATA = '/api/v1/ctgy/resident/data';
export const GET_RESIDENT = '/api/v1/ctgy/resident/'; export const GET_RESIDENT = '/api/v1/ctgy/resident/';
export const GET_RESIDENT_LIST = '/api/v1/ctgy/resident'; export const GET_RESIDENT_LIST = '/api/v1/ctgy/resident';
export const GET_RESIDENT_JUDGE_TARGET_LIST = '/api/v1/ctgy/resident/target';
export const SAVE_RESIDENT_JUDGE_TARGET_LIST = '/api/v1/ctgy/resident/target';
// 사용자 관리 // 사용자 관리
export const GET_USER_BOARD_LIST = '/api/v1/ctgy/pboard/'; export const GET_USER_BOARD_LIST = '/api/v1/ctgy/pboard/';

@ -18,7 +18,7 @@ import CmmModal from 'views/form/Modal/CmmModal';
import SaveParkingTargetForm from './SaveParkingTargetForm'; import SaveParkingTargetForm from './SaveParkingTargetForm';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/form/ExcelDownload'; import ExcelDownload from 'views/form/ExcelDownload';
import { findParkingTargets, saveParkingTargets } from 'apis/parking'; import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking';
const ParkingRegister = () => { const ParkingRegister = () => {
const [rcIrTransfer, setRcIrTransfer] = useState('1'); const [rcIrTransfer, setRcIrTransfer] = useState('1');
@ -58,7 +58,7 @@ const ParkingRegister = () => {
rcSeq2 rcSeq2
}; };
findParkingTargets(params).then((response) => { findParkingJudgeTargets(params).then((response) => {
if (response && response.data) { if (response && response.data) {
setSelectionModel([]); setSelectionModel([]);
setTotalCount(response.count); setTotalCount(response.count);
@ -87,7 +87,7 @@ const ParkingRegister = () => {
setOpen(false); setOpen(false);
// return false; // return false;
saveParkingTargets(param).then(() => { saveParkingJudgeTargets(param).then(() => {
setSelectionModel([]); setSelectionModel([]);
search(); search();
}); });

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

@ -65,8 +65,8 @@ const ResidentReview = () => {
*/ */
const columns = [ const columns = [
// { headerName: 'rowId', field: 'rowId' }, // { headerName: 'rowId', field: 'rowId' },
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu' }, { headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center' },
{ headerName: '심사건수', headerAlign: 'center', field: 'cnt' }, { headerName: '심사건수', headerAlign: 'center', field: 'cnt', align: 'center' },
{ {
headerName: '심사기간', headerName: '심사기간',
headerAlign: 'center', headerAlign: 'center',
@ -88,7 +88,8 @@ const ResidentReview = () => {
{params.value} {params.value}
</Link> </Link>
// <ModalDetails /> // <ModalDetails />
) ),
align: 'center'
}, },
{ {
headerName: '심사마감일시', headerName: '심사마감일시',
@ -96,16 +97,24 @@ const ResidentReview = () => {
field: 'msCdate', field: 'msCdate',
type: 'dateTime', type: 'dateTime',
minWidth: 125, minWidth: 125,
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}` valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`,
align: 'center'
},
{
headerName: '상태',
headerAlign: 'center',
field: 'msResult',
renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'}</>,
align: 'center'
}, },
{ headerName: '상태', field: 'msResult', renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'}</> },
{ {
headerName: '삭제', headerName: '삭제',
headerAlign: 'center', headerAlign: 'center',
field: 'actions', field: 'actions',
type: 'actions', type: 'actions',
width: 80, width: 80,
getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeSimsa(params.row)} />] getActions: (params) => [<GridActionsCellItem icon={<DeleteIcon />} label="Delete" onClick={removeSimsa(params.row)} />],
align: 'center'
} }
]; ];

@ -158,7 +158,7 @@ const SaveResidentTargetForm = ({ handleModalSave }) => {
</Grid> </Grid>
</Grid> </Grid>
<Grid item sx={{ marginTop: 3 }}> <Grid item sx={{ marginTop: 3 }}>
<Button variant="contained" color="primary" size="small" startIcon={<IconFileExport />} onClick={onSave}> <Button disabled variant="contained" color="primary" size="small" startIcon={<IconFileExport />} onClick={onSave}>
저장 저장
</Button> </Button>
</Grid> </Grid>

Loading…
Cancel
Save