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