diff --git a/src/views/biz/admin/judge/JudgeModal.jsx b/src/views/biz/admin/judge/JudgeModal.jsx index b616da5..219aedf 100644 --- a/src/views/biz/admin/judge/JudgeModal.jsx +++ b/src/views/biz/admin/judge/JudgeModal.jsx @@ -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; diff --git a/src/views/biz/admin/judge/ModalJudgeResult.jsx b/src/views/biz/admin/judge/ModalJudgeResult.jsx index 4277697..e1ba1b9 100644 --- a/src/views/biz/admin/judge/ModalJudgeResult.jsx +++ b/src/views/biz/admin/judge/ModalJudgeResult.jsx @@ -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 ( - {judgeResult.judgeUserData[carIdx].msResult === '0' ? '처리' : ''} + {judgeResult.judgeUserData[carIdx].msResult === '0' ? ( + + ) : ( + '' + )} ))} @@ -237,7 +254,15 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse > {judgeResult && `총 ${selectedRow.cnt} 건중 ${judgeResult.judgeCars.length} 건`} - + ); };