Skip to content

Commit e60b412

Browse files
committed
优化管理后台的商品分页的查询
1 parent f8375bb commit e60b412

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/views/mall/product/spu/index.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
import {deleteSpu, getSpuPage,} from "@/api/mall/product/spu";
223223
import {getProductCategoryList} from "@/api/mall/product/category";
224224
import {getBrandList} from "@/api/mall/product/brand";
225+
import {ProductSpuStatusEnum} from "@/utils/constants";
225226
226227
export default {
227228
name: "Spu",
@@ -260,7 +261,6 @@ export default {
260261
salesCountMax: null,
261262
marketPriceMin: null,
262263
marketPriceMax: null,
263-
tabStatus: null,
264264
},
265265
};
266266
},
@@ -341,15 +341,17 @@ export default {
341341
// 选中 tab
342342
handleClick(val) {
343343
if (val.name === "all") {
344-
this.queryParams.tabStatus = null;
344+
this.queryParams.status = undefined;
345+
this.queryParams.alarmStock = undefined;
345346
} else if (val.name === "on") {
346-
this.queryParams.tabStatus = 0;
347+
this.queryParams.status = ProductSpuStatusEnum.ENABLE.status;
348+
this.queryParams.alarmStock = undefined;
347349
} else if (val.name === "off") {
348-
this.queryParams.tabStatus = 1;
350+
this.queryParams.status = ProductSpuStatusEnum.DISABLE.status;
351+
this.queryParams.alarmStock = undefined;
349352
} else if (val.name === "remind") {
350-
this.queryParams.tabStatus = 2;
351-
} else {
352-
this.queryParams.tabStatus = null;
353+
this.queryParams.status = undefined;
354+
this.queryParams.alarmStock = true;
353355
}
354356
this.getList();
355357
}

0 commit comments

Comments
 (0)