From e3097b0b263479b95f4bb3da6cadc5c78e757ee1 Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Fri, 6 Mar 2026 10:36:04 +0800
Subject: [PATCH] =?UTF-8?q?2026-03-06=20=E4=BC=98=E5=8C=96=E4=BB=93?=
=?UTF-8?q?=E5=BA=93=E7=9B=98=E7=82=B9=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/warehouse/countingReport.vue | 89 +++++++++++++------
1 file changed, 64 insertions(+), 25 deletions(-)
diff --git a/src/views/modules/warehouse/countingReport.vue b/src/views/modules/warehouse/countingReport.vue
index a2b152b..32bbd21 100644
--- a/src/views/modules/warehouse/countingReport.vue
+++ b/src/views/modules/warehouse/countingReport.vue
@@ -197,7 +197,7 @@
- 查询
+ 查询
@@ -205,7 +205,7 @@
标签总数:{{ detailStatistics.totalCount }}
物料总数:{{ detailStatistics.totalQty }}
- 已盘点数:{{ detailStatistics.checkedQty }}
+ 已盘点标签数:{{ detailStatistics.checkedQty }}
@@ -229,7 +229,19 @@
-
+
+
+
+
+
关闭
@@ -337,6 +349,9 @@ export default {
detailFlag: false,
detailLoading: false,
detailList: [],
+ detailPageIndex: 1,
+ detailPageSize: 50,
+ detailTotal: 0,
detailSearchData: {
site: '',
buNo: '',
@@ -346,9 +361,9 @@ export default {
checkedFlag: ''
},
detailStatistics: {
- totalCount: 0, // 标签总数
- totalQty: 0, // 物料总数(所有标签数量总和)
- checkedQty: 0 // 已盘点数(已盘点标签数量总和)
+ totalCount: 0,
+ totalQty: 0,
+ checkedQty: 0
}
}
},
@@ -456,17 +471,17 @@ export default {
this.modalFlag = true
this.modalTitle = '修改盘点任务'
this.modalDisableFlag = true
-
+
// 将逗号分隔的字符串转换为数组
const warehouseIds = row.warehouseId ? row.warehouseId.split(',') : []
const locationIds = row.locationId ? row.locationId.split(',') : []
const partNos = row.partNo ? row.partNo.split(',') : []
-
+
// 构建显示文本(显示名称)
const warehouseDisplay = row.warehouseName || ''
const locationDisplay = row.locationName || ''
const partDisplay = row.partDesc || ''
-
+
this.modalData = {
flag: 'update',
bu: row.site + '_' + row.buNo,
@@ -559,7 +574,7 @@ export default {
this.$refs.modalForm.validate((valid) => {
if (valid) {
this.saveLoading = true
-
+
// 将数组转换为逗号分隔的字符串
const saveData = {
...this.modalData,
@@ -567,7 +582,7 @@ export default {
locationId: this.modalData.locationIds.length > 0 ? this.modalData.locationIds.join(',') : '',
partNo: this.modalData.partNos.length > 0 ? this.modalData.partNos.join(',') : ''
}
-
+
const apiMethod = this.modalData.flag === 'add' ? countingReportSave : countingReportUpdate
apiMethod(saveData).then(({data}) => {
if (data && data.code === 0) {
@@ -669,6 +684,9 @@ export default {
// 查看盘点清单
viewDetail(row) {
this.detailFlag = true
+ this.detailPageIndex = 1
+ this.detailPageSize = 50
+ this.detailTotal = 0
this.detailSearchData = {
site: row.site,
buNo: row.buNo,
@@ -680,16 +698,33 @@ export default {
this.getDetailList()
},
+ // 盘点清单查询按钮(重置页码)
+ detailSearch() {
+ this.detailPageIndex = 1
+ this.getDetailList()
+ },
+
// 获取盘点清单列表
getDetailList() {
this.detailLoading = true
- countingReportDetailList(this.detailSearchData).then(({data}) => {
+ const params = {
+ ...this.detailSearchData,
+ page: this.detailPageIndex,
+ limit: this.detailPageSize
+ }
+ countingReportDetailList(params).then(({data}) => {
if (data && data.code === 0) {
- this.detailList = data.detailList || []
- // 计算统计数据
- this.calculateStatistics()
+ this.detailList = data.page.list || []
+ this.detailTotal = data.page.totalCount || 0
+ // 统计信息来自后端全量聚合,不受分页/查询条件影响
+ if (data.statistics) {
+ this.detailStatistics.totalCount = data.statistics.totalCount || 0
+ this.detailStatistics.totalQty = data.statistics.totalQty || 0
+ this.detailStatistics.checkedQty = data.statistics.checkedQty || 0
+ }
} else {
this.detailList = []
+ this.detailTotal = 0
this.$message.error(data.msg || '查询失败')
}
this.detailLoading = false
@@ -698,13 +733,17 @@ export default {
})
},
- // 计算统计数据
- calculateStatistics() {
- this.detailStatistics.totalCount = this.detailList.length
- this.detailStatistics.totalQty = this.detailList.reduce((sum, item) => sum + (item.rollQty || 0), 0)
- this.detailStatistics.checkedQty = this.detailList
- .filter(item => item.checkedFlag === 'Y')
- .reduce((sum, item) => sum + (item.rollQty || 0), 0)
+ // 盘点清单每页数变化
+ detailSizeChangeHandle(val) {
+ this.detailPageSize = val
+ this.detailPageIndex = 1
+ this.getDetailList()
+ },
+
+ // 盘点清单当前页变化
+ detailCurrentChangeHandle(val) {
+ this.detailPageIndex = val
+ this.getDetailList()
},
// 打开多选对话框
@@ -713,10 +752,10 @@ export default {
this.$message.warning('请先选择BU')
return
}
-
+
const [site, buNo] = this.modalData.bu.split('_')
let selectedIds = []
-
+
if (type === 'warehouse') {
selectedIds = this.modalData.warehouseIds
} else if (type === 'location') {
@@ -724,7 +763,7 @@ export default {
} else if (type === 'part') {
selectedIds = this.modalData.partNos
}
-
+
this.$refs.multiSelectDialog.init(type, site, buNo, selectedIds)
},