diff --git a/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue b/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue index d709601..fbf4582 100644 --- a/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue +++ b/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue @@ -244,7 +244,8 @@ this.filteredProducts = keyword ? this.products.filter(p => { // 只基于产品名称过滤,且确保是产品数据 - return p.productName && p.productName.toLowerCase().includes(keyword) + return (p.productName && p.productName.toLowerCase().includes(keyword)) + || p?.specification?.toLowerCase()?.includes(keyword) }) : [...this.products]; }, @@ -254,8 +255,10 @@ const keyword = this.rawMaterialSearchKeyword.trim().toLowerCase(); this.filteredRawMaterials = keyword ? this.rawMaterials.filter(m => { + console.log(m.specification) // 只基于原材料名称过滤,且确保是原材料数据 - return m.rawMaterialName && m.rawMaterialName.toLowerCase().includes(keyword) + return (m.rawMaterialName && m.rawMaterialName.toLowerCase().includes(keyword)) + || m?.specification?.toLowerCase()?.includes(keyword) }) : [...this.rawMaterials]; },