diff options
| author | joonhoekim <26rote@gmail.com> | 2025-09-30 18:38:08 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-09-30 18:38:08 +0900 |
| commit | 19794b32a6e3285fdeda7519ededdce451966f3d (patch) | |
| tree | 98fbc705983ed78ed9a60cb56e7e2964144545ef /lib/vendor-pool | |
| parent | 4dfc6e120fe6ceba37379d2bf86c1f2bb650f5b6 (diff) | |
(김준회) AVL, Vendorpool 요구사항 반영 및 불필요주석 제거
Diffstat (limited to 'lib/vendor-pool')
| -rw-r--r-- | lib/vendor-pool/excel-utils.ts | 46 |
1 files changed, 26 insertions, 20 deletions
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 (참/거짓) 필드 입력법', |
