diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/avl/table/columns-detail.tsx | 25 | ||||
| -rw-r--r-- | lib/vendor-pool/excel-utils.ts | 46 |
2 files changed, 26 insertions, 45 deletions
diff --git a/lib/avl/table/columns-detail.tsx b/lib/avl/table/columns-detail.tsx index f33ef593..b354dccd 100644 --- a/lib/avl/table/columns-detail.tsx +++ b/lib/avl/table/columns-detail.tsx @@ -7,31 +7,6 @@ import type { AvlDetailItem } from "../types" // 테이블 컬럼 정의 export const columns: ColumnDef<AvlDetailItem>[] = [ - // 선택 컬럼 - // { - // id: "select", - // header: ({ table }) => ( - // <Checkbox - // checked={ - // table.getIsAllPageRowsSelected() || - // (table.getIsSomePageRowsSelected() && "indeterminate") - // } - // onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)} - // aria-label="모든 행 선택" - // /> - // ), - // cell: ({ row }) => ( - // <Checkbox - // checked={row.getIsSelected()} - // onCheckedChange={(value) => row.toggleSelected(!!value)} - // aria-label="행 선택" - // /> - // ), - // size: 50, - // enableSorting: false, - // enableHiding: false, - // }, - // 기본 정보 그룹 { header: "기본 정보", columns: [ diff --git a/lib/vendor-pool/excel-utils.ts b/lib/vendor-pool/excel-utils.ts index 8dd8743c..c1c2ac0a 100644 --- a/lib/vendor-pool/excel-utils.ts +++ b/lib/vendor-pool/excel-utils.ts @@ -10,34 +10,35 @@ export interface ExcelColumnConfig { header: string width?: number type?: 'text' | 'number' | 'boolean' | 'date' + required?: boolean } // vendor-pool Excel 컬럼 매핑 export const vendorPoolExcelColumns: ExcelColumnConfig[] = [ - { accessorKey: 'constructionSector', header: '조선/해양', width: 15 }, - { accessorKey: 'htDivision', header: 'H/T구분', width: 15 }, + { accessorKey: 'constructionSector', header: '조선/해양', width: 15, required: true }, + { accessorKey: 'htDivision', header: 'H/T구분', width: 15, required: true }, { accessorKey: 'designCategoryCode', header: '설계기능코드', width: 20 }, - { accessorKey: 'designCategory', header: '설계기능(공종)', width: 25 }, + { accessorKey: 'designCategory', header: '설계기능(공종)', width: 25, required: true }, { accessorKey: 'equipBulkDivision', header: 'Equip/Bulk', width: 15 }, { accessorKey: 'packageCode', header: '패키지코드', width: 20 }, { accessorKey: 'packageName', header: '패키지명', width: 25 }, { accessorKey: 'materialGroupCode', header: '자재그룹코드', width: 20 }, - { accessorKey: 'materialGroupName', header: '자재그룹명', width: 30 }, + { accessorKey: 'materialGroupName', header: '자재그룹명', width: 30, required: true }, { accessorKey: 'smCode', header: 'SM Code', width: 15 }, { accessorKey: 'similarMaterialNamePurchase', header: '유사자재명(구매)', width: 25 }, { accessorKey: 'similarMaterialNameOther', header: '유사자재명(기타)', width: 25 }, { accessorKey: 'vendorCode', header: '협력업체코드', width: 20 }, - { accessorKey: 'vendorName', header: '협력업체명', width: 25 }, - { accessorKey: 'taxId', header: '사업자번호', width: 20 }, + { accessorKey: 'vendorName', header: '협력업체명', width: 25, required: true }, + { accessorKey: 'taxId', header: '사업자번호', width: 20, required: true }, { accessorKey: 'faTarget', header: 'FA대상', width: 15, type: 'boolean' }, { accessorKey: 'faStatus', header: 'FA현황', width: 15 }, - { accessorKey: 'tier', header: '등급', width: 15 }, + { accessorKey: 'tier', header: '등급', width: 15, required: true }, { accessorKey: 'isAgent', header: 'Agent여부', width: 15, type: 'boolean' }, { accessorKey: 'contractSignerCode', header: '계약서명주체코드', width: 20 }, - { accessorKey: 'contractSignerName', header: '계약서명주체명', width: 25 }, - { accessorKey: 'headquarterLocation', header: '본사위치', width: 20 }, - { accessorKey: 'manufacturingLocation', header: '제작/선적지', width: 20 }, - { accessorKey: 'avlVendorName', header: 'AVL등재업체명', width: 25 }, + { accessorKey: 'contractSignerName', header: '계약서명주체명', width: 25, required: true }, + { accessorKey: 'headquarterLocation', header: '본사위치', width: 20, required: true }, + { accessorKey: 'manufacturingLocation', header: '제작/선적지', width: 20, required: true }, + { accessorKey: 'avlVendorName', header: 'AVL등재업체명', width: 25, required: true }, { accessorKey: 'similarVendorName', header: '유사업체명', width: 25 }, { accessorKey: 'hasAvl', header: 'AVL보유', width: 15, type: 'boolean' }, { accessorKey: 'isBlacklist', header: '블랙리스트', width: 15, type: 'boolean' }, @@ -109,18 +110,17 @@ export async function createVendorPoolTemplate(filename?: string) { // 2. 헤더 행 추가 (두 번째 행) const headerRow = worksheet.addRow(vendorPoolExcelColumns.map(col => col.header)) - headerRow.font = { bold: true } headerRow.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE0E0E0' } } - // 3. 컬럼 너비 설정 + // 3. 컬럼 너비 설정 및 헤더 셀 스타일 설정 vendorPoolExcelColumns.forEach((col, index) => { const column = worksheet.getColumn(index + 1) column.width = col.width || 15 - + // 헤더 셀 스타일 설정 (두 번째 행) const headerCell = worksheet.getCell(2, index + 1) headerCell.border = { @@ -130,6 +130,12 @@ export async function createVendorPoolTemplate(filename?: string) { right: { style: 'thin' } } headerCell.alignment = { vertical: 'middle', horizontal: 'center' } + // 필수값인 경우 빨간색으로 표시 + if (col.required) { + headerCell.font = { bold: true, color: { argb: 'FFFF0000' } } // 빨간색 + } else { + headerCell.font = { bold: true } + } }) // 3. 데이터 입력을 위한 빈 행 한 개 추가 (사용자가 바로 입력할 수 있도록) @@ -145,17 +151,17 @@ export async function createVendorPoolTemplate(filename?: string) { // 가이드 내용 const guideContent = [ '', - '■ 필수 입력 필드 (빨간색 * 표시)', + '■ 필수 입력 필드 (엑셀 헤더가 빨간색으로 표시됨)', ' - 조선/해양: "조선" 또는 "해양"', ' - H/T구분: "H", "T", 또는 "공통"', - ' - 설계기능코드: 2자리 이하 영문코드 (예: EL, ME)', ' - 설계기능(공종): 설계기능 한글명 (예: 전장, 기관)', - ' - Equip/Bulk: "E" 또는 "B" (1자리)', + ' - 자재그룹명: 해당 자재그룹 정보', ' - 협력업체명: 업체 한글명', - ' - 자재그룹코드/명: 해당 자재그룹 정보', - ' - 등급: "Tier 1", "Tier 2", "Tier 3" 등', + ' - 사업자번호: 업체 사업자등록번호', + ' - 등급: "Tier 1", "Tier 2", "등급 외"', ' - 계약서명주체명: 계약 주체 업체명', - ' - 본사위치/제작선적지: 국가명', + ' - 본사위치: 국가명을 입력', + ' - 제작/선적지: 입력', ' - AVL등재업체명: AVL에 등재된 업체명', '', '■ Boolean (참/거짓) 필드 입력법', |
