From 47e16f5a829149e8cefed66e31bfa2e062496cfd Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 1 Jun 2026 13:33:36 +0800 Subject: [PATCH] =?UTF-8?q?2026-06-01=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/boxManage/boxManage.js | 1 + src/views/modules/boxManage/saleBoxManage.vue | 61 ++++++++++++++----- .../workOrderAlloc/searchWorkOrderAlloc.vue | 1 + 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/api/boxManage/boxManage.js b/src/api/boxManage/boxManage.js index 67e0f63..5bbb392 100644 --- a/src/api/boxManage/boxManage.js +++ b/src/api/boxManage/boxManage.js @@ -13,6 +13,7 @@ export const searchRollForOrderNo= data => createAPI('/boxForNotification/search // 盒清单相关接口 export const searchSoReceiveCasesData = data => createAPI('/boxForNotification/searchSoReceiveCasesData','post',data) +export const searchSoReceiveCasesDataByPage = data => createAPI('/boxForNotification/searchSoReceiveCasesDataByPage','post',data) export const deleteSoReceiveCasesData = data => createAPI('/boxForNotification/deleteSoReceiveCasesData','post',data) export const validateAndScanCaseRoll = data => createAPI('/boxForNotification/validateAndScanCaseRoll','post',data) export const saveCaseRollList = data => createAPI('/boxForNotification/saveCaseRollList','post',data) diff --git a/src/views/modules/boxManage/saleBoxManage.vue b/src/views/modules/boxManage/saleBoxManage.vue index bbdeaf4..312093b 100644 --- a/src/views/modules/boxManage/saleBoxManage.vue +++ b/src/views/modules/boxManage/saleBoxManage.vue @@ -189,9 +189,10 @@ @@ -463,6 +464,7 @@ import pallet from "./com_saleBoxManage_pallet.vue" import { searchRollForOrderNo, searchSoReceiveCasesData, + searchSoReceiveCasesDataByPage, deleteSoReceiveCasesData, validateAndScanCaseRoll, saveCaseRollList, @@ -512,7 +514,9 @@ export default { dataListLoading: false, activeName: 'cases', // 盒清单相关数据 - casesList: [], + casesPageData: [], + casesTotal: 0, + casesDataLoading: false, casesStatistics: { boxCountCases: 0, // 盒标签张数 boxCountRolls: 0, // 卷标签张数 @@ -884,12 +888,6 @@ export default { exportName: '销售出库单'+this.dayjs().format('YYYYMMDDHHmmss'), } }, - computed: { - casesPagedList() { - const start = (this.casesPageIndex - 1) * this.casesPageSize - return this.casesList.slice(start, start + this.casesPageSize) - } - }, /*组件*/ components: { @@ -1059,25 +1057,54 @@ export default { sizeChangeCasesHandle(val) { this.casesPageSize = val this.casesPageIndex = 1 + this.refreshCasesTable(false) }, // 扫描装盒分页 - 当前页变更 currentChangeCasesHandle(val) { this.casesPageIndex = val + this.refreshCasesTable(false) }, // ===== 盒清单相关方法 ===== - refreshCasesTable(){ + refreshCasesTable(resetPage = true){ + if (resetPage) { + this.casesPageIndex = 1 + } + // 无当前出库单时不触发查询,避免不必要的大数据渲染 + if (!this.currentRow || !this.currentRow.orderNo) { + this.casesDataLoading = false + this.casesTotal = 0 + this.casesPageIndex = 1 + this.casesPageData = [] + this.selectedCaseRecords = [] + this.casesStatistics.boxCountCases = 0 + this.casesStatistics.boxCountRolls = 0 + this.casesStatistics.totalQty = 0 + return + } let templateData = { site: this.currentRow.site, buNo: this.currentRow.buNo, notifyNo: this.currentRow.orderNo, + page: this.casesPageIndex, + limit: this.casesPageSize } - searchSoReceiveCasesData(templateData).then(({data}) => { - this.casesList = data.rows || [] - this.casesPageIndex = 1 - // 更新统计数据 - 从列表第一条记录中获取 - if (data.rows && data.rows.length > 0) { - const firstRecord = data.rows[0] + this.casesDataLoading = true + searchSoReceiveCasesDataByPage(templateData).then(({data}) => { + const pageData = data.page || {} + const rows = pageData.list || [] + this.casesPageData = rows + this.casesTotal = pageData.totalCount || 0 + this.casesPageIndex = pageData.currPage || this.casesPageIndex + this.selectedCaseRecords = [] + this.$nextTick(() => { + if (this.$refs.caseTable && typeof this.$refs.caseTable.clearSelection === 'function') { + this.$refs.caseTable.clearSelection() + } + }) + // 更新统计数据 - 从当前页第一条记录中获取(统计值在每一行都相同) + if (rows.length > 0) { + const firstRecord = rows[0] this.casesStatistics.boxCountCases = firstRecord.boxCountCases || 0 this.casesStatistics.boxCountRolls = firstRecord.boxCountRolls || 0 this.casesStatistics.totalQty = firstRecord.totalQty || 0 @@ -1086,6 +1113,8 @@ export default { this.casesStatistics.boxCountRolls = 0 this.casesStatistics.totalQty = 0 } + }).finally(() => { + this.casesDataLoading = false }) }, diff --git a/src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderAlloc.vue b/src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderAlloc.vue index f9abc44..bcee060 100644 --- a/src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderAlloc.vue +++ b/src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderAlloc.vue @@ -71,6 +71,7 @@ +