From 42f445b44f1addfdf4f75ddd850804df6a7dd8f6 Mon Sep 17 00:00:00 2001 From: ShenQiLun <97694732@qq.com> Date: Mon, 29 Jun 2026 11:15:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BE=85=E5=85=A5=E5=BA=93>0=E6=97=B6?= =?UTF-8?q?=E5=8F=AF=E5=88=87=E6=8D=A2=E8=B4=A7=E4=BD=8D=E4=BD=86=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E5=88=87=E6=8D=A2=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/upload.vue | 60 ++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 7c4d811..8620679 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -796,8 +796,8 @@ class="wh-tab" v-for="(w, idx) in popupWarehouseList" :key="w.id" - :class="{ active: popupActiveWhIndex === idx }" - @click="selectPopupWarehouse(idx)" + :class="{ active: popupActiveWhIndex === idx, locked: warehouseLocked }" + @click="warehouseLocked ? null : selectPopupWarehouse(idx)" > {{ w.name }} @@ -1014,6 +1014,7 @@ export default { popupRefreshing: false, _pendingPreselectWh: null, _pendingPreselectLoc: null, + _warehouseLocked: false, // 扫码弹窗 showScanPopup: false, @@ -1098,6 +1099,9 @@ export default { }, computed: { + warehouseLocked() { + return !!(this._warehouseLocked) + }, conditionValue() { const map = { '全新': '100~', @@ -1521,11 +1525,15 @@ export default { // 仓库弹窗 openWarehousePicker(tab) { if (this.pendingCount > 0) { - uni.showToast({ title: '已有待入库商品,请先提交入库再切换仓库', icon: 'none' }) - return + // 已有待入库商品:可切换货位但不可切换仓库 + this.pickerTargetTab = tab + this.showWarehousePicker = true + this._warehouseLocked = true + } else { + this.pickerTargetTab = tab + this.showWarehousePicker = true + this._warehouseLocked = false } - this.pickerTargetTab = tab - this.showWarehousePicker = true const savedData = tab === 'isbn' ? this.isbnWarehouseData : this.noIsbnWarehouseData this._pendingPreselectWh = savedData ? savedData.warehouseId : null this._pendingPreselectLoc = savedData ? savedData.locationId : null @@ -1685,21 +1693,36 @@ export default { confirmWarehousePicker() { if (!this.popupSelectedLoc) return const wh = this.popupWarehouseList[this.popupActiveWhIndex] - const whData = { - warehouseId: wh.id, - warehouseName: wh.name, - warehouseCode: wh.code, - locationId: this.popupSelectedLoc.id, - locationCode: this.popupSelectedLoc.code, - locationName: this.popupSelectedLoc.name + var whData + if (this._warehouseLocked) { + // 锁定模式:只更新货位,不更改仓库 + var oldData = this.pickerTargetTab === 'isbn' ? this.isbnWarehouseData : this.noIsbnWarehouseData + whData = { + warehouseId: oldData ? oldData.warehouseId : wh.id, + warehouseName: oldData ? oldData.warehouseName : wh.name, + warehouseCode: oldData ? oldData.warehouseCode : wh.code, + locationId: this.popupSelectedLoc.id, + locationCode: this.popupSelectedLoc.code, + locationName: this.popupSelectedLoc.name + } + } else { + whData = { + warehouseId: wh.id, + warehouseName: wh.name, + warehouseCode: wh.code, + locationId: this.popupSelectedLoc.id, + locationCode: this.popupSelectedLoc.code, + locationName: this.popupSelectedLoc.name + } } - const areaText = `${wh.name} - ${this.popupSelectedLoc.code}` + const areaText = `${whData.warehouseName} - ${this.popupSelectedLoc.code}` // ISBN 和无 ISBN 货区同步 - this.isbnWarehouseData = whData + this.isbnWarehouseData = JSON.parse(JSON.stringify(whData)) this.isbnSelectedArea = areaText - this.noIsbnWarehouseData = whData + this.noIsbnWarehouseData = JSON.parse(JSON.stringify(whData)) this.noIsbnSelectedArea = areaText this.showWarehousePicker = false + this._warehouseLocked = false }, // 下拉刷新货位列表 @@ -4704,6 +4727,11 @@ picker { font-weight: 600; } +.wh-tab.locked { + opacity: 0.5; + pointer-events: none; +} + /* ========== 仓库货位搜索栏 ========== */ .wh-search-bar { display: flex;