summaryrefslogtreecommitdiff
path: root/lib/rfq-last/vendor/add-vendor-dialog.tsx
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-10 15:30:13 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-10 15:30:13 +0900
commit1197e176493c88e301f9bb02321d815ffc717d10 (patch)
treee35b563ad8152ee37292046884676c22b79080f8 /lib/rfq-last/vendor/add-vendor-dialog.tsx
parent8ff4b846c4c3150ffc839b6f9118e3a7df82fe43 (diff)
(김준회) ITB: 계약선택시 로직변경(이진용 프로 요청): ITB인 경우 내자는 계약서 강제선택, 외자는 강제비선택
Diffstat (limited to 'lib/rfq-last/vendor/add-vendor-dialog.tsx')
-rw-r--r--lib/rfq-last/vendor/add-vendor-dialog.tsx27
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)
}