diff --git a/inventory-web/src/views/bom/BomManage.vue b/inventory-web/src/views/bom/BomManage.vue
index c9ca406..461e33b 100644
--- a/inventory-web/src/views/bom/BomManage.vue
+++ b/inventory-web/src/views/bom/BomManage.vue
@@ -24,15 +24,16 @@
-
-
-
-
+
+
+
+
+
{{ row.bom_no }}
@@ -60,7 +61,6 @@
-
@@ -313,7 +313,9 @@ const fetchParentSuggestions = (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 || [])
+ const items = res.data?.items || res.data || []
+ const formatted = items.map((i: any) => ({ ...i, name: i.name || i.material_name }))
+ cb(formatted)
}).catch(() => cb([])).finally(() => { searchLoading.value = false })
}
@@ -324,6 +326,7 @@ const onParentClear = () => {
const onParentSelected = (item: any) => {
form.parent_id = item.id
+ parentNameInput.value = item.name || item.material_name || ''
if (item.spec) {
form.bom_no = item.spec.split('/')[0].trim()
} else {
@@ -336,7 +339,9 @@ const fetchChildSuggestions = (row: any, query: string, cb: (results: any[]) =>
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 || [])
+ const items = res.data?.items || res.data || []
+ const formatted = items.map((i: any) => ({ ...i, name: i.name || i.material_name }))
+ cb(formatted)
}).catch(() => cb([])).finally(() => { searchLoading.value = false })
}