|
|
@ -1,9 +1,104 @@
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
|
|
import { Button, CardMedia, Divider, Grid } from '@mui/material';
|
|
|
|
import { Button, CardMedia, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextField } from '@mui/material';
|
|
|
|
import { findImages } from 'apis/judge';
|
|
|
|
import { findImages, saveJudgeData, saveJudgeResult } from 'apis/judge';
|
|
|
|
import { SkipNext, SkipPrevious, Save } from '@mui/icons-material';
|
|
|
|
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 ProcessJudge = (props) => {
|
|
|
|
const { setTitle, rowDatas, showAlert } = props;
|
|
|
|
const { setTitle, rowDatas, showAlert } = props;
|
|
|
@ -14,10 +109,13 @@ const ProcessJudge = (props) => {
|
|
|
|
const [frecadImgs, setFrecadImgs] = useState([]);
|
|
|
|
const [frecadImgs, setFrecadImgs] = useState([]);
|
|
|
|
const [contadImgs, setContadImgs] = useState([]);
|
|
|
|
const [contadImgs, setContadImgs] = useState([]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 심사처리 팝업
|
|
|
|
|
|
|
|
const [open, setOpen] = React.useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
const getImgList = (row) => {
|
|
|
|
const getImgList = (row) => {
|
|
|
|
findImages(row, showAlert).then((res) => {
|
|
|
|
findImages(row, showAlert).then((res) => {
|
|
|
|
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
|
|
|
|
const { arrPicadImg, arrFrecadImg, arrContadImg } = res;
|
|
|
|
console.log(res);
|
|
|
|
console.log(row, res);
|
|
|
|
setPicadImgs(arrPicadImg);
|
|
|
|
setPicadImgs(arrPicadImg);
|
|
|
|
setFrecadImgs(arrFrecadImg);
|
|
|
|
setFrecadImgs(arrFrecadImg);
|
|
|
|
setContadImgs(arrContadImg);
|
|
|
|
setContadImgs(arrContadImg);
|
|
|
@ -36,12 +134,15 @@ const ProcessJudge = (props) => {
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
console.log(pageRef.current, rowDatas[pageRef.current]);
|
|
|
|
console.log(pageRef.current, rowDatas[pageRef.current]);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const onSave = () => {};
|
|
|
|
const onJudge = () => {
|
|
|
|
|
|
|
|
setOpen(true);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
pageRef.current = 0;
|
|
|
|
pageRef.current = 0;
|
|
|
|
totalPageRef.current = rowDatas.length - 1;
|
|
|
|
totalPageRef.current = rowDatas.length - 1;
|
|
|
|
setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`);
|
|
|
|
setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`);
|
|
|
|
|
|
|
|
console.log(rowDatas, rowDatas[pageRef.current].msuCode);
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
getImgList(rowDatas[pageRef.current]);
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
@ -120,11 +221,12 @@ const ProcessJudge = (props) => {
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
<Grid item style={{ marginLeft: 'auto' }}>
|
|
|
|
<Grid item style={{ marginLeft: 'auto' }}>
|
|
|
|
<Button variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
|
|
|
|
<Button variant="contained" size="small" startIcon={<Save />} onClick={onJudge}>
|
|
|
|
저장
|
|
|
|
심사
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<ChildModal open={open} setOpen={setOpen} msuCode={rowDatas[pageRef.current].msuCode} showAlert={showAlert} />
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|