feat(wms报表): 添加列设置功能并重构表格组件
引入可配置的列设置功能,允许用户自定义表格显示列 创建CoilTable通用组件替换原有表格实现 添加列设置对话框和默认列配置初始化逻辑
This commit is contained in:
293
klp-ui/src/views/wms/report/js/column.js
Normal file
293
klp-ui/src/views/wms/report/js/column.js
Normal file
@@ -0,0 +1,293 @@
|
||||
const defaultColumns = {
|
||||
// 消耗报表明细表格
|
||||
"coil-report-loss": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "操作完成时间",
|
||||
prop: "actionCompleteTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产开始时间",
|
||||
prop: "productionStartTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产结束时间",
|
||||
prop: "productionEndTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产线速度",
|
||||
prop: "productionSpeed",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
prop: "remark",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 产出报表明细表格
|
||||
"coil-report-output": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产时间",
|
||||
prop: "createTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "在库状态",
|
||||
prop: "status",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 收货明细表格
|
||||
"coil-report-receive": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产时间",
|
||||
prop: "createTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "在库状态",
|
||||
prop: "status",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "更新人",
|
||||
prop: "updateByName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
prop: "updateTime",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 发货明细表格
|
||||
"coil-report-delivery": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "在库状态",
|
||||
prop: "status",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货时间",
|
||||
prop: "exportTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货绑定车牌号",
|
||||
prop: "bindLicensePlate",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货绑定目标客户",
|
||||
prop: "bindConsigneeUnit",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货绑定单位",
|
||||
prop: "bindSenderUnit",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货绑定负责人",
|
||||
prop: "bindPrincipal",
|
||||
align: "center",
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const initColumns = (key) => {
|
||||
// 如果没有存储,初始化默认列
|
||||
if (!localStorage.getItem('preference-tableColumns-' + key)) {
|
||||
localStorage.setItem('preference-tableColumns-' + key, JSON.stringify(defaultColumns[key]))
|
||||
}
|
||||
}
|
||||
|
||||
export const resetColumns = (key) => {
|
||||
localStorage.removeItem('preference-tableColumns-' + key)
|
||||
initColumns(key)
|
||||
}
|
||||
|
||||
export const initAllColumns = () => {
|
||||
Object.keys(defaultColumns).forEach(key => initColumns(key))
|
||||
}
|
||||
|
||||
export const resetAllColumns = () => {
|
||||
Object.keys(defaultColumns).forEach(key => resetColumns(key))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user