From ba8cd44a0ed2c613a5f2cee06bfc9bd0f61f21c7 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 7 Nov 2025 08:39:04 +0000
Subject: (최겸) 입찰/견적 수정사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/bidding/list/biddings-table.tsx | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

(limited to 'lib/bidding/list/biddings-table.tsx')

diff --git a/lib/bidding/list/biddings-table.tsx b/lib/bidding/list/biddings-table.tsx
index 8920d9db..39952d5a 100644
--- a/lib/bidding/list/biddings-table.tsx
+++ b/lib/bidding/list/biddings-table.tsx
@@ -2,6 +2,7 @@
 
 import * as React from "react"
 import { useRouter } from "next/navigation"
+import { useSession } from "next-auth/react"
 import type {
     DataTableAdvancedFilterField,
     DataTableFilterField,
@@ -22,7 +23,7 @@ import {
     biddingTypeLabels
 } from "@/db/schema"
 import { EditBiddingSheet } from "./edit-bidding-sheet"
-import { SpecificationMeetingDialog, PrDocumentsDialog } from "./bidding-detail-dialogs"
+import { SpecificationMeetingDialog, PrDocumentsDialog, BidClosureDialog } from "./bidding-detail-dialogs"
 
 
 interface BiddingsTableProps {
@@ -43,6 +44,7 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
     const [isCompact, setIsCompact] = React.useState<boolean>(false)
     const [specMeetingDialogOpen, setSpecMeetingDialogOpen] = React.useState(false)
     const [prDocumentsDialogOpen, setPrDocumentsDialogOpen] = React.useState(false)
+    const [bidClosureDialogOpen, setBidClosureDialogOpen] = React.useState(false)
     const [selectedBidding, setSelectedBidding] = React.useState<BiddingListItemWithManagerCode | null>(null)
 
     console.log(data,"data")
@@ -50,6 +52,7 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
     const [rowAction, setRowAction] = React.useState<DataTableRowAction<BiddingListItemWithManagerCode> | null>(null)
 
     const router = useRouter()
+    const { data: session } = useSession()
 
     const columns = React.useMemo(
         () => getBiddingsColumns({ setRowAction }),
@@ -63,8 +66,8 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
 
             switch (rowAction.type) {
                 case "view":
-                    // 상세 페이지로 이동
-                    router.push(`/evcp/bid/${rowAction.row.original.id}`)
+                    // 상세 페이지로 이동 (info 페이지로)
+                    router.push(`/evcp/bid/${rowAction.row.original.id}/info`)
                     break
                 case "update":
                     // EditBiddingSheet는 아래에서 별도로 처리
@@ -75,6 +78,9 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
                 case "pr_documents":
                     setPrDocumentsDialogOpen(true)
                     break
+                case "bid_closure":
+                    setBidClosureDialogOpen(true)
+                    break
                 // 기존 다른 액션들은 그대로 유지
                 default:
                     break
@@ -88,10 +94,10 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
         { id: "title", label: "입찰명", type: "text" },
         { id: "biddingNumber", label: "입찰번호", type: "text" },
         { id: "projectName", label: "프로젝트명", type: "text" },
-        { id: "managerName", label: "담당자", type: "text" },
+        { id: "bidPicName", label: "입찰담당자", type: "text" },
         {
             id: "status",
-            label: "입찰상태",
+            label: "진행상태",
             type: "multi-select",
             options: Object.entries(biddingStatusLabels).map(([value, label]) => ({
                 label,
@@ -154,6 +160,12 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
         setSelectedBidding(null)
     }, [])
 
+    const handleBidClosureDialogClose = React.useCallback(() => {
+        setBidClosureDialogOpen(false)
+        setRowAction(null)
+        setSelectedBidding(null)
+    }, [])
+
 
     return (
         <>
@@ -195,6 +207,14 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
                 onOpenChange={handlePrDocumentsDialogClose}
                 bidding={selectedBidding}
             />
+
+            {/* 폐찰하기 다이얼로그 */}
+            <BidClosureDialog
+                open={bidClosureDialogOpen}
+                onOpenChange={handleBidClosureDialogClose}
+                bidding={selectedBidding}
+                userId={session?.user?.id ? String(session.user.id) : ''}
+            />
         </>
 
     )
-- 
cgit v1.2.3

