diff options
Diffstat (limited to 'lib/rfq-last/vendor/add-vendor-dialog.tsx')
| -rw-r--r-- | lib/rfq-last/vendor/add-vendor-dialog.tsx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/rfq-last/vendor/add-vendor-dialog.tsx b/lib/rfq-last/vendor/add-vendor-dialog.tsx index 6b4efe74..bcf882a1 100644 --- a/lib/rfq-last/vendor/add-vendor-dialog.tsx +++ b/lib/rfq-last/vendor/add-vendor-dialog.tsx @@ -51,6 +51,7 @@ interface AddVendorDialogProps { open: boolean; onOpenChange: (open: boolean) => void; rfqId: number; + rfqCategory?: "itb" | "rfq" | "general"; onSuccess: () => void; } @@ -58,6 +59,7 @@ export function AddVendorDialog({ open, onOpenChange, rfqId, + rfqCategory = "general", onSuccess, }: AddVendorDialogProps) { const [isLoading, setIsLoading] = React.useState(false); @@ -194,8 +196,17 @@ export function AddVendorDialog({ // 해당 벤더의 기본계약 설정 추가 const isInternational = isInternationalVendor(vendor); - // 외자업체이거나 MRC Type이 "P"가 아닌 경우 false로 설정 - const shouldCheckAgreement = hasMrcTypeP && !isInternational; + + let shouldCheckAgreement = false; + + // ITB인 경우: 국내기업만 체크 + if (rfqCategory === "itb") { + shouldCheckAgreement = !isInternational; + } else { + // 기존 로직: 외자업체이거나 MRC Type이 "P"가 아닌 경우 false로 설정 + shouldCheckAgreement = hasMrcTypeP && !isInternational; + } + setVendorContracts([ ...vendorContracts, { @@ -569,7 +580,11 @@ export function AddVendorDialog({ <div className="flex items-center space-x-2"> <Checkbox checked={contract?.agreementYn || false} - disabled={!hasMrcTypeP || isInternational} + disabled={ + rfqCategory === "itb" + ? true // ITB는 항상 비활성화 + : (!hasMrcTypeP || isInternational) // 기존 로직 + } onCheckedChange={(checked) => updateVendorContract(vendor.id, "agreementYn", !!checked) } @@ -579,7 +594,11 @@ export function AddVendorDialog({ <div className="flex items-center space-x-2"> <Checkbox checked={contract?.ndaYn || false} - disabled={!hasMrcTypeP || isInternational} + disabled={ + rfqCategory === "itb" + ? true // ITB는 항상 비활성화 + : (!hasMrcTypeP || isInternational) // 기존 로직 + } onCheckedChange={(checked) => updateVendorContract(vendor.id, "ndaYn", !!checked) } |
