From 8642ee064ddf96f1db2b948b4cc8bbbd6cfee820 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 12 Nov 2025 10:42:36 +0000 Subject: (최겸) 구매 일반계약, 입찰 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bidding/failure/biddings-failure-columns.tsx | 130 +++++++++++++++-------- 1 file changed, 88 insertions(+), 42 deletions(-) (limited to 'lib/bidding/failure/biddings-failure-columns.tsx') diff --git a/lib/bidding/failure/biddings-failure-columns.tsx b/lib/bidding/failure/biddings-failure-columns.tsx index 8a888079..3046dbc0 100644 --- a/lib/bidding/failure/biddings-failure-columns.tsx +++ b/lib/bidding/failure/biddings-failure-columns.tsx @@ -5,8 +5,9 @@ import { type ColumnDef } from "@tanstack/react-table" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { - Eye, Calendar, FileX, DollarSign, AlertTriangle, RefreshCw + Eye, Calendar, FileX, DollarSign, AlertTriangle, RefreshCw, FileText } from "lucide-react" +import { Checkbox } from "@/components/ui/checkbox" import { Tooltip, TooltipContent, @@ -27,6 +28,7 @@ import { } from "@/db/schema" import { formatDate } from "@/lib/utils" import { DataTableRowAction } from "@/types/table" +import { downloadFile } from "@/lib/file-download" type BiddingFailureItem = { id: number @@ -55,6 +57,15 @@ type BiddingFailureItem = { disposalUpdatedAt: Date | null // 폐찰수정일 disposalUpdatedBy: string | null // 폐찰수정자 + // 폐찰 정보 + closureReason: string | null // 폐찰사유 + closureDocuments: { + id: number + fileName: string + originalFileName: string + filePath: string + }[] // 폐찰 첨부파일들 + // 기타 정보 createdBy: string | null createdAt: Date | null @@ -94,6 +105,25 @@ const formatCurrency = (amount: string | number | null, currency = 'KRW') => { export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): ColumnDef[] { return [ + // ░░░ 선택 ░░░ + { + id: "select", + header: "", + cell: ({ row }) => ( + { + // single select 모드에서는 다른 행들의 선택을 해제 + row.toggleSelected(!!value) + }} + aria-label="행 선택" + /> + ), + size: 50, + enableSorting: false, + enableHiding: false, + }, + // ░░░ 입찰번호 ░░░ { accessorKey: "biddingNumber", @@ -188,7 +218,7 @@ export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): Co accessorKey: "biddingRegistrationDate", header: ({ column }) => , cell: ({ row }) => ( - {formatDate(row.original.biddingRegistrationDate, "KR")} + {row.original.biddingRegistrationDate ? formatDate(row.original.biddingRegistrationDate, "KR") : '-'} ), size: 100, meta: { excelHeader: "입찰등록일" }, @@ -216,7 +246,7 @@ export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): Co cell: ({ row }) => (
- {formatDate(row.original.disposalDate, "KR")} + {row.original.disposalDate ? formatDate(row.original.disposalDate, "KR") : '-'}
), size: 100, @@ -230,7 +260,7 @@ export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): Co cell: ({ row }) => (
- {formatDate(row.original.disposalUpdatedAt, "KR")} + {row.original.disposalUpdatedAt ? formatDate(row.original.disposalUpdatedAt, "KR") : '-'}
), size: 100, @@ -248,6 +278,57 @@ export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): Co meta: { excelHeader: "폐찰수정자" }, }, + // ░░░ 폐찰사유 ░░░ + { + id: "closureReason", + header: ({ column }) => , + cell: ({ row }) => ( +
+ {row.original.closureReason || '-'} +
+ ), + size: 150, + meta: { excelHeader: "폐찰사유" }, + }, + + // ░░░ 폐찰첨부파일 ░░░ + { + id: "closureDocuments", + header: ({ column }) => , + cell: ({ row }) => { + const documents = row.original.closureDocuments || [] + + if (documents.length === 0) { + return - + } + + return ( +
+ {documents.map((doc) => ( + + ))} +
+ ) + }, + size: 200, + meta: { excelHeader: "폐찰첨부파일" }, + }, + // ░░░ P/R번호 ░░░ { accessorKey: "prNumber", @@ -267,7 +348,7 @@ export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): Co {row.original.createdBy || '-'} ), size: 100, - meta: { excelHeader: "등록자" }, + meta: { excelHeader: "최종수정자" }, }, // ░░░ 등록일시 ░░░ @@ -275,46 +356,11 @@ export function getBiddingsFailureColumns({ setRowAction }: GetColumnsProps): Co accessorKey: "createdAt", header: ({ column }) => , cell: ({ row }) => ( - {formatDate(row.original.createdAt, "KR")} + {row.original.createdAt ? formatDate(row.original.createdAt, "KR") : '-'} ), size: 100, - meta: { excelHeader: "등록일시" }, + meta: { excelHeader: "최종일시" }, }, - // ═══════════════════════════════════════════════════════════════ - // 액션 - // ═══════════════════════════════════════════════════════════════ - { - id: "actions", - header: "액션", - cell: ({ row }) => ( - - - - - - setRowAction({ row, type: "view" })}> - - 상세보기 - - setRowAction({ row, type: "history" })}> - - 이력보기 - - - setRowAction({ row, type: "rebid" })}> - - 재입찰 - - - - ), - size: 50, - enableSorting: false, - enableHiding: false, - }, ] } -- cgit v1.2.3