From 0551cf878a00de615aa1c7b4a34e14aa179c3b79 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Wed, 29 Oct 2025 16:39:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production-inbound/inboundRegister.vue | 29 ++++++++++++++++-- .../sales-return/sales-return-inbound.vue | 30 ++++++++++++++++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src/views/modules/production-inbound/inboundRegister.vue b/src/views/modules/production-inbound/inboundRegister.vue index 4d38f54..b7ff2f7 100644 --- a/src/views/modules/production-inbound/inboundRegister.vue +++ b/src/views/modules/production-inbound/inboundRegister.vue @@ -87,8 +87,11 @@ + + + - + Auto Report of Operation @@ -353,7 +356,8 @@ export default { wdr: '*', engChgLevel: '1', ifsAutoReport: false, // Auto Report of Operation - ifsSimplifiedMaterial: true // Simplified Material Check默认选中 + ifsSimplifiedMaterial: true, // Simplified Material Check默认选中 + height: this.parseHeightFromPartNo(row.partNo) // 根据物料编码自动填充高度 }; this.processFlag = 2; } catch (error) { @@ -524,6 +528,7 @@ export default { uom: item.uom, lotSize: item.lotSize, qtyComplete: item.qtyComplete, + height: item.height || null, // 高度(mm) // IFS参数 ifsAutoReport: item.ifsAutoReport ? 'Yes' : 'No', ifsSimplifiedMaterial: item.ifsSimplifiedMaterial ? 'Yes' : 'No', @@ -593,6 +598,26 @@ export default { this.$message.error(`打印失败: ${error.message || error}`) } }, + /** + * 从物料编码中解析高度 + * 如果物料编码格式是 70004479-0030,则高度为30 + * 如果物料编码格式是 70004479,则高度为空 + */ + parseHeightFromPartNo(partNo) { + if (!partNo) return ''; + + // 检查是否包含横杠 + const parts = partNo.split('-'); + if (parts.length >= 2) { + // 取横杠后面的数字部分 + const heightStr = parts[1]; + // 转换为数字,去掉前导0 + const height = parseInt(heightStr, 10); + return isNaN(height) ? '' : height; + } + + return ''; + } }, mounted() { this.$nextTick(() => this.$refs.scanCodeRef.focus()); diff --git a/src/views/modules/sales-return/sales-return-inbound.vue b/src/views/modules/sales-return/sales-return-inbound.vue index 8429a63..05ba0a1 100644 --- a/src/views/modules/sales-return/sales-return-inbound.vue +++ b/src/views/modules/sales-return/sales-return-inbound.vue @@ -145,6 +145,11 @@ + + + + + @@ -398,7 +403,8 @@ export default { uom: row.returnUOM, locationNo: 'AS', batchNo: `${this.scanRmaNo}-${row.rmaLineNo}-1`, - site: this.site + site: this.site, + height: this.parseHeightFromPartNo(row.invPartNo) // 根据物料编码自动填充高度 }; this.processFlag = 2; @@ -535,6 +541,7 @@ export default { batchNo: item.batchNo, locationNo: item.locationNo, warehouseId: this.warehouseId, + height: item.height || null, // 高度(mm) rmaLineNo: item.rmaLineNo, packUnitList: this.handlingUnit.map(hu => ({ code: hu.code, @@ -619,6 +626,27 @@ export default { this.$refs.scanRmaRef.focus(); } }); + }, + + /** + * 从物料编码中解析高度 + * 如果物料编码格式是 70004479-0030,则高度为30 + * 如果物料编码格式是 70004479,则高度为空 + */ + parseHeightFromPartNo(partNo) { + if (!partNo) return ''; + + // 检查是否包含横杠 + const parts = partNo.split('-'); + if (parts.length >= 2) { + // 取横杠后面的数字部分 + const heightStr = parts[1]; + // 转换为数字,去掉前导0 + const height = parseInt(heightStr, 10); + return isNaN(height) ? '' : height; + } + + return ''; } },