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)) }