From 33e8452331c301430191b3506825ebaf3edac93a Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 1 Oct 2025 09:48:03 +0000
Subject: (최겸) 구매 PQ 리스트 기능 수정, 견적 첨부파일 리비전 액션 추가, 기타
 등
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/pq/table/add-pq-list-dialog.tsx | 34 +++++++++-------------------------
 1 file changed, 9 insertions(+), 25 deletions(-)

(limited to 'lib/pq/table/add-pq-list-dialog.tsx')

diff --git a/lib/pq/table/add-pq-list-dialog.tsx b/lib/pq/table/add-pq-list-dialog.tsx
index c1899a29..472a1b3d 100644
--- a/lib/pq/table/add-pq-list-dialog.tsx
+++ b/lib/pq/table/add-pq-list-dialog.tsx
@@ -10,13 +10,8 @@ import { DatePicker } from "@/components/ui/date-picker"
 import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"
 import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"
 import { Loader2, Plus } from "lucide-react"
+import { ProjectSelector } from "@/components/ProjectSelector"
 
-// 프로젝트 목록을 위한 임시 타입 (실제로는 projects에서 가져와야 함)
-interface Project {
-  id: number
-  name: string
-  code: string
-}
 
 const pqListFormSchema = z.object({
   name: z.string().min(1, "PQ 목록 명을 입력해주세요"),
@@ -42,7 +37,6 @@ interface PqListFormProps {
   open: boolean
   onOpenChange: (open: boolean) => void
   initialData?: Partial<PqListFormData> & { id?: number }
-  projects?: Project[]
   onSubmit: (data: PqListFormData & { id?: number }) => Promise<void>
   isLoading?: boolean
 }
@@ -57,7 +51,6 @@ export function AddPqDialog({
   open,
   onOpenChange,
   initialData,
-  projects = [],
   onSubmit,
   isLoading = false
 }: PqListFormProps) {
@@ -162,23 +155,13 @@ export function AddPqDialog({
                     <FormLabel className="flex items-center gap-1">
                       프로젝트 <span className="text-red-500">*</span>
                     </FormLabel>
-                    <Select 
-                      onValueChange={(value) => field.onChange(parseInt(value))} 
-                      defaultValue={field.value?.toString()}
-                    >
-                      <FormControl>
-                        <SelectTrigger>
-                          <SelectValue placeholder="프로젝트를 선택하세요" />
-                        </SelectTrigger>
-                      </FormControl>
-                      <SelectContent>
-                        {projects.map((project) => (
-                          <SelectItem key={project.id} value={project.id.toString()}>
-                            {project.code} - {project.name}
-                          </SelectItem>
-                        ))}
-                      </SelectContent>
-                    </Select>
+                    <FormControl>
+                      <ProjectSelector
+                        selectedProjectId={field.value}
+                        onProjectSelect={(project) => field.onChange(project.id)}
+                        placeholder="프로젝트를 선택하세요"
+                      />
+                    </FormControl>
                     <FormMessage />
                   </FormItem>
                 )}
@@ -200,6 +183,7 @@ export function AddPqDialog({
                         date={field.value ?? undefined}
                         onSelect={(date) => field.onChange(date ?? null)}
                         placeholder="유효일 선택"
+                        minDate={new Date()}
                       />
                     </FormControl>
                     <FormMessage />
-- 
cgit v1.2.3

