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 | 20 |
1 files changed, 18 insertions, 2 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 a9d37a4b..b7e54f3d 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 @@ -572,6 +572,11 @@ const handleOpenRequestDialog = async () => { row.original.type === "NON_INSPECTION" ) + // 승인되지 않은 PQ가 포함되었는지 확인 + const hasNonApprovedStatus = selectedRows.some(row => + row.original.status !== "APPROVED" + ) + // 실사 방법 라벨 변환 함수 const getInvestigationMethodLabel = (method: string): string => { switch (method) { @@ -676,9 +681,20 @@ const handleOpenRequestDialog = async () => { variant="outline" size="sm" onClick={handleOpenRequestDialog} // 여기를 수정: 새로운 핸들러 함수 사용 - disabled={isLoading || selectedRows.length === 0 || hasNonInspectionPQ} + disabled={ + isLoading || + selectedRows.length === 0 || + hasNonInspectionPQ || + hasNonApprovedStatus + } className="gap-2" - title={hasNonInspectionPQ ? "미실사 PQ는 실사 의뢰할 수 없습니다." : undefined} + title={ + hasNonInspectionPQ + ? "미실사 PQ는 실사 의뢰할 수 없습니다." + : hasNonApprovedStatus + ? "승인된 PQ만 실사 의뢰할 수 있습니다." + : undefined + } > <ClipboardCheck className="size-4" aria-hidden="true" /> <span className="hidden sm:inline">실사 의뢰</span> |
