From f7320eaa464827ca4a29b5f4b49dce7fd8a91cde Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Thu, 4 Sep 2025 16:30:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=AE=BE=E5=A4=87=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=A2=9E=E5=8A=A0=E4=BA=A7=E7=BA=BF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/sparePartsLedger/index.vue | 27 ++++++++++++- .../device/sparepartsInOutStorage/index.vue | 40 +++++++++++++++---- src/views/wms/equipment/index.vue | 10 +++++ 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/src/views/device/sparePartsLedger/index.vue b/src/views/device/sparePartsLedger/index.vue index a4f02d3..154da55 100644 --- a/src/views/device/sparePartsLedger/index.vue +++ b/src/views/device/sparePartsLedger/index.vue @@ -44,6 +44,27 @@ style="width: 150px" /> + + + + + + + + @@ -232,10 +234,11 @@ @@ -374,6 +377,8 @@ export default { delFlag: null, factoryCode: null, }, + // 日期范围 + dateRange: [], // 表单参数 form: {}, // 表单校验 @@ -412,12 +417,32 @@ export default { /** 查询备品备件出入库列表 */ getList() { this.loading = true; - listSparepartsInOutStorage(this.queryParams).then((response) => { + listSparepartsInOutStorage(this.addDateRange(this.queryParams, this.dateRange)).then((response) => { this.sparepartsInOutStorageList = response.rows; this.total = response.total; this.loading = false; }); }, + getSummaries(param) { + const { columns, data } = param; + const sums = []; + + // 初始化所有列 + columns.forEach((column, index) => { + if (index === 1) { + sums[index] = '总数'; // 第一列显示固定文本 + } else if (column.property === 'amount') { + // 计算amount列合计 + const total = data.reduce((sum, item) => { + const val = Number(item.amount); + return sum + (isNaN(val) ? 0 : val); + }, 0); + sums[index] = total + ' 个'; + } + }); + + return sums; + }, // 取消按钮 cancel() { this.open = false; @@ -452,6 +477,7 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + this.dateRange = []; this.resetForm("queryForm"); this.handleQuery(); }, diff --git a/src/views/wms/equipment/index.vue b/src/views/wms/equipment/index.vue index 026bec2..ac294e9 100644 --- a/src/views/wms/equipment/index.vue +++ b/src/views/wms/equipment/index.vue @@ -689,6 +689,14 @@ /> + + + + + @@ -1383,6 +1391,7 @@ export default { equipmentCategory: null, factoryWorkshop: null, sapAsset: null, + dh: null }, queryEquipmentHeadParams: { pageNum: 1, @@ -1609,6 +1618,7 @@ export default { sapName: null, factoryWorkshop: null, sapAsset: null, + dh: null, }; this.resetForm("form"); },