diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-25 03:15:45 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-25 03:15:45 +0000 |
| commit | 450234437267cdd9cdf196d5d37657708062bef5 (patch) | |
| tree | 2ec0ef193a71e949ccda776e040cc02ceff88ce0 /lib/vendor-basic-info | |
| parent | 146dd77da407438023d6fe6f18c0ebb8b6915765 (diff) | |
(최겸) 구매 기준정보, 로그인 용어, 입찰 내정가 산정 로직 수정
Diffstat (limited to 'lib/vendor-basic-info')
| -rw-r--r-- | lib/vendor-basic-info/basic-info-client.tsx | 55 | ||||
| -rw-r--r-- | lib/vendor-basic-info/types.ts | 1 |
2 files changed, 48 insertions, 8 deletions
diff --git a/lib/vendor-basic-info/basic-info-client.tsx b/lib/vendor-basic-info/basic-info-client.tsx index 0ef9f940..39763e0a 100644 --- a/lib/vendor-basic-info/basic-info-client.tsx +++ b/lib/vendor-basic-info/basic-info-client.tsx @@ -30,6 +30,10 @@ import { getVendorAttachmentsByType, getVendorPeriodicGrade, getVendorTypeInfo } import { useCreditIntegration } from "./use-credit-integration"; // downloadFile은 동적으로 import import { SalesInfoTable } from "./sales-info-table"; +import { vendors } from "@/db/schema/vendors"; + +// StatusType 정의 +type StatusType = (typeof vendors.status.enumValues)[number]; interface BasicInfoClientProps { initialData: VendorData | null; @@ -351,6 +355,26 @@ export default function BasicInfoClient({ const [pqSubmissionData, setPqSubmissionData] = useState<any[]>([]); const [additionalInfo, setAdditionalInfo] = useState<any>(null); const [businessContacts, setBusinessContacts] = useState<any[]>([]); + + // status 값에 따른 업체분류 결정 함수 + const getVendorClassification = (status: StatusType): string => { + const classificationMap: Record<StatusType, string> = { + "PENDING_REVIEW": "발굴업체", // 업체발굴 + "REJECTED": "발굴업체", // 가입거절 + "APPROVED": "잠재업체", // 가입승인 + "IN_PQ": "잠재업체", // PQ요청 + "PQ_SUBMITTED": "잠재업체", // PQ제출 + "PQ_FAILED": "잠재업체", // 실사실패 + "PQ_APPROVED": "잠재업체", // 실사통과 + "IN_REVIEW": "잠재업체", // 정규등록검토 + "READY_TO_SEND": "잠재업체", // 정규등록검토 + "ACTIVE": "정규업체", // 정규등록 + "INACTIVE": "중지업체", // 비활성화 + "BLACKLISTED": "중지업체", // 거래금지 + }; + + return classificationMap[status] || "미분류"; + }; const [formData, setFormData] = useState<VendorFormData>({ vendorName: initialData?.vendorName || "", representativeName: initialData?.representativeName || "", @@ -426,7 +450,12 @@ export default function BasicInfoClient({ try { const result = await fetchVendorRegistrationStatus(parseInt(vendorId)); if (!result.success || !result.data) { - toast.info("기본계약 정보가 없습니다."); + // 정규업체 등록 관련 레코드가 없는 경우 + if (result.noRegistration) { + toast.info("정규업체 등록 진행 정보가 없습니다."); + } else { + toast.info("기본계약 정보가 없습니다."); + } return; } @@ -812,11 +841,21 @@ export default function BasicInfoClient({ /> <InfoItem title="업체유형" - value={formData.businessType} - isEditable={true} - editMode={editMode} - fieldKey="businessType" - onChange={(value) => updateField("businessType", value)} + value={getVendorClassification(initialData?.status as StatusType) || ""} + type="readonly" + /> + <InfoItem + title="성조회 여부" + value={(() => { + const memberVal = initialData?.isAssociationMember as string | null; + switch (memberVal) { + case "Y": return "가입"; + case "N": return "미가입"; + case "E": return "해당없음"; + default: return "정보없음"; + } + })()} + type="readonly" /> <InfoItem title="소개자료" @@ -902,7 +941,7 @@ export default function BasicInfoClient({ <div className="space-y-2"> <InfoItem title="업체분류" - value={vendorTypeInfo?.vendorTypeName || ""} + value={getVendorClassification(initialData?.status as StatusType) || ""} type="readonly" /> <InfoItem @@ -941,7 +980,7 @@ export default function BasicInfoClient({ <WideInfoSection title="첨부파일" content={ - <div className="grid grid-cols-5 gap-4 min-w-0 overflow-x-auto"> + <div className="flex flex-wrap justify-between gap-4 min-w-0 overflow-x-auto"> {/* 사업자등록증 */} <div className="text-center min-w-0"> <div className="text-sm font-medium mb-2 break-words">사업자등록증</div> diff --git a/lib/vendor-basic-info/types.ts b/lib/vendor-basic-info/types.ts index ead3a44c..58b61957 100644 --- a/lib/vendor-basic-info/types.ts +++ b/lib/vendor-basic-info/types.ts @@ -127,6 +127,7 @@ export interface VendorData { email: string; website: string; status: string; + isAssociationMember: string | null; representativeName: string; representativeBirth: string; representativeEmail: string; |
