|
|
|
@ -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} />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|