mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 17:05:54 +08:00
commit message
This commit is contained in:
120
manager/src/views/statistics/goods.vue
Normal file
120
manager/src/views/statistics/goods.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<div>
|
||||
<Affix :offset-top="100">
|
||||
<Card class="card fixed-bottom">
|
||||
<affixTime :closeShop="true" @selected="clickBreadcrumb"/>
|
||||
</Card>
|
||||
</Affix>
|
||||
<Card class="card">
|
||||
|
||||
<Tabs @on-click="handleClickType">
|
||||
<TabPane label="热门商品订单数量" name="NUM">
|
||||
<Table :columns="columns" :data="data"></Table>
|
||||
</TabPane>
|
||||
<TabPane label="热门商品订单金额" name="PRICE">
|
||||
<Table :columns="columns" :data="data"></Table>
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import memberLayout from "@/views/member/list";
|
||||
import * as API_Goods from "@/api/goods";
|
||||
import affixTime from "@/views/lili-components/affix-time";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
affixTime,
|
||||
memberLayout,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
year: "",
|
||||
params: {
|
||||
searchType: "LAST_SEVEN",
|
||||
year: "",
|
||||
month: "",
|
||||
shopId: "",
|
||||
type: "NUM"
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
},
|
||||
{
|
||||
title: "销售数量",
|
||||
key: "num",
|
||||
},
|
||||
{
|
||||
title: "销售金额",
|
||||
key: "price",
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price)
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClickType(name) {
|
||||
this.params.type = name;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
clickBreadcrumb(item, index) {
|
||||
let callback = item;
|
||||
let type = this.params.type;
|
||||
this.params = {...callback};
|
||||
this.params.type = type;
|
||||
this.getData();
|
||||
},
|
||||
getData() {
|
||||
Promise.all([API_Goods.goodsStatistics(this.params)]).then((res) => {
|
||||
if (res[0].result) {
|
||||
this.data = res[0].result;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.page-col {
|
||||
text-align: right;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.order-col {
|
||||
display: flex;
|
||||
|
||||
> div {
|
||||
margin-right: 8px;
|
||||
padding: 16px;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.tips {
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user