diff --git a/inventory-web/src/views/bom/BomManage.vue b/inventory-web/src/views/bom/BomManage.vue
index 461e33b..60be6df 100644
--- a/inventory-web/src/views/bom/BomManage.vue
+++ b/inventory-web/src/views/bom/BomManage.vue
@@ -10,11 +10,11 @@
placeholder="搜索 编号/名称/规格/子件..."
style="width: 300px; margin-right: 10px;"
clearable
- @clear="fetchBomList"
- @keyup.enter="fetchBomList"
+ @clear="handleSearch"
+ @keyup.enter="handleSearch"
>
-
+
g.category)" size="small" style="margin-right: 6px;">全部展开
@@ -463,13 +463,17 @@ const rules = reactive({
const dialogTitle = ref('新建 BOM')
+const handleSearch = () => {
+ activeCategories.value = [] // 用户主动搜索时重置折叠状态
+ fetchBomList()
+}
+
const fetchBomList = async () => {
loading.value = true
try {
const res = await getBomList({ keyword: searchKeyword.value })
if (res.code === 200) {
bomGroups.value = res.data
- activeCategories.value = []
}
} finally { loading.value = false }
}