feat: 심사자 심사 반영

main
minuk926 3 years ago
parent 3022c5e0ae
commit f1e8cfdf96

@ -3,7 +3,14 @@
//----------------------------------------------------------------------------
import axios from 'utils/axios';
import { GET_PARKING_JUDGE_TARGET_LIST, GET_PARKING_LIST, REMOVE_PARKING_JUDGE, SAVE_PARKING_JUDGE_TARGET_LIST } from 'commons/ApiUrl';
import {
GET_JUDGE_LIST,
GET_PARKING_JUDGE_LIST,
GET_PARKING_JUDGE_TARGET_LIST,
GET_PARKING_LIST,
REMOVE_PARKING_JUDGE,
SAVE_PARKING_JUDGE_TARGET_LIST
} from 'commons/ApiUrl';
import { setRowId } from './common';
// eslint-disable-next-line no-return-await
@ -34,3 +41,15 @@ export async function removeParkingJudge(params) {
// eslint-disable-next-line no-return-await
return await axios.post(REMOVE_PARKING_JUDGE, params);
}
//----------------------------------------------------------------
// 심사자
//----------------------------------------------------------------
export async function findByUserJudges(params) {
const res = await axios.get(GET_PARKING_JUDGE_LIST, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) }));
return res;
}
return res;
}

@ -24,6 +24,8 @@ 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 REMOVE_PARKING_JUDGE = '/api/v1/ctgy/parking/remove';
export const GET_PARKING_JUDGE_LIST = '/api/v1/ctgy/parking/judge';
// 거주자/장애인 의견 진술
export const GET_ADMIN_JUDGE_DATA_LIST = '/api/v1/ctgy/admin/data';
export const SAVE_ADMIN_JUDGE_DATA = '/api/v1/ctgy/admin/data';

@ -73,7 +73,7 @@ const judge = {
id: 'judge-2-1',
title: <FormattedMessage id="judge-2-1" />,
type: 'item',
url: '/parking/review',
url: '/judge/parking/review',
icon: icons.IconList
},
{

@ -17,6 +17,7 @@ const Board = Loadable(lazy(() => import('views/biz/board/Board')));
// parking
const ParkingReview = Loadable(lazy(() => import('views/biz/admin/parking/ParkingReview')));
const ParkingRegister = Loadable(lazy(() => import('views/biz/admin/parking/ParkingRegister')));
const ParkingUserByJudgeReview = Loadable(lazy(() => import('views/biz/judge/ParkingJudgeByUserReview')));
// Admin Resident /Disabled
const JudgeDataReview = Loadable(lazy(() => import('views/biz/admin/judge/JudgeDataReview')));
@ -106,6 +107,10 @@ const MainRoutes = {
},
// ----------------------------------------
{
path: '/judge/parking/review',
element: <ParkingUserByJudgeReview />
},
{
path: '/judge/resident/review',
element: <UserByJudgeReview msDatagb="1" menuName="거주자" />

@ -1,11 +1,8 @@
import { useMemo, useRef, useState } from 'react';
import { useAlert } from 'react-alert';
// material-ui
import { Button, Divider, Grid, TextField } from '@mui/material';
// assets
// berry ui
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';

@ -172,52 +172,51 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => {
return (
<MainCard>
<Grid container spacing={2} alignItems="center">
<Grid container item spacing={2} xs={7} justifyContent="start">
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'red' }}>심의기간 : </span>{' '}
<span style={{ color: 'blue' }}>
{minSdate} ~ {maxEdate}
</span>{' '}
]
</Typography>
{totalCount > 0 && (
<>
<Grid container spacing={2} alignItems="center">
<Grid container item spacing={2} xs={7} justifyContent="start">
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'red' }}>심의기간 : </span>{' '}
<span style={{ color: 'blue' }}>
{minSdate} ~ {maxEdate}
</span>{' '}
]
</Typography>
</Grid>
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'red' }}>접수번호 : </span>
<span style={{ color: 'blue' }}>
{' '}
{minSeq} ~ {maxSeq}
</span>{' '}
]
</Typography>
</Grid>
</Grid>
<Grid container item spacing={2} xs={5} justifyContent="end" alignItems="center">
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'blue' }}>{user?.name} 위원 / </span>
<span style={{ color: 'red' }}>{user?.team?.substring(2)}</span> ]
</Typography>
</Grid>
<Grid item>
<Button variant="contained" size="small" startIcon={<CreditScoreIcon />} onClick={onJudge}>
심사
</Button>
</Grid>
</Grid>
</Grid>
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'red' }}>접수번호 : </span>
<span style={{ color: 'blue' }}>
{' '}
{minSeq} ~ {maxSeq}
</span>{' '}
]
</Typography>
<Grid container spacing={1} item xs={12} mt={1}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
</Grid>
<Grid container item spacing={2} xs={5} justifyContent="end" alignItems="center">
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'blue' }}>{user?.name} 위원 / </span>
<span style={{ color: 'red' }}>{user?.team?.substring(2)}</span> ]
</Typography>
</Grid>
<Grid item>
<Button variant="contained" size="small" startIcon={<CreditScoreIcon />} onClick={onJudge}>
심사
</Button>
</Grid>
</Grid>
{/* <Grid item> */}
{/* <Button variant="contained" size="small" startIcon={<CreditScoreIcon />} onClick={onJudge}> */}
{/* 심사 */}
{/* </Button> */}
{/* </Grid> */}
</Grid>
<Grid container spacing={1} item xs={12} mt={1}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
</>
)}
<MuiDataGrid
// isCheckbox
isHideFooter

