feat: add category and type filters to product search
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -16,22 +16,51 @@
|
||||
|
||||
<el-input
|
||||
v-model="queryParams.keyword"
|
||||
placeholder="🔍 搜索物料 / SN / 工单..."
|
||||
placeholder="请输入名称或规格"
|
||||
class="filter-item-input"
|
||||
clearable
|
||||
@clear="fetchData"
|
||||
@keyup.enter="fetchData"
|
||||
style="width: 260px;"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<template #prefix><el-icon><Search /></el-icon></template>
|
||||
</el-input>
|
||||
|
||||
<el-select
|
||||
v-model="queryParams.category"
|
||||
placeholder="类别"
|
||||
class="filter-item-select"
|
||||
clearable
|
||||
filterable
|
||||
@change="fetchData"
|
||||
style="width: 160px;"
|
||||
popper-class="long-dropdown"
|
||||
>
|
||||
<el-option v-for="item in categoryOptions" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
|
||||
<el-select
|
||||
v-model="queryParams.material_type"
|
||||
placeholder="类型"
|
||||
class="filter-item-select"
|
||||
clearable
|
||||
filterable
|
||||
@change="fetchData"
|
||||
style="width: 160px;"
|
||||
popper-class="long-dropdown"
|
||||
>
|
||||
<el-option v-for="item in typeOptions" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
|
||||
<el-button type="primary" plain class="search-btn" @click="fetchData">搜索</el-button>
|
||||
<el-button class="reset-btn" @click="resetQuery">重置</el-button>
|
||||
|
||||
<el-select
|
||||
v-model="queryParams.statuses"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="状态筛选"
|
||||
style="width: 220px;"
|
||||
style="width: 200px; margin-left: 10px;"
|
||||
@change="fetchData"
|
||||
>
|
||||
<el-option label="在库" value="在库" />
|
||||
@ -465,7 +494,7 @@ const dialogStatus = ref<'create' | 'update'>('create')
|
||||
const tableData = ref([])
|
||||
const total = ref(0)
|
||||
const formRef = ref()
|
||||
const queryParams = reactive({ page: 1, pageSize: 100, keyword: '', statuses: ['在库', '借库'], company: '' })
|
||||
const queryParams = reactive({ page: 1, pageSize: 100, keyword: '', category: '', material_type: '', statuses: ['在库', '借库'], company: '' })
|
||||
const categoryOptions = ref<string[]>([])
|
||||
const typeOptions = ref<string[]>([])
|
||||
const companyOptions = ref<string[]>([]) // [新增]
|
||||
@ -1007,6 +1036,11 @@ onMounted(() => {
|
||||
.filter-item-input { /* 宽度已在行内样式控制 */ }
|
||||
.action-btn { font-weight: 500; }
|
||||
|
||||
.search-btn { background-color: #E6F1FC; border-color: #A3D0FD; color: #409EFF; }
|
||||
.search-btn:hover { background-color: #409EFF; border-color: #409EFF; color: #fff; }
|
||||
.reset-btn { background-color: #fff; border: 1px solid #dcdfe6; }
|
||||
.reset-btn:hover { border-color: #c0c4cc; color: #606266; }
|
||||
|
||||
/* [新增] 修复弹窗最小高度 */
|
||||
.dialog-scroll-container { min-height: 450px; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user