| | |
| | | <el-form :inline="true" :model="query" class="mb-2"> |
| | | <el-form-item label="产品大类"> |
| | | <el-input |
| | | v-model="query.productName" |
| | | v-model="query.parentName" |
| | | placeholder="输入产品大类" |
| | | clearable |
| | | :disabled="Boolean(props.fixedProductName)" |
| | |
| | | }); |
| | | |
| | | const query = reactive({ |
| | | productName: "", |
| | | parentName: "", |
| | | model: "", |
| | | }); |
| | | |
| | |
| | | } |
| | | |
| | | function onReset() { |
| | | query.productName = props.fixedProductName ? props.fixedProductName : ""; |
| | | query.parentName = props.fixedProductName ? props.fixedProductName : ""; |
| | | query.model = ""; |
| | | page.pageNum = 1; |
| | | loadData(); |
| | |
| | | try { |
| | | multipleSelection.value = []; // 翻页/搜索后清空选择更符合预期 |
| | | const res: any = await productModelList({ |
| | | productName: query.productName.trim(), |
| | | parentName: query.parentName.trim(), |
| | | model: query.model.trim(), |
| | | current: page.pageNum, |
| | | size: page.pageSize, |
| | |
| | | watch(() => props.modelValue, (visible) => { |
| | | if (visible) { |
| | | multipleSelection.value = []; |
| | | // 只有传了 fixedProductName 才启用“固定大类筛选”的特殊逻辑,其它场景保持原行为不变 |
| | | // 只有传了 fixedProductName 才启用"固定大类筛选"的特殊逻辑,其它场景保持原行为不变 |
| | | if (props.fixedProductName) { |
| | | query.productName = props.fixedProductName; |
| | | query.parentName = props.fixedProductName; |
| | | page.pageNum = 1; |
| | | loadData(); |
| | | } |