From 91eff371b57cdb377b0f296b8a146a412ac793d1 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 15 Dec 2025 16:07:29 +0800 Subject: [PATCH] =?UTF-8?q?2025-12-15=20=E8=BF=87=E7=AB=99=E9=87=87?= =?UTF-8?q?=E9=9B=86-=E3=80=8B=E8=BD=A6=E9=97=B4=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0->=E5=BC=82=E5=B8=B8=E6=88=AA=E5=8D=B7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com_abnormal_continue_roll.vue | 8 ++-- .../modules/yieldReport/com_separate_roll.vue | 47 +++++++++++-------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/views/modules/yieldReport/com_abnormal_continue_roll.vue b/src/views/modules/yieldReport/com_abnormal_continue_roll.vue index de6a003..b430f92 100644 --- a/src/views/modules/yieldReport/com_abnormal_continue_roll.vue +++ b/src/views/modules/yieldReport/com_abnormal_continue_roll.vue @@ -15,9 +15,9 @@ max-height="150" @row-dblclick="selectRollNo" highlight-current-row> - + - + @@ -27,12 +27,12 @@ - + - + diff --git a/src/views/modules/yieldReport/com_separate_roll.vue b/src/views/modules/yieldReport/com_separate_roll.vue index 5985d6c..4efb7e9 100644 --- a/src/views/modules/yieldReport/com_separate_roll.vue +++ b/src/views/modules/yieldReport/com_separate_roll.vue @@ -456,7 +456,7 @@ export default { async init(scheduleData, operatorData) { // 设置标记,防止初始化过程中触发handleRowCountChange this.isLoadingCachedData = true; - + //初始化参数 this.scheduleData = scheduleData; //初始化操作员对象 @@ -490,15 +490,15 @@ export default { this.$refs.rollQty && this.$refs.rollQty.focus(); }); this.titleCon = this.labels.componentTitle;//重置标题 - + // 查询是否有缓存的换班结转数据(等待完成) await this.loadCachedShiftChangeData(); - + // 如果没有缓存数据,初始化空白行 if (!this.hasCachedData) { this.initRowDataList(); } - + // 取消标记 this.isLoadingCachedData = false; }, @@ -511,29 +511,29 @@ export default { orderNo: this.scheduleData.orderNo, seqNo: parseInt(this.scheduleData.seqNo) || 0 }; - + console.log('查询缓存数据参数:', params); - + const {data} = await getUnprocessedShiftChangeData(params); - + console.log('查询缓存数据结果:', data); - + if (data && data.code === 0 && data.data && data.data.length > 0) { // 有缓存数据,恢复到界面 this.hasCachedData = true; this.cachedDataCount = data.count; - + const cachedList = data.data; - + console.log('缓存数据列表:', cachedList); - + // 恢复排数和卷数 if (cachedList.length > 0) { this.pageData.rowCount = cachedList[0].rowCount || 0; this.pageData.rollCount = cachedList[0].rollCount || 0; this.pageData.fixture = cachedList[0].fixtureNo || ''; } - + // 恢复行数据列表 this.rowDataList = cachedList.map(item => ({ rowNumber: item.rowBumber, @@ -545,12 +545,12 @@ export default { totalQty: (Number(item.goodQty) || 0) + (Number(item.defectQty) || 0), remark: item.remark || '' })); - + // 保存缓存的原始数据(用于产量报告时校验) this.cachedRowDataList = JSON.parse(JSON.stringify(this.rowDataList)); - + console.log('恢复后的行数据:', this.rowDataList); - + this.$message.info(`已加载上次换班结转的缓存数据(${this.cachedDataCount}条)`); } // 如果没有缓存数据,不做任何处理,由init方法负责初始化 @@ -559,7 +559,7 @@ export default { // 加载失败时不做处理,由init方法负责初始化 } }, - + // 计算良率 calculateYieldRate(goodQty, defectQty) { const totalQty = goodQty + defectQty; @@ -751,7 +751,7 @@ export default { // 确认框 try { - await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告(不打印)并保存缓存数据。', '提示', { + await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告。', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -761,13 +761,14 @@ export default { } try { - // ========== 第一步:执行产量报告(不打印)========== + // ========== 第一步:执行产量报告 ========== // 计算分卷 const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount); const remainingRows = this.pageData.rowCount % this.pageData.rollCount; let currentRowIndex = 0; let newRollNo = ''; // 用于保存产量报告返回的新卷号 + const allPrintList = []; // 收集所有打印数据 // 循环创建每一卷 for (let rollIndex = 0; rollIndex < this.pageData.rollCount; rollIndex++) { @@ -821,6 +822,8 @@ export default { // 保存返回的新卷号(取最后一个卷的卷号) if (data.printList && data.printList.length > 0) { newRollNo = data.printList[0].rollNo || ''; + // 收集打印数据 + allPrintList.push(...data.printList); } this.$message.success(`第${rollIndex + 1}/${this.pageData.rollCount}卷创建成功`); @@ -873,6 +876,12 @@ export default { if (abnormalData && abnormalData.code === 0) { this.$message.success('异常截卷操作完成!数据已保存。'); + + // ========== 第三步:打印标签(和产量报告一样)========== + if (allPrintList.length > 0) { + await this.printLabelsWithTemplate(allPrintList); + } + // 延时关闭弹窗 setTimeout(() => { this.closeDialog(); @@ -1176,7 +1185,7 @@ export default { for (let i = 0; i < this.cachedRowDataList.length; i++) { const cachedRow = this.cachedRowDataList[i]; const currentRow = this.rowDataList[i]; - + if (currentRow) { // 校验良品数不能小于缓存值 if ((currentRow.goodQty || 0) < (cachedRow.goodQty || 0)) {