From 47fb72704161b4b58a27c7f5c679fc44618de9a1 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 4 Nov 2025 10:03:32 +0000
Subject: (최겸) 구매 견적 내 RFQ Cancel/Delete, 연동제 적용, MRC Type 개발
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/rfq-last/attachment/vendor-response-table.tsx | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

(limited to 'lib/rfq-last/attachment/vendor-response-table.tsx')

diff --git a/lib/rfq-last/attachment/vendor-response-table.tsx b/lib/rfq-last/attachment/vendor-response-table.tsx
index 8488eea1..22f813b3 100644
--- a/lib/rfq-last/attachment/vendor-response-table.tsx
+++ b/lib/rfq-last/attachment/vendor-response-table.tsx
@@ -19,7 +19,8 @@ import {
   Calendar,
   AlertCircle, 
   X,
-  CheckCircle2
+  CheckCircle2,
+  XCircle
 } from "lucide-react";
 import { format, formatDistanceToNow, isValid, isBefore, isAfter } from "date-fns";
 import { ko } from "date-fns/locale";
@@ -184,6 +185,13 @@ export function VendorResponseTable({
     return vendorItem?.vendorId || null;
   }, [selectedVendor, data]);
 
+  // 선택된 벤더의 응답 상태 확인 (취소 상태인지)
+  const isVendorCancelled = React.useMemo(() => {
+    if (!selectedVendor) return false;
+    // 선택된 벤더의 문서 중 하나라도 취소 상태인지 확인
+    return filteredData.some(item => item.responseStatus === "취소");
+  }, [selectedVendor, filteredData]);
+
   // 데이터 새로고침
   const handleRefresh = React.useCallback(async () => {
     setIsRefreshing(true);
@@ -567,13 +575,18 @@ export function VendorResponseTable({
                 size="sm"
                 onClick={() => setShowConfirmDialog(true)}
                 className="h-7"
-                disabled={confirmedVendors.has(selectedVendorId)}
+                disabled={confirmedVendors.has(selectedVendorId) || isVendorCancelled}
               >
                 {confirmedVendors.has(selectedVendorId) ? (
                   <>
                     <CheckCircle2 className="h-3 w-3 mr-1" />
                     확정완료
                   </>
+                ) : isVendorCancelled ? (
+                  <>
+                    <XCircle className="h-3 w-3 mr-1" />
+                    취소됨 (확정 불가)
+                  </>
                 ) : (
                   <>
                     <CheckCircle2 className="h-3 w-3 mr-1" />
-- 
cgit v1.2.3

