feat: 심사기준 심사결과 반영

main
Lim Jonguk 3 years ago
parent 9cf8bdb0ab
commit 2633048cf3

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

@ -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';

@ -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 (
<div className="modalGroup">
{/* <Button onClick={handleOpen}>Grid Modal(List)</Button> */}
@ -80,7 +97,9 @@ CmmModal.propTypes = {
open: PropTypes.bool,
title: PropTypes.string,
setOpen: PropTypes.func,
judgeData: PropTypes.array
judgeData: PropTypes.array,
dataGb: PropTypes.string,
showAlert: PropTypes.object
};
export default CmmModal;

@ -16,7 +16,7 @@ import { IconSearch } from '@tabler/icons';
import { findJudgeResults } from 'apis/judge';
import _ from 'lodash';
import { useAlert } from 'react-alert';
import JudgeModal from '../../judge/JudgeModal';
import JudgeModal from './JudgeModal';
const StyledTableCell = styled(TableCell)(({ theme }) => ({
[`&.${tableCellClasses.head}`]: {
@ -237,7 +237,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
>
{judgeResult && `${selectedRow.cnt} 건중 ${judgeResult.judgeCars.length}`}
</TableFooter>
<JudgeModal open={open} setOpen={setOpen} title={title} judgeData={judgeDatas} />
<JudgeModal open={open} setOpen={setOpen} title={title} judgeData={judgeDatas} dataGb={dataGb} showAlert={alert} />
</Box>
);
};

Loading…
Cancel
Save