From 33be47506f0aa62b969d82521580a29e95080268 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 13 Aug 2025 11:05:09 +0000
Subject: (대표님) 입찰, 법무검토, EDP 변경사항 대응, dolce 개선, form-data
 개선, 정규업체 등록관리 추가 (최겸) pq 미사용 컴포넌트 및 페이지 제거, 파일
 라우트에 pq 적용
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/pq/pq-review-table-new/site-visit-dialog.tsx | 179 ++++++++++++-----------
 1 file changed, 97 insertions(+), 82 deletions(-)

(limited to 'lib/pq/pq-review-table-new/site-visit-dialog.tsx')

diff --git a/lib/pq/pq-review-table-new/site-visit-dialog.tsx b/lib/pq/pq-review-table-new/site-visit-dialog.tsx
index b6bd3624..172aed98 100644
--- a/lib/pq/pq-review-table-new/site-visit-dialog.tsx
+++ b/lib/pq/pq-review-table-new/site-visit-dialog.tsx
@@ -36,6 +36,7 @@ import {
 } from "@/components/ui/popover"
 import { Checkbox } from "@/components/ui/checkbox"
 import { Badge } from "@/components/ui/badge"
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
 import { toast } from "sonner"
 import { getSiteVisitRequestAction } from "@/lib/site-visit/service"
 import {
@@ -444,82 +445,96 @@ export function SiteVisitDialog({
                 삼성중공업에 어떤 부문의 담당자가 몇 명 실사 참석 예정인지에 대한 정보를 입력하세요.
               </div>
               
-              <div className="space-y-4">
-                {[
-                  { key: "technicalSales", label: "기술영업" },
-                  { key: "design", label: "설계" },
-                  { key: "procurement", label: "구매" },
-                  { key: "quality", label: "품질" },
-                  { key: "production", label: "생산" },
-                  { key: "commissioning", label: "시운전" },
-                  { key: "other", label: "기타" },
-                ].map((item) => (
-                  <div key={item.key} className="border rounded-lg p-4 space-y-3">
-                    <div className="flex items-center space-x-3">
-                      <FormField
-                        control={form.control}
-                        name={`shiAttendees.${item.key}.checked` as `shiAttendees.${typeof item.key}.checked`}
-                        render={({ field }) => (
-                          <FormItem className="flex flex-row items-center space-x-2 space-y-0">
-                            <FormControl>
-                              <Checkbox
-                                checked={field.value}
-                                onCheckedChange={field.onChange}
-                                disabled={isPending}
-                              />
-                            </FormControl>
-                            <FormLabel className="text-sm font-medium">{item.label}</FormLabel>
-                          </FormItem>
-                        )}
-                      />
-                    </div>
-                    
-                    <div className="grid grid-cols-2 gap-4">
-                      <FormField
-                        control={form.control}
-                        name={`shiAttendees.${item.key}.count` as `shiAttendees.${typeof item.key}.count`}
-                        render={({ field }) => (
-                          <FormItem>
-                            <FormLabel className="text-sm">참석 인원</FormLabel>
-                            <div className="flex items-center space-x-2">
-                              <FormControl>
-                                <Input
-                                  type="number"
-                                  min="0"
-                                  placeholder="0"
-                                  {...field}
-                                  onChange={(e) => field.onChange(parseInt(e.target.value) || 0)}
-                                  disabled={isPending}
-                                  className="w-20"
-                                />
-                              </FormControl>
-                              <span className="text-sm text-muted-foreground">명</span>
-                            </div>
-                            <FormMessage />
-                          </FormItem>
-                        )}
-                      />
-                      
-                      <FormField
-                        control={form.control}
-                        name={`shiAttendees.${item.key}.details` as `shiAttendees.${typeof item.key}.details`}
-                        render={({ field }) => (
-                          <FormItem>
-                            <FormLabel className="text-sm">참석자 정보</FormLabel>
-                            <FormControl>
-                              <Input
-                                placeholder="부서 및 이름 등"
-                                {...field}
-                                disabled={isPending}
-                              />
-                            </FormControl>
-                            <FormMessage />
-                          </FormItem>
-                        )}
-                      />
-                    </div>
-                  </div>
-                ))}
+              <div className="border rounded-lg overflow-hidden">
+                <Table>
+                  <TableHeader>
+                    <TableRow className="bg-muted/50">
+                      <TableHead className="w-[100px]">참석여부</TableHead>
+                      <TableHead className="w-[120px]">부문</TableHead>
+                      <TableHead className="w-[100px]">참석인원</TableHead>
+                      <TableHead>참석자 정보</TableHead>
+                    </TableRow>
+                  </TableHeader>
+                  <TableBody>
+                    {[
+                      { key: "technicalSales", label: "기술영업" },
+                      { key: "design", label: "설계" },
+                      { key: "procurement", label: "구매" },
+                      { key: "quality", label: "품질" },
+                      { key: "production", label: "생산" },
+                      { key: "commissioning", label: "시운전" },
+                      { key: "other", label: "기타" },
+                    ].map((item) => (
+                      <TableRow key={item.key}>
+                        <TableCell>
+                          <FormField
+                            control={form.control}
+                            name={`shiAttendees.${item.key}.checked` as any}
+                            render={({ field }) => (
+                              <FormItem className="flex items-center space-x-2 space-y-0">
+                                <FormControl>
+                                  <Checkbox
+                                    checked={field.value as boolean}
+                                    onCheckedChange={field.onChange}
+                                    disabled={isPending}
+                                  />
+                                </FormControl>
+                              </FormItem>
+                            )}
+                          />
+                        </TableCell>
+                        <TableCell>
+                          <span className="font-medium">{item.label}</span>
+                        </TableCell>
+                        <TableCell>
+                          <FormField
+                            control={form.control}
+                            name={`shiAttendees.${item.key}.count` as any}
+                            render={({ field }) => (
+                              <FormItem className="space-y-0">
+                                <div className="flex items-center space-x-2">
+                                  <FormControl>
+                                    <Input
+                                      type="number"
+                                      min="0"
+                                      placeholder="0"
+                                      value={field.value as number}
+                                      onChange={(e) => field.onChange(parseInt(e.target.value) || 0)}
+                                      disabled={isPending}
+                                      className="w-16 h-8"
+                                    />
+                                  </FormControl>
+                                  <span className="text-xs text-muted-foreground">명</span>
+                                </div>
+                                <FormMessage />
+                              </FormItem>
+                            )}
+                          />
+                        </TableCell>
+                        <TableCell>
+                          <FormField
+                            control={form.control}
+                            name={`shiAttendees.${item.key}.details` as any}
+                            render={({ field }) => (
+                              <FormItem className="space-y-0">
+                                <FormControl>
+                                  <Input
+                                    placeholder="부서 및 이름 등"
+                                    value={field.value as string}
+                                    onChange={field.onChange}
+                                    disabled={isPending}
+                                    className="h-8"
+                                  />
+                                </FormControl>
+                                <FormMessage />
+                              </FormItem>
+                            )}
+                          />
+                        </TableCell>
+                      </TableRow>
+                    ))}
+                  </TableBody>
+                </Table>
               </div>
 
               {/* 전체 참석자 상세정보 */}
@@ -544,10 +559,10 @@ export function SiteVisitDialog({
             </div>
 
             {/* 협력업체 요청정보 및 자료 */}
-            <div>
+            {/* <div>
               <FormLabel className="text-sm font-medium">협력업체 요청정보 및 자료</FormLabel>
               <div className="text-sm text-muted-foreground mb-2">
-                협력업체에게 요청할 정보를 선택하세요. 선택된 항목들은 협력업체 정보 입력 폼에 포함됩니다.
+                협력업체에게 요청할 정보를 선택하세요. 
               </div>
               <div className="mt-2 space-y-2">
                 {[
@@ -564,7 +579,7 @@ export function SiteVisitDialog({
                   <FormField
                     key={item.key}
                     control={form.control}
-                    name={`vendorRequests.${item.key}` as `vendorRequests.${typeof item.key}`}
+                    name={`vendorRequests.${item.key}` as any}
                     render={({ field }) => (
                       <FormItem className="flex flex-row items-start space-x-3 space-y-0">
                         <FormControl>
@@ -580,7 +595,7 @@ export function SiteVisitDialog({
                   />
                 ))}
               </div>
-              <FormField
+              {/* <FormField
                 control={form.control}
                 name="otherVendorRequests"
                 render={({ field }) => (
@@ -597,8 +612,8 @@ export function SiteVisitDialog({
                     <FormMessage />
                   </FormItem>
                 )}
-              />
-            </div>
+              /> 
+            </div> */}
 
             {/* 추가 요청사항 */}
             <FormField
-- 
cgit v1.2.3

