feat: 新增 Odoo 风格物料管理视图及相关路由,优化成品入库逻辑
This commit is contained in:
@ -50,6 +50,12 @@ const routes: Array<RouteRecordRaw> = [
|
||||
name: 'MaterialBase',
|
||||
component: () => import('@/views/material/list.vue'),
|
||||
meta: { title: '基础信息', icon: 'Box' }
|
||||
},
|
||||
{
|
||||
path: 'buyOdoo',
|
||||
name: 'BuyOdoo',
|
||||
component: () => import('@/views/material/buyOdoo.vue'),
|
||||
meta: { title: '物料管理(Odoo式)', icon: 'Grid' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
1548
inventory-web/src/views/material/buyOdoo.vue
Normal file
1548
inventory-web/src/views/material/buyOdoo.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -1036,7 +1036,9 @@ const fetchMaterialSuggestions = (query: string, cb: (results: any[]) => void) =
|
||||
const safeQuery = rawQuery.replace(/[\x00-\x1F\x7F-\x9F\u200B-\u200D\uFEFF]/g, '').trim()
|
||||
searchLoading.value = true
|
||||
searchMaterialBase(safeQuery).then((res: any) => {
|
||||
cb((res.data?.items || []).map((i: any) => ({ ...i, isHistory: false })))
|
||||
const items = res.data?.items || res.data || []
|
||||
const formatted = items.map((i: any) => ({ ...i, name: i.name || i.material_name, isHistory: false }))
|
||||
cb(formatted)
|
||||
}).catch(() => cb([])).finally(() => { searchLoading.value = false })
|
||||
}
|
||||
|
||||
@ -1061,6 +1063,7 @@ const onMaterialSelected = (item: any) => {
|
||||
form.material_type = item.type
|
||||
form.category = item.category
|
||||
form.unit = item.unit
|
||||
materialNameInput.value = item.name
|
||||
// 切换物料时清空已选 BOM,防止脏数据
|
||||
form.bom_code = ''
|
||||
form.bom_version = ''
|
||||
|
||||
Reference in New Issue
Block a user