feat: 심사자 거주자/장애인 심의목록 조회 반영

design 반영
main
minuk926 3 years ago
parent e14ed3e528
commit e23a8c43a3

@ -4,24 +4,25 @@
import axios from 'utils/axios';
import {
GET_JUDGE_DATA,
GET_JUDGE_DATA_LIST,
SAVE_JUDGE_DATA,
GET_JUDGE_TARGET_LIST,
GET_JUDGE_LIST,
SAVE_JUDGE_TARGET_LIST,
GET_JUDGE_RESULT_LIST,
GET_ADMIN_JUDGE_DATA,
GET_ADMIN_JUDGE_DATA_LIST,
SAVE_ADMIN_JUDGE_DATA,
GET_ADMIN_JUDGE_TARGET_LIST,
GET_ADMIN_JUDGE_LIST,
SAVE_ADMIN_JUDGE_TARGET_LIST,
GET_ADMIN_JUDGE_RESULT_LIST,
GET_PARKING_JUDGE_RESULT_LIST,
REMOVE_JUDGE,
REMOVE_ADMIN_JUDGE,
GET_JUDGE_FILE_DOWNLOAD,
REMOVE_JUDGE_DATA
REMOVE_ADMIN_JUDGE_DATA,
GET_JUDGE_LIST
} from 'commons/ApiUrl';
import { setRowId } from './common';
import FileSaver from 'file-saver';
// eslint-disable-next-line no-return-await
export async function findJudgeDatas(params) {
const res = await axios.get(GET_JUDGE_DATA_LIST, { params });
const res = await axios.get(GET_ADMIN_JUDGE_DATA_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
@ -31,7 +32,7 @@ export async function findJudgeDatas(params) {
export async function saveJudgeData(formData) {
// eslint-disable-next-line no-return-await
return await axios(SAVE_JUDGE_DATA, {
return await axios(SAVE_ADMIN_JUDGE_DATA, {
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' } // , Authorization: localStorage.getItem('access_token') }
@ -40,16 +41,16 @@ export async function saveJudgeData(formData) {
export async function removeJudgeData(params) {
// eslint-disable-next-line no-return-await
return await axios.post(REMOVE_JUDGE_DATA, params);
return await axios.post(REMOVE_ADMIN_JUDGE_DATA, params);
}
export async function findJudge(scCode) {
// eslint-disable-next-line no-return-await
return await axios.get(GET_JUDGE_DATA + scCode);
return await axios.get(GET_ADMIN_JUDGE_DATA + scCode);
}
export async function findJudges(params) {
const res = await axios.get(GET_JUDGE_LIST, { params });
const res = await axios.get(GET_ADMIN_JUDGE_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
@ -59,7 +60,7 @@ export async function findJudges(params) {
export async function findJudgeResults2(params) {
// eslint-disable-next-line no-return-await
return await axios.get(GET_JUDGE_RESULT_LIST, { params });
return await axios.get(GET_ADMIN_JUDGE_RESULT_LIST, { params });
}
/**
@ -69,7 +70,7 @@ export async function findJudgeResults2(params) {
* @returns {Promise<{judgeData: ([]|*), judgeTeam: *, totJudgeUserData: *[][], simsaUser: *}|*>}
*/
export async function findJudgeResults(params, isParking) {
const res = await axios.get(isParking ? GET_PARKING_JUDGE_RESULT_LIST : GET_JUDGE_RESULT_LIST, { params });
const res = await axios.get(isParking ? GET_PARKING_JUDGE_RESULT_LIST : GET_ADMIN_JUDGE_RESULT_LIST, { params });
if (res && res.success && res.data) {
const totJudgeUserData = res.data?.totJudgeUserData;
@ -104,7 +105,7 @@ export async function findJudgeResults(params, isParking) {
}
export async function findJudgeTargets(params) {
const res = await axios.get(GET_JUDGE_TARGET_LIST, { params });
const res = await axios.get(GET_ADMIN_JUDGE_TARGET_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
@ -114,12 +115,12 @@ export async function findJudgeTargets(params) {
export async function saveJudgeTargets(params) {
// eslint-disable-next-line no-return-await
return await axios.post(SAVE_JUDGE_TARGET_LIST, params);
return await axios.post(SAVE_ADMIN_JUDGE_TARGET_LIST, params);
}
export async function removeJudge(params) {
// eslint-disable-next-line no-return-await
return await axios.post(REMOVE_JUDGE, params);
return await axios.post(REMOVE_ADMIN_JUDGE, params);
}
export async function judgeFileDownload(params, alert) {
@ -153,3 +154,15 @@ export async function judgeFileDownload(params, alert) {
}
});
}
//----------------------------------------------------------------
// 심사자
//----------------------------------------------------------------
export async function findByUserJudges(params) {
const res = await axios.get(GET_JUDGE_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}

@ -25,18 +25,21 @@ export const SAVE_PARKING_JUDGE_TARGET_LIST = '/api/v1/ctgy/parking/target';
export const REMOVE_PARKING_JUDGE = '/api/v1/ctgy/parking/remove';
// 거주자/장애인 의견 진술
export const GET_JUDGE_DATA_LIST = '/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 REMOVE_JUDGE_DATA = '/api/v1/ctgy/judge/data/remove';
export const GET_ADMIN_JUDGE_DATA_LIST = '/api/v1/ctgy/admin/data';
export const SAVE_ADMIN_JUDGE_DATA = '/api/v1/ctgy/admin/data';
export const GET_ADMIN_JUDGE_DATA = '/api/v1/ctgy/admin/data/';
export const REMOVE_ADMIN_JUDGE_DATA = '/api/v1/ctgy/admin/data/remove';
export const GET_ADMIN_JUDGE_LIST = '/api/v1/ctgy/admin';
export const GET_ADMIN_JUDGE_RESULT_LIST = '/api/v1/ctgy/admin/result';
export const GET_ADMIN_JUDGE_TARGET_LIST = '/api/v1/ctgy/admin/target';
export const SAVE_ADMIN_JUDGE_TARGET_LIST = '/api/v1/ctgy/admin/target';
export const REMOVE_ADMIN_JUDGE = '/api/v1/ctgy/admin/remove';
export const GET_JUDGE_LIST = '/api/v1/ctgy/judge';
export const GET_JUDGE_RESULT_LIST = '/api/v1/ctgy/judge/result';
export const GET_JUDGE_FILE_DOWNLOAD = '/api/v1/ctgy/cmm/download/judge';
export const GET_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target';
export const SAVE_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target';
export const REMOVE_JUDGE = '/api/v1/ctgy/judge/remove';
export const GET_JUDGE_FILE_DOWNLOAD = '/api/v1/ctgy/cmm/download/judge';
// 사용자 관리
export const GET_USER_LIST = '/api/v1/ctgy/user';

@ -81,7 +81,7 @@ const judge = {
id: 'judge-2-2',
title: <FormattedMessage id="judge-2-2" />,
type: 'item',
url: '/resident/review',
url: '/judge/resident/review',
icon: icons.IconList
},
{
@ -89,7 +89,7 @@ const judge = {
id: 'judge-2-3',
title: <FormattedMessage id="judge-2-3" />,
type: 'item',
url: '/disabled/review',
url: '/judge/disabled/review',
icon: icons.IconList
}
]

@ -18,10 +18,11 @@ const Board = Loadable(lazy(() => import('views/biz/board/Board')));
const ParkingReview = Loadable(lazy(() => import('views/biz/admin/parking/ParkingReview')));
const ParkingRegister = Loadable(lazy(() => import('views/biz/admin/parking/ParkingRegister')));
// Resident /Disabled
// Admin Resident /Disabled
const JudgeDataReview = Loadable(lazy(() => import('views/biz/admin/judge/JudgeDataReview')));
const JudgeReview = Loadable(lazy(() => import('views/biz/admin/judge/JudgeReview')));
const JudgeRegistReview = Loadable(lazy(() => import('views/biz/admin/judge/JudgeRegistReview')));
const UserByJudgeReview = Loadable(lazy(() => import('views/biz/judge/JudgeReview')));
// user
const UserManager = Loadable(lazy(() => import('views/biz/user/UserManager')));
@ -105,6 +106,15 @@ const MainRoutes = {
},
// ----------------------------------------
{
path: '/judge/resident/review',
element: <UserByJudgeReview msDatagb="1" menuName="거주자" />
},
{
path: '/judge/disabled/review',
element: <UserByJudgeReview msDatagb="2" menuName="장애인" />
},
{
path: '/sample-page',
element: <SamplePage />

@ -136,7 +136,18 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
/>
</Grid>
<Grid item sm={6}>
<TextField disabled size="small" required label="위반장소" fullWidth value={rowData.scPos} />
<TextField
sx={{
border: '0px solid red',
marginLeft: '8px'
}}
disabled
size="small"
required
label="위반장소"
fullWidth
value={rowData.scPos}
/>
</Grid>
</Grid>
<Grid container spacing={1} xs={12} mt={1}>

@ -288,6 +288,10 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
</Grid>
<Grid item sm={6}>
<TextField
sx={{
border: '0px solid red',
marginLeft: '8px'
}}
size="small"
required
label="위반장소"

@ -224,7 +224,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
}}
/>
</Grid>
<Grid item sm={5}>
<Grid item sm={5} className="fix_address">
<TextField size="small" required disabled label="주소" fullWidth value={scJuso} onChange={(e) => setScJuso(e?.target?.value)} />
</Grid>
<Grid item sm={5.3}>

@ -111,14 +111,30 @@ const JudgeReview = ({ msDatagb, menuName }) => {
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`,
align: 'center'
},
/*
{
headerName: '상태',
headerAlign: 'center',
field: 'msResult',
width: 150,
renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'}</>,
renderCell: (params) => {
switch (params.row.msResult) {
case '0':
return '심의전';
// break;
case '1':
return '부과';
// break;
case '2':
return '미부과';
// break;
default:
return params.row.msResult;
}
},
align: 'center'
},
*/
{
headerName: '삭제',
headerAlign: 'center',

@ -94,13 +94,21 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
};
return (
<Box>
<Box
sx={{
border: '0px solid red',
'& .MuiTypography-root': {
border: '0px solid pink',
fontWeight: '400'
}
}}
>
<Grid container spacing={1} alignItems="center" mb={1}>
<Grid item xs={12}>
<Grid container spacing={1}>
<Grid item sm={5}>
<Typography variant="subtitle1">
심의차수: {selectedRow.msChasu} 심의기간: {selectedRow.msSdate} ~ {selectedRow.msEdate}
심의차수: {selectedRow.msChasu} 심의기간: {selectedRow.msSdate} ~ {selectedRow.msEdate}
</Typography>
</Grid>
<Grid item sm={2}>
@ -192,11 +200,21 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
</StyledTableRow>
))}
</TableBody>
<TableFooter>{judgeResult && `${selectedRow.cnt} 건중 ${judgeResult.judgeCars.length}`}</TableFooter>
{/* <TableFooter>{judgeResult && `총 ${selectedRow.cnt} 건중 ${judgeResult.judgeCars.length} 건`}</TableFooter> */}
</Table>
</TableContainer>
</Paper>
<MuiAlert open={alertOpen} setOpen={setAlertOpen} />
<TableFooter
sx={{
border: '0px solid red',
display: 'flex',
flexDirection: 'row-reverse',
paddingTop: '5px'
}}
>
{judgeResult && `${selectedRow.cnt} 건중 ${judgeResult.judgeCars.length}`}
</TableFooter>
</Box>
);
};

@ -112,6 +112,7 @@ const ParkingReview = () => {
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`,
align: 'center'
},
/*
{
headerName: '상태',
headerAlign: 'center',
@ -120,6 +121,7 @@ const ParkingReview = () => {
renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'}</>,
align: 'center'
},
*/
{
headerName: '삭제',
headerAlign: 'center',

@ -112,7 +112,7 @@ const PublicBoardForm = (props) => {
<Grid item xs={12} sm={6}>
<TextField
size="small"
disabled={!owner}
disabled={!create}
required
label="제목"
value={subject}
@ -161,7 +161,7 @@ const PublicBoardForm = (props) => {
quillRef.current = element;
}
}}
readOnly={!owner}
readOnly={!create}
value={contents}
onChange={setContents}
modules={modules}
@ -175,7 +175,7 @@ const PublicBoardForm = (props) => {
<Grid item sm={6}>
<FileForm
isDownload={rowData.inFilename}
isDisabled={!owner}
isDisabled={false}
labelName="첨부파일"
savedFilename={rowData.inFilename}
selectedFile={selectedFile}
@ -198,13 +198,13 @@ const PublicBoardForm = (props) => {
</Button>
</Grid>
<Grid item style={{ marginLeft: 'auto' }}>
<Button disabled={!owner} variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
<Button disabled={false} variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
저장
</Button>
</Grid>
{!create && (
<Grid item>
<Button disabled={!owner} variant="contained" size="small" startIcon={<Delete />} onClick={onRemove}>
<Button disabled={false} variant="contained" size="small" startIcon={<Delete />} onClick={onRemove}>
삭제
</Button>
</Grid>

@ -0,0 +1,286 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import getYear from 'date-fns/getYear';
// material-ui
import { GridActionsCellItem } from '@mui/x-data-grid';
import { Button, Divider, FormControl, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select } from '@mui/material';
import DeleteIcon from '@mui/icons-material/Delete';
import { IconSearch, IconFileReport } from '@tabler/icons';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import InputLabel from 'ui-component/extended/Form/InputLabel';
import { findByUserJudges, findJudgeResults, findJudges, removeJudge } from 'apis/judge';
import CmmModal from 'views/cmm/CmmModal';
const JudgeReview = ({ msDatagb, menuName }) => {
const isInit = useRef(true);
const year = getYear(new Date());
const years = _.range(year, year - 14, -1);
const [open, setOpen] = useState(false);
const [title, setTitle] = useState();
const [selectedYear, setSelectedYear] = useState(year);
const [searchTxt, setSearchTxt] = useState('');
const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({
page: 0,
pageSize: 100,
rows: []
// loading: false
});
const [judgeResultData, setJudgeResultData] = useState({
totJudgeUserData: [],
judgeData: [],
judgeCars: [],
judgeUserData: [],
simsaUser: [],
selectedRow: {},
judgeTeam: ''
});
const search = useCallback(() => {
const params = {
msDatagb
};
findByUserJudges(params).then((response) => {
if (response && response.data) {
setTotalCount(response.count);
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
// apiRef.current.forceUpdate(); // .updateRowData([]);
// apiRef.current.updateRowData([]);
}
});
}, [msDatagb, selectedYear, searchTxt]);
const execJudge = useCallback(
(row) => () => {
// removeJudge(row).then((response) => {
// if (response && response.success) {
// setRowsState({
// ...rowsState,
// page: 0
// });
// search();
// } else {
// alert.show(response.message);
// }
// });
},
[]
);
const columns = [
// { headerName: 'rowId', field: 'rowId' },
{ headerName: '접수번호', headerAlign: 'center', field: 'msSeq', align: 'center', width: 100 },
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center', width: 100 },
{ headerName: '차량번호', headerAlign: 'center', field: 'msCarnum', align: 'center', width: 100 },
{
headerName: '심의결정',
headerAlign: 'center',
field: 'msResult',
align: 'center',
renderCell: (params) => {
switch (params.row.msResult) {
case '0':
return '심의전';
// break;
case '1':
return '부과';
// break;
case '2':
return '미부과';
// break;
default:
return params.row.msResult;
}
},
width: 100
},
{
headerName: '심의결정(msu)',
headerAlign: 'center',
field: 'msuResult',
align: 'center',
renderCell: (params) => {
switch (params.row.msResult) {
case '0':
return '심의전';
// break;
case '1':
return '부과';
// break;
case '2':
return '미부과';
// break;
default:
return params.row.msResult;
}
},
width: 100
},
{
headerName: '심사 마감 일시',
headerAlign: 'center',
field: 'msCdate',
type: 'dateTime',
minWidth: 150,
width: 200,
valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}`,
align: 'center'
},
{
headerName: '상태',
headerAlign: 'center',
field: 'msResult',
width: 150,
renderCell: (params) => {
switch (params.row.msResult) {
case '0':
return '심의전';
// break;
case '1':
return '부과';
// break;
case '2':
return '미부과';
// break;
default:
return params.row.msResult;
}
},
align: 'center'
},
{
headerName: '개별심사',
headerAlign: 'center',
field: 'actions',
type: 'actions',
width: 80,
// getActions: (params) => [<GridActionsCellItem icon={<IconFileReport />} label="" onClick={deleteJudge(params.row)} />],
getActions: (params) => [
<Button color="warning" onClick={execJudge(params.row)}>
처리
</Button>
],
align: 'center'
}
];
const handleSearch = async (event) => {
if (!selectedYear) return;
if (event.type === 'keydown' && event.key === 'Enter') {
const newString = event?.target.value;
setSearchTxt(newString);
search();
}
};
useEffect(() => {
if (isInit.current) {
isInit.current = false;
return;
}
search();
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
}, [search]);
const handleOnCellClick = async (e) => {
if (e?.field === 'msDate') {
const params = {
msDatagb: e.row.msDatagb,
msSdate: e.row.msSdate,
msEdate: e.row.msEdate,
msChasu: e.row.msChasu,
msuTeam: e.row.msuTeam
};
const res = await findJudgeResults(params);
setJudgeResultData({
...res?.data,
selectedRow: e.row,
judgeTeam: res.data?.judgeTeam
});
setTitle(`${e.row.msCdate} ${menuName} 심사 결과 (${e.row.msChasu}차 - 총 ${e.row.cnt}건)`);
setOpen(true);
}
};
return (
<MainCard>
<Grid container spacing={2} alignItems="center">
<Grid item xs={12}>
<Grid container spacing={1}>
<Grid item xs={2}>
<FormControl fullWidth>
<InputLabel required>심의 년도</InputLabel>
<Select
size="small"
id="reviewYear"
name="reviewYear"
defaultValue={year}
onChange={(e) => setSelectedYear(e.target.value)}
>
{years.map((year, idx) => (
<MenuItem key={idx} value={year}>
{year}
</MenuItem>
))}
</Select>
</FormControl>
</Grid>
<Grid item>
<OutlinedInput
required
placeholder="심의차수"
onKeyDown={handleSearch}
size="small"
autoComplete
autoFocus
endAdornment={
<InputAdornment position="end">
<IconSearch stroke={1.5} size="1rem" />
</InputAdornment>
}
/>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid container spacing={1} item xs={12} mt={1}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
<MuiDataGrid
isHideFooter
columns={columns}
rowsState={rowsState}
totalCount={totalCount}
setRowsState={setRowsState}
handleCellClick={handleOnCellClick}
// handleSelection={handleSelection}
// selectionModel={selectionModel}
/>
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
<div>Empty</div>
</CmmModal>
</MainCard>
);
};
JudgeReview.propTypes = {
msDatagb: PropTypes.string.isRequired,
menuName: PropTypes.string.isRequired
};
export default JudgeReview;

@ -13,7 +13,7 @@ const FileForm = ({ isDownload = false, isDisabled = false, labelName, selectedF
return (
<Grid container item spacing={0.5}>
<Grid item sm={7.5}>
<Grid item sm={7.5} className="image_Down">
{isDownload ? (
<TextField
placeholder={labelName}

Loading…
Cancel
Save