From dfc898b298e16bf686d2929db0eee50abe87881d Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 14 Oct 2025 05:59:11 +0000 Subject: (최겸) 구매 견적 첨부파일 기능 수정, 제출 후 수정x 추가 등 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendor-response/editor/attachments-upload.tsx | 87 +++++++++++++++------- 1 file changed, 61 insertions(+), 26 deletions(-) (limited to 'lib/rfq-last/vendor-response/editor/attachments-upload.tsx') diff --git a/lib/rfq-last/vendor-response/editor/attachments-upload.tsx b/lib/rfq-last/vendor-response/editor/attachments-upload.tsx index b85407ff..96a88ef7 100644 --- a/lib/rfq-last/vendor-response/editor/attachments-upload.tsx +++ b/lib/rfq-last/vendor-response/editor/attachments-upload.tsx @@ -33,7 +33,8 @@ import { FileCheck, Calculator, Wrench, - X + X, + CheckCircle } from "lucide-react" import { formatBytes } from "@/lib/utils" import { cn } from "@/lib/utils" @@ -52,6 +53,7 @@ interface AttachmentsUploadProps { onExistingAttachmentsChange?: (files: any[]) => void responseId?: number userId?: number + isSubmitted?: boolean } const acceptedFileTypes = { @@ -67,7 +69,8 @@ export default function AttachmentsUpload({ existingAttachments = [], onExistingAttachmentsChange, responseId, - userId + userId, + isSubmitted = false }: AttachmentsUploadProps) { const purchaseInputRef = useRef(null) const designInputRef = useRef(null) @@ -271,6 +274,16 @@ export default function AttachmentsUpload({ return (
+ {/* 제출완료 상태 알림 */} + {isSubmitted && ( + + + + 제출완료: 견적서가 이미 제출되어 추가 파일 업로드가 제한됩니다. + + + )} + {/* 필수 파일 안내 */} @@ -312,13 +325,14 @@ export default function AttachmentsUpload({

@@ -328,11 +342,15 @@ export default function AttachmentsUpload({ type="button" variant="outline" size="sm" - onClick={() => purchaseInputRef.current?.click()} - className="border-blue-500 text-blue-600 hover:bg-blue-50" + onClick={() => !isSubmitted && purchaseInputRef.current?.click()} + className={cn( + "border-blue-500 text-blue-600 hover:bg-blue-50", + isSubmitted && "opacity-50 cursor-not-allowed" + )} + disabled={isSubmitted} > - 구매 문서 선택 + {isSubmitted ? "제출완료" : "구매 문서 선택"}

@@ -382,11 +401,15 @@ export default function AttachmentsUpload({ type="button" variant="outline" size="sm" - onClick={() => designInputRef.current?.click()} - className="border-green-500 text-green-600 hover:bg-green-50" + onClick={() => !isSubmitted && designInputRef.current?.click()} + className={cn( + "border-green-500 text-green-600 hover:bg-green-50", + isSubmitted && "opacity-50 cursor-not-allowed" + )} + disabled={isSubmitted} > - 설계 문서 선택 + {isSubmitted ? "제출완료" : "설계 문서 선택"} handleDeleteClick(file, true, index)} + onClick={() => !isSubmitted && handleDeleteClick(file, true, index)} + className={isSubmitted ? "opacity-50 cursor-not-allowed" : ""} + disabled={isSubmitted} > @@ -523,8 +548,12 @@ export default function AttachmentsUpload({ type="button" variant={file.attachmentType === "구매" ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" - onClick={() => handleTypeChange(index, "구매")} + className={cn( + "h-7 px-2 text-xs", + isSubmitted && "opacity-50 cursor-not-allowed" + )} + onClick={() => !isSubmitted && handleTypeChange(index, "구매")} + disabled={isSubmitted} > 구매 @@ -533,8 +562,12 @@ export default function AttachmentsUpload({ type="button" variant={file.attachmentType === "설계" ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" - onClick={() => handleTypeChange(index, "설계")} + className={cn( + "h-7 px-2 text-xs", + isSubmitted && "opacity-50 cursor-not-allowed" + )} + onClick={() => !isSubmitted && handleTypeChange(index, "설계")} + disabled={isSubmitted} > 설계 @@ -552,7 +585,9 @@ export default function AttachmentsUpload({ type="button" variant="ghost" size="sm" - onClick={() => handleDeleteClick(file, false, index)} + onClick={() => !isSubmitted && handleDeleteClick(file, false, index)} + className={isSubmitted ? "opacity-50 cursor-not-allowed" : ""} + disabled={isSubmitted} > -- cgit v1.2.3