feat: 首页全局搜索支持按 SKU 查库位——采购/半成品/成品库存纳入搜索并显示库位
This commit is contained in:
@ -268,6 +268,8 @@ const getBadgeType = (type: string) => {
|
||||
const map: Record<string, string> = {
|
||||
'material': 'success',
|
||||
'stock_buy': 'primary',
|
||||
'stock_semi': 'warning',
|
||||
'stock_product': 'info',
|
||||
'bom': 'warning'
|
||||
}
|
||||
return map[type] || 'info'
|
||||
@ -313,6 +315,14 @@ const handleSearchSelect = (item: any) => {
|
||||
path: '/bom',
|
||||
query: { keyword: item.title }
|
||||
})
|
||||
} else if (item.type === 'stock_semi' || item.type === 'stock_product' || item.type === 'stock_buy') {
|
||||
// 库存命中:弹出该条记录的库位,便于快速定位(采购库仍保留跳库存页)
|
||||
const loc = item.extra?.warehouse_location || '-'
|
||||
if (item.type === 'stock_buy') {
|
||||
router.push({ path: '/inventory/buy', query: { keyword: item.title } })
|
||||
} else {
|
||||
ElMessage.success(`【${item.title}】库位:${loc}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user