diff options
| -rw-r--r-- | lib/techsales-rfq/service.ts | 6 | ||||
| -rw-r--r-- | lib/techsales-rfq/table/detail-table/rfq-detail-column.tsx | 6 | ||||
| -rw-r--r-- | lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx | 4 |
3 files changed, 8 insertions, 8 deletions
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 (
<div className="text-right flex items-center justify-end gap-1">
@@ -505,8 +505,8 @@ export function getRfqDetailColumns({ <DropdownMenuContent align="end">
<DropdownMenuItem
onClick={() => 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"}
>
<Trash2 className="mr-2 h-4 w-4" />
벤더 삭제
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;
}
|
