feat: 거주자 심의 반영

main
minuk926 3 years ago
parent 053c1252b0
commit 43f1debfd0

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

@ -3,7 +3,14 @@
//----------------------------------------------------------------------------
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';
// eslint-disable-next-line no-return-await
@ -41,3 +48,20 @@ export async function findResidents(params) {
}
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_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const SAVE_PARKING_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const GET_PARKING_JUDGE_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';
// 거주자 의견 진술
@ -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 GET_RESIDENT = '/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/';

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

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

@ -65,8 +65,8 @@ const ResidentReview = () => {
*/
const columns = [
// { headerName: 'rowId', field: 'rowId' },
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu' },
{ headerName: '심사건수', headerAlign: 'center', field: 'cnt' },
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center' },
{ headerName: '심사건수', headerAlign: 'center', field: 'cnt', align: 'center' },
{
headerName: '심사기간',
headerAlign: 'center',
@ -88,7 +88,8 @@ const ResidentReview = () => {
{params.value}
</Link>
// <ModalDetails />
)
),
align: 'center'
},
{
headerName: '심사마감일시',
@ -96,16 +97,24 @@ const ResidentReview = () => {
field: 'msCdate',
type: 'dateTime',
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: '삭제',
headerAlign: 'center',
field: 'actions',
type: 'actions',
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 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>
</Grid>

Loading…
Cancel
Save