fix:待入库>0时可切换货位但不可切换仓库

This commit is contained in:
ShenQiLun 2026-06-29 11:15:12 +08:00
parent c3b3a83716
commit 42f445b44f

View File

@ -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)"
>
<text class="wh-tab-text">{{ w.name }}</text>
</view>
@ -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;