diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-01 06:26:44 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-01 06:26:44 +0000 |
| commit | d689608ca2a54cab2cd12a12f0b6007a1be39ab2 (patch) | |
| tree | bb93e630c18b3028322f7f7aee87547e893f5df7 /lib/rfq-last/vendor-response/editor/attachments-upload.tsx | |
| parent | 7021eca8f53e398f55f775c6dc431bca9670fabe (diff) | |
(대표님, 최겸) 구매 견적 첨부파일 type 오류 수정, 문서확정, short list 기능 수정
Diffstat (limited to 'lib/rfq-last/vendor-response/editor/attachments-upload.tsx')
| -rw-r--r-- | lib/rfq-last/vendor-response/editor/attachments-upload.tsx | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/lib/rfq-last/vendor-response/editor/attachments-upload.tsx b/lib/rfq-last/vendor-response/editor/attachments-upload.tsx index ea7bb9c9..b85407ff 100644 --- a/lib/rfq-last/vendor-response/editor/attachments-upload.tsx +++ b/lib/rfq-last/vendor-response/editor/attachments-upload.tsx @@ -97,10 +97,10 @@ export default function AttachmentsUpload({ // 파일 추가 const handleFileAdd = (files: FileList | null, type: "구매" | "설계") => { if (!files) return - + const newFiles: FileWithType[] = [] const errors: string[] = [] - + Array.from(files).forEach(file => { const error = validateFile(file) if (error) { @@ -110,17 +110,31 @@ export default function AttachmentsUpload({ attachmentType: type, description: "" }) + // 디버그 로그 추가 + console.log(`파일 추가됨: ${file.name}, 타입: ${type}`) newFiles.push(fileWithType) } }) - + if (errors.length > 0) { setUploadErrors(errors) setTimeout(() => setUploadErrors([]), 5000) } - + if (newFiles.length > 0) { - onAttachmentsChange([...attachments, ...newFiles]) + const updatedFiles = [...attachments, ...newFiles] + onAttachmentsChange(updatedFiles) + + // 추가된 파일들의 타입 확인 로그 + console.log('업데이트된 파일 목록:', updatedFiles.map(f => ({ + name: f.name, + attachmentType: f.attachmentType + }))) + + // 각 파일의 타입이 제대로 설정되었는지 검증 + newFiles.forEach(file => { + console.log(`새 파일 타입 검증: ${file.name} = ${file.attachmentType}`) + }) } } @@ -175,7 +189,15 @@ export default function AttachmentsUpload({ // 파일 타입 변경 const handleTypeChange = (index: number, newType: "구매" | "설계") => { const newFiles = [...attachments] + const oldType = newFiles[index].attachmentType newFiles[index].attachmentType = newType + + console.log(`파일 타입 변경: ${newFiles[index].name} (${oldType} -> ${newType})`) + console.log('변경 후 파일 목록:', newFiles.map(f => ({ + name: f.name, + attachmentType: f.attachmentType + }))) + onAttachmentsChange(newFiles) } |
