summaryrefslogtreecommitdiff
path: root/lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-10-24 09:52:35 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-10-24 09:52:35 +0000
commit0174ad394032a8dad81107341f477d6d23a3c04c (patch)
tree6be84f638a852e6d0cea057b67e462e78fc65d41 /lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx
parent912e2bc761d7d57bd33d68cb5050da43dea59636 (diff)
(최겸) 구매 피드백 수정(PQ, 실사 등)-1024
Diffstat (limited to 'lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx')
-rw-r--r--lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx b/lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx
index a5185cab..ea6b6189 100644
--- a/lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx
+++ b/lib/pq/pq-review-table-new/vendors-table-toolbar-actions.tsx
@@ -624,7 +624,11 @@ const handleOpenRequestDialog = async () => {
variant="outline"
size="sm"
onClick={() => setIsCancelDialogOpen(true)}
- disabled={isLoading || selectedRows.length === 0}
+ disabled={
+ isLoading ||
+ selectedRows.length === 0 ||
+ !selectedRows.every(row => row.original.investigation?.investigationStatus === "PLANNED")
+ }
className="gap-2"
>
<X className="size-4" aria-hidden="true" />
@@ -636,7 +640,11 @@ const handleOpenRequestDialog = async () => {
variant="outline"
size="sm"
onClick={() => setIsReRequestDialogOpen(true)}
- disabled={isLoading || selectedRows.length === 0}
+ disabled={
+ isLoading ||
+ selectedRows.length === 0 ||
+ !selectedRows.every(row => row.original.investigation?.investigationStatus === "CANCELED")
+ }
className="gap-2"
>
<RefreshCw className="size-4" aria-hidden="true" />
@@ -648,7 +656,19 @@ const handleOpenRequestDialog = async () => {
variant="outline"
size="sm"
onClick={() => setIsSendResultsDialogOpen(true)}
- disabled={isLoading || selectedRows.length === 0}
+ disabled={
+ isLoading ||
+ selectedRows.length === 0 ||
+ !selectedRows.every(row => {
+ const investigation = row.original.investigation;
+ if (!investigation) return false;
+
+ // 실사 완료 상태이거나 평가 결과가 있는 경우에만 활성화
+ return investigation.investigationStatus === "COMPLETED" ||
+ investigation.evaluationResult === "REJECTED" ||
+ investigation.evaluationResult === "SUPPLEMENT";
+ })
+ }
className="gap-2"
>
<Send className="size-4" aria-hidden="true" />