From 02b1cf005cf3e1df64183d20ba42930eb2767a9f Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 21 Aug 2025 06:57:36 +0000
Subject: (대표님, 최겸) 설계메뉴추가, 작업사항 업데이트 설계메뉴 - 문서관리
 설계메뉴 - 벤더 데이터 gtc 메뉴 업데이트 정보시스템 - 메뉴리스트 및 정보
 업데이트 파일 라우트 업데이트 엑셀임포트 개선 기본계약 개선 벤더 가입과정
 변경 및 개선 벤더 기본정보 - pq 돌체 오류 수정 및 개선 벤더 로그인 과정
 이메일 오류 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../additional-info-dialog.tsx                     | 119 +++++++++++++++------
 1 file changed, 84 insertions(+), 35 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 84475877..303c6d7e 100644
--- a/components/vendor-regular-registrations/additional-info-dialog.tsx
+++ b/components/vendor-regular-registrations/additional-info-dialog.tsx
@@ -69,6 +69,7 @@ interface AdditionalInfoDialogProps {
   onOpenChange: (open: boolean) => void;
   vendorId: number;
   onSave?: () => void;
+  readonly?: boolean;
 }
 
 const contactTypes = [
@@ -86,6 +87,7 @@ export function AdditionalInfoDialog({
   onOpenChange,
   vendorId,
   onSave,
+  readonly = false,
 }: AdditionalInfoDialogProps) {
   const [saving, setSaving] = useState(false);
   const [loading, setLoading] = useState(false);
@@ -204,9 +206,12 @@ export function AdditionalInfoDialog({
     <Dialog open={open} onOpenChange={onOpenChange}>
       <DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
         <DialogHeader>
-          <DialogTitle>추가정보 입력</DialogTitle>
+          <DialogTitle>{readonly ? "추가정보 조회" : "추가정보 입력"}</DialogTitle>
           <p className="text-sm text-muted-foreground">
-            정규업체 등록을 위한 추가정보를 입력해주세요. <span className="text-red-500">*</span> 표시는 필수 입력 항목입니다.
+            {readonly 
+              ? "정규업체 등록을 위한 추가 정보를 조회합니다."
+              : "정규업체 등록을 위한 추가정보를 입력해주세요. * 표시는 필수 입력 항목입니다."
+            }
           </p>
         </DialogHeader>
 
@@ -240,9 +245,13 @@ export function AdditionalInfoDialog({
                             name={`businessContacts.${index}.contactName`}
                             render={({ field }) => (
                               <FormItem>
-                                <FormLabel>담당자명 *</FormLabel>
+                                <FormLabel>담당자명 {!readonly && "*"}</FormLabel>
                                 <FormControl>
-                                  <Input placeholder="담당자명 입력" {...field} />
+                                  <Input 
+                                    placeholder={readonly ? "" : "담당자명 입력"} 
+                                    readOnly={readonly}
+                                    {...field} 
+                                  />
                                 </FormControl>
                                 <FormMessage />
                               </FormItem>
@@ -253,9 +262,13 @@ export function AdditionalInfoDialog({
                             name={`businessContacts.${index}.position`}
                             render={({ field }) => (
                               <FormItem>
-                                <FormLabel>직급 *</FormLabel>
+                                <FormLabel>직급 {!readonly && "*"}</FormLabel>
                                 <FormControl>
-                                  <Input placeholder="직급 입력" {...field} />
+                                  <Input 
+                                    placeholder={readonly ? "" : "직급 입력"} 
+                                    readOnly={readonly}
+                                    {...field} 
+                                  />
                                 </FormControl>
                                 <FormMessage />
                               </FormItem>
@@ -268,9 +281,13 @@ export function AdditionalInfoDialog({
                             name={`businessContacts.${index}.department`}
                             render={({ field }) => (
                               <FormItem>
-                                <FormLabel>부서 *</FormLabel>
+                                <FormLabel>부서 {!readonly && "*"}</FormLabel>
                                 <FormControl>
-                                  <Input placeholder="부서명 입력" {...field} />
+                                  <Input 
+                                    placeholder={readonly ? "" : "부서명 입력"} 
+                                    readOnly={readonly}
+                                    {...field} 
+                                  />
                                 </FormControl>
                                 <FormMessage />
                               </FormItem>
@@ -281,9 +298,14 @@ export function AdditionalInfoDialog({
                             name={`businessContacts.${index}.email`}
                             render={({ field }) => (
                               <FormItem>
-                                <FormLabel>Email *</FormLabel>
+                                <FormLabel>Email {!readonly && "*"}</FormLabel>
                                 <FormControl>
-                                  <Input placeholder="이메일 입력" type="email" {...field} />
+                                  <Input 
+                                    placeholder={readonly ? "" : "이메일 입력"} 
+                                    type="email" 
+                                    readOnly={readonly}
+                                    {...field} 
+                                  />
                                 </FormControl>
                                 <FormMessage />
                               </FormItem>
@@ -295,11 +317,12 @@ export function AdditionalInfoDialog({
                           name={`businessContacts.${index}.responsibility`}
                           render={({ field }) => (
                             <FormItem>
-                              <FormLabel>담당업무 *</FormLabel>
+                              <FormLabel>담당업무 {!readonly && "*"}</FormLabel>
                               <FormControl>
                                 <Textarea 
-                                  placeholder="담당업무 상세 입력" 
+                                  placeholder={readonly ? "" : "담당업무 상세 입력"} 
                                   className="h-20"
+                                  readOnly={readonly}
                                   {...field} 
                                 />
                               </FormControl>
@@ -325,9 +348,13 @@ export function AdditionalInfoDialog({
                         name="additionalInfo.businessType"
                         render={({ field }) => (
                           <FormItem>
-                            <FormLabel>사업유형 *</FormLabel>
+                            <FormLabel>사업유형 {!readonly && "*"}</FormLabel>
                             <FormControl>
-                              <Input placeholder="사업유형 입력" {...field} />
+                              <Input 
+                                placeholder={readonly ? "" : "사업유형 입력"} 
+                                readOnly={readonly}
+                                {...field} 
+                              />
                             </FormControl>
                             <FormMessage />
                           </FormItem>
@@ -338,9 +365,13 @@ export function AdditionalInfoDialog({
                         name="additionalInfo.industryType"
                         render={({ field }) => (
                           <FormItem>
-                            <FormLabel>산업유형 *</FormLabel>
+                            <FormLabel>산업유형 {!readonly && "*"}</FormLabel>
                             <FormControl>
-                              <Input placeholder="산업유형 입력" {...field} />
+                              <Input 
+                                placeholder={readonly ? "" : "산업유형 입력"} 
+                                readOnly={readonly}
+                                {...field} 
+                              />
                             </FormControl>
                             <FormMessage />
                           </FormItem>
@@ -353,9 +384,13 @@ export function AdditionalInfoDialog({
                         name="additionalInfo.companySize"
                         render={({ field }) => (
                           <FormItem>
-                            <FormLabel>기업규모 *</FormLabel>
+                            <FormLabel>기업규모 {!readonly && "*"}</FormLabel>
                             <FormControl>
-                              <Input placeholder="기업규모 입력" {...field} />
+                              <Input 
+                                placeholder={readonly ? "" : "기업규모 입력"} 
+                                readOnly={readonly}
+                                {...field} 
+                              />
                             </FormControl>
                             <FormMessage />
                           </FormItem>
@@ -366,11 +401,12 @@ export function AdditionalInfoDialog({
                         name="additionalInfo.revenue"
                         render={({ field }) => (
                           <FormItem>
-                            <FormLabel>매출액 (억원) *</FormLabel>
+                            <FormLabel>매출액 (억원) {!readonly && "*"}</FormLabel>
                             <FormControl>
                               <Input 
-                                placeholder="매출액 입력" 
+                                placeholder={readonly ? "" : "매출액 입력"} 
                                 type="number"
+                                readOnly={readonly}
                                 {...field} 
                               />
                             </FormControl>
@@ -385,11 +421,12 @@ export function AdditionalInfoDialog({
                         name="additionalInfo.factoryEstablishedDate"
                         render={({ field }) => (
                           <FormItem>
-                            <FormLabel>공장설립일 *</FormLabel>
+                            <FormLabel>공장설립일 {!readonly && "*"}</FormLabel>
                             <FormControl>
                               <Input 
-                                placeholder="YYYY-MM-DD" 
+                                placeholder={readonly ? "" : "YYYY-MM-DD"} 
                                 type="date"
+                                readOnly={readonly}
                                 {...field} 
                               />
                             </FormControl>
@@ -403,11 +440,12 @@ export function AdditionalInfoDialog({
                       name="additionalInfo.preferredContractTerms"
                       render={({ field }) => (
                         <FormItem>
-                          <FormLabel>선호계약조건 *</FormLabel>
+                          <FormLabel>선호계약조건 {!readonly && "*"}</FormLabel>
                           <FormControl>
                             <Textarea 
-                              placeholder="선호하는 계약조건을 상세히 입력해주세요" 
+                              placeholder={readonly ? "" : "선호하는 계약조건을 상세히 입력해주세요"} 
                               className="h-32"
+                              readOnly={readonly}
                               {...field} 
                             />
                           </FormControl>
@@ -421,17 +459,28 @@ export function AdditionalInfoDialog({
             </Tabs>
 
             <DialogFooter className="mt-6">
-              <Button
-                type="button"
-                variant="outline"
-                onClick={() => onOpenChange(false)}
-                disabled={saving}
-              >
-                취소
-              </Button>
-              <Button type="submit" disabled={saving}>
-                {saving ? "저장 중..." : "저장"}
-              </Button>
+              {readonly ? (
+                <Button
+                  type="button"
+                  onClick={() => onOpenChange(false)}
+                >
+                  닫기
+                </Button>
+              ) : (
+                <>
+                  <Button
+                    type="button"
+                    variant="outline"
+                    onClick={() => onOpenChange(false)}
+                    disabled={saving}
+                  >
+                    취소
+                  </Button>
+                  <Button type="submit" disabled={saving}>
+                    {saving ? "저장 중..." : "저장"}
+                  </Button>
+                </>
+              )}
             </DialogFooter>
           </form>
         </Form>
-- 
cgit v1.2.3

