fix:待入库>0时可切换货位但不可切换仓库
This commit is contained in:
parent
c3b3a83716
commit
42f445b44f
@ -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
|
||||
}
|
||||
const savedData = tab === 'isbn' ? this.isbnWarehouseData : this.noIsbnWarehouseData
|
||||
this._pendingPreselectWh = savedData ? savedData.warehouseId : null
|
||||
this._pendingPreselectLoc = savedData ? savedData.locationId : null
|
||||
@ -1685,7 +1693,20 @@ export default {
|
||||
confirmWarehousePicker() {
|
||||
if (!this.popupSelectedLoc) return
|
||||
const wh = this.popupWarehouseList[this.popupActiveWhIndex]
|
||||
const whData = {
|
||||
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,
|
||||
@ -1693,13 +1714,15 @@ export default {
|
||||
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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user