diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-19 09:23:47 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-19 09:23:47 +0000 |
| commit | 8077419e40368dc703f94d558fc746b73fbc6702 (patch) | |
| tree | 333bdfb3b0d84336f1bf7d4f0f1bbced6bec2d4c /components/vendor-regular-registrations/additional-info-dialog.tsx | |
| parent | aa71f75ace013b2fe982e5a104e61440458e0fd2 (diff) | |
(최겸) 구매 PQ 비밀유지계약서 별첨 첨부파일 추가, 정규업체등록관리 개발
Diffstat (limited to 'components/vendor-regular-registrations/additional-info-dialog.tsx')
| -rw-r--r-- | components/vendor-regular-registrations/additional-info-dialog.tsx | 122 |
1 files changed, 31 insertions, 91 deletions
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({ <CardHeader className="pb-3">
<CardTitle className="text-lg flex items-center gap-2">
{contactType.label} 담당자
- <Badge variant="destructive" className="text-xs">필수</Badge>
</CardTitle>
</CardHeader>
<CardContent className="space-y-4">
@@ -352,21 +325,10 @@ export function AdditionalInfoDialog({ name="additionalInfo.businessType"
render={({ field }) => (
<FormItem>
- <FormLabel>사업유형</FormLabel>
- <Select onValueChange={field.onChange} defaultValue={field.value}>
- <FormControl>
- <SelectTrigger>
- <SelectValue placeholder="사업유형 선택" />
- </SelectTrigger>
- </FormControl>
- <SelectContent>
- {businessTypes.map((type) => (
- <SelectItem key={type.value} value={type.value}>
- {type.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <FormLabel>사업유형 *</FormLabel>
+ <FormControl>
+ <Input placeholder="사업유형 입력" {...field} />
+ </FormControl>
<FormMessage />
</FormItem>
)}
@@ -376,21 +338,10 @@ export function AdditionalInfoDialog({ name="additionalInfo.industryType"
render={({ field }) => (
<FormItem>
- <FormLabel>산업유형</FormLabel>
- <Select onValueChange={field.onChange} defaultValue={field.value}>
- <FormControl>
- <SelectTrigger>
- <SelectValue placeholder="산업유형 선택" />
- </SelectTrigger>
- </FormControl>
- <SelectContent>
- {industryTypes.map((type) => (
- <SelectItem key={type.value} value={type.value}>
- {type.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <FormLabel>산업유형 *</FormLabel>
+ <FormControl>
+ <Input placeholder="산업유형 입력" {...field} />
+ </FormControl>
<FormMessage />
</FormItem>
)}
@@ -402,21 +353,10 @@ export function AdditionalInfoDialog({ name="additionalInfo.companySize"
render={({ field }) => (
<FormItem>
- <FormLabel>기업규모</FormLabel>
- <Select onValueChange={field.onChange} defaultValue={field.value}>
- <FormControl>
- <SelectTrigger>
- <SelectValue placeholder="기업규모 선택" />
- </SelectTrigger>
- </FormControl>
- <SelectContent>
- {companySizes.map((size) => (
- <SelectItem key={size.value} value={size.value}>
- {size.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <FormLabel>기업규모 *</FormLabel>
+ <FormControl>
+ <Input placeholder="기업규모 입력" {...field} />
+ </FormControl>
<FormMessage />
</FormItem>
)}
@@ -426,7 +366,7 @@ export function AdditionalInfoDialog({ name="additionalInfo.revenue"
render={({ field }) => (
<FormItem>
- <FormLabel>매출액 (억원)</FormLabel>
+ <FormLabel>매출액 (억원) *</FormLabel>
<FormControl>
<Input
placeholder="매출액 입력"
@@ -445,7 +385,7 @@ export function AdditionalInfoDialog({ name="additionalInfo.factoryEstablishedDate"
render={({ field }) => (
<FormItem>
- <FormLabel>공장설립일</FormLabel>
+ <FormLabel>공장설립일 *</FormLabel>
<FormControl>
<Input
placeholder="YYYY-MM-DD"
@@ -463,7 +403,7 @@ export function AdditionalInfoDialog({ name="additionalInfo.preferredContractTerms"
render={({ field }) => (
<FormItem>
- <FormLabel>선호계약조건</FormLabel>
+ <FormLabel>선호계약조건 *</FormLabel>
<FormControl>
<Textarea
placeholder="선호하는 계약조건을 상세히 입력해주세요"
|
