diff --git a/inventory-web/src/router/index.ts b/inventory-web/src/router/index.ts index a69da78..cc5cefd 100644 --- a/inventory-web/src/router/index.ts +++ b/inventory-web/src/router/index.ts @@ -50,6 +50,12 @@ const routes: Array = [ 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' } } ] }, diff --git a/inventory-web/src/views/material/buyOdoo.vue b/inventory-web/src/views/material/buyOdoo.vue new file mode 100644 index 0000000..7eba2a5 --- /dev/null +++ b/inventory-web/src/views/material/buyOdoo.vue @@ -0,0 +1,1548 @@ + + + + + \ No newline at end of file diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue index 9f0b489..641b33e 100644 --- a/inventory-web/src/views/stock/inbound/product.vue +++ b/inventory-web/src/views/stock/inbound/product.vue @@ -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 = ''