diff options
Diffstat (limited to 'lib/vendor-investigation/table/investigation-progress-sheet.tsx')
| -rw-r--r-- | lib/vendor-investigation/table/investigation-progress-sheet.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/vendor-investigation/table/investigation-progress-sheet.tsx b/lib/vendor-investigation/table/investigation-progress-sheet.tsx index c0357f5c..a9fbdfdb 100644 --- a/lib/vendor-investigation/table/investigation-progress-sheet.tsx +++ b/lib/vendor-investigation/table/investigation-progress-sheet.tsx @@ -45,7 +45,7 @@ import { updateVendorInvestigationProgressSchema, type UpdateVendorInvestigationProgressSchema, } from "../validations" -import { updateVendorInvestigationProgressAction } from "../service" +import getPQSubmissionTypeAction, { updateVendorInvestigationProgressAction } from "../service" import { VendorInvestigationsViewWithContacts } from "@/config/vendorInvestigationsColumnsConfig" interface InvestigationProgressSheetProps @@ -61,6 +61,7 @@ export function InvestigationProgressSheet({ ...props }: InvestigationProgressSheetProps) { const [isPending, startTransition] = React.useTransition() + const [isProjectPQ, setIsProjectPQ] = React.useState<boolean>(false) // RHF + Zod const form = useForm<UpdateVendorInvestigationProgressSchema>({ @@ -84,6 +85,14 @@ export function InvestigationProgressSheet({ forecastedAt: investigation.forecastedAt ?? undefined, confirmedAt: investigation.confirmedAt ?? undefined, }) + // PQ 타입 조회 (PROJECT면 구매자체평가 비활성화) + if (investigation.pqSubmissionId) { + getPQSubmissionTypeAction(investigation.pqSubmissionId).then((res) => { + if (res.success) setIsProjectPQ(res.type === "PROJECT") + }) + } else { + setIsProjectPQ(false) + } } }, [investigation, form]) @@ -211,7 +220,7 @@ export function InvestigationProgressSheet({ </SelectTrigger> <SelectContent> <SelectGroup> - <SelectItem value="PURCHASE_SELF_EVAL">구매자체평가</SelectItem> + <SelectItem value="PURCHASE_SELF_EVAL" disabled={isProjectPQ}>구매자체평가</SelectItem> <SelectItem value="DOCUMENT_EVAL">서류평가</SelectItem> <SelectItem value="PRODUCT_INSPECTION">제품검사평가</SelectItem> <SelectItem value="SITE_VISIT_EVAL">방문실사평가</SelectItem> @@ -237,6 +246,7 @@ export function InvestigationProgressSheet({ <Button variant="outline" className={`w-full pl-3 text-left font-normal ${!field.value && "text-muted-foreground"}`} + disabled={form.watch("investigationMethod") === "PRODUCT_INSPECTION" || form.watch("investigationMethod") === "SITE_VISIT_EVAL"} > {field.value ? ( format(field.value, "yyyy년 MM월 dd일") |
