From 5b6ad4796e29e8499f488832d223a4cba46f146b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 19 Mar 2026 15:08:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms=E6=8A=A5=E8=A1=A8):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=97=E8=AE=BE=E7=BD=AE=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 引入可配置的列设置功能,允许用户自定义表格显示列 创建CoilTable通用组件替换原有表格实现 添加列设置对话框和默认列配置初始化逻辑 --- klp-ui/src/main.js | 7 + .../wms/report/components/coilTable/index.vue | 86 +++++ .../wms/report/components/setting/columns.vue | 275 ++++++++++++++++ klp-ui/src/views/wms/report/delivery.vue | 77 ++--- klp-ui/src/views/wms/report/js/column.js | 293 ++++++++++++++++++ klp-ui/src/views/wms/report/merge/index.vue | 89 ++---- klp-ui/src/views/wms/report/receive.vue | 60 ++-- klp-ui/src/views/wms/report/template/day.vue | 89 ++---- klp-ui/src/views/wms/report/template/loss.vue | 78 ++--- .../src/views/wms/report/template/merge.vue | 89 ++---- .../src/views/wms/report/template/month.vue | 89 ++---- klp-ui/src/views/wms/report/template/out.vue | 64 ++-- klp-ui/src/views/wms/report/template/team.vue | 91 ++---- klp-ui/src/views/wms/report/template/year.vue | 89 ++---- 14 files changed, 941 insertions(+), 535 deletions(-) create mode 100644 klp-ui/src/views/wms/report/components/coilTable/index.vue create mode 100644 klp-ui/src/views/wms/report/components/setting/columns.vue create mode 100644 klp-ui/src/views/wms/report/js/column.js diff --git a/klp-ui/src/main.js b/klp-ui/src/main.js index 93611be2..c767d1d2 100644 --- a/klp-ui/src/main.js +++ b/klp-ui/src/main.js @@ -48,6 +48,10 @@ import KLPTable from '@/components/KLPUI/KLPTable/index.vue' import MemoInput from '@/components/MemoInput/index.vue' import CurrentCoilNo from '@/components/KLPService/Renderer/CurrentCoilNo.vue' +// 初始化所有列 +import { initAllColumns } from '@/views/wms/report/js/column.js' + + // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -83,6 +87,9 @@ Vue.use(VueKonva); Vue.use(dashboardBigPlugin) DictData.install() +// 初始化所有列 +initAllColumns() + /** * If you don't want to use mock-server * you want to use MockJs for mock api diff --git a/klp-ui/src/views/wms/report/components/coilTable/index.vue b/klp-ui/src/views/wms/report/components/coilTable/index.vue new file mode 100644 index 00000000..e9eeb17c --- /dev/null +++ b/klp-ui/src/views/wms/report/components/coilTable/index.vue @@ -0,0 +1,86 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/components/setting/columns.vue b/klp-ui/src/views/wms/report/components/setting/columns.vue new file mode 100644 index 00000000..353fcc4b --- /dev/null +++ b/klp-ui/src/views/wms/report/components/setting/columns.vue @@ -0,0 +1,275 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/delivery.vue b/klp-ui/src/views/wms/report/delivery.vue index b8a2a005..6e90f381 100644 --- a/klp-ui/src/views/wms/report/delivery.vue +++ b/klp-ui/src/views/wms/report/delivery.vue @@ -41,6 +41,7 @@ 查询 导出 + 列设置 @@ -53,57 +54,14 @@ - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + 发货明细配置 + + + @@ -115,6 +73,8 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { components: { @@ -123,7 +83,9 @@ export default { CoilNo, MemoInput, MutiSelect, - WarehouseSelect + WarehouseSelect, + ColumnsSetting, + CoilTable, }, dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], data() { @@ -149,6 +111,8 @@ export default { const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00` const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00` return { + activeColumnConfig: 'coil-report-delivery', + settingVisible: false, list: [], queryParams: { pageNum: 1, @@ -168,6 +132,8 @@ export default { includeBindInfo: true, }, loading: false, + + deliveryColumns: [], } }, computed: { @@ -184,6 +150,14 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.deliveryColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-delivery') || '[]') || [] + }, + // 统一查询入口 + handleQuery() { + this.getList() + }, getList() { this.loading = true listCoilWithIds({ @@ -212,6 +186,7 @@ export default { }, mounted() { this.getList() + this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/js/column.js b/klp-ui/src/views/wms/report/js/column.js new file mode 100644 index 00000000..8c3a6767 --- /dev/null +++ b/klp-ui/src/views/wms/report/js/column.js @@ -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)) +} + + diff --git a/klp-ui/src/views/wms/report/merge/index.vue b/klp-ui/src/views/wms/report/merge/index.vue index 72e2043b..8bf716de 100644 --- a/klp-ui/src/views/wms/report/merge/index.vue +++ b/klp-ui/src/views/wms/report/merge/index.vue @@ -38,6 +38,7 @@ 查询 导出产出钢卷 导出消耗钢卷 + 列设置 @@ -66,72 +67,20 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 投入明细配置 + 产出明细配置 + + + @@ -146,6 +95,8 @@ import ProductInfo from "@/components/KLPService/Renderer/ProductInfo"; import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo"; import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import { calcSummary } from "@/views/wms/report/js/calc"; +import CoilTable from "@/views/wms/report/components/coilTable"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns"; export default { name: 'MergeTemplate', @@ -161,6 +112,8 @@ export default { ProductInfo, RawMaterialInfo, CoilNo, + CoilTable, + ColumnsSetting }, dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], data() { @@ -214,6 +167,8 @@ export default { lossList: [], outList: [], activeTab: 'loss', + activeColumnConfig: 'coil-report-loss', + settingVisible: false, loading: false, queryParams: { startTime: start, @@ -227,7 +182,9 @@ export default { itemManufacturer: '', pageSize: 9999, pageNum: 1, - } + }, + lossColumns: [], + outputColumns: [] } }, computed: { @@ -237,6 +194,7 @@ export default { }, created() { this.handleQuery() + this.loadColumns() }, methods: { handleQuery() { @@ -310,6 +268,11 @@ export default { coilIds: this.lossList.map(item => item.coilId).join(',') }, `materialCoil_${new Date().getTime()}.xlsx`) }, + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + } } } diff --git a/klp-ui/src/views/wms/report/receive.vue b/klp-ui/src/views/wms/report/receive.vue index 69cc886a..4c3697c1 100644 --- a/klp-ui/src/views/wms/report/receive.vue +++ b/klp-ui/src/views/wms/report/receive.vue @@ -48,6 +48,7 @@ 查询 导出 + 列设置 @@ -60,40 +61,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 收货明细配置 + + + @@ -109,6 +84,8 @@ import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { listDeliveryPlan } from '@/api/wms/deliveryPlan' +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { components: { @@ -118,6 +95,8 @@ export default { MemoInput, MutiSelect, WarehouseSelect, + ColumnsSetting, + CoilTable, }, dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], data() { @@ -143,6 +122,8 @@ export default { const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00` const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00` return { + activeColumnConfig: 'coil-report-receive', + settingVisible: false, list: [], queryParams: { pageNum: 1, @@ -162,6 +143,8 @@ export default { }, planList: [], loading: false, + + receiveColumns: [], } }, computed: { @@ -178,6 +161,14 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.receiveColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-receive') || '[]') || [] + }, + // 统一查询入口 + handleQuery() { + this.getList() + }, remoteMethod(query) { listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => { this.planList = res.rows @@ -233,6 +224,7 @@ export default { mounted() { this.getList() this.remoteMethod('') + this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/day.vue b/klp-ui/src/views/wms/report/template/day.vue index 83213b0d..88e37c14 100644 --- a/klp-ui/src/views/wms/report/template/day.vue +++ b/klp-ui/src/views/wms/report/template/day.vue @@ -39,6 +39,7 @@ 查询 导出产出钢卷 导出消耗钢卷 + 列设置 @@ -73,73 +74,20 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 投入明细配置 + 产出明细配置 + + + @@ -155,6 +103,8 @@ import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { name: 'DayTemplate', @@ -165,6 +115,8 @@ export default { MemoInput, MutiSelect, WarehouseSelect, + ColumnsSetting, + CoilTable, }, props: { actionTypes: { @@ -205,6 +157,8 @@ export default { return { activeTab: 'loss', + activeColumnConfig: 'coil-report-loss', + settingVisible: false, list: [], lossList: [], queryParams: { @@ -233,7 +187,10 @@ export default { '2019583429955104769', '2019583137616310273', ], - getDayTimeRange // 挂载时间范围生成函数 + getDayTimeRange, // 挂载时间范围生成函数 + + lossColumns: [], + outputColumns: [], } }, watch: { @@ -255,6 +212,11 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + }, // 日期变更处理:更新开始/结束时间 handleDateChange(date) { if (!date) return @@ -372,6 +334,7 @@ export default { mounted() { this.getList() this.getLossList() + this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/loss.vue b/klp-ui/src/views/wms/report/template/loss.vue index 8843d427..fe9cdd4f 100644 --- a/klp-ui/src/views/wms/report/template/loss.vue +++ b/klp-ui/src/views/wms/report/template/loss.vue @@ -47,6 +47,7 @@ 查询 导出 + 列设置 @@ -59,39 +60,14 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + 消耗明细配置 + + + @@ -107,6 +83,8 @@ import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { listDeliveryPlan } from '@/api/wms/deliveryPlan' +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { name: 'LossTemplate', @@ -117,6 +95,8 @@ export default { MemoInput, MutiSelect, WarehouseSelect, + ColumnsSetting, + CoilTable, }, props: { actionTypes: { @@ -152,6 +132,8 @@ export default { const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00` const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00` return { + activeColumnConfig: 'coil-report-loss', + settingVisible: false, list: [], queryParams: { pageNum: 1, @@ -171,6 +153,8 @@ export default { }, planList: [], loading: false, + + lossColumns: [], } }, computed: { @@ -187,6 +171,14 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + }, + // 统一查询入口 + handleQuery() { + this.getList() + }, remoteMethod(query) { listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => { this.planList = res.rows @@ -207,8 +199,8 @@ export default { }) })) const actions = resultList.flatMap(item => item.rows) - const coilIds = actions.map(item => item.coilId).join(',') - if (!coilIds) { + const actionIds = actions.map(item => item.actionId).join(',') + if (!actionIds) { this.$message({ message: '暂无数据', type: 'warning', @@ -217,15 +209,26 @@ export default { this.loading = false return } + // const coilIds = actions.map(item => item.coilId).join(',') + // if (!coilIds) { + // this.$message({ + // message: '暂无数据', + // type: 'warning', + // }) + // this.list = [] + // this.loading = false + // return + // } listCoilWithIds({ ...this.queryParams, byCreateTimeStart: undefined, byCreateTimeEnd: undefined, - coilIds: coilIds, + actionIds: actionIds, + // coilIds: coilIds, }).then(res => { this.list = res.rows.map(item => { // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度 - const [thickness, width] = item.specification.split('*') + const [thickness, width] = item.specification?.split('*') || [undefined, undefined] return { ...item, computedThickness: parseFloat(thickness), @@ -245,6 +248,7 @@ export default { mounted() { this.getList() this.remoteMethod('') + this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/merge.vue b/klp-ui/src/views/wms/report/template/merge.vue index 24555b6e..6ea97bcc 100644 --- a/klp-ui/src/views/wms/report/template/merge.vue +++ b/klp-ui/src/views/wms/report/template/merge.vue @@ -38,6 +38,7 @@ 查询 导出产出钢卷 导出消耗钢卷 + 列设置 @@ -66,72 +67,20 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 投入明细配置 + 产出明细配置 + + + @@ -146,6 +95,8 @@ import ProductInfo from "@/components/KLPService/Renderer/ProductInfo"; import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo"; import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import { calcSummary } from "@/views/wms/report/js/calc"; +import CoilTable from "@/views/wms/report/components/coilTable"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns"; export default { name: 'MergeTemplate', @@ -161,6 +112,8 @@ export default { ProductInfo, RawMaterialInfo, CoilNo, + CoilTable, + ColumnsSetting }, dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], data() { @@ -214,6 +167,8 @@ export default { lossList: [], outList: [], activeTab: 'loss', + activeColumnConfig: 'coil-report-loss', + settingVisible: false, loading: false, queryParams: { startTime: start, @@ -227,7 +182,9 @@ export default { itemManufacturer: '', pageSize: 9999, pageNum: 1, - } + }, + lossColumns: [], + outColumns: [] } }, computed: { @@ -237,6 +194,7 @@ export default { }, created() { this.handleQuery() + this.loadColumns() }, methods: { handleQuery() { @@ -302,6 +260,11 @@ export default { coilIds: this.lossList.map(item => item.coilId).join(',') }, `materialCoil_${new Date().getTime()}.xlsx`) }, + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + } } } diff --git a/klp-ui/src/views/wms/report/template/month.vue b/klp-ui/src/views/wms/report/template/month.vue index 860da92d..d2405d58 100644 --- a/klp-ui/src/views/wms/report/template/month.vue +++ b/klp-ui/src/views/wms/report/template/month.vue @@ -39,6 +39,7 @@ 查询 导出产出钢卷 导出消耗钢卷 + 列设置 @@ -73,73 +74,20 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 投入明细配置 + 产出明细配置 + + + @@ -155,6 +103,8 @@ import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { name: 'MonthTemplate', @@ -165,6 +115,8 @@ export default { MemoInput, MutiSelect, WarehouseSelect, + ColumnsSetting, + CoilTable, }, props: { actionTypes: { @@ -235,6 +187,8 @@ export default { return { activeTab: 'loss', + activeColumnConfig: 'coil-report-loss', + settingVisible: false, list: [], lossList: [], queryParams: { @@ -263,7 +217,10 @@ export default { '2019583429955104769', '2019583137616310273', ], - getDayTimeRange // 挂载时间范围生成函数 + getDayTimeRange, // 挂载时间范围生成函数 + + lossColumns: [], + outputColumns: [], } }, watch: { @@ -285,6 +242,11 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + }, // 日期变更处理:更新开始/结束时间 handleDateChange(date) { if (!date) return @@ -402,6 +364,7 @@ export default { mounted() { this.getList() this.getLossList() + this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/out.vue b/klp-ui/src/views/wms/report/template/out.vue index f9bfe699..af1631a1 100644 --- a/klp-ui/src/views/wms/report/template/out.vue +++ b/klp-ui/src/views/wms/report/template/out.vue @@ -44,6 +44,7 @@ 查询 导出 + 列设置 @@ -56,40 +57,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 产出明细配置 + + + @@ -101,7 +76,8 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; - +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { name: 'OutTemplate', @@ -112,6 +88,8 @@ export default { MemoInput, MutiSelect, WarehouseSelect, + ColumnsSetting, + CoilTable, }, props: { baseQueryParams: { @@ -147,6 +125,8 @@ export default { const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00` const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00` return { + activeColumnConfig: 'coil-report-output', + settingVisible: false, list: [], queryParams: { pageNum: 1, @@ -173,6 +153,8 @@ export default { '2019583429955104769', '2019583137616310273', ], + + outputColumns: [], } }, watch: { @@ -200,6 +182,14 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + }, + // 统一查询入口 + handleQuery() { + this.getList() + }, getList() { this.loading = true Promise.all([ @@ -242,6 +232,10 @@ export default { }, `materialCoil_${new Date().getTime()}.xlsx`) }, }, + mounted() { + this.getList() + this.loadColumns() + } } diff --git a/klp-ui/src/views/wms/report/template/team.vue b/klp-ui/src/views/wms/report/template/team.vue index 14142aab..70e7dd29 100644 --- a/klp-ui/src/views/wms/report/template/team.vue +++ b/klp-ui/src/views/wms/report/template/team.vue @@ -49,6 +49,7 @@ 查询 导出产出钢卷 导出消耗钢卷 + 列设置 @@ -85,71 +86,20 @@ - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 投入明细配置 + 产出明细配置 + + + @@ -163,6 +113,8 @@ import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { calcSummary, calcAbSummary, calcTeamSummary } from "@/views/wms/report/js/calc"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { name: 'TeamTemplate', @@ -172,7 +124,9 @@ export default { CoilNo, MemoInput, MutiSelect, - WarehouseSelect + WarehouseSelect, + ColumnsSetting, + CoilTable, }, props: { actionTypes: { @@ -209,6 +163,8 @@ export default { return { activeTab: 'loss', + activeColumnConfig: 'coil-report-loss', + settingVisible: false, list: [], lossList: [], queryParams: { @@ -238,7 +194,10 @@ export default { '2019583429955104769', '2019583137616310273' ], - getDayTimeRange + getDayTimeRange, + + lossColumns: [], + outputColumns: [], }; }, watch: { @@ -277,6 +236,11 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + }, handleQuery() { this.getList(); this.getLossList(); @@ -386,6 +350,7 @@ export default { mounted() { this.getList(); this.getLossList(); + this.loadColumns(); } }; diff --git a/klp-ui/src/views/wms/report/template/year.vue b/klp-ui/src/views/wms/report/template/year.vue index de632f85..ae74bbb9 100644 --- a/klp-ui/src/views/wms/report/template/year.vue +++ b/klp-ui/src/views/wms/report/template/year.vue @@ -39,6 +39,7 @@ 查询 导出产出钢卷 导出消耗钢卷 + 列设置 @@ -73,73 +74,20 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 投入明细配置 + 产出明细配置 + + + @@ -155,6 +103,8 @@ import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; +import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; +import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; export default { name: 'YearTemplate', @@ -165,6 +115,8 @@ export default { MemoInput, MutiSelect, WarehouseSelect, + ColumnsSetting, + CoilTable, }, props: { actionTypes: { @@ -214,6 +166,8 @@ export default { return { activeTab: 'loss', + activeColumnConfig: 'coil-report-loss', + settingVisible: false, list: [], lossList: [], queryParams: { @@ -242,7 +196,10 @@ export default { '2019583429955104769', '2019583137616310273', ], - getDayTimeRange // 挂载时间范围生成函数 + getDayTimeRange, // 挂载时间范围生成函数 + + lossColumns: [], + outputColumns: [], } }, watch: { @@ -264,6 +221,11 @@ export default { } }, methods: { + // 加载列设置 + loadColumns() { + this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || [] + this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || [] + }, // 日期变更处理:更新开始/结束时间 handleDateChange(date) { if (!date) return @@ -381,6 +343,7 @@ export default { mounted() { this.getList() this.getLossList() + this.loadColumns() } }