fix: 거주자 / 장애인 의견진술 공통화 진행

main
Lim Jonguk 3 years ago
parent 584cbe8cca
commit 72f75413a4

@ -9,7 +9,8 @@ import {
SAVE_JUDGE_DATA, SAVE_JUDGE_DATA,
GET_JUDGE_TARGET_LIST, GET_JUDGE_TARGET_LIST,
GET_JUDGE_LIST, GET_JUDGE_LIST,
SAVE_JUDGE_TARGET_LIST SAVE_JUDGE_TARGET_LIST,
GET_JUDGE_DETAIL_LIST
} from 'commons/ApiUrl'; } from 'commons/ApiUrl';
import { setRowId } from './common'; import { setRowId } from './common';
@ -49,6 +50,15 @@ export async function findJudges(params) {
return res; return res;
} }
export async function findJudgeDetails(params) {
const res = await axios.get(GET_JUDGE_DETAIL_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
export async function findJudgeTargets(params) { export async function findJudgeTargets(params) {
const res = await axios.get(GET_JUDGE_TARGET_LIST, { params }); const res = await axios.get(GET_JUDGE_TARGET_LIST, { params });
if (res.success) { if (res.success) {

@ -3,7 +3,7 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
import axios from 'utils/axios'; import axios from 'utils/axios';
import { GET_PARKING_JUDGE_TARGET_LIST, GET_PARKING_LIST, SAVE_PARKING_JUDGE_TARGET_LIST } from 'commons/ApiUrl'; import { GET_PARKING_DETAIL_LIST, 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,6 +16,15 @@ export async function findParkings(params) {
return res; return res;
} }
export async function findParkingDetails(params) {
const res = await axios.get(GET_PARKING_DETAIL_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}
export async function findParkingJudgeTargets(params) { export async function findParkingJudgeTargets(params) {
const res = await axios.get(GET_PARKING_JUDGE_TARGET_LIST, { params }); const res = await axios.get(GET_PARKING_JUDGE_TARGET_LIST, { params });
if (res.success) { if (res.success) {
@ -32,12 +41,3 @@ export async function saveParkingJudgeTargets(params) {
} }
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;
// }

@ -16,16 +16,17 @@ 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_DETAIL_LIST = '/api/v1/ctgy/parking/detail';
export const GET_PARKING_JUDGE_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 SAVE_PARKING_JUDGE_TARGET_LIST = '/api/v1/ctgy/parking/target';
// export const GET_PARKING_DETAILS_LIST = '/api/v1/ctgy/parking/details';
// 거주자/장애인 의견 진술 // 거주자/장애인 의견 진술
export const GET_JUDGE_DATA_LIST = '/api/v1/ctgy/judge/data'; export const GET_JUDGE_DATA_LIST = '/api/v1/ctgy/judge/data';
export const SAVE_JUDGE_DATA = '/api/v1/ctgy/judge/data'; export const SAVE_JUDGE_DATA = '/api/v1/ctgy/judge/data';
export const GET_JUDGE_DATA = '/api/v1/ctgy/judge/data/'; export const GET_JUDGE_DATA = '/api/v1/ctgy/judge/data/';
export const GET_JUDGE_LIST = '/api/v1/ctgy/judge'; export const GET_JUDGE_LIST = '/api/v1/ctgy/judge';
export const GET_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target'; export const GET_JUDGE_DETAIL_LIST = '/api/v1/ctgy/judge/detail';
export const GET_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge';
export const SAVE_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target'; export const SAVE_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target';
// 장애인 의견 진술 // 장애인 의견 진술

@ -22,7 +22,9 @@ const ParkingRegister = Loadable(lazy(() => import('views/biz/parking/ParkingReg
// resident // resident
const ResidentDataReview = Loadable(lazy(() => import('views/biz/resident/ResidentDataReview'))); const ResidentDataReview = Loadable(lazy(() => import('views/biz/resident/ResidentDataReview')));
const ResidentRegister = Loadable(lazy(() => import('views/biz/resident/ResidentRegist'))); const ResidentRegister = Loadable(lazy(() => import('views/biz/resident/ResidentRegist')));
const ResidentReview = Loadable(lazy(() => import('views/biz/resident/ResidentReview')));
// Resident /Disabled
const JudgeReview = Loadable(lazy(() => import('views/biz/judge/JudgeReview')));
// disabled // disabled
// const DisabledDataReview = Loadable(lazy(() => import('views/biz/disabled/DisabledDataReview'))); // const DisabledDataReview = Loadable(lazy(() => import('views/biz/disabled/DisabledDataReview')));
@ -76,7 +78,7 @@ const MainRoutes = {
}, },
{ {
path: '/resident/review', path: '/resident/review',
element: <ResidentReview /> element: <JudgeReview msDatagb="1" menuName="거주자" />
}, },
{ {
path: '/resident/register', path: '/resident/register',
@ -89,7 +91,7 @@ const MainRoutes = {
}, },
{ {
path: '/disabled/review', path: '/disabled/review',
element: <></> // <DisabledReview /> element: <JudgeReview msDatagb="2" menuName="장애인" /> // <DisabledReview />
}, },
{ {
path: '/disabled/register', path: '/disabled/register',

@ -38,17 +38,9 @@ const alertError = (config, request, response, error) => {
return; return;
} }
if (response.data) { if (response.data) {
const errCode = response.data.code || response.data.status; const errCode = response.data?.code || response.data?.status;
let errMsg = ''; const errMsg = response.data?.message || response.data?.error;
if (response.data.code !== '' && response.data.code !== null) { console.error(`============= ${errCode}: ${errMsg} ====================`);
if (response.data.message !== '' && response.data.message != null) {
errMsg = response.data.message;
} else {
errMsg = response.data.error;
}
}
console.error(`${errCode}: ${errMsg}`);
console.error('=================================');
// Alert.error(`${errCode}: ${errMsg}`); // Alert.error(`${errCode}: ${errMsg}`);
Swal.fire({ Swal.fire({

@ -16,14 +16,21 @@ import MainCard from 'ui-component/cards/MainCard';
import MuiDataGrid from 'views/form/MuiDataGrid'; import MuiDataGrid from 'views/form/MuiDataGrid';
import xitCmm from 'commons/XitCmm'; import xitCmm from 'commons/XitCmm';
import InputLabel from 'ui-component/extended/Form/InputLabel'; import InputLabel from 'ui-component/extended/Form/InputLabel';
import { findJudges } from 'apis/judge'; import { findJudge, findJudges } from 'apis/judge';
import CmmModal from 'views/form/Modal/CmmModal';
import ModalJudgeDetail from './ModalJudgeDetail';
const ResidentReview = () => { const JudgeReview = ({ msDatagb, menuName }) => {
const isInit = useRef(true); const isInit = useRef(true);
const year = getYear(new Date()); const year = getYear(new Date());
console.log(typeof year); console.log(typeof year);
const years = _.range(year, year - 14, -1); const years = _.range(year, year - 14, -1);
const [open, setOpen] = useState(false);
// const [create, setCreate] = useState(false);
// const [selectedRow, setSelectedRow] = useState({});
const [title, setTitle] = useState();
const [selectedYear, setSelectedYear] = useState(year); const [selectedYear, setSelectedYear] = useState(year);
const [searchTxt, setSearchTxt] = useState(''); const [searchTxt, setSearchTxt] = useState('');
@ -34,7 +41,8 @@ const ResidentReview = () => {
rows: [] rows: []
// loading: false // loading: false
}); });
const removeSimsa = useCallback( const [selectedRowData, setSelectedRowData] = useState({});
const removeJudge = useCallback(
(row) => () => { (row) => () => {
// setTimeout(() => { // setTimeout(() => {
// setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId)); // setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId));
@ -45,24 +53,6 @@ const ResidentReview = () => {
[] []
); );
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 = [ const columns = [
// { headerName: 'rowId', field: 'rowId' }, // { headerName: 'rowId', field: 'rowId' },
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center' }, { headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center' },
@ -75,19 +65,9 @@ const ResidentReview = () => {
description: '심사기간', description: '심사기간',
valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`, valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`,
renderCell: (params) => ( renderCell: (params) => (
// <Link underline="hover" href="/parking/details" rel="noopener"> <Link underline="hover" href="#">
<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} {params.value}
</Link> </Link>
// <ModalDetails />
), ),
align: 'center' align: 'center'
}, },
@ -113,14 +93,14 @@ const ResidentReview = () => {
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={removeJudge(params.row)} />],
align: 'center' align: 'center'
} }
]; ];
const search = useCallback(() => { const search = useCallback(() => {
const params = { const params = {
// scDatagb: '1', msDatagb,
page: rowsState.page, page: rowsState.page,
size: rowsState.pageSize size: rowsState.pageSize
}; };
@ -133,7 +113,7 @@ const ResidentReview = () => {
// apiRef.current.updateRowData([]); // apiRef.current.updateRowData([]);
} }
}); });
}, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); }, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
const handleSearch = async (event) => { const handleSearch = async (event) => {
if (!selectedYear) return; if (!selectedYear) return;
@ -154,6 +134,25 @@ const ResidentReview = () => {
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); // }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
}, [search]); }, [search]);
const handleOnCellClick = (e) => {
if (e?.field === 'msDate') {
// findJudge(e.row?.msDate).then((res) => {
// setRowData(res.data);
// setCreate(false);
setSelectedRowData({
...selectedRowData,
msDatagb: e.row.msDatagb,
msSdate: e.row.msSdate,
msEdate: e.row.msEdate,
msChasu: e.row.msChasu,
msuTeam: e.row.msuTeam
});
setTitle(`${menuName} 의견진술 심의 상세 목록`);
setOpen(true);
// });
}
};
return ( return (
<MainCard> <MainCard>
<Grid container spacing={2} alignItems="center"> <Grid container spacing={2} alignItems="center">
@ -201,8 +200,17 @@ const ResidentReview = () => {
<Grid item xs={12}> <Grid item xs={12}>
<Divider /> <Divider />
</Grid> </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}>
<ModalJudgeDetail {...selectedRowData} />
</CmmModal>
</MainCard> </MainCard>
); );
}; };
export default ResidentReview; export default JudgeReview;

@ -0,0 +1,50 @@
import Board from '../board/Board';
import { useCallback, useEffect, useState } from 'react';
import { findJudgeDetails } from 'apis/judge';
const ModalDetails = ({ msDatagb, msSdate, msEdate, msChasu, msuTeam }) => {
const [rowData, setRowData] = useState({});
const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({
page: 0,
pageSize: 20,
rows: []
// loading: false
});
const search = useCallback(() => {
const params = {
msDatagb,
msSdate,
msEdate,
msChasu,
msuTeam
};
findJudgeDetails(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
// apiRef.current.forceUpdate(); // .updateRowData([]);
// apiRef.current.updateRowData([]);
}
});
}, [msDatagb, msSdate, msEdate, msChasu, msuTeam]);
useEffect(() => {
// if (isInit.current) {
// isInit.current = false;
// return;
// }
search();
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
}, [search]);
return (
<>
<h2>dkdkkdkd</h2>
</>
);
};
export default ModalDetails;
Loading…
Cancel
Save