数据请求

This commit is contained in:
余同学 2024-08-13 10:47:05 +08:00
parent 3d36f659b8
commit d67293dc4d
1 changed files with 22 additions and 4 deletions

View File

@ -33,11 +33,10 @@
>
</el-form-item>
</el-form>
<el-tabs v-model="activeName" @tab-click="$refs.oTable.reload()">
<el-tab-pane label="出售中" name="出售中"></el-tab-pane>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="在售" name="在售"></el-tab-pane>
<el-tab-pane label="仓库中" name="仓库中"></el-tab-pane>
<el-tab-pane label="已售罄" name="已售罄"></el-tab-pane>
<el-tab-pane label="警戒库存" name="警戒库存"></el-tab-pane>
<el-tab-pane label="折扣" name="折扣"></el-tab-pane>
</el-tabs>
<div class="mb-2">
<el-button type="primary" size="small" @click="addProduct"
@ -62,6 +61,7 @@ export default {
user: "",
region: "",
},
productFilterType: "SALE",
};
},
methods: {
@ -75,6 +75,10 @@ export default {
pageNumber: pageNo,
pageSize: pageSize,
},
productFilterType: this.productFilterType,
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId,
productQuerySortParam: [],
})
.then((res) => {
console.log(res);
@ -87,6 +91,20 @@ export default {
this.$refs.oTable.complete(false);
});
},
handleClick() {
switch (this.activeName) {
case "在售":
this.productFilterType = "SALE";
break;
case "仓库中":
this.productFilterType = "WAREHOUSE";
break;
case "折扣":
this.productFilterType = "DISCOUNT";
break;
}
this.$refs.oTable.reload();
},
},
computed: {
tableCols() {