From 7a1524ba54f43d0f2a19e4bca2c6a2e0b01c5ef1 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 17 Jun 2025 09:02:32 +0000
Subject: (대표님) 20250617 18시 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../ship-vendor-document/new-revision-dialog.tsx   | 64 +++++++---------------
 1 file changed, 21 insertions(+), 43 deletions(-)

(limited to 'components/ship-vendor-document/new-revision-dialog.tsx')

diff --git a/components/ship-vendor-document/new-revision-dialog.tsx b/components/ship-vendor-document/new-revision-dialog.tsx
index 092256c7..83c9c658 100644
--- a/components/ship-vendor-document/new-revision-dialog.tsx
+++ b/components/ship-vendor-document/new-revision-dialog.tsx
@@ -105,7 +105,7 @@ const getUsageOptions = (drawingKind: string) => {
       return [
         { value: "Approval", label: "Approval" },
         { value: "Working", label: "Working" },
-        { value: "Reference", label: "Reference" },
+        { value: "Comments", label: "Comments" },
       ]
     case 'B4':
       return [
@@ -130,22 +130,19 @@ const getUsageTypeOptions = (usage: string) => {
   switch (usage) {
     case 'Approval':
       return [
-        { value: "Approval Submission Full", label: "Approval Submission Full" },
-        { value: "Approval Submission Partial", label: "Approval Submission Partial" },
-        { value: "Approval Completion Full", label: "Approval Completion Full" },
-        { value: "Approval Completion Partial", label: "Approval Completion Partial" },
+        { value: "Full", label: "Full" },
+        { value: "Partial", label: "Partial" },
+
       ]
     case 'Working':
       return [
-        { value: "Working Full", label: "Working Full" },
-        { value: "Working Partial", label: "Working Partial" },
+        { value: "Full", label: "Full" },
+        { value: "Partial", label: "Partial" },
       ]
-    case 'Reference':
+    case 'Comments':
       return [
-        { value: "Reference Full", label: "Reference Full" },
-        { value: "Reference Partial", label: "Reference Partial" },
-        { value: "Reference Series Full", label: "Reference Series Full" },
-        { value: "Reference Series Partial", label: "Reference Series Partial" },
+        { value: "Comments", label: "Comments" },
+      
       ]
     default:
       return []
@@ -153,31 +150,8 @@ const getUsageTypeOptions = (usage: string) => {
 }
 
 // 리비전 형식 가이드 생성
-const getRevisionGuide = (drawingKind: string, usage: string, usageType: string) => {
-  if (drawingKind === 'B4') {
-    return "R00, R01, R02... 형식으로 입력하세요"
-  }
-  
-  if (drawingKind === 'B5') {
-    return "A, B, C... 형식으로 입력하세요"
-  }
-  
-  if (drawingKind === 'B3') {
-    if (usage === 'Reference') {
-      return "00, 01, 02... 형식으로 입력하세요"
-    }
-    if (usageType === 'Working Partial') {
-      return "00, 01, 02... 형식으로 입력하세요"
-    }
-    if (usageType?.includes('Full') && (usageType.includes('Working') || usageType.includes('Approval'))) {
-      return "A, B, C... 형식으로 입력하세요"
-    }
-    if (usageType?.includes('Partial') && usageType.includes('Approval')) {
-      return "리비전 형식은 추후 정의 예정입니다"
-    }
-  }
-  
-  return "리비전을 입력하세요"
+const getRevisionGuide = () => {
+  return "R01, R02, R03... 형식으로 입력하세요"
 }
 
 interface NewRevisionDialogProps {
@@ -344,17 +318,21 @@ export function NewRevisionDialog({
     return []
   }, [drawingKind, watchedUsage])
 
-  // 용도 변경 시 용도 타입 초기화
+  // 용도 변경 시 용도 타입 초기화 또는 자동 설정
   React.useEffect(() => {
     if (showUsageType && watchedUsage) {
-      form.setValue("usageType", "")
+      if (watchedUsage === "Comments") {
+        form.setValue("usageType", "Comments")
+      } else {
+        form.setValue("usageType", "")
+      }
     }
   }, [watchedUsage, showUsageType, form])
 
   // 리비전 가이드 텍스트
   const revisionGuide = React.useMemo(() => {
-    return getRevisionGuide(drawingKind, watchedUsage, watchedUsageType || "")
-  }, [drawingKind, watchedUsage, watchedUsageType])
+    return getRevisionGuide()
+  }, [])
 
   const handleDialogClose = () => {
     if (!isUploading) {
@@ -481,8 +459,8 @@ export function NewRevisionDialog({
                 )}
               />
 
-              {/* 용도 타입 선택 (B3만) */}
-              {showUsageType && watchedUsage && (
+              {/* 용도 타입 선택 (B3만, Comments가 아닐 때만) */}
+              {showUsageType && watchedUsage && watchedUsage !== "Comments" && (
                 <FormField
                   control={form.control}
                   name="usageType"
-- 
cgit v1.2.3

