From e5f4a774fabc17b5b18d50c96f5695d89dcabc86 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 2 Jun 2025 02:27:56 +0000
Subject: (김준회) 기술영업 조선 RFQ 에러 처리 및 필터와 소팅 처리
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../table/vendor-quotations-table-columns.tsx | 255 +++++++++++++++++----
1 file changed, 211 insertions(+), 44 deletions(-)
(limited to 'lib/techsales-rfq/vendor-response/table/vendor-quotations-table-columns.tsx')
diff --git a/lib/techsales-rfq/vendor-response/table/vendor-quotations-table-columns.tsx b/lib/techsales-rfq/vendor-response/table/vendor-quotations-table-columns.tsx
index 109698ea..cf1dac42 100644
--- a/lib/techsales-rfq/vendor-response/table/vendor-quotations-table-columns.tsx
+++ b/lib/techsales-rfq/vendor-response/table/vendor-quotations-table-columns.tsx
@@ -13,24 +13,46 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip"
-import { DataTableColumnHeader } from "@/components/data-table/data-table-column-header"
import {
TechSalesVendorQuotations,
TECH_SALES_QUOTATION_STATUS_CONFIG
} from "@/db/schema"
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"
+import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header"
interface QuotationWithRfqCode extends TechSalesVendorQuotations {
+ // RFQ 관련 정보
rfqCode?: string;
materialCode?: string;
dueDate?: Date;
rfqStatus?: string;
+
+ // 아이템 정보
itemName?: string;
+ itemShipbuildingId?: number;
+
+ // 프로젝트 정보
projNm?: string;
+ pspid?: string;
+ sector?: string;
+
+ // 벤더 정보
+ vendorName?: string;
+ vendorCode?: string;
+
+ // 사용자 정보
+ createdByName?: string | null;
+ updatedByName?: string | null;
+
+ // 견적 코드 및 버전
quotationCode?: string | null;
quotationVersion?: number | null;
+
+ // 추가 상태 정보
rejectionReason?: string | null;
acceptedAt?: Date | null;
+
+ // 첨부파일 개수
attachmentCount?: number;
}
@@ -65,23 +87,23 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
enableSorting: false,
enableHiding: false,
},
- {
- accessorKey: "id",
- header: ({ column }) => (
-
- ),
- cell: ({ row }) => (
-
- {row.getValue("id")}
-
- ),
- enableSorting: true,
- enableHiding: true,
- },
+ // {
+ // accessorKey: "id",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => (
+ //
+ // {row.getValue("id")}
+ //
+ // ),
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
{
accessorKey: "rfqCode",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const rfqCode = row.getValue("rfqCode") as string;
@@ -94,26 +116,58 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
enableSorting: true,
enableHiding: false,
},
- {
- accessorKey: "materialCode",
- header: ({ column }) => (
-
- ),
- cell: ({ row }) => {
- const materialCode = row.getValue("materialCode") as string;
- return (
-
- {materialCode || "N/A"}
-
- );
- },
- enableSorting: true,
- enableHiding: true,
- },
+ // {
+ // accessorKey: "vendorName",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const vendorName = row.getValue("vendorName") as string;
+ // return (
+ //
+ // {vendorName || "N/A"}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: false,
+ // },
+ // {
+ // accessorKey: "vendorCode",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const vendorCode = row.getValue("vendorCode") as string;
+ // return (
+ //
+ // {vendorCode || "N/A"}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
+ // {
+ // accessorKey: "materialCode",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const materialCode = row.getValue("materialCode") as string;
+ // return (
+ //
+ // {materialCode || "N/A"}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
{
accessorKey: "itemName",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const itemName = row.getValue("itemName") as string;
@@ -134,13 +188,13 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
);
},
- enableSorting: false,
+ enableSorting: true,
enableHiding: true,
},
{
accessorKey: "projNm",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const projNm = row.getValue("projNm") as string;
@@ -161,13 +215,45 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
);
},
- enableSorting: false,
+ enableSorting: true,
enableHiding: true,
},
+ // {
+ // accessorKey: "quotationCode",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const quotationCode = row.getValue("quotationCode") as string;
+ // return (
+ //
+ // {quotationCode || "미부여"}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
+ // {
+ // accessorKey: "quotationVersion",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const quotationVersion = row.getValue("quotationVersion") as number;
+ // return (
+ //
+ // {quotationVersion || 1}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
{
id: "attachments",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const quotation = row.original
@@ -216,7 +302,7 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
{
accessorKey: "status",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const status = row.getValue("status") as string;
@@ -243,7 +329,7 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
{
accessorKey: "currency",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const currency = row.getValue("currency") as string;
@@ -259,7 +345,7 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
{
accessorKey: "totalPrice",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const totalPrice = row.getValue("totalPrice") as string;
@@ -287,7 +373,7 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
{
accessorKey: "validUntil",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const validUntil = row.getValue("validUntil") as Date;
@@ -305,7 +391,7 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
{
accessorKey: "submittedAt",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const submittedAt = row.getValue("submittedAt") as Date;
@@ -320,10 +406,28 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
enableSorting: true,
enableHiding: true,
},
+ // {
+ // accessorKey: "acceptedAt",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const acceptedAt = row.getValue("acceptedAt") as Date;
+ // return (
+ //
+ //
+ // {acceptedAt ? formatDateTime(acceptedAt) : "미승인"}
+ //
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
{
accessorKey: "dueDate",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const dueDate = row.getValue("dueDate") as Date;
@@ -340,10 +444,41 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
enableSorting: true,
enableHiding: true,
},
+ // {
+ // accessorKey: "rejectionReason",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const rejectionReason = row.getValue("rejectionReason") as string;
+ // return (
+ //
+ // {rejectionReason ? (
+ //
+ //
+ //
+ //
+ // {rejectionReason}
+ //
+ //
+ //
+ // {rejectionReason}
+ //
+ //
+ //
+ // ) : (
+ //
N/A
+ // )}
+ //
+ // );
+ // },
+ // enableSorting: false,
+ // enableHiding: true,
+ // },
{
accessorKey: "createdAt",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const createdAt = row.getValue("createdAt") as Date;
@@ -361,7 +496,7 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
{
accessorKey: "updatedAt",
header: ({ column }) => (
-
+
),
cell: ({ row }) => {
const updatedAt = row.getValue("updatedAt") as Date;
@@ -376,6 +511,38 @@ export function getColumns({ router, openAttachmentsSheet }: GetColumnsProps): C
enableSorting: true,
enableHiding: true,
},
+ // {
+ // accessorKey: "createdByName",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const createdByName = row.getValue("createdByName") as string;
+ // return (
+ //
+ // {createdByName || "N/A"}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
+ // {
+ // accessorKey: "updatedByName",
+ // header: ({ column }) => (
+ //
+ // ),
+ // cell: ({ row }) => {
+ // const updatedByName = row.getValue("updatedByName") as string;
+ // return (
+ //
+ // {updatedByName || "N/A"}
+ //
+ // );
+ // },
+ // enableSorting: true,
+ // enableHiding: true,
+ // },
{
id: "actions",
header: "작업",
--
cgit v1.2.3