|
|
@ -22,7 +22,9 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
|
|
|
|
const [scContDocs, setScContDocs] = useState([]);
|
|
|
|
const [scContDocs, setScContDocs] = useState([]);
|
|
|
|
const [scIngbs, setScIngbs] = useState([]);
|
|
|
|
const [scIngbs, setScIngbs] = useState([]);
|
|
|
|
|
|
|
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
const [newOpen, setNewOpen] = useState(false);
|
|
|
|
|
|
|
|
const [dtlOpen, setDtlOpen] = useState(false);
|
|
|
|
|
|
|
|
const [modOpen, setModOpen] = useState(false);
|
|
|
|
const [create, setCreate] = useState(false);
|
|
|
|
const [create, setCreate] = useState(false);
|
|
|
|
const [detail, setDetail] = useState(false);
|
|
|
|
const [detail, setDetail] = useState(false);
|
|
|
|
const [modify, setModify] = useState(false);
|
|
|
|
const [modify, setModify] = useState(false);
|
|
|
@ -103,13 +105,11 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
const handleCreate = () => {
|
|
|
|
const handleCreate = () => {
|
|
|
|
// setIsPostOpen(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setModify(false);
|
|
|
|
setModify(false);
|
|
|
|
setDetail(false);
|
|
|
|
setDetail(false);
|
|
|
|
setCreate(true);
|
|
|
|
setCreate(true);
|
|
|
|
setTitle(`${menuName} 의견진술 자료 신규 등록`);
|
|
|
|
setTitle(`${menuName} 의견진술 자료 신규 등록`);
|
|
|
|
setOpen(true);
|
|
|
|
setNewOpen(true);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleOnCellClick = (e) => {
|
|
|
|
const handleOnCellClick = (e) => {
|
|
|
@ -120,37 +120,30 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
|
|
|
|
setDetail(true);
|
|
|
|
setDetail(true);
|
|
|
|
setRowData(res.data);
|
|
|
|
setRowData(res.data);
|
|
|
|
setTitle(`${menuName} 의견진술 자료 상세`);
|
|
|
|
setTitle(`${menuName} 의견진술 자료 상세`);
|
|
|
|
setOpen(true);
|
|
|
|
setDtlOpen(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSaveResident = (type, payload) => {
|
|
|
|
const handleJudgeData = (type, payload) => {
|
|
|
|
switch (type) {
|
|
|
|
switch (type) {
|
|
|
|
case 'SAVE':
|
|
|
|
case 'SAVE':
|
|
|
|
if (window.confirm('저장 하시겠습니까?')) {
|
|
|
|
|
|
|
|
saveJudgeData(payload).then((res) => {
|
|
|
|
saveJudgeData(payload).then((res) => {
|
|
|
|
if (res?.success) {
|
|
|
|
if (res?.success) {
|
|
|
|
setCreate(false);
|
|
|
|
setCreate(false);
|
|
|
|
setModify(false);
|
|
|
|
|
|
|
|
setDetail(false);
|
|
|
|
setDetail(false);
|
|
|
|
setOpen(false);
|
|
|
|
|
|
|
|
search();
|
|
|
|
search();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
showAlert.show(`${res?.data.message}`);
|
|
|
|
showAlert.show(`${res?.data.message}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'DELETE':
|
|
|
|
case 'DELETE':
|
|
|
|
removeJudgeData(payload).then((res) => {
|
|
|
|
removeJudgeData(payload).then((res) => {
|
|
|
|
if (res?.success) {
|
|
|
|
if (res?.success) {
|
|
|
|
setCreate(false);
|
|
|
|
setCreate(false);
|
|
|
|
setModify(false);
|
|
|
|
setModify(false);
|
|
|
|
setDetail(false);
|
|
|
|
|
|
|
|
setOpen(false);
|
|
|
|
|
|
|
|
search();
|
|
|
|
search();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
showAlert.show(`${res?.data.message}`);
|
|
|
|
showAlert.show(`${res?.data.message}`);
|
|
|
@ -162,13 +155,13 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const openModify = () => {
|
|
|
|
const openModify = () => {
|
|
|
|
setOpen(false);
|
|
|
|
setDtlOpen(false);
|
|
|
|
setCreate(false);
|
|
|
|
setCreate(false);
|
|
|
|
setDetail(false);
|
|
|
|
setDetail(false);
|
|
|
|
|
|
|
|
|
|
|
|
setModify(true);
|
|
|
|
setModify(true);
|
|
|
|
setTitle(`${menuName} 의견진술 자료 변경`);
|
|
|
|
setTitle(`${menuName} 의견진술 자료 변경`);
|
|
|
|
setOpen(true);
|
|
|
|
setModOpen(true);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -192,30 +185,44 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
|
|
|
|
setRowsState={setRowsState}
|
|
|
|
setRowsState={setRowsState}
|
|
|
|
handleCellClick={handleOnCellClick}
|
|
|
|
handleCellClick={handleOnCellClick}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
|
|
|
|
{create && (
|
|
|
|
{create && <JudgeDataNewForm handleModalSave={handleSaveResident} scDatagb={scDatagb} contDocs={scContDocs} ingbs={scIngbs} />}
|
|
|
|
<CmmModal isBackdrop title={title} open={newOpen} setOpen={setNewOpen}>
|
|
|
|
{/* {!create && <JudgeDataModifyForm handleModalSave={handleSaveResident} rowData={rowData} />} */}
|
|
|
|
<JudgeDataNewForm
|
|
|
|
|
|
|
|
handleModalSave={handleJudgeData}
|
|
|
|
|
|
|
|
scDatagb={scDatagb}
|
|
|
|
|
|
|
|
contDocs={scContDocs}
|
|
|
|
|
|
|
|
ingbs={scIngbs}
|
|
|
|
|
|
|
|
setOpen={setNewOpen}
|
|
|
|
|
|
|
|
setCreate={setCreate}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</CmmModal>
|
|
|
|
|
|
|
|
)}
|
|
|
|
{detail && (
|
|
|
|
{detail && (
|
|
|
|
|
|
|
|
<CmmModal isBackdrop title={title} open={dtlOpen} setOpen={setDtlOpen}>
|
|
|
|
<JudgeDataDetailForm
|
|
|
|
<JudgeDataDetailForm
|
|
|
|
rowData={rowData}
|
|
|
|
rowData={rowData}
|
|
|
|
contDocs={scContDocs}
|
|
|
|
contDocs={scContDocs}
|
|
|
|
ingbs={scIngbs}
|
|
|
|
ingbs={scIngbs}
|
|
|
|
setOpen={setOpen}
|
|
|
|
setDetail={setDetail}
|
|
|
|
handleModalSave={handleSaveResident}
|
|
|
|
handleModalSave={handleJudgeData}
|
|
|
|
onModify={openModify}
|
|
|
|
onModify={openModify}
|
|
|
|
|
|
|
|
setOpen={setDtlOpen}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
</CmmModal>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
{modify && (
|
|
|
|
{modify && (
|
|
|
|
|
|
|
|
<CmmModal isBackdrop title={title} open={modOpen} setOpen={setModOpen}>
|
|
|
|
<JudgeDataModifyForm
|
|
|
|
<JudgeDataModifyForm
|
|
|
|
rowData={rowData}
|
|
|
|
rowData={rowData}
|
|
|
|
contDocs={scContDocs}
|
|
|
|
contDocs={scContDocs}
|
|
|
|
ingbs={scIngbs}
|
|
|
|
ingbs={scIngbs}
|
|
|
|
setOpen={setOpen}
|
|
|
|
setModify={setModify}
|
|
|
|
handleModalSave={handleSaveResident}
|
|
|
|
handleModalSave={handleJudgeData}
|
|
|
|
onModify={openModify}
|
|
|
|
onModify={openModify}
|
|
|
|
|
|
|
|
setOpen={setModOpen}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
|
|
|
|
</CmmModal>
|
|
|
|
</CmmModal>
|
|
|
|
|
|
|
|
)}
|
|
|
|
</MainCard>
|
|
|
|
</MainCard>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|