diff --git a/src/apis/judge.js b/src/apis/judge.js index 3be67a1..16047e3 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -16,7 +16,8 @@ import { GET_JUDGE_FILE_DOWNLOAD, REMOVE_ADMIN_JUDGE_DATA, GET_JUDGE_LIST, - SAVE_JUDGE_RESULT + SAVE_JUDGE_RESULT, + SAVE_ADMIN_JUDGE_STDS } from 'commons/ApiUrl'; import { setRowId } from './common'; import FileSaver from 'file-saver'; @@ -150,6 +151,11 @@ export async function judgeFileDownload(params, alert) { }); } +export async function saveJudgeStds(params) { + // eslint-disable-next-line no-return-await + return await axios.post(SAVE_ADMIN_JUDGE_STDS, params); +} + //---------------------------------------------------------------- // 심사자 //---------------------------------------------------------------- diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 882bdba..deaeb92 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -39,6 +39,8 @@ export const GET_ADMIN_JUDGE_TARGET_LIST = '/api/v1/ctgy/admin/target'; export const SAVE_ADMIN_JUDGE_TARGET_LIST = '/api/v1/ctgy/admin/target'; export const REMOVE_ADMIN_JUDGE = '/api/v1/ctgy/admin/remove'; +export const SAVE_ADMIN_JUDGE_STDS = '/api/v1/ctgy/admin/judge'; + export const GET_JUDGE_LIST = '/api/v1/ctgy/judge'; export const SAVE_JUDGE_RESULT = '/api/v1/ctgy/judge'; diff --git a/src/views/biz/judge/JudgeModal.jsx b/src/views/biz/admin/judge/JudgeModal.jsx similarity index 78% rename from src/views/biz/judge/JudgeModal.jsx rename to src/views/biz/admin/judge/JudgeModal.jsx index 6b922d4..b616da5 100644 --- a/src/views/biz/judge/JudgeModal.jsx +++ b/src/views/biz/admin/judge/JudgeModal.jsx @@ -8,6 +8,7 @@ import { IconSearch } from '@tabler/icons'; import Button from '@mui/material/Button'; import combo from 'commons/combo_data'; import { useState } from 'react'; +import { saveJudgeStds, saveJudgeTargets } from '../../../../apis/judge'; const style = { position: 'relative', @@ -22,15 +23,31 @@ const style = { p: 3 }; -const CmmModal = ({ isBackdrop = false, open, setOpen, title, judgeData = () => {} }) => { +const CmmModal = ({ isBackdrop = false, open, setOpen, title, judgeData = () => {}, dataGb, showAlert }) => { const [judgeStd, setJudgeStd] = useState('1'); const handleClose = () => { setOpen(false); }; const handleJudge = () => { - alert(`[${JSON.stringify(judgeData)}]==>>심사기준::${judgeStd}명`); + if (window.confirm(`부과판정 ${judgeStd}명 기준으로 ${judgeData.length}건 심사 처리 하시겠습니까?`)) { + const param = { + dataGb, + judgeStdCnt: judgeStd, + judgeDataKeys: judgeData + }; + + saveJudgeStds(param).then((res) => { + if (res?.success) { + showAlert.show(`${judgeData.length}건 처리되었습니다`); + setOpen(false); + } else { + showAlert.show(`${res?.data.message}`); + } + }); + } }; + return (