扫码:切换到对应仓库tab后,将货位号填入搜索框触发前端过滤

This commit is contained in:
97694732@qq.com 2026-06-04 17:40:56 +08:00
parent 9357474966
commit 856f19fd28

View File

@ -1610,7 +1610,7 @@ export default {
const raw = this.scanPopupRaw
if (whCode && locCode) {
// NS##a5-4
// NS##a5-4 tab
const whIdx = this.popupWarehouseList.findIndex(w => {
const code = (w.code || '').toLowerCase()
const name = (w.name || '').toLowerCase()
@ -1618,15 +1618,22 @@ export default {
return code === search || name === search || code.includes(search)
})
if (whIdx !== -1) {
await this.loadPopupLocations(this.popupWarehouseList[whIdx].id, false, locCode)
//
this.popupActiveWhIndex = whIdx
this.popupSelectedWh = this.popupWarehouseList[whIdx]
if (this.popupLocationList.length > 0) {
this.popupSelectedLoc = this.popupLocationList[0]
this.popupSelectedLoc = null
this.popupLocationSearch = ''
uni.showToast({ title: '已匹配仓库' + whCode + ' 货位:' + this.popupLocationList[0].code, icon: 'success' })
await this.loadPopupLocations(this.popupWarehouseList[whIdx].id)
//
this.popupLocationSearch = locCode
//
if (this.filteredLocationList.length === 1) {
this.popupSelectedLoc = this.filteredLocationList[0]
uni.showToast({ title: '已匹配 仓库' + whCode + ' 货位:' + this.filteredLocationList[0].code, icon: 'success' })
} else if (this.filteredLocationList.length > 1) {
uni.showToast({ title: '已切换到仓库' + whCode + ',找到' + this.filteredLocationList.length + '个匹配货位', icon: 'none' })
} else {
uni.showToast({ title: '已切换仓库' + whCode + ',但未找到货位' + locCode, icon: 'none' })
uni.showToast({ title: '已切换仓库' + whCode + ',但未找到匹配货位', icon: 'none' })
}
} else {
uni.showToast({ title: '未找到仓库: ' + whCode, icon: 'none' })