summaryrefslogtreecommitdiff
path: root/lib/tbe-last/table/tbe-last-table-columns.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-15 14:41:01 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-15 14:41:01 +0000
commit4ee8b24cfadf47452807fa2af801385ed60ab47c (patch)
treee1d1fb029f0cf5519c517494bf9a545505c35700 /lib/tbe-last/table/tbe-last-table-columns.tsx
parent265859d691a01cdcaaf9154f93c38765bc34df06 (diff)
(대표님) 작업사항 - rfqLast, tbeLast, pdfTron, userAuth
Diffstat (limited to 'lib/tbe-last/table/tbe-last-table-columns.tsx')
-rw-r--r--lib/tbe-last/table/tbe-last-table-columns.tsx214
1 files changed, 94 insertions, 120 deletions
diff --git a/lib/tbe-last/table/tbe-last-table-columns.tsx b/lib/tbe-last/table/tbe-last-table-columns.tsx
index 71b3acde..726d8925 100644
--- a/lib/tbe-last/table/tbe-last-table-columns.tsx
+++ b/lib/tbe-last/table/tbe-last-table-columns.tsx
@@ -4,7 +4,7 @@
import * as React from "react"
import { type ColumnDef } from "@tanstack/react-table"
-import { FileText, MessageSquare, Package, ListChecks } from "lucide-react"
+import { FileText, Package, ListChecks } from "lucide-react"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
@@ -77,72 +77,64 @@ export function getColumns({
size: 120,
},
- // RFQ Info Group
+ // RFQ Code
{
- id: "rfqInfo",
- header: "RFQ Information",
- columns: [
- {
- accessorKey: "rfqCode",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="RFQ Code" />
- ),
- cell: ({ row }) => row.original.rfqCode,
- size: 120,
- },
- {
- accessorKey: "rfqTitle",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="RFQ Title" />
- ),
- cell: ({ row }) => row.original.rfqTitle || "-",
- size: 200,
- },
- {
- accessorKey: "rfqDueDate",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Due Date" />
- ),
- cell: ({ row }) => {
- const date = row.original.rfqDueDate;
- return date ? formatDate(date, "KR") : "-";
- },
- size: 100,
- },
- ],
+ accessorKey: "rfqCode",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="RFQ Code" />
+ ),
+ cell: ({ row }) => row.original.rfqCode,
+ size: 120,
},
- // Package Info
+ // RFQ Title
{
- id: "packageInfo",
- header: "Package",
- columns: [
- {
- accessorKey: "packageNo",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Package No" />
- ),
- cell: ({ row }) => {
- const packageNo = row.original.packageNo;
- const packageName = row.original.packageName;
-
- if (!packageNo) return "-";
-
- return (
- <div className="flex flex-col">
- <span className="font-medium">{packageNo}</span>
- {packageName && (
- <span className="text-xs text-muted-foreground">{packageName}</span>
- )}
- </div>
- );
- },
- size: 150,
- },
- ],
+ accessorKey: "rfqTitle",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="RFQ Title" />
+ ),
+ cell: ({ row }) => row.original.rfqTitle || "-",
+ size: 200,
+ },
+
+ // RFQ Due Date
+ {
+ accessorKey: "rfqDueDate",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="Due Date" />
+ ),
+ cell: ({ row }) => {
+ const date = row.original.rfqDueDate;
+ return date ? formatDate(date, "KR") : "-";
+ },
+ size: 100,
+ },
+
+ // Package No
+ {
+ accessorKey: "packageNo",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="Package No" />
+ ),
+ cell: ({ row }) => {
+ const packageNo = row.original.packageNo;
+ const packageName = row.original.packageName;
+
+ if (!packageNo) return "-";
+
+ return (
+ <div className="flex flex-col">
+ <span className="font-medium">{packageNo}</span>
+ {packageName && (
+ <span className="text-xs text-muted-foreground">{packageName}</span>
+ )}
+ </div>
+ );
+ },
+ size: 150,
},
- // Project Info
+ // Project
{
accessorKey: "projectCode",
header: ({ column }) => (
@@ -166,28 +158,44 @@ export function getColumns({
size: 150,
},
- // Vendor Info
+ // Vendor Code
{
- id: "vendorInfo",
- header: "Vendor",
- columns: [
- {
- accessorKey: "vendorCode",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Vendor Code" />
- ),
- cell: ({ row }) => row.original.vendorCode || "-",
- size: 100,
- },
- {
- accessorKey: "vendorName",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Vendor Name" />
- ),
- cell: ({ row }) => row.original.vendorName,
- size: 200,
- },
- ],
+ accessorKey: "vendorCode",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="Vendor Code" />
+ ),
+ cell: ({ row }) => row.original.vendorCode || "-",
+ size: 100,
+ },
+
+ // Vendor Name
+ {
+ accessorKey: "vendorName",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="Vendor Name" />
+ ),
+ cell: ({ row }) => row.original.vendorName,
+ size: 200,
+ },
+
+ // 구매담당자 (PIC Name)
+ {
+ accessorKey: "picName",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="구매담당자" />
+ ),
+ cell: ({ row }) => row.original.picName || "-",
+ size: 120,
+ },
+
+ // 설계담당자 (Engineering PIC Name)
+ {
+ accessorKey: "EngPicName",
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple column={column} title="설계담당자" />
+ ),
+ cell: ({ row }) => row.original.EngPicName || "-",
+ size: 120,
},
// TBE Status
@@ -239,7 +247,7 @@ export function getColumns({
<Button
variant="outline"
size="sm"
- onClick={() => onOpenEvaluation(session)}
+ onClick={() => onOpenEvaluation(session )}
>
평가입력
</Button>
@@ -314,9 +322,9 @@ export function getColumns({
),
cell: ({ row }) => {
const sessionId = row.original.tbeSessionId;
- const buyerDocs = row.original.buyerDocumentsCount;
- const vendorDocs = row.original.vendorDocumentsCount;
- const reviewedDocs = row.original.reviewedDocumentsCount;
+ const buyerDocs = Number(row.original.buyerDocumentsCount);
+ const vendorDocs = Number(row.original.vendorDocumentsCount);
+ const reviewedDocs = Number(row.original.reviewedDocumentsCount);
const totalDocs = buyerDocs + vendorDocs;
return (
@@ -336,40 +344,6 @@ export function getColumns({
size: 100,
enableSorting: false,
},
-
- // Comments
- {
- id: "comments",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Comments" />
- ),
- cell: ({ row }) => {
- const sessionId = row.original.tbeSessionId;
- const totalComments = row.original.totalCommentsCount;
- const unresolvedComments = row.original.unresolvedCommentsCount;
-
- return (
- <Button
- variant="ghost"
- size="sm"
- className="h-8 px-2 relative"
- onClick={() => onOpenDocuments(sessionId)}
- >
- <MessageSquare className="h-4 w-4" />
- {totalComments > 0 && (
- <Badge
- variant={unresolvedComments > 0 ? "destructive" : "secondary"}
- className="absolute -top-1 -right-1 h-4 min-w-[1rem] p-0 text-[0.625rem]"
- >
- {unresolvedComments > 0 ? unresolvedComments : totalComments}
- </Badge>
- )}
- </Button>
- );
- },
- size: 80,
- enableSorting: false,
- },
];
return columns;