2023-11-25 09:04:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="center" >
|
2023-12-18 17:42:52 +08:00
|
|
|
|
|
2023-11-25 09:04:19 +08:00
|
|
|
|
<div class="left-box">
|
|
|
|
|
<div class="but-box">
|
2023-12-18 17:42:52 +08:00
|
|
|
|
<div class="hui"><span class="title-hei">油品销售额</span> </div>
|
2023-12-14 15:26:00 +08:00
|
|
|
|
|
2023-11-25 09:04:19 +08:00
|
|
|
|
<div >
|
2023-12-18 17:42:52 +08:00
|
|
|
|
<el-radio-group @change="getOilSales()" v-model="radio" size="mini">
|
|
|
|
|
<el-radio-button label="7天"></el-radio-button>
|
|
|
|
|
<el-radio-button label="15天"></el-radio-button>
|
|
|
|
|
<el-radio-button label="30天"></el-radio-button>
|
2023-11-25 09:04:19 +08:00
|
|
|
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
|
|
|
|
|
<div><span>{{radio}}交易金额总计:</span><span class="title-lan">{{sum}}</span> <span>元</span></div>
|
|
|
|
|
<div v-loading="oilLoading" id="ccccc" style="width: 100%; height: 400px;"></div>
|
2023-11-25 09:04:19 +08:00
|
|
|
|
</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-25 09:04:19 +08:00
|
|
|
|
<div class="right-box">
|
|
|
|
|
<div class="title-hei">员工销售排行</div>
|
|
|
|
|
<div class="four-box">
|
|
|
|
|
<div class="pm">排名</div>
|
|
|
|
|
<div class="mc">员工名称</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
<div class="xs">储值卡销售额</div>
|
|
|
|
|
<div class="xs">屯油卡销售额</div>
|
|
|
|
|
<div class="xs">油品销售额</div>
|
|
|
|
|
<div class="xse">总销售额(万)</div>
|
2023-11-25 09:04:19 +08:00
|
|
|
|
</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
<template v-loading="employeLoading" >
|
|
|
|
|
<div class="four-boxx" v-for="(item,index) in employeList" :key="index" >
|
2023-11-25 09:04:19 +08:00
|
|
|
|
<div class="pm">{{index+1}}</div>
|
|
|
|
|
<div class="dis">
|
|
|
|
|
<div class="touxiang">
|
|
|
|
|
<img src="../../../src/assets/images/avatar.png" class="touxiang">
|
|
|
|
|
</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
<div class="name">{{item.realName}}</div>
|
2023-11-25 09:04:19 +08:00
|
|
|
|
</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
<div class="xs">{{item.cardSum}}</div>
|
|
|
|
|
<div class="xs">{{item.fuelSum}}</div>
|
|
|
|
|
<div class="xs">{{item.oilSum}}</div>
|
|
|
|
|
<div class="xse">{{item.totalSum}}</div>
|
2023-11-25 09:04:19 +08:00
|
|
|
|
</div>
|
2023-12-18 17:42:52 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
2023-11-25 09:04:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import echarts from "echarts";
|
2023-12-18 17:42:52 +08:00
|
|
|
|
import { employeeSalesApi,oilSalesApi } from "@/api/indexStatistics";
|
|
|
|
|
|
|
|
|
|
import { parseTime } from "@/utils/fuint"
|
2023-11-25 09:04:19 +08:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "centenrindex",
|
|
|
|
|
data(){
|
|
|
|
|
return{
|
2023-12-18 17:42:52 +08:00
|
|
|
|
radio:'7天',
|
|
|
|
|
oilLoading:false,
|
|
|
|
|
employeLoading:false,
|
|
|
|
|
// 时间轴
|
|
|
|
|
timeDate:[],
|
|
|
|
|
oilDate:[],
|
|
|
|
|
sum:0,
|
|
|
|
|
employeList:{
|
|
|
|
|
|
|
|
|
|
}
|
2023-11-25 09:04:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2023-12-18 17:42:52 +08:00
|
|
|
|
async mounted() {
|
|
|
|
|
await this.getOilSales()
|
|
|
|
|
// this.initChart()
|
|
|
|
|
},
|
|
|
|
|
async created() {
|
|
|
|
|
// this.getOilSales()
|
|
|
|
|
this.getEmployeList()
|
2023-11-25 09:04:19 +08:00
|
|
|
|
},
|
|
|
|
|
methods:{
|
2023-12-18 17:42:52 +08:00
|
|
|
|
// 油品销售
|
|
|
|
|
async getOilSales() {
|
|
|
|
|
this.oilLoading = true
|
|
|
|
|
await oilSalesApi().then(res=>{
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.timeDate=[]
|
|
|
|
|
this.oilDate=[]
|
|
|
|
|
this.sum = 0
|
|
|
|
|
let dataList = res.data
|
|
|
|
|
if (this.radio === '7天' && dataList.length >= 7) {
|
|
|
|
|
dataList = dataList.slice(0, 7);
|
|
|
|
|
} else if (this.radio === '15天' && dataList.length >= 15) {
|
|
|
|
|
dataList = dataList.slice(0, 15);
|
|
|
|
|
} else if (this.radio === '30天' && dataList.length >= 30) {
|
|
|
|
|
dataList = dataList.slice(0, 30);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dataList.forEach(element => {
|
|
|
|
|
this.timeDate.push(parseTime(element.sales_day,'{y}-{m}-{d}'));
|
|
|
|
|
this.oilDate.push(element.total_sales);
|
|
|
|
|
this.sum+=element.total_sales
|
|
|
|
|
});
|
|
|
|
|
this.initChart()
|
|
|
|
|
// this.changeLabel();
|
|
|
|
|
this.oilLoading = false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getEmployeList() {
|
|
|
|
|
this.employeLoading = true
|
|
|
|
|
employeeSalesApi().then(res=>{
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
if (res.data.length >=10) {
|
|
|
|
|
this.employeList = res.data.slice(0, 10);
|
|
|
|
|
} else {
|
|
|
|
|
this.employeList = res.data
|
|
|
|
|
}
|
|
|
|
|
this.employeLoading = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
changeLabel() {
|
|
|
|
|
if (this.radio === '7天' && this.timeDate.length >= 7) {
|
|
|
|
|
this.timeDate = this.timeDate.slice(0, 7);
|
|
|
|
|
this.oilDate = this.oilDate.slice(0, 7);
|
|
|
|
|
} else if (this.radio === '15天' && this.timeDate.length >= 15) {
|
|
|
|
|
this.timeDate = this.timeDate.slice(0, 15);
|
|
|
|
|
this.oilDate = this.oilDate.slice(0, 15);
|
|
|
|
|
} else if (this.radio === '30天' && this.timeDate.length >= 30) {
|
|
|
|
|
this.timeDate = this.timeDate.slice(0, 30);
|
|
|
|
|
this.oilDate = this.oilDate.slice(0, 30);
|
|
|
|
|
}
|
|
|
|
|
this.initChart()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2023-11-25 09:04:19 +08:00
|
|
|
|
initChart() {
|
2023-12-14 15:26:00 +08:00
|
|
|
|
const chart = echarts.init(document.getElementById('ccccc'))
|
2023-11-25 09:04:19 +08:00
|
|
|
|
|
|
|
|
|
const option = {
|
|
|
|
|
color: [
|
|
|
|
|
'#77A8F9',
|
|
|
|
|
'#86E1BB',
|
|
|
|
|
'#8195F5',
|
|
|
|
|
],
|
|
|
|
|
dataset: {
|
|
|
|
|
source: [
|
|
|
|
|
['product', '#92', '#95', '#98'],
|
2023-12-14 15:26:00 +08:00
|
|
|
|
|
2023-11-25 09:04:19 +08:00
|
|
|
|
]
|
|
|
|
|
},
|
2023-12-14 15:26:00 +08:00
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
2023-12-18 17:42:52 +08:00
|
|
|
|
// data: ['2023.1.1', '2023.2.1', '2023.3.1', '2023.4.1', '2023.5.1', '2023.6.1', '2023.7.1']
|
|
|
|
|
data: this.timeDate
|
2023-12-14 15:26:00 +08:00
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value'
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
2023-12-18 17:42:52 +08:00
|
|
|
|
data: this.oilDate,
|
2023-12-14 15:26:00 +08:00
|
|
|
|
type: 'line'
|
|
|
|
|
},
|
2023-12-18 17:42:52 +08:00
|
|
|
|
// {
|
|
|
|
|
// data: [210, 230, 264, 318, 235, 247, 160],
|
2023-12-14 15:26:00 +08:00
|
|
|
|
|
|
|
|
|
|
2023-12-18 17:42:52 +08:00
|
|
|
|
// type: 'line'
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// data: [120, 220, 214, 118, 235, 227, 110],
|
|
|
|
|
// type: 'line'
|
|
|
|
|
// }
|
2023-12-14 15:26:00 +08:00
|
|
|
|
]
|
2023-11-25 09:04:19 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
chart.setOption(option)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.center{
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin: 10px auto;
|
|
|
|
|
}
|
|
|
|
|
.left-box{
|
2023-12-14 15:26:00 +08:00
|
|
|
|
width: 49.5%;
|
2023-11-25 09:04:19 +08:00
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
}
|
|
|
|
|
.right-box{
|
2023-12-14 15:26:00 +08:00
|
|
|
|
width: 49.5%;
|
2023-11-25 09:04:19 +08:00
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
height: 455px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.but-box{
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
.hui{
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
.title-hei{
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #1a1a1a;
|
|
|
|
|
}
|
|
|
|
|
.title-lan{
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #4F6EE3;
|
|
|
|
|
}
|
|
|
|
|
.four-box{
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
.four-boxx{
|
|
|
|
|
margin: 10px auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
.touxiang{
|
|
|
|
|
width: 28px;
|
|
|
|
|
height: 28px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background: #00acac;
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.dis{
|
|
|
|
|
width: 30%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.pm{
|
|
|
|
|
width: 10%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
.mc{
|
|
|
|
|
width: 30%;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
.xs{
|
|
|
|
|
width: 30%;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
.xs{
|
|
|
|
|
width: 30%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
.xse{
|
|
|
|
|
width: 30%;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
</style>
|