@ -0,0 +1,238 @@
import { useCallback, useEffect, useState } from 'react';
import _ from 'lodash';
// material-ui
import { GridActionsCellItem } from '@mui/x-data-grid';
import { Divider, Grid, Typography } from '@mui/material';
import CreditScoreIcon from '@mui/icons-material/CreditScore';
// berry ui
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import { findByUserJudges } from 'apis/parking';
import CmmModal from 'views/cmm/CmmModal';
import ProcessParkingJudge from './ProcessParkingJudge';
import useAuth from 'hooks/useAuth';
import Button from '@mui/material/Button';
import { useAlert } from 'react-alert';
const ParkingJudgeByUserReview = () => {
const { user } = useAuth();
const showAlert = useAlert();
const [totalCount, setTotalCount] = useState(0);
const [rowsState, setRowsState] = useState({
page: 0,
pageSize: 100,
rows: []
// loading: false
});
const [open, setOpen] = useState(false);
const [title, setTitle] = useState('');
const [rowDatas, setRowDatas] = useState([]);
const [minSdate, setMinSdate] = useState('');
const [maxEdate, setMaxEdate] = useState('');
const [minSeq, setMinSeq] = useState(0);
const [maxSeq, setMaxSeq] = useState(0);
const search = useCallback(() => {
findByUserJudges().then((res) => {
if (res && res.data) {
setTotalCount(res.count);
setRowsState((prevState) => ({ ...prevState, rows: res.data }));
if (res?.data?.length > 0) {
const arrMsSeq = res?.data?.map((r) => r.msSeq);
setMinSdate(_.min(res?.data?.map((r) => r.msSdate)));
setMaxEdate(_.max(res?.data?.map((r) => r.msEdate)));
setMinSeq(_.min(arrMsSeq));
setMaxSeq(_.max(arrMsSeq));
}
}
});
}, []);
const onJudge = () => {
// setRowDatas(rowsState?.rows);
// setTitle(` `);
// setOpen(true);
alert('적용예정');
};
const processJudge = useCallback(
(row) => () => {
// setRowDatas([row]);
// setTitle(` `);
// setOpen(true);
alert('적용예정');
},
[]
);
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: '심사자심사',
headerAlign: 'center',
field: 'msuResult',
align: 'center',
renderCell: (params) => {
switch (params.row.msuResult) {
case '0':
return '심의전';
// break;
case '1':
return '부과';
// break;
case '2':
return '미부과';
// break;
default:
return params.row.msuResult;
}
},
width: 100
},
{
headerName: '심의 기간',
headerAlign: 'center',
field: 'msDate',
minWidth: 200,
width: 250,
description: '심사 기간',
valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`,
align: 'center'
},
{
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: 'actions',
type: 'actions',
width: 80,
getActions: (params) => [
<GridActionsCellItem color="error" icon={<CreditScoreIcon />} label="개별심사" onClick={processJudge(params.row)} />
],
align: 'center'
}
];
const handleSearch = async (event) => {
if (event.type === 'keydown' && event.key === 'Enter') {
search();
}
};
useEffect(() => {
search();
// }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]);
}, [search]);
return (
<MainCard>
{totalCount > 0 && (
<>
<Grid container spacing={2} alignItems="center">
<Grid container item spacing={2} xs={7} justifyContent="start">
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'red' }}>심의기간 : </span>{' '}
<span style={{ color: 'blue' }}>
{minSdate} ~ {maxEdate}
</span>{' '}
]
</Typography>
</Grid>
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'red' }}>접수번호 : </span>
<span style={{ color: 'blue' }}>
{' '}
{minSeq} ~ {maxSeq}
</span>{' '}
]
</Typography>
</Grid>
</Grid>
<Grid container item spacing={2} xs={5} justifyContent="end" alignItems="center">
<Grid item>
<Typography variant="subtitle1">
[ <span style={{ color: 'blue' }}>{user?.name} 위원 / </span>
<span style={{ color: 'red' }}>{user?.team?.substring(2)}</span> ]
</Typography>
</Grid>
<Grid item>
<Button variant="contained" size="small" startIcon={<CreditScoreIcon />} onClick={onJudge}>
심사
</Button>
</Grid>
</Grid>
</Grid>
<Grid container spacing={1} item xs={12} mt={1}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
</>
)}
<MuiDataGrid
// isCheckbox
isHideFooter
columns={columns}
rowsState={rowsState}
totalCount={totalCount}
setRowsState={setRowsState}
// handleCellClick={handleOnCellClick}
// handleSelection={handleSelection}
// selectionModel={selectionModel}
/>
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
<ProcessParkingJudge setTitle={setTitle} rowDatas={rowDatas} showAlert={showAlert} setOpen={setOpen} />
</CmmModal>
</MainCard>
);
};
export default ParkingJudgeByUserReview;

@ -68,14 +68,11 @@ const ProcessJudge = (props) => {
<>
<Grid container spacing={1}>
{picadImgs?.map((img, idx) => (
<Grid item xs={3} key={idx} columnSpacing={1}>
<Grid item xs={3} key={idx}>
<CardMedia
component="img"
sx={{
height: 233,
width: 350,
maxHeight: { xs: 233, md: 167 },
maxWidth: { xs: 350, md: 250 }
height: 150
}}
src={img}
/>
@ -85,14 +82,11 @@ const ProcessJudge = (props) => {
<Grid container m={1} />
<Grid container spacing={1}>
{frecadImgs?.map((img, idx) => (
<Grid item xs={3} key={idx} columnSpacing={1}>
<Grid item xs={3} key={idx}>
<CardMedia
component="img"
sx={{
height: 233,
width: 350,
maxHeight: { xs: 233, md: 167 },
maxWidth: { xs: 350, md: 250 }
height: 150
}}
src={img}
/>
@ -102,14 +96,11 @@ const ProcessJudge = (props) => {
<Grid container m={1} />
<Grid container spacing={1}>
{contadImgs?.map((img, idx) => (
<Grid item xs={3} key={idx} columnSpacing={1}>
<Grid item xs={3} key={idx}>
<CardMedia
component="img"
sx={{
height: 233,
width: 350,
maxHeight: { xs: 233, md: 167 },
maxWidth: { xs: 350, md: 250 }
height: 150
}}
src={img}
/>

@ -0,0 +1,206 @@
import { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { Button, CardMedia, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextField } from '@mui/material';
import { findImages, saveJudgeResult } from 'apis/judge';
import { SkipNext, SkipPrevious, Save } from '@mui/icons-material';
const ProcessParkingJudge = (props) => {
const { rowDatas, setOpen, showAlert } = props;
const pageRef = useRef(0);
const totalPageRef = useRef(0);
const curDataRef = useRef({});
const [picadImgs, setPicadImgs] = useState([]);
const [frecadImgs, setFrecadImgs] = useState([]);
const [contadImgs, setContadImgs] = useState([]);
const [reason, setReason] = useState();
const [selectedResult, setSelectedResult] = useState();
const getImgList = (row) => {
findImages(row, showAlert).then((res) => {
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
setPicadImgs(arrPicadImg);
setFrecadImgs(arrFrecadImg);
setContadImgs(arrContadImg);
});
};
const onPrev = () => {
pageRef.current -= 1;
curDataRef.current = rowDatas[pageRef.current];
setReason(curDataRef.current.msuReason ?? '');
setSelectedResult(curDataRef.current.msuResult);
getImgList(curDataRef.current);
};
const onNext = () => {
pageRef.current += 1;
curDataRef.current = rowDatas[pageRef.current];
setReason(curDataRef.current.msuReason ?? '');
setSelectedResult(curDataRef.current.msuResult);
getImgList(rowDatas[pageRef.current]);
};
const handleSave = () => {
saveJudgeResult({ msuCode: curDataRef.current.msuCode, msuResult: selectedResult, msuReason: reason }).then((res) => {
if (res?.success) {
curDataRef.current.msuResult = selectedResult;
curDataRef.current.msuReason = reason;
showAlert.show('심의처리 되었습니다');
} else {
showAlert.show(`${res?.data.message}`);
}
});
};
const handleClose = () => {
setOpen(false);
};
useEffect(() => {
pageRef.current = 0;
totalPageRef.current = rowDatas.length - 1;
curDataRef.current = rowDatas[pageRef.current];
setReason(curDataRef.current.msuReason ?? '');
setSelectedResult(curDataRef.current.msuResult);
getImgList(curDataRef.current);
}, []);
return (
<>
<Grid container spacing={1}>
{picadImgs?.map((img, idx) => (
<Grid item xs={3} key={idx}>
<CardMedia
component="img"
sx={{
height: 150
}}
src={img}
/>
</Grid>
))}
</Grid>
<Grid container m={1} />
<Grid container spacing={1}>
{frecadImgs?.map((img, idx) => (
<Grid item xs={3} key={idx}>
<CardMedia
component="img"
sx={{
height: 150
}}
src={img}
/>
</Grid>
))}
</Grid>
<Grid container m={1} />
<Grid container spacing={1}>
{contadImgs?.map((img, idx) => (
<Grid item xs={3} key={idx}>
<CardMedia
component="img"
sx={{
height: 150
}}
src={img}
/>
</Grid>
))}
</Grid>
<Grid container m={1}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
<Grid container spacing={1} mt={1}>
<Grid item xs={2}>
<TextField size="small" required disabled label="접수번호" fullWidth value={rowDatas[pageRef.current].msSeq} />
</Grid>
<Grid item xs={2}>
<TextField size="small" required disabled label="위반일자" fullWidth value={rowDatas[pageRef.current].scWdate} />
</Grid>
<Grid item xs={6}>
<TextField size="small" required disabled label="위반장소" fullWidth value={rowDatas[pageRef.current].scPos} />
</Grid>
<Grid item xs={2}>
<FormControl fullWidth>
<InputLabel disabled required>
심의결정
</InputLabel>
<Select
size="small"
defaultValue={selectedResult || '1'}
value={selectedResult || '1'}
onChange={(e) => setSelectedResult(e?.target?.value)}
>
<MenuItem key="0" value="0">
심의전
</MenuItem>
<MenuItem key="1" value="1">
수용
</MenuItem>
<MenuItem key="2" value="2">
미수용
</MenuItem>
</Select>
</FormControl>
</Grid>
</Grid>
<Grid container spacing={1} mt={1}>
<Grid item xs={12}>
<TextField
size="small"
multiline
rows={2}
required
label="결정사유"
fullWidth
value={reason}
onChange={(e) => setReason(e.target.value)}
/>
</Grid>
</Grid>
<Grid container spacing={1} m={0.5}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
<Grid item container spacing={0.5} mt={1}>
<Grid item>
<Button disabled={pageRef.current === 0} variant="contained" size="small" startIcon={<SkipPrevious />} onClick={onPrev}>
이전
</Button>
</Grid>
<Grid item>
<Button
disabled={pageRef.current === totalPageRef.current}
variant="contained"
size="small"
endIcon={<SkipNext />}
onClick={onNext}
>
다음
</Button>
</Grid>
<Grid item style={{ marginLeft: 'auto' }}>
<Button variant="contained" size="small" startIcon={<Save />} onClick={handleSave}>
심의처리
</Button>
</Grid>
<Grid item>
<Button variant="contained" color="primary" size="small" onClick={handleClose}>
닫기
</Button>
</Grid>
</Grid>
</>
);
};
ProcessParkingJudge.propTypes = {
rowDatas: PropTypes.array.isRequired,
showAlert: PropTypes.object,
setOpen: PropTypes.func.isRequired
};
export default ProcessParkingJudge;

@ -3,9 +3,7 @@ import PropTypes from 'prop-types';
// material-ui
import { DataGrid, gridClasses } from '@mui/x-data-grid';
// import { grey } from '@mui/material/colors';
import Box from '@mui/material/Box';
// import { useTheme } from '@mui/material/styles';
import { useTheme } from '@mui/styles';
import dataGridKoKR from './defaultDataGridLocale';
import CustomPagination from './CustomPagination';

Loading…
Cancel
Save