Commit 2af55f37 authored by zhengke's avatar zhengke

修改

parent 4b2014a1
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: #1D243D; background-color: #1D243D;
font-family: 'MicrosoftYaHei'
} }
.salesGuest .nav{ .salesGuest .nav{
padding: 25px 45px; padding: 25px 45px;
...@@ -68,20 +69,24 @@ ...@@ -68,20 +69,24 @@
.salesTable th,.salesTable td{ .salesTable th,.salesTable td{
height:40px; height:40px;
font-size:12px; font-size:12px;
padding:0 6px;
} }
.salescomSpan{ .salescomSpan{
display:inline-block; display:inline-block;
padding:5px 20px; padding:5px 0;
border-radius: 18px; border-radius: 18px;
color:#fff; color:#fff;
width:100%;
text-align: center;
font-size:15px; font-size:15px;
background-color: #2B314E; background-color: #2B314E;
} }
.salesTable tr:nth-child(even){ .salesTable tr:nth-child(even){
background-color: #252B48; background-color: #252B48;
} }
.salesTable tr:hover{ .salesTable tbody tr:hover{
background-color: #2B314E; background-color: #2B314E!important;
box-shadow: 0px 0px 10px rgba(81,84,99,0.8)!important;/*设置阴影,可以自定义参数*/
} }
.saleSecondTh th{ .saleSecondTh th{
color:#8089B4; color:#8089B4;
...@@ -95,6 +100,9 @@ ...@@ -95,6 +100,9 @@
font-size:12px; font-size:12px;
color:#4BD7AA; color:#4BD7AA;
} }
.saleFirstth{
height:60px!important;
}
</style> </style>
<template> <template>
<div class="salesGuest"> <div class="salesGuest">
...@@ -115,8 +123,9 @@ ...@@ -115,8 +123,9 @@
</div> </div>
<div class="content" > <div class="content" >
<table class="salesTable" style="border-collapse:collapse; border-spacing:0;"> <table class="salesTable" style="border-collapse:collapse; border-spacing:0;">
<thead>
<tr class="saleFirstth"> <tr class="saleFirstth">
<th width="80"><span class="salescomSpan" style="padding:5px 15px;">日期</span></th> <th width="80"><span class="salescomSpan" style="padding:5px 10px;">日期</span></th>
<th colspan="2" v-for="item in companyList"><span class="salescomSpan">{{item.OutBranchName}}</span></th> <th colspan="2" v-for="item in companyList"><span class="salescomSpan">{{item.OutBranchName}}</span></th>
</tr> </tr>
<tr class="saleSecondTh"> <tr class="saleSecondTh">
...@@ -149,6 +158,8 @@ ...@@ -149,6 +158,8 @@
<th>收客人数</th> <th>收客人数</th>
</th> </th>
</tr> </tr>
</thead>
<tbody>
<tr v-for="item in dataList"> <tr v-for="item in dataList">
<td><span style="color:#fff;padding-left:15px;">{{item.month}}</span></td> <td><span style="color:#fff;padding-left:15px;">{{item.month}}</span></td>
<template v-for="subItem in item.List"> <template v-for="subItem in item.List">
...@@ -156,6 +167,7 @@ ...@@ -156,6 +167,7 @@
<td><span class="guestNum">{{subItem.GuestNum}}</span></td> <td><span class="guestNum">{{subItem.GuestNum}}</span></td>
</template> </template>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
...@@ -221,6 +233,7 @@ export default { ...@@ -221,6 +233,7 @@ export default {
} }
} }
}) })
console.log(this.dataList,'datalistt');
} }
}) })
}, },
...@@ -237,7 +250,7 @@ export default { ...@@ -237,7 +250,7 @@ export default {
}, },
//点击跳转 //点击跳转
goSalesMap(){ goSalesMap(){
window.location="http://192.168.0.116:8080/#/salesGuestList" window.location="http://192.168.0.117:8080/#/salesGuestList"
} }
} }
} }
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
.MapIcon { .MapIcon {
/* float:right; */ /* float:right; */
color: #fff; color: #fff;
text-align: right;
/* margin-top:10px; */ /* margin-top:10px; */
} }
.MapIcon span { .MapIcon span {
...@@ -120,6 +121,9 @@ ...@@ -120,6 +121,9 @@
margin-right: 10px; margin-right: 10px;
cursor: pointer; cursor: pointer;
} }
.checkedSpan{
color:#459BC7;
}
</style> </style>
<template> <template>
<div class="salesGuest" v-loading="loading"> <div class="salesGuest" v-loading="loading">
...@@ -172,10 +176,11 @@ ...@@ -172,10 +176,11 @@
</el-row> </el-row>
</div> </div>
<div class="content" > <div class="content" >
<!-- <div class="MapIcon"> <div class="MapIcon">
<span @click="LineMap()">折线图</span> <span @click="getAll()" :class="{'checkedSpan':checkIndex==1}">不限</span>
<span @click="BarMap()">柱状图</span> <span @click="LineMap()" :class="{'checkedSpan':checkIndex==2}">折线图</span>
</div> --> <span @click="BarMap()" :class="{'checkedSpan':checkIndex==3}">柱状图</span>
</div>
<div class="myecharts" ref="myecharts" > <div class="myecharts" ref="myecharts" >
</div> </div>
...@@ -198,7 +203,8 @@ export default { ...@@ -198,7 +203,8 @@ export default {
yearList: [], yearList: [],
Mydatalist: [], Mydatalist: [],
//所有月份 //所有月份
monthList: [] monthList: [],
checkIndex:1,
}; };
}, },
watch: {}, watch: {},
...@@ -209,7 +215,6 @@ export default { ...@@ -209,7 +215,6 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
this.dataList = [];
let url = let url =
"http://47.96.23.199:5001/api/order/get_sale_numandpreferprice_statistics"; "http://47.96.23.199:5001/api/order/get_sale_numandpreferprice_statistics";
this.loading = true; this.loading = true;
...@@ -223,12 +228,16 @@ export default { ...@@ -223,12 +228,16 @@ export default {
x.OutBranchName = x.OutBranchName.replace("印象", ""); x.OutBranchName = x.OutBranchName.replace("印象", "");
}); });
this.getCompany(this.dataList); this.getCompany(this.dataList);
}else{
this.dataList = [];
this.getCompany(this.dataList);
} }
} }
}); });
}, },
//去重获取公司 //去重获取公司
getCompany(dataList) { getCompany(dataList) {
this.Mydatalist=[];
this.companyList = []; this.companyList = [];
this.monthList = []; this.monthList = [];
var obj = {}; var obj = {};
...@@ -281,14 +290,14 @@ export default { ...@@ -281,14 +290,14 @@ export default {
companyArr1.push(obj2); companyArr1.push(obj2);
var tempArray = []; var tempArray = [];
let obj = { let obj = {
name: item.OutBranchName, name: item.name,
type: "bar", type: "bar",
data: item.preferPriceList data: item.preferPriceList
}; };
let objline = { let objline = {
type: "line", type: "line",
symbolSize: 2, symbolSize: 2,
name: item.OutBranchName, name: item.name,
yAxisIndex: 1, yAxisIndex: 1,
hoverAnimation: true, hoverAnimation: true,
smooth: true, smooth: true,
...@@ -298,7 +307,7 @@ export default { ...@@ -298,7 +307,7 @@ export default {
this.Mydatalist.push(obj); this.Mydatalist.push(obj);
this.Mydatalist.push(objline); this.Mydatalist.push(objline);
}); });
this.init(companyArr1); this.init(companyArr1,this.Mydatalist);
}, },
getOtherMonth(branchId, monthStr) { getOtherMonth(branchId, monthStr) {
...@@ -313,7 +322,7 @@ export default { ...@@ -313,7 +322,7 @@ export default {
//点击切换为折现图 //点击切换为折现图
LineMap() { LineMap() {
// let newArr=this.Mydatalist; this.checkIndex=2;
let newArr = JSON.parse(JSON.stringify(this.Mydatalist)); let newArr = JSON.parse(JSON.stringify(this.Mydatalist));
let myArr = []; let myArr = [];
newArr.forEach(x => { newArr.forEach(x => {
...@@ -321,7 +330,6 @@ export default { ...@@ -321,7 +330,6 @@ export default {
myArr.push(x); myArr.push(x);
} }
}); });
this.Mydatalist = myArr;
let companyArr1 = []; let companyArr1 = [];
this.companyList.forEach((item, index) => { this.companyList.forEach((item, index) => {
let obj2 = { let obj2 = {
...@@ -337,10 +345,11 @@ export default { ...@@ -337,10 +345,11 @@ export default {
}; };
companyArr1.push(obj2); companyArr1.push(obj2);
}); });
this.init(companyArr1); this.init(companyArr1,myArr);
}, },
//点击切换为柱状图 //点击切换为柱状图
BarMap() { BarMap() {
this.checkIndex=3;
let newArr = this.Mydatalist; let newArr = this.Mydatalist;
let myArr = []; let myArr = [];
newArr.forEach(x => { newArr.forEach(x => {
...@@ -348,7 +357,6 @@ export default { ...@@ -348,7 +357,6 @@ export default {
myArr.push(x); myArr.push(x);
} }
}); });
this.Mydatalist = myArr;
let companyArr1 = []; let companyArr1 = [];
this.companyList.forEach((item, index) => { this.companyList.forEach((item, index) => {
let obj2 = { let obj2 = {
...@@ -364,9 +372,27 @@ export default { ...@@ -364,9 +372,27 @@ export default {
}; };
companyArr1.push(obj2); companyArr1.push(obj2);
}); });
this.init(companyArr1); this.init(companyArr1,myArr);
},
getAll(){
this.checkIndex=1;
let companyArr1 = [];
this.companyList.forEach((item, index) => {
let obj2 = {
data: [item.OutBranchName],
icon: "circle",
x: index * 5 + 3.5 + "%",
orient: "horizontal",
textStyle: {
//图例文字的样式
color: "#fff",
fontSize: 16
}
};
companyArr1.push(obj2);
});
this.init(companyArr1,this.Mydatalist);
}, },
//获取年份 //获取年份
getYear() { getYear() {
var myDate = new Date(); var myDate = new Date();
...@@ -393,8 +419,7 @@ export default { ...@@ -393,8 +419,7 @@ export default {
} }
}); });
}, },
init(companyArr1) { init(companyArr1,Mydatalist) {
console.log("companyArr1",companyArr1);
var that = this; var that = this;
var myChart = this.$echarts.init(this.$refs.myecharts); var myChart = this.$echarts.init(this.$refs.myecharts);
var option = { var option = {
...@@ -421,14 +446,6 @@ export default { ...@@ -421,14 +446,6 @@ export default {
} }
} }
}, },
// toolbox: {
// feature: {
// dataView: {show: true, readOnly: false},
// magicType: {show: true, type: ['line', 'bar']},
// restore: {show: true},
// saveAsImage: {show: true}
// }
// },
xAxis: { xAxis: {
type: "category", type: "category",
boundaryGap: true, boundaryGap: true,
...@@ -513,7 +530,7 @@ export default { ...@@ -513,7 +530,7 @@ export default {
} }
} }
], ],
series: this.Mydatalist, series: Mydatalist,
color: [ color: [
"#FE7691", "#FE7691",
"#FA219C", "#FA219C",
...@@ -530,6 +547,7 @@ export default { ...@@ -530,6 +547,7 @@ export default {
"#E70000" "#E70000"
] ]
}; };
myChart.clear();
myChart.setOption(option, true); myChart.setOption(option, true);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment