fix: 거주지/장애인 상세 목록 반영

main
minuk926 3 years ago
parent 3cc537635b
commit fd94b75dc1

@ -19,17 +19,10 @@ const ParkingReview = Loadable(lazy(() => import('views/biz/parking/ParkingRevie
const ParkingDetails = Loadable(lazy(() => import('views/biz/parking/ModalDetails')));
const ParkingRegister = Loadable(lazy(() => import('views/biz/parking/ParkingRegister')));
// resident
const ResidentDataReview = Loadable(lazy(() => import('views/biz/resident/ResidentDataReview')));
const ResidentRegister = Loadable(lazy(() => import('views/biz/resident/ResidentRegist')));
// Resident /Disabled
const JudgeDataReview = Loadable(lazy(() => import('views/biz/judge/JudgeDataReview')));
const JudgeReview = Loadable(lazy(() => import('views/biz/judge/JudgeReview')));
// disabled
// const DisabledDataReview = Loadable(lazy(() => import('views/biz/disabled/DisabledDataReview')));
// const DisabledRegister = Loadable(lazy(() => import('views/biz/disabled/DisabledRegist')));
// const DisabledReview = Loadable(lazy(() => import('views/biz/disabled/DisabledReview')));
const JudgeRegistReview = Loadable(lazy(() => import('views/biz/judge/JudgeRegistReview')));
// user
const UserManager = Loadable(lazy(() => import('views/biz/user/UserManager')));
@ -74,7 +67,7 @@ const MainRoutes = {
/* 거주자 */
{
path: '/resident/data',
element: <ResidentDataReview scDatagb="1" menuName="거주자" />
element: <JudgeDataReview scDatagb="1" menuName="거주자" />
},
{
path: '/resident/review',
@ -82,12 +75,12 @@ const MainRoutes = {
},
{
path: '/resident/register',
element: <ResidentRegister />
element: <JudgeRegistReview scDatagb="1" menuName="거주자" />
},
/* 장애인 */
{
path: '/disabled/data',
element: <ResidentDataReview scDatagb="2" menuName="장애인" />
element: <JudgeDataReview scDatagb="2" menuName="장애인" />
},
{
path: '/disabled/review',
@ -95,7 +88,7 @@ const MainRoutes = {
},
{
path: '/disabled/register',
element: <></> // <DisabledRegister />
element: <JudgeRegistReview scDatagb="2" menuName="장애인" />
},
/* 사용자 */
{

@ -13,7 +13,7 @@ import NewJudgeDataForm from 'views/biz/judge/NewJudgeDataForm';
import ModifyJudgeDataForm from 'views/biz/judge/ModifyJudgeDataForm';
import PropTypes from 'prop-types';
const ResidentDataReview = ({ scDatagb, menuName }) => {
const JudgeDataReview = ({ scDatagb, menuName }) => {
const [open, setOpen] = useState(false);
const [create, setCreate] = useState(false);
// const [selectedRow, setSelectedRow] = useState({});
@ -75,7 +75,7 @@ const ResidentDataReview = ({ scDatagb, menuName }) => {
useEffect(() => {
search();
}, [search]); // search, rowsState.page, rowsState.pageSize]);
}, [search]);
const handleCreate = () => {
setTitle(`${menuName} 의견진술 자료 신규 등록`);
@ -106,7 +106,7 @@ const ResidentDataReview = ({ scDatagb, menuName }) => {
<Grid container alignItems="right">
<Grid item>
<Button variant="contained" size="small" onClick={handleCreate}>
의견진술 자료 등록
{`${menuName} 의견진술 자료 등록`}
</Button>
</Grid>
</Grid>
@ -127,9 +127,9 @@ const ResidentDataReview = ({ scDatagb, menuName }) => {
</MainCard>
);
};
ResidentDataReview.propTypes = {
JudgeDataReview.propTypes = {
scDatagb: PropTypes.string.isRequired,
menuName: PropTypes.string.isRequired
};
export default ResidentDataReview;
export default JudgeDataReview;

@ -1,4 +1,4 @@
import { useState } from 'react';
import { useCallback, useEffect, useState } from 'react';
// material-ui
import { Button, Divider, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from '@mui/material';
@ -19,19 +19,21 @@ import SaveJudgeTargetForm from 'views/biz/judge/SaveJudgeTargetForm';
import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/form/ExcelDownload';
import { findJudgeTargets, saveJudgeTargets } from 'apis/judge';
import PropTypes from 'prop-types';
const ResidentRegister = () => {
const JudgeRegistReview = ({ scDatagb, menuName }) => {
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({
const [rowsState, setRowsState] = useState({
page: 0,
pageSize: 100,
rows: []
});
const [open, setOpen] = useState(false);
const [title, setTitle] = useState();
const columns = [
{ headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
@ -50,9 +52,9 @@ const ResidentRegister = () => {
{ headerName: '접수방법', headerAlign: 'center', field: 'scIngbNm', align: 'center' }
];
const search = () => {
const search = useCallback(() => {
const params = {
scDatagb: '1', //
scDatagb, //
scTransfer,
scSeq1,
scSeq2
@ -62,15 +64,16 @@ const ResidentRegister = () => {
if (response && response.data) {
setSelectionModel([]);
setTotalCount(response.count);
setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data }));
setRowsState((prevRows) => ({ ...prevRows, rows: response.data }));
}
});
};
}, [rowsState.page, rowsState.pageSize, scDatagb]);
const handleSave = () => {
if (selectionModel.length === 0) {
xitCmm.alertParam(`처리할 데이타가 없습니다`);
} else {
setTitle(`${menuName} 의견진술 심의목록 저장`);
setOpen(true);
// alert(` => ${selectRows}`);
}
@ -79,11 +82,11 @@ const ResidentRegister = () => {
const submitResidentTargets = (params) => {
const param = {
...params,
scDatagb: '1', //
scDatagb, //
scTransfer,
scSeq1,
scSeq2,
scCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].scCode)
scCodes: selectionModel.map((d) => rowsState.rows[d - 1].scCode)
};
setOpen(false);
console.log(param);
@ -100,6 +103,10 @@ const ResidentRegister = () => {
}
};
useEffect(() => {
search();
}, [search]);
const handleOnKeyDown = (event) => {
if (event.type === 'keydown' && event.key === 'Enter' && scSeq1 && scSeq2) {
search();
@ -179,7 +186,12 @@ const ResidentRegister = () => {
</Button>
</Grid>
<Grid item>
<ExcelDownload fileName="심사등록대상" gridColumns={columns} excelDatas={rowsStatus.rows} isDisabled={totalCount === 0} />
<ExcelDownload
fileName={`${menuName} 의견진술 심의목록`}
gridColumns={columns}
excelDatas={rowsState.rows}
isDisabled={totalCount === 0}
/>
</Grid>
</Grid>
</Grid>
@ -195,16 +207,20 @@ const ResidentRegister = () => {
isCheckbox
isHideFooter
columns={columns}
rowsState={rowsStatus}
rowsState={rowsState}
totalCount={totalCount}
setRowsStatus={setRowsStatus}
setrowsState={setRowsState}
handleSelection={handleSelection}
selectionModel={selectionModel}
/>
<CmmModal isBackdrop title="심의등록" open={open} setOpen={setOpen}>
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
<SaveJudgeTargetForm isDisabled={selectionModel.length === 0} handleModalSave={submitResidentTargets} />
</CmmModal>
</MainCard>
);
};
export default ResidentRegister;
JudgeRegistReview.propTypes = {
scDatagb: PropTypes.string.isRequired,
menuName: PropTypes.string.isRequired
};
export default JudgeRegistReview;
Loading…
Cancel
Save