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

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

@ -16,7 +16,8 @@ import {
GET_JUDGE_FILE_DOWNLOAD, GET_JUDGE_FILE_DOWNLOAD,
REMOVE_ADMIN_JUDGE_DATA, REMOVE_ADMIN_JUDGE_DATA,
GET_JUDGE_LIST, GET_JUDGE_LIST,
SAVE_JUDGE_RESULT SAVE_JUDGE_RESULT,
SAVE_ADMIN_JUDGE_STDS
} from 'commons/ApiUrl'; } from 'commons/ApiUrl';
import { setRowId } from './common'; import { setRowId } from './common';
import FileSaver from 'file-saver'; 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 SAVE_ADMIN_JUDGE_TARGET_LIST = '/api/v1/ctgy/admin/target';
export const REMOVE_ADMIN_JUDGE = '/api/v1/ctgy/admin/remove'; 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 GET_JUDGE_LIST = '/api/v1/ctgy/judge';
export const SAVE_JUDGE_RESULT = '/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 Button from '@mui/material/Button';
import combo from 'commons/combo_data'; import combo from 'commons/combo_data';
import { useState } from 'react'; import { useState } from 'react';
import { saveJudgeStds, saveJudgeTargets } from '../../../../apis/judge';
const style = { const style = {
position: 'relative', position: 'relative',
@ -22,15 +23,31 @@ const style = {
p: 3 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 [judgeStd, setJudgeStd] = useState('1');
const handleClose = () => { const handleClose = () => {
setOpen(false); setOpen(false);
}; };
const handleJudge = () => { 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 ( return (
<div className="modalGroup"> <div className="modalGroup">
{/* <Button onClick={handleOpen}>Grid Modal(List)</Button> */} {/* <Button onClick={handleOpen}>Grid Modal(List)</Button> */}
@ -80,7 +97,9 @@ CmmModal.propTypes = {
open: PropTypes.bool, open: PropTypes.bool,
title: PropTypes.string, title: PropTypes.string,
setOpen: PropTypes.func, setOpen: PropTypes.func,
judgeData: PropTypes.array judgeData: PropTypes.array,
dataGb: PropTypes.string,
showAlert: PropTypes.object
}; };
export default CmmModal; export default CmmModal;

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

Loading…
Cancel
Save