From 3ea002c329ae44e11b4081083bef39c6ed0f9a1b Mon Sep 17 00:00:00 2001 From: minuk926 Date: Wed, 4 May 2022 19:50:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8B=AC=EC=82=AC=EC=9E=90=20=EC=8B=AC?= =?UTF-8?q?=EC=82=AC=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/judge.js | 8 +- src/commons/ApiUrl.js | 1 + .../biz/admin/judge/JudgeRegistReview.jsx | 4 +- src/views/biz/judge/JudgeByUserReview.jsx | 8 +- src/views/biz/judge/ProcessJudge.jsx | 114 +++++++++++++++++- 5 files changed, 122 insertions(+), 13 deletions(-) diff --git a/src/apis/judge.js b/src/apis/judge.js index bbadc58..0aeadc8 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -15,7 +15,8 @@ import { REMOVE_ADMIN_JUDGE, GET_JUDGE_FILE_DOWNLOAD, REMOVE_ADMIN_JUDGE_DATA, - GET_JUDGE_LIST + GET_JUDGE_LIST, + SAVE_JUDGE_RESULT } from 'commons/ApiUrl'; import { setRowId } from './common'; import FileSaver from 'file-saver'; @@ -213,3 +214,8 @@ export async function findImages(row, alert) { } return res; } + +export async function saveJudgeResult(params) { + // eslint-disable-next-line no-return-await + return await axios.post(SAVE_JUDGE_RESULT, params); +} diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 84b769d..e1e2cd0 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -38,6 +38,7 @@ export const SAVE_ADMIN_JUDGE_TARGET_LIST = '/api/v1/ctgy/admin/target'; export const REMOVE_ADMIN_JUDGE = '/api/v1/ctgy/admin/remove'; export const GET_JUDGE_LIST = '/api/v1/ctgy/judge'; +export const SAVE_JUDGE_RESULT = '/api/v1/ctgy/judge'; export const GET_JUDGE_FILE_DOWNLOAD = '/api/v1/ctgy/cmm/download/judge'; diff --git a/src/views/biz/admin/judge/JudgeRegistReview.jsx b/src/views/biz/admin/judge/JudgeRegistReview.jsx index 89e5085..0453381 100644 --- a/src/views/biz/admin/judge/JudgeRegistReview.jsx +++ b/src/views/biz/admin/judge/JudgeRegistReview.jsx @@ -180,14 +180,14 @@ const JudgeRegistReview = ({ scDatagb, menuName }) => { diff --git a/src/views/biz/judge/JudgeByUserReview.jsx b/src/views/biz/judge/JudgeByUserReview.jsx index 815e8c4..0f0c94d 100644 --- a/src/views/biz/judge/JudgeByUserReview.jsx +++ b/src/views/biz/judge/JudgeByUserReview.jsx @@ -81,7 +81,7 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => { { headerName: '심의차수', headerAlign: 'center', field: 'msChasu', align: 'center', width: 100 }, { headerName: '차량번호', headerAlign: 'center', field: 'msCarnum', align: 'center', width: 100 }, { - headerName: '심의결정', + headerName: '민원결과', headerAlign: 'center', field: 'msResult', align: 'center', @@ -103,12 +103,12 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => { width: 100 }, { - headerName: '심의결정(msu)', + headerName: '심사자심사', headerAlign: 'center', field: 'msuResult', align: 'center', renderCell: (params) => { - switch (params.row.msResult) { + switch (params.row.msuResult) { case '0': return '심의전'; // break; @@ -119,7 +119,7 @@ const JudgeByUserReview = ({ msDatagb, menuName }) => { return '미부과'; // break; default: - return params.row.msResult; + return params.row.msuResult; } }, width: 100 diff --git a/src/views/biz/judge/ProcessJudge.jsx b/src/views/biz/judge/ProcessJudge.jsx index 88c83d0..36888d6 100644 --- a/src/views/biz/judge/ProcessJudge.jsx +++ b/src/views/biz/judge/ProcessJudge.jsx @@ -1,9 +1,104 @@ import { useEffect, useRef, useState } from 'react'; import PropTypes from 'prop-types'; -import { Button, CardMedia, Divider, Grid } from '@mui/material'; -import { findImages } from 'apis/judge'; +import { Button, CardMedia, Divider, FormControl, Grid, InputLabel, MenuItem, Select, TextField } from '@mui/material'; +import { findImages, saveJudgeData, saveJudgeResult } from 'apis/judge'; import { SkipNext, SkipPrevious, Save } from '@mui/icons-material'; +import CmmModal from '../../cmm/CmmModal'; +import * as React from 'react'; +import Modal from '@mui/material/Modal'; +import Box from '@mui/material/Box'; + +const style = { + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: 400, + bgcolor: 'background.paper', + border: '2px solid #000', + boxShadow: 24, + pt: 2, + px: 4, + pb: 3 +}; + +function ChildModal({ open, setOpen, msuCode, showAlert }) { + const [reason, setReason] = useState(''); + const [selectedResult, setSelectedResult] = useState(); + + const handleClose = () => { + setOpen(false); + }; + + const handleSave = () => { + saveJudgeResult({ msuCode, msuResult: selectedResult, msuReason: reason }).then((res) => { + if (res?.success) { + setOpen(false); + } else { + showAlert.show(`${res?.data.message}`); + } + }); + }; + + return ( + <> + + +

심사 처리

+ + + + + 심사결과 + + + + + + setReason(e.target.value)} + /> + + + + + + + + + + + + + + + +
+
+ + ); +} const ProcessJudge = (props) => { const { setTitle, rowDatas, showAlert } = props; @@ -14,10 +109,13 @@ const ProcessJudge = (props) => { const [frecadImgs, setFrecadImgs] = useState([]); const [contadImgs, setContadImgs] = useState([]); + // 심사처리 팝업 + const [open, setOpen] = React.useState(false); + const getImgList = (row) => { findImages(row, showAlert).then((res) => { const { arrPicadImg, arrFrecadImg, arrContadImg } = res; - console.log(res); + console.log(row, res); setPicadImgs(arrPicadImg); setFrecadImgs(arrFrecadImg); setContadImgs(arrContadImg); @@ -36,12 +134,15 @@ const ProcessJudge = (props) => { getImgList(rowDatas[pageRef.current]); console.log(pageRef.current, rowDatas[pageRef.current]); }; - const onSave = () => {}; + const onJudge = () => { + setOpen(true); + }; useEffect(() => { pageRef.current = 0; totalPageRef.current = rowDatas.length - 1; setTitle(`${title} [ 접수번호 : ${rowDatas[pageRef.current].msSeq}]`); + console.log(rowDatas, rowDatas[pageRef.current].msuCode); getImgList(rowDatas[pageRef.current]); }, []); @@ -120,11 +221,12 @@ const ProcessJudge = (props) => {
- + ); };