summaryrefslogtreecommitdiff
path: root/lib/basic-contract/vendor-table
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-14 05:28:01 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-14 05:28:01 +0000
commit675b4e3d8ffcb57a041db285417d81e61284d900 (patch)
tree254f3d6a6c0ce39ae8fba35618f3810e08945f19 /lib/basic-contract/vendor-table
parent39f12cb19f29cbc5568057e154e6adf4789ae736 (diff)
(대표님) RFQ-last, tbe-last, 기본계약 템플릿 내 견적,입찰,계약 추가, env.dev NAS_PATH 수정
Diffstat (limited to 'lib/basic-contract/vendor-table')
-rw-r--r--lib/basic-contract/vendor-table/basic-contract-columns.tsx52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/basic-contract/vendor-table/basic-contract-columns.tsx b/lib/basic-contract/vendor-table/basic-contract-columns.tsx
index 1b11285c..c8af2e02 100644
--- a/lib/basic-contract/vendor-table/basic-contract-columns.tsx
+++ b/lib/basic-contract/vendor-table/basic-contract-columns.tsx
@@ -241,6 +241,57 @@ export function getColumns({ setRowAction, locale = 'ko', t }: GetColumnsProps):
groupMap[groupName].push(childCol)
})
+ const contractTypeColumn: ColumnDef<BasicContractView> = {
+ id: "contractType",
+ accessorFn: (row) => {
+ // 계약 유형 판별 로직
+ if (row.generalContractId) return "contract";
+ if (row.rfqCompanyId) return "quotation";
+ if (row.biddingCompanyId) return "bidding";
+ return "general";
+ },
+ header: ({ column }) => (
+ <DataTableColumnHeaderSimple
+ column={column}
+ title={locale === 'ko' ? "계약 소스" : "Contract Source"}
+ />
+ ),
+ cell: ({ getValue }) => {
+ const type = getValue() as string;
+
+ // 타입별 표시 텍스트와 스타일 정의
+ const typeConfig = {
+ general: {
+ label: locale === 'ko' ? '일반' : 'General',
+ variant: 'outline' as const
+ },
+ quotation: {
+ label: locale === 'ko' ? '견적' : 'Quotation',
+ variant: 'secondary' as const
+ },
+ contract: {
+ label: locale === 'ko' ? '계약' : 'Contract',
+ variant: 'default' as const
+ },
+ bidding: {
+ label: locale === 'ko' ? '입찰' : 'Bidding',
+ variant: 'destructive' as const
+ }
+ };
+
+ const config = typeConfig[type as keyof typeof typeConfig] || typeConfig.general;
+
+ return (
+ <Badge variant={config.variant}>
+ {config.label}
+ </Badge>
+ );
+ },
+ enableSorting: true,
+ enableHiding: true,
+ minSize: 80,
+ };
+
// ----------------------------------------------------------------
// 4-2) groupMap에서 실제 상위 컬럼(그룹)을 만들기
// ----------------------------------------------------------------
@@ -269,6 +320,7 @@ export function getColumns({ setRowAction, locale = 'ko', t }: GetColumnsProps):
return [
selectColumn,
downloadColumn, // 다운로드 컬럼 추가
+ contractTypeColumn,
...nestedColumns,
]
} \ No newline at end of file