feat: 심사자 심사 반영

main
minuk926 3 years ago
parent 6c5c4ed2e0
commit 3ea002c329

@ -15,7 +15,8 @@ import {
REMOVE_ADMIN_JUDGE,
GET_JUDGE_FILE_DOWNLOAD,
REMOVE_ADMIN_JUDGE_DATA,
GET_JUDGE_LIST
GET_JUDGE_LIST,
SAVE_JUDGE_RESULT
} from 'commons/ApiUrl';
import { setRowId } from './common';
import FileSaver from 'file-saver';
@ -213,3 +214,8 @@ export async function findImages(row, alert) {
}
return res;
}
export async function saveJudgeResult(params) {
// eslint-disable-next-line no-return-await
return await axios.post(SAVE_JUDGE_RESULT, params);
}

@ -38,6 +38,7 @@ 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 SAVE_JUDGE_RESULT = '/api/v1/ctgy/judge';
export const GET_JUDGE_FILE_DOWNLOAD = '/api/v1/ctgy/cmm/download/judge';

@ -180,14 +180,14 @@ const JudgeRegistReview = ({ scDatagb, menuName }) => {
</Grid>
<Grid item style={{ marginLeft: 'auto' }}>
<Button
disabled={selectionModel.length === 0}
disabled={scTransfer === '2' || selectionModel.length === 0}
variant="contained"
color="primary"
size="small"
startIcon={<PersonAddTwoToneIcon />}
onClick={handleSave}
>
저장
등록
</Button>
</Grid>
<Grid item>

@ -81,7 +81,7 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => {
{ headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center', width: 100 },
{ headerName: '차량번호', headerAlign: 'center', field: 'msCarnum', align: 'center', width: 100 },
{
headerName: '심의결정',
headerName: '민원결과',
headerAlign: 'center',
field: 'msResult',
align: 'center',
@ -103,12 +103,12 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => {
width: 100
},
{
headerName: '심의결정(msu)',
headerName: '심사자심사',
headerAlign: 'center',
field: 'msuResult',
align: 'center',
renderCell: (params) => {
switch (params.row.msResult) {
switch (params.row.msuResult) {
case '0':
return '심의전';
// break;
@ -119,7 +119,7 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => {
return '미부과';
// break;
default:
return params.row.msResult;
return params.row.msuResult;
}
},
width: 100

@ -1,9 +1,104 @@
import { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { Button, CardMedia, Divider, Grid } from '@mui/material';
import { findImages } from 'apis/judge';
import { Button, CardMedia, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextField } from '@mui/material';
import { findImages, saveJudgeData, saveJudgeResult } from 'apis/judge';
import { SkipNext, SkipPrevious, Save } from '@mui/icons-material';
import CmmModal from '../../cmm/CmmModal';
import * as React from 'react';
import Modal from '@mui/material/Modal';
import Box from '@mui/material/Box';
const style = {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 400,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
pt: 2,
px: 4,
pb: 3
};
function ChildModal({ open, setOpen, msuCode, showAlert }) {
const [reason, setReason] = useState('');
const [selectedResult, setSelectedResult] = useState();
const handleClose = () => {
setOpen(false);
};
const handleSave = () => {
saveJudgeResult({ msuCode, msuResult: selectedResult, msuReason: reason }).then((res) => {
if (res?.success) {
setOpen(false);
} else {
showAlert.show(`${res?.data.message}`);
}
});
};
return (
<>
<Modal hideBackdrop open={open} onClose={handleClose} aria-labelledby="child-modal-title" aria-describedby="child-modal-description">
<Box sx={{ ...style, width: 600 }}>
<h2 id="child-modal-title">심사 처리</h2>
<Grid container spacing={1} xs={12} mt={1}>
<Grid item xs={3}>
<FormControl fullWidth>
<InputLabel disabled required>
심사결과
</InputLabel>
<Select size="small" defaultValue="1" value="1" onChange={(e) => setSelectedResult(e?.target?.value)}>
<MenuItem key="1" value="1">
수용
</MenuItem>
<MenuItem key="2" value="2">
미수용
</MenuItem>
</Select>
</FormControl>
</Grid>
<Grid item xs={12}>
<TextField
sx={{
border: '0px solid red',
marginLeft: '8px'
}}
size="small"
required
label="심사사유"
fullWidth
value={reason}
onChange={(e) => setReason(e.target.value)}
/>
</Grid>
</Grid>
<Grid container spacing={1} item xs={12} mt={1}>
<Grid item xs={12}>
<Divider />
</Grid>
</Grid>
<Grid item container spacing={0.5} xs={12} mt={1}>
<Grid item>
<Button variant="contained" color="primary" size="small" onClick={handleClose}>
닫기
</Button>
</Grid>
<Grid item style={{ marginLeft: 'auto' }}>
<Button variant="contained" color="primary" size="small" onClick={handleSave}>
심사 처리
</Button>
</Grid>
</Grid>
</Box>
</Modal>
</>
);
}
const ProcessJudge = (props) => {
const { setTitle, rowDatas, showAlert } = props;
@ -14,10 +109,13 @@ const ProcessJudge = (props) => {
const [frecadImgs, setFrecadImgs] = useState([]);
const [contadImgs, setContadImgs] = useState([]);
//
const [open, setOpen] = React.useState(false);
const getImgList = (row) => {
findImages(row, showAlert).then((res) => {
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
console.log(res);
console.log(row, res);
setPicadImgs(arrPicadImg);
setFrecadImgs(arrFrecadImg);
setContadImgs(arrContadImg);
@ -36,12 +134,15 @@ const ProcessJudge = (props) => {
getImgList(rowDatas[pageRef.current]);
console.log(pageRef.current, rowDatas[pageRef.current]);
};
const onSave = () => {};
const onJudge = () => {
setOpen(true);
};
useEffect(() => {
pageRef.current = 0;
totalPageRef.current = rowDatas.length - 1;
setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`);
console.log(rowDatas, rowDatas[pageRef.current].msuCode);
getImgList(rowDatas[pageRef.current]);
}, []);
@ -120,11 +221,12 @@ const ProcessJudge = (props) => {
</Button>
</Grid>
<Grid item style={{ marginLeft: 'auto' }}>
<Button variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
저장
<Button variant="contained" size="small" startIcon={<Save />} onClick={onJudge}>
심사
</Button>
</Grid>
</Grid>
<ChildModal open={open} setOpen={setOpen} msuCode={rowDatas[pageRef.current].msuCode} showAlert={showAlert} />
</>
);
};

Loading…
Cancel
Save