Files
klp-oa/klp-ui/src/views/aps/sheets/templates.js
2026-03-14 15:06:18 +08:00

43 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 统一排产表:模板配置
*
* 设计目标:
* - 用同一套 UI 渲染不同机组的“排产表样式”(多级表头/字段差异)
* - 后端返回统一的 rowModel行数据前端仅做字段映射和展示
*
* 约定:
* - columns 支持多级:{ label, children } 或叶子列 { label, prop, width, minWidth, fixed, align }
* - summary用于底部合计显示哪些字段求和
*/
export const APS_SHEET_TEMPLATES = [
{
key: 'unified',
name: '统一排产表',
columns: [
{ label: '产线', prop: 'lineName', minWidth: 140 },
{ label: '计划号', prop: 'planCode', minWidth: 140 },
{ label: '订单号', prop: 'orderCode', minWidth: 140 },
{ label: '客户', prop: 'customerName', minWidth: 140 },
{ label: '业务员', prop: 'salesman', width: 100 },
{ label: '产品', prop: 'productName', minWidth: 140 },
{ label: '原料钢卷', prop: 'rawMaterialId', minWidth: 220 },
{ label: '原料卷号', prop: 'rawCoilNos', minWidth: 220 },
{ label: '钢卷位置', prop: 'rawLocation', minWidth: 140 },
{ label: '包装要求', prop: 'rawPackaging', minWidth: 140 },
{ label: '切边要求', prop: 'rawEdgeReq', minWidth: 120 },
{ label: '镀层种类', prop: 'rawCoatingType', width: 110 },
{ label: '原料净重', prop: 'rawNetWeight', width: 110, align: 'right' },
{ label: '计划数量', prop: 'planQty', width: 100, align: 'right' },
{ label: '开始时间', prop: 'startTime', width: 170 },
{ label: '结束时间', prop: 'endTime', width: 170 }
],
summary: { sumFields: ['planQty', 'rawNetWeight'] }
}
]
export function getTemplateByKey(key) {
return APS_SHEET_TEMPLATES.find(t => t.key === key) || APS_SHEET_TEMPLATES[0]
}