From 584cbe8cca880a7a18e58d41c96e8f5351262f94 Mon Sep 17 00:00:00 2001 From: Lim Jonguk Date: Sun, 10 Apr 2022 05:28:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B1=B0=EC=A3=BC=EC=9E=90=20/=20?= =?UTF-8?q?=EC=9E=A5=EC=95=A0=EC=9D=B8=20=EC=9D=98=EA=B2=AC=EC=A7=84?= =?UTF-8?q?=EC=88=A0=20=EA=B3=B5=ED=86=B5=ED=99=94=20=EC=A7=84=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/disabled.js | 43 -- src/apis/{resident.js => judge.js} | 38 +- src/commons/ApiUrl.js | 12 +- src/routes/MainRoutes.js | 14 +- src/views/biz/disabled/DisabledDataReview.jsx | 131 ----- src/views/biz/disabled/DisabledRegist.jsx | 208 -------- src/views/biz/disabled/DisabledReview.jsx | 198 -------- .../biz/disabled/NewDisabledDataForm.jsx | 438 ----------------- .../ModifyJudgeDataForm.jsx} | 6 +- .../NewJudgeDataForm.jsx} | 6 +- .../SaveJudgeTargetForm.jsx} | 6 +- .../biz/resident/ModifyResidentDataForm.jsx | 454 ------------------ src/views/biz/resident/ResidentDataReview.jsx | 25 +- src/views/biz/resident/ResidentRegist.jsx | 10 +- src/views/biz/resident/ResidentReview.jsx | 5 +- .../biz/resident/SaveResidentTargetForm.jsx | 172 ------- 16 files changed, 62 insertions(+), 1704 deletions(-) delete mode 100644 src/apis/disabled.js rename src/apis/{resident.js => judge.js} (54%) delete mode 100644 src/views/biz/disabled/DisabledDataReview.jsx delete mode 100644 src/views/biz/disabled/DisabledRegist.jsx delete mode 100644 src/views/biz/disabled/DisabledReview.jsx delete mode 100644 src/views/biz/disabled/NewDisabledDataForm.jsx rename src/views/biz/{disabled/ModifyDisabledDataForm.jsx => judge/ModifyJudgeDataForm.jsx} (99%) rename src/views/biz/{resident/NewResidentDataForm.jsx => judge/NewJudgeDataForm.jsx} (99%) rename src/views/biz/{disabled/SaveDisabledTargetForm.jsx => judge/SaveJudgeTargetForm.jsx} (97%) delete mode 100644 src/views/biz/resident/ModifyResidentDataForm.jsx delete mode 100644 src/views/biz/resident/SaveResidentTargetForm.jsx diff --git a/src/apis/disabled.js b/src/apis/disabled.js deleted file mode 100644 index da0c818..0000000 --- a/src/apis/disabled.js +++ /dev/null @@ -1,43 +0,0 @@ -//---------------------------------------------------------------------------- -// Parking : 주정차의견진술관리 -//---------------------------------------------------------------------------- - -import axios from 'utils/axios'; -import { GET_DISABLED, GET_DISABLED_DATA_LIST, GET_DISABLED_LIST, SAVE_DISABLED_DATA } from 'commons/ApiUrl'; -import { setRowId } from './common'; - -// eslint-disable-next-line no-return-await -export async function findDisabledDatas(params) { - const res = await axios.get(GET_DISABLED_DATA_LIST, { params }); - if (res.success) { - res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); - return res; - } - return res; -} - -export async function saveDisabledData(formData) { - // eslint-disable-next-line no-return-await - return await axios(SAVE_DISABLED_DATA, { - method: 'post', - data: formData, - headers: { 'Content-Type': 'multipart/form-data' } // , Authorization: localStorage.getItem('access_token') } - }); -} - -export async function findDisabled(scCode) { - const res = await axios.get(GET_DISABLED + scCode); - if (res.success) { - return res; - } - return res; -} - -export async function findDisableds(params) { - const res = await axios.get(GET_DISABLED_LIST, { params }); - if (res.success) { - res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); - return res; - } - return res; -} diff --git a/src/apis/resident.js b/src/apis/judge.js similarity index 54% rename from src/apis/resident.js rename to src/apis/judge.js index e174879..d089735 100644 --- a/src/apis/resident.js +++ b/src/apis/judge.js @@ -1,21 +1,21 @@ //---------------------------------------------------------------------------- -// Parking : 주정차의견진술관리 +// Resident / Disabled : 주정차/장애인 의견진술관리 //---------------------------------------------------------------------------- import axios from 'utils/axios'; import { - GET_RESIDENT_DATA, - GET_RESIDENT_DATA_LIST, - GET_RESIDENT_JUDGE_TARGET_LIST, - GET_RESIDENT_LIST, - SAVE_RESIDENT_DATA, - SAVE_RESIDENT_JUDGE_TARGET_LIST + GET_JUDGE_DATA, + GET_JUDGE_DATA_LIST, + SAVE_JUDGE_DATA, + GET_JUDGE_TARGET_LIST, + GET_JUDGE_LIST, + SAVE_JUDGE_TARGET_LIST } from 'commons/ApiUrl'; import { setRowId } from './common'; // eslint-disable-next-line no-return-await -export async function findResidentDatas(params) { - const res = await axios.get(GET_RESIDENT_DATA_LIST, { params }); +export async function findJudgeDatas(params) { + const res = await axios.get(GET_JUDGE_DATA_LIST, { params }); if (res.success) { res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); return res; @@ -23,25 +23,25 @@ export async function findResidentDatas(params) { return res; } -export async function saveResidentData(formData) { +export async function saveJudgeData(formData) { // eslint-disable-next-line no-return-await - return await axios(SAVE_RESIDENT_DATA, { + return await axios(SAVE_JUDGE_DATA, { method: 'post', data: formData, headers: { 'Content-Type': 'multipart/form-data' } // , Authorization: localStorage.getItem('access_token') } }); } -export async function findResident(scCode) { - const res = await axios.get(GET_RESIDENT_DATA + scCode); +export async function findJudge(scCode) { + const res = await axios.get(GET_JUDGE_DATA + scCode); if (res.success) { return res; } return res; } -export async function findResidents(params) { - const res = await axios.get(GET_RESIDENT_LIST, { params }); +export async function findJudges(params) { + const res = await axios.get(GET_JUDGE_LIST, { params }); if (res.success) { res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); return res; @@ -49,8 +49,8 @@ export async function findResidents(params) { return res; } -export async function findResidentJudgeTargets(params) { - const res = await axios.get(GET_RESIDENT_JUDGE_TARGET_LIST, { params }); +export async function findJudgeTargets(params) { + const res = await axios.get(GET_JUDGE_TARGET_LIST, { params }); if (res.success) { res.data = res.data.map((d, idx) => ({ ...d, rowId: setRowId(params, idx) })); return res; @@ -58,8 +58,8 @@ export async function findResidentJudgeTargets(params) { return res; } -export async function saveResidentJudgeTargets(params) { - const res = await axios.post(SAVE_RESIDENT_JUDGE_TARGET_LIST, params); +export async function saveJudgeTargets(params) { + const res = await axios.post(SAVE_JUDGE_TARGET_LIST, params); if (res.success) { return res; } diff --git a/src/commons/ApiUrl.js b/src/commons/ApiUrl.js index 0507318..15a2b23 100644 --- a/src/commons/ApiUrl.js +++ b/src/commons/ApiUrl.js @@ -21,12 +21,12 @@ export const SAVE_PARKING_JUDGE_TARGET_LIST = '/api/v1/ctgy/parking/target'; // export const GET_PARKING_DETAILS_LIST = '/api/v1/ctgy/parking/details'; // 거주자/장애인 의견 진술 -export const GET_RESIDENT_DATA_LIST = '/api/v1/ctgy/judge/data'; -export const SAVE_RESIDENT_DATA = '/api/v1/ctgy/judge/data'; -export const GET_RESIDENT_DATA = '/api/v1/ctgy/judge/data/'; -export const GET_RESIDENT_LIST = '/api/v1/ctgy/judge'; -export const GET_RESIDENT_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target'; -export const SAVE_RESIDENT_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target'; +export const GET_JUDGE_DATA_LIST = '/api/v1/ctgy/judge/data'; +export const SAVE_JUDGE_DATA = '/api/v1/ctgy/judge/data'; +export const GET_JUDGE_DATA = '/api/v1/ctgy/judge/data/'; +export const GET_JUDGE_LIST = '/api/v1/ctgy/judge'; +export const GET_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target'; +export const SAVE_JUDGE_TARGET_LIST = '/api/v1/ctgy/judge/target'; // 장애인 의견 진술 export const GET_DISABLED_DATA_LIST = '/api/v1/ctgy/judge/data'; diff --git a/src/routes/MainRoutes.js b/src/routes/MainRoutes.js index 37045a6..843d02b 100755 --- a/src/routes/MainRoutes.js +++ b/src/routes/MainRoutes.js @@ -25,9 +25,9 @@ const ResidentRegister = Loadable(lazy(() => import('views/biz/resident/Resident const ResidentReview = Loadable(lazy(() => import('views/biz/resident/ResidentReview'))); // disabled -const DisabledDataReview = Loadable(lazy(() => import('views/biz/disabled/DisabledDataReview'))); -const DisabledRegister = Loadable(lazy(() => import('views/biz/disabled/DisabledRegist'))); -const DisabledReview = Loadable(lazy(() => import('views/biz/disabled/DisabledReview'))); +// const DisabledDataReview = Loadable(lazy(() => import('views/biz/disabled/DisabledDataReview'))); +// const DisabledRegister = Loadable(lazy(() => import('views/biz/disabled/DisabledRegist'))); +// const DisabledReview = Loadable(lazy(() => import('views/biz/disabled/DisabledReview'))); // user const UserManager = Loadable(lazy(() => import('views/biz/user/UserManager'))); @@ -72,7 +72,7 @@ const MainRoutes = { /* 거주자 */ { path: '/resident/data', - element: + element: }, { path: '/resident/review', @@ -85,15 +85,15 @@ const MainRoutes = { /* 장애인 */ { path: '/disabled/data', - element: + element: }, { path: '/disabled/review', - element: + element: <> // }, { path: '/disabled/register', - element: + element: <> // }, /* 사용자 */ { diff --git a/src/views/biz/disabled/DisabledDataReview.jsx b/src/views/biz/disabled/DisabledDataReview.jsx deleted file mode 100644 index a2e75b8..0000000 --- a/src/views/biz/disabled/DisabledDataReview.jsx +++ /dev/null @@ -1,131 +0,0 @@ -import { useCallback, useEffect, useState } from 'react'; - -import { Button, Divider, Grid, Link } from '@mui/material'; - -// berry ui -import MainCard from 'ui-component/cards/MainCard'; - -// project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; -import CmmModal from 'views/form/Modal/CmmModal'; -import { findDisabled, findDisabledDatas, saveDisabledData } from 'apis/disabled'; -import NewDisabledDataForm from './NewDisabledDataForm'; -import ModifyDisabledDataForm from './ModifyDisabledDataForm'; - -const DisabledDataReview = () => { - const [open, setOpen] = useState(false); - const [create, setCreate] = useState(false); - // const [selectedRow, setSelectedRow] = useState({}); - const [title, setTitle] = useState(); - const [rowData, setRowData] = useState({}); - - const [totalCount, setTotalCount] = useState(0); - const [rowsState, setRowsState] = useState({ - page: 0, - pageSize: 20, - rows: [] - // loading: false - }); - - const columns = [ - { headerName: 'No.', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 }, - { headerName: '심사코드?', field: 'scCode', hide: true }, - { - headerName: '접수번호', - headerAlign: 'center', - field: 'scSeq', - renderCell: (params) => ( - - {params.value} - - ) - }, - { headerName: '동명', headerAlign: 'center', field: 'scDong' }, - { headerName: '차량번호', headerAlign: 'center', field: 'scCarnum' }, - { headerName: '성명', headerAlign: 'center', field: 'scName' }, - { headerName: '진술유형', headerAlign: 'center', field: 'scContDocNm' }, - { - headerName: '접수일자', - headerAlign: 'center', - field: 'scCdate' - // type: 'date', - // valueGetter: ({ value }) => value && new Date(value) - }, - { headerName: '접수방법', headerAlign: 'center', field: 'scIngbNm' } - ]; - - const search = useCallback(() => { - const params = { - page: rowsState.page, - size: rowsState.pageSize - }; - - findDisabledDatas(params).then((response) => { - console.log(response); - if (response && response.data) { - setTotalCount(response.count); - setRowsState((prevState) => ({ ...prevState, rows: response.data })); - // apiRef.current.forceUpdate(); // .updateRowData([]); - // apiRef.current.updateRowData([]); - } - }); - }, [rowsState.page, rowsState.pageSize]); - - useEffect(() => { - search(); - }, [search]); // search, rowsState.page, rowsState.pageSize]); - - const handleCreate = () => { - setTitle('장애인 의견진술 자료 신규 등록'); - setCreate(true); - setOpen(true); - }; - - const handleOnCellClick = (e) => { - if (e?.field === 'scSeq') { - findDisabled(e.row?.scCode).then((res) => { - setRowData(res.data); - setCreate(false); - setTitle('장애인 의견진술 자료 변경'); - setOpen(true); - }); - } - }; - - const handleSaveResident = (payload) => { - saveDisabledData(payload).then(() => { - search(); - setOpen(false); - }); - }; - - return ( - - - - - - - - - - - - - - - {create && } - {!create && } - - - ); -}; -export default DisabledDataReview; diff --git a/src/views/biz/disabled/DisabledRegist.jsx b/src/views/biz/disabled/DisabledRegist.jsx deleted file mode 100644 index 89acb47..0000000 --- a/src/views/biz/disabled/DisabledRegist.jsx +++ /dev/null @@ -1,208 +0,0 @@ -import { useState } from 'react'; - -// material-ui -import { Button, Divider, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from '@mui/material'; - -// assets -import { IconSearch } from '@tabler/icons'; -import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; - -// berry ui -import MainCard from 'ui-component/cards/MainCard'; - -// project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; - -import xitCmm from 'commons/XitCmm'; -import CmmModal from 'views/form/Modal/CmmModal'; -import SaveDisabledTargetForm from './SaveDisabledTargetForm'; -import NumberFormat from 'react-number-format'; -import ExcelDownload from 'views/form/ExcelDownload'; -import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking'; - -const DisabledRegister = () => { - const [rcIrTransfer, setRcIrTransfer] = useState('1'); - const [rcSeq1, setRcSeq1] = useState('2022200801'); - const [rcSeq2, setRcSeq2] = useState('2022200899'); - const [selectionModel, setSelectionModel] = useState([]); - const [totalCount, setTotalCount] = useState(0); - const [rowsStatus, setRowsStatus] = useState({ - page: 0, - pageSize: 100, - rows: [] - }); - const [open, setOpen] = useState(false); - - const columns = [ - { headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 }, - { headerName: '접수번호', headerAlign: 'center', field: 'rcSeq', align: 'center' }, - { headerName: '최초차량번호', headerAlign: 'center', field: 'mmOcarno', align: 'center', minWidth: 110 }, - { headerName: '최종차량번호', headerAlign: 'center', field: 'mmNcarno', align: 'center', minWidth: 110 }, - { headerName: '성명', headerAlign: 'center', field: 'rcName', minWidth: 150 }, - { headerName: '진술유형', headerAlign: 'center', field: 'rcContDocNm', minWidth: 130 }, - { - headerName: '접수일자', - headerAlign: 'center', - field: 'rcDate', - align: 'center', - format: '####-##-##' - // valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}` - }, - { headerName: '접수방법', headerAlign: 'center', field: 'rcIngbNm', align: 'center' } - ]; - - const search = () => { - const params = { - rcIrTransfer, - rcSeq1, - rcSeq2 - }; - - findParkingJudgeTargets(params).then((response) => { - if (response && response.data) { - setSelectionModel([]); - setTotalCount(response.count); - setRowsStatus((prevRows) => ({ ...prevRows, rows: response.data })); - } - }); - }; - - const handleSave = () => { - if (selectionModel.length === 0) { - xitCmm.alertParam(`처리할 데이타가 없습니다`); - } else { - setOpen(true); - // alert(`저장할 데이타 => ${selectRows}`); - } - }; - - const submitDisabledTargets = (params) => { - const param = { - ...params, - rcIrTransfer, - rcSeq1, - rcSeq2, - rcCodes: selectionModel.map((d) => rowsStatus.rows[d - 1].rcCode) - }; - setOpen(false); - // return false; - - saveParkingJudgeTargets(param).then(() => { - setSelectionModel([]); - search(); - }); - }; - - const handleSearch = () => { - if (rcSeq1 && rcSeq2) { - search(); - } - }; - - const handleOnKeyDown = (event) => { - if (event.type === 'keydown' && event.key === 'Enter' && rcSeq1 && rcSeq2) { - search(); - } - }; - - const handleSelection = (newSelection) => { - setSelectionModel(newSelection); - }; - - return ( - - - - - - - - 자료등록여부 - - setRcIrTransfer(e.target.value)} - > - } label="미등록" /> - } label="등록" /> - - - - - setRcSeq1(e.target.value.replace(/-/g, ''))} - placeholder="yyyy-MM-9999" - onKeyDown={handleOnKeyDown} - label="접수번호(시작)" - format="####-######" - /> -  -  - setRcSeq2(e.target.value.replace(/-/g, ''))} - placeholder="yyyy-MM-9999" - onKeyDown={handleOnKeyDown} - label="접수번호(종료)" - format="####-######" - /> - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; -export default DisabledRegister; diff --git a/src/views/biz/disabled/DisabledReview.jsx b/src/views/biz/disabled/DisabledReview.jsx deleted file mode 100644 index 1090be1..0000000 --- a/src/views/biz/disabled/DisabledReview.jsx +++ /dev/null @@ -1,198 +0,0 @@ -import { useCallback, useEffect, useRef, useState } from 'react'; - -import _ from 'lodash'; -import getYear from 'date-fns/getYear'; - -// material-ui -import { GridActionsCellItem } from '@mui/x-data-grid'; -import { Divider, FormControl, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select } from '@mui/material'; -import DeleteIcon from '@mui/icons-material/Delete'; -import { IconSearch } from '@tabler/icons'; - -// berry ui -import MainCard from 'ui-component/cards/MainCard'; - -// project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; -import xitCmm from 'commons/XitCmm'; -import InputLabel from 'ui-component/extended/Form/InputLabel'; -import { findDisableds } from 'apis/disabled'; - -const DisabledReview = () => { - const isInit = useRef(true); - const year = getYear(new Date()); - console.log(typeof year); - const years = _.range(year, year - 14, -1); - - const [selectedYear, setSelectedYear] = useState(year); - const [searchTxt, setSearchTxt] = useState(''); - - const [totalCount, setTotalCount] = useState(0); - const [rowsState, setRowsState] = useState({ - page: 0, - pageSize: 20, - rows: [] - // loading: false - }); - const removeSimsa = useCallback( - (row) => () => { - // setTimeout(() => { - // setRowsState((prevRows) => prevRows.filter((row) => row.rowId !== rowId)); - // }); - xitCmm.alertParam(`삭제대상
${JSON.stringify(row)}`); - console.log(row); - }, - [] - ); - - const openModalDetails = () => {}; - - /* - ms_maincode : '민원코드' - ms_seq : '접수번호' - ms_carnum : '차량번호' - ms_year : '년도' - ms_chasu : '차수' - ms_sdate : '심사시작일시' - ms_startsi : '심사시작시간' - ms_edate : '심사종료일시' - ms_cdate : '심사마감일시' - ms_closesi : '심사마감시간' - ms_wdate : '단속일자' - ms_pos : '단속장소' - ms_result : '결과코드' - ms_jbtime : '단속시간' - */ - const columns = [ - // { headerName: 'rowId', field: 'rowId' }, - { headerName: '심의차수', headerAlign: 'center', field: 'msChasu' }, - { headerName: '심사건수', headerAlign: 'center', field: 'cnt' }, - { - headerName: '심사기간', - headerAlign: 'center', - field: 'msDate', - minWidth: 180, - description: '심사기간', - valueGetter: (params) => `${params.row.msSdate} ~ ${params.row.msEdate}`, - renderCell: (params) => ( - // - navigate(`/parking/details?msChasu=${params.msChasu}&msSdate=${params.msSdate}&msEdate=${params.msEdate}`)} - onClick={openModalDetails} - data-target="modalDetails" - rel="noopener" - > - {/* }> */} - {/* }> */} - {params.value} - - // - ) - }, - { - headerName: '심사마감일시', - headerAlign: 'center', - field: 'msCdate', - type: 'dateTime', - minWidth: 125, - valueGetter: (params) => `${params.row.msCdate} ${params.row.msClosesi}` - }, - { headerName: '상태', field: 'msResult', renderCell: (params) => <>{params.row.msResult === '1' ? '진행중' : '심사완료'} }, - { - headerName: '삭제', - headerAlign: 'center', - field: 'actions', - type: 'actions', - width: 80, - getActions: (params) => [} label="Delete" onClick={removeSimsa(params.row)} />] - } - ]; - - const search = useCallback(() => { - const params = { - page: rowsState.page, - size: rowsState.pageSize - }; - - findDisableds({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { - if (response && response.data) { - setTotalCount(response.count); - setRowsState((prevState) => ({ ...prevState, rows: response.data })); - // apiRef.current.forceUpdate(); // .updateRowData([]); - // apiRef.current.updateRowData([]); - } - }); - }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); - - const handleSearch = async (event) => { - if (!selectedYear) return; - - if (event.type === 'keydown' && event.key === 'Enter') { - const newString = event?.target.value; - setSearchTxt(newString); - search(); - } - }; - - useEffect(() => { - if (isInit.current) { - isInit.current = false; - return; - } - search(); - // }, [rowsState.page, rowsState.pageSize, selectedYear, searchTxt]); - }, [search]); - - return ( - - - - - - - 심의 년도 - - - - - - - - } - /> - - - - - - - - - - - - - ); -}; -export default DisabledReview; diff --git a/src/views/biz/disabled/NewDisabledDataForm.jsx b/src/views/biz/disabled/NewDisabledDataForm.jsx deleted file mode 100644 index a31f7f5..0000000 --- a/src/views/biz/disabled/NewDisabledDataForm.jsx +++ /dev/null @@ -1,438 +0,0 @@ -import { useEffect, useState } from 'react'; - -import PropTypes from 'prop-types'; -import NumberFormat from 'react-number-format'; -import { useAlert } from 'react-alert'; -import format from 'date-fns/format'; - -import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornment } from '@mui/material'; -import Button from '@mui/material/Button'; -import { IconSearch } from '@tabler/icons'; - -import { getComboCodeList } from 'apis/common'; -import FileInputForms from 'views/form/FileInputForms'; - -const toDate = new Date(); - -const NewDisabledDataForm = ({ handleModalSave }) => { - const alert = useAlert(); - - const [scCarnum, setScCarnum] = useState(''); - const [scName, setScName] = useState(''); - const [scDong, setScDong] = useState(''); - const [scContDoc, setScContDoc] = useState(); - const [selectedContDoc, setSelectedContDoc] = useState('11'); - const [scIngb, setScIngb] = useState(); - const [selectedIngb, setSelectedIngb] = useState('1'); - const [zippost1, setZippost1] = useState(null); - const [scJuso, setScJuso] = useState(''); - const [scBunji, setScBunji] = useState(''); - const [scWdate, setScWdate] = useState(null); - const [scCdate, setScCdate] = useState(format(toDate, 'yyyyMMdd')); - const [scJbtime, setScJbtime] = useState(null); - const [scPos, setScPos] = useState(''); - - const [picads, setPicads] = useState({}); - const [frecads, setFrecads] = useState({}); - const [contads, setContads] = useState({}); - - const onSave = () => { - // TODO : validation check 추가 - const formData = new FormData(); - formData.append('scCarnum', scCarnum); - formData.append('scName', scName); - formData.append('scDong', scDong); - formData.append('scContDoc', selectedContDoc); - formData.append('scCdate', scCdate); - formData.append('scIngb', selectedIngb); - formData.append('scWdate', scWdate); - formData.append('scJbtime', scJbtime); - formData.append('scPos', scPos); - formData.append('zippost1', zippost1); - formData.append('scJuso', scJuso); - formData.append('scBunji', scBunji); - - Object.values(picads).forEach((v) => { - formData.append('picadFiles', v); - }); - - Object.values(frecads).forEach((v) => { - formData.append('frecadFiles', v); - }); - - Object.values(contads).forEach((v) => { - formData.append('contadFiles', v); - }); - - handleModalSave(formData); - }; - - useEffect(() => { - // setSelectedContDoc('11'); - setScContDoc([]); - getComboCodeList({ codeMcd: 'SC_CONT_DOC' }).then((res) => { - console.log(res); - setScContDoc(res.data); - }); - getComboCodeList({ codeMcd: 'RC_INGB' }).then((res) => { - console.log(res); - setScIngb(res.data); - }); - }, []); - - const handleChangeFile = (e) => { - const fileKey = e.target.name; - const fileArrKey = fileKey + e.target.dataset.index; - - if (fileKey === 'scPicad') { - setPicads((picads) => { - const updated = { ...picads }; - updated[fileArrKey] = e.target.files[0]; - return updated; - }); - } else if (fileKey === 'scFrecad') { - setFrecads((frecads) => { - const updated = { ...frecads }; - updated[fileArrKey] = e.target.files[0]; - return updated; - }); - } else if (fileKey === 'scContad') { - setContads((contads) => { - const updated = { ...contads }; - updated[fileArrKey] = e.target.files[0]; - return updated; - }); - } - }; - - return ( - <> - - - - setScCarnum(e?.target?.value)} - autoFocus - /> - - - setScName(e?.target?.value)} /> - - - setScDong(e?.target?.value)} /> - - - - 진술유형 - - - - - - - setScCdate(e?.target?.value)} - /> - - - - 접수방법 - - - - - setScWdate(e?.target?.value)} - /> - - - setScJbtime(e?.target?.value)} - /> - - - - - setScPos(e?.target?.value)} /> - - - - - setZippost1(e?.target?.value)} - InputProps={{ - display: 'none', - readOnly: true, - endAdornment: ( - - - - ) - }} - /> - - - setScJuso(e?.target?.value)} - InputProps={{ readOnly: true }} - /> - - - setScBunji(e?.target?.value)} /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {/* - - - ); -}; -NewDisabledDataForm.propTypes = { - handleModalSave: PropTypes.func.isRequired -}; -export default NewDisabledDataForm; diff --git a/src/views/biz/disabled/ModifyDisabledDataForm.jsx b/src/views/biz/judge/ModifyJudgeDataForm.jsx similarity index 99% rename from src/views/biz/disabled/ModifyDisabledDataForm.jsx rename to src/views/biz/judge/ModifyJudgeDataForm.jsx index bd98b51..3e7eade 100644 --- a/src/views/biz/disabled/ModifyDisabledDataForm.jsx +++ b/src/views/biz/judge/ModifyJudgeDataForm.jsx @@ -14,7 +14,7 @@ import FileInputForms from 'views/form/FileInputForms'; // const toDate = new Date(); -const ModifyDisabledDataForm = ({ rowData, handleModalSave }) => { +const ModifyJudgeDataForm = ({ rowData, handleModalSave }) => { const alert = useAlert(); const [scCarnum, setScCarnum] = useState(rowData.scCarnum); @@ -447,8 +447,8 @@ const ModifyDisabledDataForm = ({ rowData, handleModalSave }) => { ); }; -ModifyDisabledDataForm.propTypes = { +ModifyJudgeDataForm.propTypes = { rowData: PropTypes.object.isRequired, handleModalSave: PropTypes.func.isRequired }; -export default ModifyDisabledDataForm; +export default ModifyJudgeDataForm; diff --git a/src/views/biz/resident/NewResidentDataForm.jsx b/src/views/biz/judge/NewJudgeDataForm.jsx similarity index 99% rename from src/views/biz/resident/NewResidentDataForm.jsx rename to src/views/biz/judge/NewJudgeDataForm.jsx index 540f4fc..9123475 100644 --- a/src/views/biz/resident/NewResidentDataForm.jsx +++ b/src/views/biz/judge/NewJudgeDataForm.jsx @@ -14,7 +14,7 @@ import FileInputForms from 'views/form/FileInputForms'; const toDate = new Date(); -const NewResidentDataForm = ({ handleModalSave }) => { +const NewJudgeDataForm = ({ handleModalSave }) => { const alert = useAlert(); const [scCarnum, setScCarnum] = useState(''); @@ -432,7 +432,7 @@ const NewResidentDataForm = ({ handleModalSave }) => { ); }; -NewResidentDataForm.propTypes = { +NewJudgeDataForm.propTypes = { handleModalSave: PropTypes.func.isRequired }; -export default NewResidentDataForm; +export default NewJudgeDataForm; diff --git a/src/views/biz/disabled/SaveDisabledTargetForm.jsx b/src/views/biz/judge/SaveJudgeTargetForm.jsx similarity index 97% rename from src/views/biz/disabled/SaveDisabledTargetForm.jsx rename to src/views/biz/judge/SaveJudgeTargetForm.jsx index 46ea271..bde30a9 100644 --- a/src/views/biz/disabled/SaveDisabledTargetForm.jsx +++ b/src/views/biz/judge/SaveJudgeTargetForm.jsx @@ -17,7 +17,7 @@ import combo from 'commons/combo_data'; const toDate = new Date(); -const SaveDisabledTargetForm = ({ handleModalSave }) => { +const SaveJudgeTargetForm = ({ handleModalSave }) => { const [msuTeam, setMsuTeam] = useState(combo.teams[0].code); const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd')); const [msStartsi, setMsStartsi] = useState(getHours(toDate)); @@ -165,8 +165,8 @@ const SaveDisabledTargetForm = ({ handleModalSave }) => { ); }; -SaveDisabledTargetForm.propTypes = { +SaveJudgeTargetForm.propTypes = { handleModalSave: PropTypes.func.isRequired // isDisabled: PropTypes.bool.isRequired }; -export default SaveDisabledTargetForm; +export default SaveJudgeTargetForm; diff --git a/src/views/biz/resident/ModifyResidentDataForm.jsx b/src/views/biz/resident/ModifyResidentDataForm.jsx deleted file mode 100644 index 973f75d..0000000 --- a/src/views/biz/resident/ModifyResidentDataForm.jsx +++ /dev/null @@ -1,454 +0,0 @@ -import { useEffect, useState } from 'react'; - -import PropTypes from 'prop-types'; -import NumberFormat from 'react-number-format'; -import { useAlert } from 'react-alert'; -// import format from 'date-fns/format'; - -import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornment } from '@mui/material'; -import Button from '@mui/material/Button'; -import { IconSearch } from '@tabler/icons'; - -import { getComboCodeList } from 'apis/common'; -import FileInputForms from 'views/form/FileInputForms'; - -// const toDate = new Date(); - -const ModifyResidentDataForm = ({ rowData, handleModalSave }) => { - const alert = useAlert(); - - const [scCarnum, setScCarnum] = useState(rowData.scCarnum); - const [scName, setScName] = useState(rowData.scName); - const [scDong, setScDong] = useState(rowData.scDong); - const [scContDoc, setScContDoc] = useState(); - const [selectedContDoc, setSelectedContDoc] = useState(rowData.scContDoc); - const [scIngb, setScIngb] = useState(); - const [selectedIngb, setSelectedIngb] = useState(rowData.scIngb); - const [zippost1, setZippost1] = useState(`${rowData.zippost1}${rowData.zippost2}`); - const [scJuso, setScJuso] = useState(rowData.scJuso); - const [scBunji, setScBunji] = useState(rowData.scBunji); - const [scWdate, setScWdate] = useState(rowData.scWdate); - const [scCdate, setScCdate] = useState(rowData.scCdate); - const [scJbtime, setScJbtime] = useState(rowData.scJbtime); - const [scPos, setScPos] = useState(''); - - const [picads, setPicads] = useState({}); - const [frecads, setFrecads] = useState({}); - const [contads, setContads] = useState({}); - - const onSave = () => { - // TODO : validation check 추가 - const formData = new FormData(); - formData.append('scCarnum', scCarnum); - formData.append('scName', scName); - formData.append('scDong', scDong); - formData.append('scContDoc', selectedContDoc); - formData.append('scCdate', scCdate); - formData.append('scIngb', selectedIngb); - formData.append('scWdate', scWdate); - formData.append('scJbtime', scJbtime); - formData.append('scPos', scPos); - formData.append('zippost1', zippost1); - formData.append('scJuso', scJuso); - formData.append('scBunji', scBunji); - - Object.values(picads).forEach((v) => { - formData.append('picadFiles', v); - }); - - Object.values(frecads).forEach((v) => { - formData.append('frecadFiles', v); - }); - - Object.values(contads).forEach((v) => { - formData.append('contadFiles', v); - }); - - handleModalSave(formData); - }; - - useEffect(() => { - // setSelectedContDoc('11'); - setScContDoc([]); - getComboCodeList({ codeMcd: 'SC_CONT_DOC' }).then((res) => { - console.log(res); - setScContDoc(res.data); - }); - getComboCodeList({ codeMcd: 'RC_INGB' }).then((res) => { - console.log(res); - setScIngb(res.data); - }); - }, []); - - const handleChangeFile = (e) => { - const fileKey = e.target.name; - const fileArrKey = fileKey + e.target.dataset.index; - - if (fileKey === 'scPicad') { - setPicads((picads) => { - const updated = { ...picads }; - updated[fileArrKey] = e.target.files[0]; - return updated; - }); - } else if (fileKey === 'scFrecad') { - setFrecads((frecads) => { - const updated = { ...frecads }; - updated[fileArrKey] = e.target.files[0]; - return updated; - }); - } else if (fileKey === 'scContad') { - setContads((contads) => { - const updated = { ...contads }; - updated[fileArrKey] = e.target.files[0]; - return updated; - }); - } - }; - - return ( - <> - - - - setScCarnum(e?.target?.value)} - autoFocus - /> - - - setScName(e?.target?.value)} /> - - - setScDong(e?.target?.value)} /> - - - - 진술유형 - - - - - - - setScCdate(e?.target?.value)} - /> - - - - 접수방법 - - - - - setScWdate(e?.target?.value)} - /> - - - setScJbtime(e?.target?.value)} - /> - - - - - setScPos(e?.target?.value)} - /> - - - - - setZippost1(e?.target?.value)} - InputProps={{ - display: 'none', - readOnly: true, - endAdornment: ( - - - - ) - }} - /> - - - setScJuso(e?.target?.value)} - InputProps={{ readOnly: true }} - /> - - - setScBunji(e?.target?.value)} /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {/* - - - ); -}; -ModifyResidentDataForm.propTypes = { - rowData: PropTypes.object.isRequired, - handleModalSave: PropTypes.func.isRequired -}; -export default ModifyResidentDataForm; diff --git a/src/views/biz/resident/ResidentDataReview.jsx b/src/views/biz/resident/ResidentDataReview.jsx index 2cacecb..4e833e3 100644 --- a/src/views/biz/resident/ResidentDataReview.jsx +++ b/src/views/biz/resident/ResidentDataReview.jsx @@ -8,11 +8,11 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiDataGrid from 'views/form/MuiDataGrid'; import CmmModal from 'views/form/Modal/CmmModal'; -import { findResident, findResidentDatas, saveResidentData } from 'apis/resident'; -import NewResidentDataForm from './NewResidentDataForm'; -import ModifyResidentDataForm from './ModifyResidentDataForm'; +import { findJudge, findJudgeDatas, saveJudgeData } from 'apis/judge'; +import NewJudgeDataForm from 'views/biz/judge/NewJudgeDataForm'; +import ModifyJudgeDataForm from 'views/biz/judge/ModifyJudgeDataForm'; -const ResidentDataReview = () => { +const ResidentDataReview = ({ scDatagb, menuName }) => { const [open, setOpen] = useState(false); const [create, setCreate] = useState(false); // const [selectedRow, setSelectedRow] = useState({}); @@ -56,11 +56,12 @@ const ResidentDataReview = () => { const search = useCallback(() => { const params = { + scDatagb, // 거주자 page: rowsState.page, size: rowsState.pageSize }; - findResidentDatas(params).then((response) => { + findJudgeDatas(params).then((response) => { console.log(response); if (response && response.data) { setTotalCount(response.count); @@ -69,31 +70,31 @@ const ResidentDataReview = () => { // apiRef.current.updateRowData([]); } }); - }, [rowsState.page, rowsState.pageSize]); + }, [rowsState.page, rowsState.pageSize, scDatagb]); useEffect(() => { search(); }, [search]); // search, rowsState.page, rowsState.pageSize]); const handleCreate = () => { - setTitle('거주자 의견진술 자료 신규 등록'); + setTitle(`${menuName} 의견진술 자료 신규 등록`); setCreate(true); setOpen(true); }; const handleOnCellClick = (e) => { if (e?.field === 'scSeq') { - findResident(e.row?.scCode).then((res) => { + findJudge(e.row?.scCode).then((res) => { setRowData(res.data); setCreate(false); - setTitle('거주자 의견진술 자료 변경'); + setTitle(`${menuName} 의견진술 자료 변경`); setOpen(true); }); } }; const handleSaveResident = (payload) => { - saveResidentData(payload).then(() => { + saveJudgeData(payload).then(() => { search(); setOpen(false); }); @@ -122,8 +123,8 @@ const ResidentDataReview = () => { handleCellClick={handleOnCellClick} /> - {create && } - {!create && } + {create && } + {!create && } ); diff --git a/src/views/biz/resident/ResidentRegist.jsx b/src/views/biz/resident/ResidentRegist.jsx index 285e2c3..2f2f8c5 100644 --- a/src/views/biz/resident/ResidentRegist.jsx +++ b/src/views/biz/resident/ResidentRegist.jsx @@ -15,10 +15,10 @@ import MuiDataGrid from 'views/form/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; import CmmModal from 'views/form/Modal/CmmModal'; -import SaveResidentTargetForm from './SaveResidentTargetForm'; +import SaveJudgeTargetForm from 'views/biz/judge/SaveJudgeTargetForm'; import NumberFormat from 'react-number-format'; import ExcelDownload from 'views/form/ExcelDownload'; -import { findResidentJudgeTargets, saveResidentJudgeTargets } from 'apis/resident'; +import { findJudgeTargets, saveJudgeTargets } from 'apis/judge'; const ResidentRegister = () => { const [scTransfer, setScTransfer] = useState('1'); @@ -58,7 +58,7 @@ const ResidentRegister = () => { scSeq2 }; - findResidentJudgeTargets(params).then((response) => { + findJudgeTargets(params).then((response) => { if (response && response.data) { setSelectionModel([]); setTotalCount(response.count); @@ -88,7 +88,7 @@ const ResidentRegister = () => { setOpen(false); console.log(param); - saveResidentJudgeTargets(param).then(() => { + saveJudgeTargets(param).then(() => { setSelectionModel([]); search(); }); @@ -202,7 +202,7 @@ const ResidentRegister = () => { selectionModel={selectionModel} /> - + ); diff --git a/src/views/biz/resident/ResidentReview.jsx b/src/views/biz/resident/ResidentReview.jsx index 4a4b258..a422eea 100644 --- a/src/views/biz/resident/ResidentReview.jsx +++ b/src/views/biz/resident/ResidentReview.jsx @@ -16,7 +16,7 @@ import MainCard from 'ui-component/cards/MainCard'; import MuiDataGrid from 'views/form/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; import InputLabel from 'ui-component/extended/Form/InputLabel'; -import { findResidents } from 'apis/resident'; +import { findJudges } from 'apis/judge'; const ResidentReview = () => { const isInit = useRef(true); @@ -120,11 +120,12 @@ const ResidentReview = () => { const search = useCallback(() => { const params = { + // scDatagb: '1', page: rowsState.page, size: rowsState.pageSize }; - findResidents({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { + findJudges({ ...params, msYear: selectedYear, msChasu: searchTxt }).then((response) => { if (response && response.data) { setTotalCount(response.count); setRowsState((prevState) => ({ ...prevState, rows: response.data })); diff --git a/src/views/biz/resident/SaveResidentTargetForm.jsx b/src/views/biz/resident/SaveResidentTargetForm.jsx deleted file mode 100644 index 6185b78..0000000 --- a/src/views/biz/resident/SaveResidentTargetForm.jsx +++ /dev/null @@ -1,172 +0,0 @@ -import { useState } from 'react'; - -import NumberFormat from 'react-number-format'; -import format from 'date-fns/format'; -import getHours from 'date-fns/getHours'; -import koLocale from 'date-fns/locale/ko'; - -import { Grid, TextField, MenuItem, Select, FormControl, InputLabel } from '@mui/material'; -import DateAdapter from '@mui/lab/AdapterDateFns'; -import LocalizationProvider from '@mui/lab/LocalizationProvider'; -import { DatePicker, TimePicker } from '@mui/lab'; -import Button from '@mui/material/Button'; -import PropTypes from 'prop-types'; -import { IconFileExport } from '@tabler/icons'; - -import combo from 'commons/combo_data'; - -const toDate = new Date(); - -const SaveResidentTargetForm = ({ handleModalSave }) => { - const [msuTeam, setMsuTeam] = useState(combo.teams[0].code); - const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd')); - const [msStartsi, setMsStartsi] = useState(getHours(toDate)); - const [msEdate, setMsEdate] = useState(format(toDate, 'yyyy-MM-dd')); - const [msChasu, setMsChasu] = useState(99); - const [msCdate, setMsCdate] = useState(format(toDate, 'yyyy-MM-dd')); - const [msClosesi, setMsClosesi] = useState(getHours(toDate)); - - const onSave = () => { - // TODO : validation check 추가 - handleModalSave({ - msuTeam, - msSdate, - msStartsi, - msEdate, - msChasu, - msCdate, - msClosesi - }); - }; - - return ( - <> - - - - } - label="심의시작일" - value={msSdate} - inputFormat="yyyy-MM-dd" - mask="____-__-__" - onChange={(newValue) => { - setMsSdate(format(newValue, 'yyyy-MM-dd')); - }} - /> - - {/* */} - - - - } - label="심의시작시간" - value={msStartsi} - inputFormat="HH" - mask="__" - onChange={(newValue) => { - // setMsStartsi(format(newValue, 'HH')); - setMsStartsi(getHours(newValue)); - }} - /> - - {/* */} - - - - } - label="심의종료일" - value={msEdate} - inputFormat="yyyy-MM-dd" - mask="____-__-__" - onChange={(newValue) => { - setMsEdate(format(newValue, 'yyyy-MM-dd')); - }} - /> - - - - - - - - - - setMsChasu(values.value)} - /> - - - - } - label="심의마감일" - value={msCdate} - inputFormat="yyyy-MM-dd" - mask="____-__-__" - onChange={(newValue) => { - setMsCdate(format(newValue, 'yyyy-MM-dd')); - }} - /> - - - {/* setMsCdate(format(e.target.value), 'yyyy-MM-dd')} */} - {/* /> */} - - - - } - renderInput={(props) => } - label="심의마감시간" - value={msClosesi} - inputFormat="HH" - mask="__" - onChange={(newValue) => { - setMsClosesi(getHours(newValue)); - }} - /> - - - - - - - - ); -}; -SaveResidentTargetForm.propTypes = { - handleModalSave: PropTypes.func.isRequired - // isDisabled: PropTypes.bool.isRequired -}; -export default SaveResidentTargetForm;