|
|
|
@ -97,9 +97,10 @@ |
|
|
|
style="width: 220px; margin-right: 12px" |
|
|
|
style="width: 220px; margin-right: 12px" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable |
|
|
|
|
|
|
|
:filter-method="handleFilter" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in modelOption" |
|
|
|
v-for="(item, index) in filteredList" |
|
|
|
:key="index" |
|
|
|
:key="index" |
|
|
|
:label="item.name" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id" |
|
|
|
:value="item.id" |
|
|
|
@ -622,6 +623,7 @@ export default { |
|
|
|
tempId: 0, |
|
|
|
tempId: 0, |
|
|
|
projectOptions: [], //检验项目列表 |
|
|
|
projectOptions: [], //检验项目列表 |
|
|
|
standardList: [], //检验标准列表 |
|
|
|
standardList: [], //检验标准列表 |
|
|
|
|
|
|
|
filteredList:[], |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
@ -671,10 +673,31 @@ export default { |
|
|
|
this.rankList = res.data.data; |
|
|
|
this.rankList = res.data.data; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
handleFilter(keyword){ |
|
|
|
|
|
|
|
// 1. 无关键词时,显示全部数据 |
|
|
|
|
|
|
|
if (!keyword) { |
|
|
|
|
|
|
|
this.filteredList = [...this.originList] |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2. 统一转为小写,实现不区分大小写过滤 |
|
|
|
|
|
|
|
const lowerKeyword = keyword.toLowerCase() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3. 同时匹配两个字段:name 或 pinyin 包含关键词即保留 |
|
|
|
|
|
|
|
this.filteredList = this.originList.filter(item => { |
|
|
|
|
|
|
|
// 字段1:姓名(转小写) |
|
|
|
|
|
|
|
const matchName = item.name.toLowerCase().includes(lowerKeyword) |
|
|
|
|
|
|
|
// 字段2:拼音(转小写) |
|
|
|
|
|
|
|
const matchPinyin = item.modelNameStr.toLowerCase().includes(lowerKeyword) |
|
|
|
|
|
|
|
// 只要有一个字段匹配,就保留该选项 |
|
|
|
|
|
|
|
return matchName || matchPinyin |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 工艺模板列表 |
|
|
|
// 工艺模板列表 |
|
|
|
async getModelList() { |
|
|
|
async getModelList() { |
|
|
|
await getModelList().then(res => { |
|
|
|
await getModelList().then(res => { |
|
|
|
this.modelOption = res.data.data; |
|
|
|
this.modelOption = res.data.data; |
|
|
|
|
|
|
|
this.filteredList = [...this.modelOption] |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 工序列表查询 |
|
|
|
// 工序列表查询 |
|
|
|
|