|
|
|
@ -11,7 +11,6 @@ import { IconSearch } from '@tabler/icons';
|
|
|
|
|
|
|
|
|
|
import FileInputForms from 'views/cmm/file-ctl/FileInputForms';
|
|
|
|
|
import DaumPost from '../../cmm/DaumPost';
|
|
|
|
|
import FileReadInputForm from '../../cmm/file-ctl/FileReadInputForm';
|
|
|
|
|
|
|
|
|
|
// const toDate = new Date();
|
|
|
|
|
|
|
|
|
@ -104,6 +103,12 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
|
|
|
|
|
// const file = new File();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
|
|
|
// for (const pair of formData.entries()) {
|
|
|
|
|
// console.log(pair[0], pair[1]);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
handleModalSave('SAVE', formData);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -115,19 +120,21 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
|
|
|
|
|
setPicads((picads) => {
|
|
|
|
|
const updated = { ...picads };
|
|
|
|
|
updated[fileArrKey] = e.target.files[0];
|
|
|
|
|
e.target.fileName = e.target.files[0].name;
|
|
|
|
|
rowData[fileArrKey] = e.target.files[0].name;
|
|
|
|
|
return updated;
|
|
|
|
|
});
|
|
|
|
|
} else if (fileKey === 'scFrecad') {
|
|
|
|
|
setFrecads((frecads) => {
|
|
|
|
|
const updated = { ...frecads };
|
|
|
|
|
updated[fileArrKey] = e.target.files[0];
|
|
|
|
|
rowData[fileArrKey] = e.target.files[0].name;
|
|
|
|
|
return updated;
|
|
|
|
|
});
|
|
|
|
|
} else if (fileKey === 'scContad') {
|
|
|
|
|
setContads((contads) => {
|
|
|
|
|
const updated = { ...contads };
|
|
|
|
|
updated[fileArrKey] = e.target.files[0];
|
|
|
|
|
rowData[fileArrKey] = e.target.files[0].name;
|
|
|
|
|
return updated;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -151,10 +158,27 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
|
|
|
|
|
setIsPostOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const setFileUploadBtn = (fieldName, idx) => {
|
|
|
|
|
let isDisabled = false;
|
|
|
|
|
switch (idx) {
|
|
|
|
|
case 1:
|
|
|
|
|
isDisabled = false;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
isDisabled =
|
|
|
|
|
rowData[`${fieldName}${idx}`] || rowData[`${fieldName}${idx - 1}`]
|
|
|
|
|
? false
|
|
|
|
|
: typeof picads[`${fieldName}${idx - 1}`] === 'undefined';
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return isDisabled;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// eslint-disable-next-line no-plusplus
|
|
|
|
|
for (let idx = 1; idx < 5; idx++) {
|
|
|
|
|
if (rowData[`scPicad${idx}`]) {
|
|
|
|
|
// URL.createObjectURL(rowData[`scPicad${idx}`]);
|
|
|
|
|
console.log(rowData[`scPicad${idx}`]);
|
|
|
|
|
// const file = new File();
|
|
|
|
|
}
|
|
|
|
@ -314,7 +338,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
|
|
|
|
|
{_.range(1, 5, 1).map((idx) => (
|
|
|
|
|
<Grid item sm={3}>
|
|
|
|
|
<FileInputForms
|
|
|
|
|
isDisabled={idx === 1 ? false : typeof picads[`scPicad${idx - 1}`] === 'undefined'}
|
|
|
|
|
isDisabled={setFileUploadBtn('scPicad', idx)}
|
|
|
|
|
fieldName="scPicad"
|
|
|
|
|
index={idx}
|
|
|
|
|
labelName={`단속사진${idx}`}
|
|
|
|
@ -331,7 +355,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
|
|
|
|
|
{_.range(1, 5, 1).map((idx) => (
|
|
|
|
|
<Grid item sm={3}>
|
|
|
|
|
<FileInputForms
|
|
|
|
|
isDisabled={idx === 1 ? false : typeof frecads[`scFrecad${idx - 1}`] === 'undefined'}
|
|
|
|
|
isDisabled={setFileUploadBtn('scFrecad', idx)}
|
|
|
|
|
fieldName="scFrecad"
|
|
|
|
|
index={idx}
|
|
|
|
|
labelName={`진술서${idx}`}
|
|
|
|
@ -348,7 +372,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
|
|
|
|
|
{_.range(1, 9, 1).map((idx) => (
|
|
|
|
|
<Grid item sm={3}>
|
|
|
|
|
<FileInputForms
|
|
|
|
|
isDisabled={idx === 1 ? false : typeof contads[`scContad${idx - 1}`] === 'undefined'}
|
|
|
|
|
isDisabled={setFileUploadBtn('scContad', idx)}
|
|
|
|
|
fieldName="scContad"
|
|
|
|
|
index={idx}
|
|
|
|
|
labelName={`첨부자료${idx}`}
|
|
|
|
|