feat: 重构全局搜索框为复合条件选择,支持按名称、俗名、规格进行精准查杂

This commit is contained in:
dxc
2026-03-11 13:37:52 +08:00
parent e224a07a47
commit b1cc280a71
12 changed files with 156 additions and 65 deletions

View File

@ -17,15 +17,22 @@
<el-input
v-model="queryParams.keyword"
placeholder="请输入名称、规格搜索..."
placeholder="请输入搜索关键字"
class="filter-item-input"
clearable
@input="handleInputSearch"
@clear="fetchData"
@keyup.enter="fetchData"
style="width: 200px;"
style="width: 280px;"
>
<template #prefix><el-icon><Search /></el-icon></template>
<template #prepend>
<el-select v-model="queryParams.searchField" style="width: 90px">
<el-option label="全部" value="all" />
<el-option label="名称" value="name" />
<el-option label="规格" value="spec" />
<el-option label="条码" value="barcode" />
<el-option label="批号" value="batch_number" />
</el-select>
</template>
</el-input>
<el-input
@ -771,6 +778,7 @@ const queryParams = reactive({
page: 1,
pageSize: 50,
keyword: '',
searchField: 'all',
sku: '',
category: '',
material_type: '',
@ -1277,6 +1285,7 @@ const loadWarehouseTree = async () => {
const resetQuery = () => {
queryParams.keyword = ''
queryParams.searchField = 'all'
queryParams.sku = ''
queryParams.category = ''
queryParams.material_type = ''