From 8077419e40368dc703f94d558fc746b73fbc6702 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 19 Aug 2025 09:23:47 +0000 Subject: (최겸) 구매 PQ 비밀유지계약서 별첨 첨부파일 추가, 정규업체등록관리 개발 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../additional-info-dialog.tsx | 122 ++++++--------------- 1 file changed, 31 insertions(+), 91 deletions(-) (limited to 'components/vendor-regular-registrations/additional-info-dialog.tsx') diff --git a/components/vendor-regular-registrations/additional-info-dialog.tsx b/components/vendor-regular-registrations/additional-info-dialog.tsx index fbd60515..84475877 100644 --- a/components/vendor-regular-registrations/additional-info-dialog.tsx +++ b/components/vendor-regular-registrations/additional-info-dialog.tsx @@ -16,13 +16,7 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; + import { Form, FormControl, @@ -54,12 +48,12 @@ const businessContactSchema = z.object({ // 추가정보 스키마 const additionalInfoSchema = z.object({ - businessType: z.string().optional(), - industryType: z.string().optional(), - companySize: z.string().optional(), - revenue: z.string().optional(), - factoryEstablishedDate: z.string().optional(), - preferredContractTerms: z.string().optional(), + businessType: z.string().min(1, "사업유형은 필수입니다"), + industryType: z.string().min(1, "산업유형은 필수입니다"), + companySize: z.string().min(1, "기업규모는 필수입니다"), + revenue: z.string().min(1, "매출액은 필수입니다"), + factoryEstablishedDate: z.string().min(1, "공장설립일은 필수입니다"), + preferredContractTerms: z.string().min(1, "선호계약조건은 필수입니다"), }); // 전체 폼 스키마 @@ -85,28 +79,7 @@ const contactTypes = [ { value: "tax_invoice", label: "세금계산서", required: true }, ]; -const businessTypes = [ - { value: "manufacturing", label: "제조업" }, - { value: "trading", label: "무역업" }, - { value: "service", label: "서비스업" }, - { value: "construction", label: "건설업" }, - { value: "other", label: "기타" }, -]; -const industryTypes = [ - { value: "shipbuilding", label: "조선업" }, - { value: "marine", label: "해양플랜트" }, - { value: "energy", label: "에너지" }, - { value: "automotive", label: "자동차" }, - { value: "other", label: "기타" }, -]; - -const companySizes = [ - { value: "large", label: "대기업" }, - { value: "medium", label: "중견기업" }, - { value: "small", label: "중소기업" }, - { value: "startup", label: "스타트업" }, -]; export function AdditionalInfoDialog({ open, @@ -169,16 +142,17 @@ export function AdditionalInfoDialog({ }; }); - // 추가정보 데이터 설정 + // 추가정보 데이터 설정 + const additionalInfoData = additionalInfo as any; const additionalData = { - businessType: additionalInfo?.businessType || "", - industryType: additionalInfo?.industryType || "", - companySize: additionalInfo?.companySize || "", - revenue: additionalInfo?.revenue || "", - factoryEstablishedDate: additionalInfo?.factoryEstablishedDate - ? new Date(additionalInfo.factoryEstablishedDate).toISOString().split('T')[0] + businessType: additionalInfoData?.businessType || "", + industryType: additionalInfoData?.industryType || "", + companySize: additionalInfoData?.companySize || "", + revenue: additionalInfoData?.revenue || "", + factoryEstablishedDate: additionalInfoData?.factoryEstablishedDate + ? new Date(additionalInfoData.factoryEstablishedDate).toISOString().split('T')[0] : "", - preferredContractTerms: additionalInfo?.preferredContractTerms || "", + preferredContractTerms: additionalInfoData?.preferredContractTerms || "", }; // 폼 데이터 업데이트 @@ -257,7 +231,6 @@ export function AdditionalInfoDialog({ {contactType.label} 담당자 - 필수 @@ -352,21 +325,10 @@ export function AdditionalInfoDialog({ name="additionalInfo.businessType" render={({ field }) => ( - 사업유형 - + 사업유형 * + + + )} @@ -376,21 +338,10 @@ export function AdditionalInfoDialog({ name="additionalInfo.industryType" render={({ field }) => ( - 산업유형 - + 산업유형 * + + + )} @@ -402,21 +353,10 @@ export function AdditionalInfoDialog({ name="additionalInfo.companySize" render={({ field }) => ( - 기업규모 - + 기업규모 * + + + )} @@ -426,7 +366,7 @@ export function AdditionalInfoDialog({ name="additionalInfo.revenue" render={({ field }) => ( - 매출액 (억원) + 매출액 (억원) * ( - 공장설립일 + 공장설립일 * ( - 선호계약조건 + 선호계약조건 *