fix: 심의 부과 처리 반영

main
minuk926 3 years ago
parent 2633048cf3
commit 7f47240e9f

@ -23,14 +23,14 @@ const style = {
p: 3
};
const CmmModal = ({ isBackdrop = false, open, setOpen, title, judgeData = () => {}, dataGb, showAlert }) => {
const CmmModal = ({ isBackdrop = false, open, setOpen, title, judgeData = () => {}, dataGb, showAlert, callback }) => {
const [judgeStd, setJudgeStd] = useState('1');
const handleClose = () => {
setOpen(false);
};
const handleJudge = () => {
if (window.confirm(`부과판정 ${judgeStd} 기준으로 ${judgeData.length}건 심사 처리 하시겠습니까?`)) {
if (window.confirm(`${judgeStd}[부과] 기준으로 ${judgeData.length}건 심사 처리 하시겠습니까?`)) {
const param = {
dataGb,
judgeStdCnt: judgeStd,
@ -41,6 +41,7 @@ const CmmModal = ({ isBackdrop = false, open, setOpen, title, judgeData = () =>
if (res?.success) {
showAlert.show(`${judgeData.length}건 처리되었습니다`);
setOpen(false);
callback();
} else {
showAlert.show(`${res?.data.message}`);
}
@ -99,7 +100,8 @@ CmmModal.propTypes = {
setOpen: PropTypes.func,
judgeData: PropTypes.array,
dataGb: PropTypes.string,
showAlert: PropTypes.object
showAlert: PropTypes.object,
callback: PropTypes.func
};
export default CmmModal;

@ -10,7 +10,7 @@ import { Divider, FormControl, Grid, InputLabel, MenuItem, Select, TableFooter,
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import combo from 'commons/combo_data';
import { useState } from 'react';
import { useCallback, useRef, useState } from 'react';
import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons';
import { findJudgeResults } from 'apis/judge';
@ -72,6 +72,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
}
}
setJudgeDatas(arrJudgeData);
// judgeDatas.current = arrJudgeData;
setJudgeResult({
...judgeResult,
@ -94,9 +95,19 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
};
const handleJudgeModal = () => {
setJudgeDatas(judgeData ?? []);
// judgeDatas.current = judgeData;
setOpen(true);
};
const onHandleJudge = useCallback(
(row) => () => {
setJudgeDatas([{ msMaincode: row.msMaincode, msSeq: row.msSeq }]);
setOpen(true);
},
[]
);
return (
<Box
sx={{
@ -218,7 +229,13 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
{judgeResult.judgeUserData[carIdx].msResultNm}
</StyledTableCell>
<StyledTableCell align="center" style={{ width: 80 }}>
{judgeResult.judgeUserData[carIdx].msResult === '0' ? '처리' : ''}
{judgeResult.judgeUserData[carIdx].msResult === '0' ? (
<Button size="small" color="error" onClick={onHandleJudge(row)}>
처리
</Button>
) : (
''
)}
</StyledTableCell>
</StyledTableRow>
))}
@ -237,7 +254,15 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
>
{judgeResult && `${selectedRow.cnt} 건중 ${judgeResult.judgeCars.length}`}
</TableFooter>
<JudgeModal open={open} setOpen={setOpen} title={title} judgeData={judgeDatas} dataGb={dataGb} showAlert={alert} />
<JudgeModal
open={open}
setOpen={setOpen}
title={title}
judgeData={judgeDatas}
dataGb={dataGb}
showAlert={alert}
callback={onSearch}
/>
</Box>
);
};

Loading…
Cancel
Save