From a25a90ffbf665708555f44fca71413572976b4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Mon, 19 Jan 2026 09:21:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms):=20=E9=87=8D=E6=9E=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=BA=93=E4=BD=8D=E9=80=89=E6=8B=A9=E4=B8=BA=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E5=B9=B6=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将仓库选择组件替换为支持多选的el-select组件 - 使用warehouseQueryMap和warehouseIds动态生成查询参数 - 优化数据获取逻辑,使用flatMap处理多仓库查询结果 --- klp-ui/src/views/wms/report/zha.vue | 141 ++++++++++++++++++--------- klp-ui/src/views/wms/report/zinc.vue | 80 ++++++++++----- 2 files changed, 150 insertions(+), 71 deletions(-) diff --git a/klp-ui/src/views/wms/report/zha.vue b/klp-ui/src/views/wms/report/zha.vue index 57d4fb04..994b6e03 100644 --- a/klp-ui/src/views/wms/report/zha.vue +++ b/klp-ui/src/views/wms/report/zha.vue @@ -19,8 +19,11 @@ @keyup.enter.native="handleQuery" /> - + + + + num.toString().padStart(2, '0') const now = new Date() // 当前本地北京时间 @@ -148,6 +151,40 @@ export default { itemManufacturer: '', }, loading: false, + warehouseIds: [ + '1988150099140866050', + '1988150263284953089', + '1988150545175736322', + '1988150150521090049', + ], + warehouseOptions: [ + { label: '酸连轧成品库', value: '1988150099140866050' }, + { label: '镀锌原料库', value: '1988150263284953089' }, + { label: '脱脂原料库', value: '1988150545175736322' }, + { label: '酸连轧纵剪分条原料库', value: '1988150150521090049' }, + ], + warehouseQueryMap: { + '1988150099140866050': { + selectType: 'product', + createBy: 'suanzhakuguan', + warehouseId: '1988150099140866050' + }, + '1988150263284953089': { + selectType: 'raw_material', + createBy: 'suanzhakuguan', + warehouseId: '1988150263284953089' + }, + '1988150545175736322': { + selectType: 'raw_material', + createBy: 'suanzhakuguan', + warehouseId: '1988150545175736322' + }, + '1988150150521090049': { + selectType: 'raw_material', + createBy: 'suanzhakuguan', + warehouseId: '1988150150521090049' + }, + } } }, computed: { @@ -166,49 +203,61 @@ export default { methods: { getList() { this.loading = true - Promise.all([ - // 酸连轧成品库 - listCoilWithIds({ - ...this.queryParams, - pageSize: 9999, - pageNum: 1, - // dataType: 1, - createBy: 'suanzhakuguan', - warehouseId: '1988150099140866050' - }), - // 镀锌原料库 - listCoilWithIds({ - ...this.queryParams, - pageSize: 9999, - pageNum: 1, - // dataType: 1, - selectType: 'raw_material', - createBy: 'suanzhakuguan', - warehouseId: '1988150263284953089' - }), - // 脱脂原料库 - listCoilWithIds({ - ...this.queryParams, - pageSize: 9999, - pageNum: 1, - // dataType: 1, - selectType: 'raw_material', - createBy: 'suanzhakuguan', - warehouseId: '1988150545175736322' - }), - // 酸连轧纵剪分条原料库1988150150521090049 - listCoilWithIds({ - ...this.queryParams, - pageSize: 9999, - pageNum: 1, - // dataType: 1, - selectType: 'raw_material', - createBy: 'suanzhakuguan', - warehouseId: '1988150150521090049' - }), - ]).then(([res1, res2, res3, res4]) => { - console.log(res1, res2, res3, res4) - const list = [...res1.rows, ...res2.rows, ...res3.rows, ...res4.rows] + Promise.all( + this.warehouseIds.map(warehouseId => { + const params = this.warehouseQueryMap[warehouseId] + return listCoilWithIds({ + ...this.queryParams, + pageSize: 9999, + pageNum: 1, + // dataType: 1, + ...params + }) + }) + // [ + // // 酸连轧成品库 + // listCoilWithIds({ + // ...this.queryParams, + // pageSize: 9999, + // pageNum: 1, + // // dataType: 1, + // createBy: 'suanzhakuguan', + // warehouseId: '1988150099140866050' + // }), + // // 镀锌原料库 + // listCoilWithIds({ + // ...this.queryParams, + // pageSize: 9999, + // pageNum: 1, + // // dataType: 1, + // selectType: 'raw_material', + // createBy: 'suanzhakuguan', + // warehouseId: '1988150263284953089' + // }), + // // 脱脂原料库 + // listCoilWithIds({ + // ...this.queryParams, + // pageSize: 9999, + // pageNum: 1, + // // dataType: 1, + // selectType: 'raw_material', + // createBy: 'suanzhakuguan', + // warehouseId: '1988150545175736322' + // }), + // // 酸连轧纵剪分条原料库1988150150521090049 + // listCoilWithIds({ + // ...this.queryParams, + // pageSize: 9999, + // pageNum: 1, + // // dataType: 1, + // selectType: 'raw_material', + // createBy: 'suanzhakuguan', + // warehouseId: '1988150150521090049' + // }), + // ] + ).then((resList) => { + console.log(resList) + const list = resList.flatMap(res => res.rows) // 按照createTime 降序排序 this.list = list.sort( (a, b) => new Date(b.createTime) - new Date(a.createTime) diff --git a/klp-ui/src/views/wms/report/zinc.vue b/klp-ui/src/views/wms/report/zinc.vue index 04698203..850f2d5b 100644 --- a/klp-ui/src/views/wms/report/zinc.vue +++ b/klp-ui/src/views/wms/report/zinc.vue @@ -19,8 +19,11 @@ @keyup.enter.native="handleQuery" /> - + + + + { - console.log(res1, res2) - const list = [...res1.rows, ...res2.rows] + ...this.warehouseIds.map(warehouseId => listCoilWithIds({ + ...this.queryParams, + ...this.warehouseQueryMap[warehouseId], + pageSize: 9999, + pageNum: 1, + // dataType: 1, + })) + // // 镀锌成品库 + // listCoilWithIds({ + // ...this.queryParams, + // pageSize: 9999, + // pageNum: 1, + // // dataType: 1, + // selectType: 'product', + // // createBy: 'suanzhakuguan', + // warehouseId: '1988150323162836993' + // }), + // // 镀锌纵剪分条原料库 + // listCoilWithIds({ + // ...this.queryParams, + // pageSize: 9999, + // pageNum: 1, + // // dataType: 1, + // selectType: 'raw_material', + // // createBy: 'suanzhakuguan', + // warehouseId: '1988150487185289217' + // }), + ]).then((resList) => { + console.log(resList) + const list = resList.flatMap(res => res.rows) // 按照createTime 降序排序 this.list = list.sort( (a, b) => new Date(b.createTime) - new Date(a.createTime)