From 907c0831071c47b9f3e3f01bf187971f974b32b9 Mon Sep 17 00:00:00 2001 From: DXC Date: Fri, 5 Jun 2026 15:35:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20Odoo=20=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E5=8F=8A=E7=9B=B8=E5=85=B3=E8=B7=AF=E7=94=B1=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=88=90=E5=93=81=E5=85=A5=E5=BA=93=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-web/src/router/index.ts | 6 + inventory-web/src/views/material/buyOdoo.vue | 1548 +++++++++++++++++ .../src/views/stock/inbound/product.vue | 5 +- 3 files changed, 1558 insertions(+), 1 deletion(-) create mode 100644 inventory-web/src/views/material/buyOdoo.vue 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 = ''