diff options
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.tsx | 26 |
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" />
|
