From 89fa000062650474915d5156fd21c6a85a06608b Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 20 Oct 2025 00:54:54 +0000 Subject: (최겸) 기술영업 벤더, rfq 삭제 기능 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/techsales-rfq/service.ts | 6 +++--- lib/techsales-rfq/table/detail-table/rfq-detail-column.tsx | 6 +++--- lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/techsales-rfq/service.ts b/lib/techsales-rfq/service.ts index b4fb28df..058ef48b 100644 --- a/lib/techsales-rfq/service.ts +++ b/lib/techsales-rfq/service.ts @@ -1734,9 +1734,9 @@ export async function deleteTechSalesRfq(rfqId: number) { throw new Error("RFQ를 찾을 수 없습니다."); } - // 벤더 추가 이전 상태에서만 삭제 가능 - if (rfq.status !== "RFQ Created") { - throw new Error("벤더가 추가된 RFQ는 삭제할 수 없습니다."); + // "RFQ Created" 또는 "RFQ vendorSelected" 상태에서만 삭제 가능 + if (!["RFQ Created", "RFQ Vendor Assignned"].includes(rfq.status)) { + throw new Error("RFQ가 'RFQ Created' 또는 'RFQ Vendor Assignned' 상태일 때만 삭제할 수 있습니다."); } // 관련 RFQ 아이템들 삭제 diff --git a/lib/techsales-rfq/table/detail-table/rfq-detail-column.tsx b/lib/techsales-rfq/table/detail-table/rfq-detail-column.tsx index ded0c116..fe9befe5 100644 --- a/lib/techsales-rfq/table/detail-table/rfq-detail-column.tsx +++ b/lib/techsales-rfq/table/detail-table/rfq-detail-column.tsx @@ -465,7 +465,7 @@ export function getRfqDetailColumns({ const vendorId = row.original.vendorId; const unreadCount = vendorId ? unreadMessages[vendorId] || 0 : 0; const status = row.original.status; - const isDraft = status === "Draft"; + const isAssigned = status === "Assigned"; return (
@@ -505,8 +505,8 @@ export function getRfqDetailColumns({ setRowAction({ row, type: "delete" })} - disabled={!isDraft} - className={!isDraft ? "opacity-50 cursor-not-allowed" : "text-destructive focus:text-destructive"} + disabled={!isAssigned} + className={!isAssigned ? "opacity-50 cursor-not-allowed" : "text-destructive focus:text-destructive"} > 벤더 삭제 diff --git a/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx b/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx index d834875a..fe6f84e0 100644 --- a/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx +++ b/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx @@ -535,8 +535,8 @@ export function RfqDetailTables({ selectedRfq, maxHeight }: RfqDetailTablesProps } // Draft 상태 체크 - if (vendor.status !== "Draft") { - toast.error("Draft 상태의 벤더만 삭제할 수 있습니다."); + if (vendor.status !== "Assigned") { + toast.error("Assigned 상태의 벤더만 삭제할 수 있습니다."); setRowAction(null); return; } -- cgit v1.2.3