From 78a06a535061f129989344a328e6262ad9b52db4 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 6 May 2026 16:11:36 +0800 Subject: [PATCH] =?UTF-8?q?2026-05-06=20pda=E8=B7=A8=E5=8C=BA=E8=B0=83?= =?UTF-8?q?=E6=8B=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cross-area-transfer/crossAreaTransfer.vue | 120 +++++++++++++++--- .../modules/production/production-return.vue | 2 +- 2 files changed, 103 insertions(+), 19 deletions(-) diff --git a/src/views/modules/cross-area-transfer/crossAreaTransfer.vue b/src/views/modules/cross-area-transfer/crossAreaTransfer.vue index c52550c..092844c 100644 --- a/src/views/modules/cross-area-transfer/crossAreaTransfer.vue +++ b/src/views/modules/cross-area-transfer/crossAreaTransfer.vue @@ -38,7 +38,7 @@
-
+
标签条码 {{ labelInfo.labelCode }} @@ -83,10 +83,13 @@
- -
+ +
- 库位:{{ scanCode }} +
+ {{ listTitle }} + 总数:{{ listTotalQuantity }} +
@@ -97,16 +100,16 @@
标签数量
-
-
{{ index + 1 }}
+
+
{{ currentDisplayLabels.length - index }}
{{ item.labelCode }}
{{ item.partNo }}
{{ item.unit || '-' }}
{{ item.quantity }}
-
+
-

该库位下暂无标签

+

{{ transferMode === 'location' ? '该库位下暂无标签' : '该标签下暂无可调拨标签' }}

@@ -180,10 +183,51 @@ export default { batchNo: '' }, + // 标签模式下,父标签查询命中的多条子标签 + labelMultiLabels: [], + // 库位下的标签列表 locationLabels: [] } }, + computed: { + isLabelMultiMode() { + return this.transferMode === 'label' && this.labelMultiLabels.length > 1 + }, + isListMode() { + return this.transferMode === 'location' || this.isLabelMultiMode + }, + currentDisplayLabels() { + return this.transferMode === 'location' ? this.locationLabels : this.labelMultiLabels + }, + listTitle() { + const scanText = this.scanCode.trim() + return this.transferMode === 'location' ? `库位:${scanText}` : `标签:${scanText}` + }, + listTotalQuantity() { + const total = this.currentDisplayLabels.reduce((sum, item) => { + const qty = Number(item.quantity) + return sum + (Number.isNaN(qty) ? 0 : qty) + }, 0) + + if (Number.isInteger(total)) { + return total + } + + return Number(total.toFixed(6)).toString() + }, + labelSourceLocation() { + if (this.labelInfo.locationId) { + return this.labelInfo.locationId + } + + const uniqueLocations = [...new Set(this.labelMultiLabels.map(item => item.locationId).filter(Boolean))] + return uniqueLocations.length === 1 ? uniqueLocations[0] : '' + }, + labelBuNo() { + return this.labelInfo.buNo || (this.labelMultiLabels[0] && this.labelMultiLabels[0].buNo) || '' + } + }, mounted() { // 聚焦扫描框 this.$nextTick(() => { @@ -264,9 +308,19 @@ export default { const { data } = await getCrossAreaTransferInfo(params) if (data && data.code === 0) { if (this.transferMode === 'label') { - this.labelInfo = data.data || {} - console.log('标签信息:', this.labelInfo) + this.locationLabels = [] + const labelData = data.data || [] + if (Array.isArray(labelData)) { + this.labelMultiLabels = labelData + this.labelInfo = labelData[0] || {} + console.log('标签列表:', this.labelMultiLabels) + } else { + this.labelInfo = labelData + this.labelMultiLabels = [] + console.log('标签信息:', this.labelInfo) + } } else { + this.labelMultiLabels = [] this.locationLabels = data.data || [] console.log('库位标签列表:', this.locationLabels) } @@ -301,7 +355,7 @@ export default { return } // 检查目标库位是否与源库位相同 - if (this.transferMode === 'label' && targetLocation === this.labelInfo.locationId) { + if (this.transferMode === 'label' && this.labelSourceLocation && targetLocation === this.labelSourceLocation) { this.$message.warning('目标库位不能与当前库位相同') if (this.$refs.locationInput) { this.$refs.locationInput.focus(); @@ -322,15 +376,22 @@ export default { this.$message.error('缺少必要参数,请重新登录') return } + const buNo = this.transferMode === 'label' + ? this.labelBuNo + : ((this.locationLabels[0] && this.locationLabels[0].buNo) || '') + if (!buNo) { + this.$message.error('未获取到BU信息,请重新扫描') + return + } try { this.loading = true const params = { scanCode: this.scanCode.trim(), transferMode: this.transferMode, - sourceLocation: this.transferMode === 'label' ? this.scanCode.trim() : this.labelInfo.locationId, + sourceLocation: this.scanCode.trim(), targetLocation: targetLocation, site: site, - buNo: this.transferMode === 'label' ? this.labelInfo.buNo : this.locationLabels[0].buNo, + buNo: buNo, warehouseId: warehouseId, operator: operator } @@ -368,6 +429,7 @@ export default { orderRef2: '', batchNo: '' } + this.labelMultiLabels = [] this.locationLabels = [] this.$nextTick(() => { @@ -517,8 +579,12 @@ export default { /* 信息展示 */ .info-container { flex: 1; + display: flex; + flex-direction: column; padding: 0 16px; margin-bottom: 10px; + min-height: 0; + overflow: hidden; } .info-card { @@ -567,18 +633,25 @@ export default { border-radius: 8px; overflow: hidden; flex: 1; + height: 100%; display: flex; flex-direction: column; - max-height: 410px; + min-height: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); border: 1px solid #f0f0f0; } .location-info { - padding: 6px 8px; + padding: 8px 10px; background: #f8f9fa; border-bottom: 2px solid #17B3A3; - text-align: center; +} + +.location-info-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; } .location-title { @@ -590,21 +663,32 @@ export default { } .location-subtitle { - display: block; color: #666; font-size: 12px; + font-weight: 500; +} + +.location-total { + color: #17B3A3; + font-size: 12px; + font-weight: 600; } .labels-table { flex: 1; display: flex; flex-direction: column; + min-height: 0; } .table-body { flex: 1; overflow-y: auto; - max-height: 360px; + min-height: 0; + padding-bottom: 8px; + box-sizing: border-box; + -webkit-overflow-scrolling: touch; + touch-action: pan-y; } .table-body::-webkit-scrollbar { diff --git a/src/views/modules/production/production-return.vue b/src/views/modules/production/production-return.vue index 153afef..857b57c 100644 --- a/src/views/modules/production/production-return.vue +++ b/src/views/modules/production/production-return.vue @@ -33,7 +33,7 @@ export default { data() { return { buttons: [ - { icon: 'scan', label: '申请单退仓', iconClass: 'purchase', to: 'productionApplicationReturnList', disabled: false }, + { icon: 'scan', label: '申请单退仓', iconClass: 'purchase', to: 'productionApplicationReturnList', disabled: true }, { icon: 'records', label: '直接退仓', iconClass: 'qualified', to: 'productionQualifiedReturn', disabled: false }, ] }