Commit 0e99484e authored by 黄奎's avatar 黄奎

国内国际机票统计修改

parent 20684036
<style> <style>
@import url('../../assets/css/domestic/OrderDataStati.css'); @import url('../../assets/css/domestic/OrderDataStati.css');
</style> </style>
<template> <template>
<div class="page_OrderDataStati"> <div class="page_OrderDataStati">
...@@ -15,6 +16,11 @@ ...@@ -15,6 +16,11 @@
<span class="margin_left_15">总实际利润 <i>¥{{allRealProfit}}</i></span> <span class="margin_left_15">总实际利润 <i>¥{{allRealProfit}}</i></span>
</div> </div>
<div class="_input"> <div class="_input">
<el-select v-model="IsInter" size="mini" @change="getDataMonth">
<el-option :key="-1" label="全部" :value="-1"></el-option>
<el-option :key="0" label="国内机票" :value="0"></el-option>
<el-option :key="1" label="国际机票" :value="1"></el-option>
</el-select>
<el-select v-model="Year" size="mini" @change="getDataMonth"> <el-select v-model="Year" size="mini" @change="getDataMonth">
<el-option v-for="item in yearList" :key="item" :label="item" :value="item"></el-option> <el-option v-for="item in yearList" :key="item" :label="item" :value="item"></el-option>
</el-select> </el-select>
...@@ -37,6 +43,11 @@ ...@@ -37,6 +43,11 @@
<span class="margin_left_15">总实际利润 <i>¥{{allRealProfitYear}}</i></span> <span class="margin_left_15">总实际利润 <i>¥{{allRealProfitYear}}</i></span>
</div> </div>
<div class="_input"> <div class="_input">
<el-select v-model="IsInters" size="mini" @change="getDataYear">
<el-option :key="-1" label="全部" :value="-1"></el-option>
<el-option :key="0" label="国内机票" :value="0"></el-option>
<el-option :key="1" label="国际机票" :value="1"></el-option>
</el-select>
<el-select v-model="YearS" size="mini" @change="getDataYear"> <el-select v-model="YearS" size="mini" @change="getDataYear">
<el-option v-for="item in yearList" :key="item" :label="item" :value="item"></el-option> <el-option v-for="item in yearList" :key="item" :label="item" :value="item"></el-option>
</el-select> </el-select>
...@@ -50,48 +61,53 @@ ...@@ -50,48 +61,53 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return{ return {
Year:new Date().getFullYear(),
Month:new Date().getMonth()+1, Year: new Date().getFullYear(),
date:new Date().getDate(), Month: new Date().getMonth() + 1,
YearS:new Date().getFullYear(), date: new Date().getDate(),
MonthS:'', IsInter:-1,//月统计[0-国内,1-国际]
clientHeight:'', YearS: new Date().getFullYear(),
yearList:[], MonthS: '',
MonthList:[], IsInters:-1,//年统计[0-国内,1-国际]
dayList:[], clientHeight: '',
allRealProfit:0, yearList: [],
allProfit:0, MonthList: [],
allRealProfitYear:0, dayList: [],
allProfitYear:0, allRealProfit: 0,
allProfit: 0,
allRealProfitYear: 0,
allProfitYear: 0,
} }
},created(){ },
this.clientHeight = (document.documentElement.clientHeight - 300)/2; created() {
let count = this.Year-(this.Year-8); this.clientHeight = (document.documentElement.clientHeight - 300) / 2;
this.yearList.push(2018); let count = this.Year - (this.Year - 8);
for(let i = 1;i<=count;i++){ for (let i = 0; i <= count; i++) {
this.yearList.push(this.Year-i); this.yearList.push(this.Year - i);
} }
},mounted(){ },
mounted() {
this.getDataMonth(); this.getDataMonth();
this.getDataYear(); this.getDataYear();
},methods:{ },
getDataMonth(){ methods: {
this.dayList =[]; getDataMonth() {
this.dayList = [];
let msg = { let msg = {
Year:this.Year, Year: this.Year,
Month:this.Month Month: this.Month
} }
this.apipost('Domestic_Ticket_post_GetProfitList',msg,r=>{ this.apipost('Domestic_Ticket_post_GetProfitList', msg, r => {
if(r.data.resultCode==1){ if (r.data.resultCode == 1) {
let data = r.data.data; let data = r.data.data;
let ProfitList = []; let ProfitList = [];
let RealProfitList = []; let RealProfitList = [];
let allProfit = 0; let allProfit = 0;
let allRealProfit = 0; let allRealProfit = 0;
data.forEach(y=>{ data.forEach(y => {
this.dayList.push(y.Day); this.dayList.push(y.Day);
ProfitList.push(y.Profit); ProfitList.push(y.Profit);
RealProfitList.push(y.RealProfit); RealProfitList.push(y.RealProfit);
...@@ -100,21 +116,21 @@ export default { ...@@ -100,21 +116,21 @@ export default {
}) })
this.allProfit = allProfit; this.allProfit = allProfit;
this.allRealProfit = allRealProfit; this.allRealProfit = allRealProfit;
this.chartsMap(ProfitList,RealProfitList); this.chartsMap(ProfitList, RealProfitList);
}else{} } else {}
},null) }, null)
}, },
chartsMap(ProfitList,RealProfitList){ // 画饼 chartsMap(ProfitList, RealProfitList) { // 画饼
var then = this; var then = this;
let myChart = this.$echarts.init(document.getElementById('chartsMap')); let myChart = this.$echarts.init(document.getElementById('chartsMap'));
myChart.setOption({ myChart.setOption({
title: { title: {
left: 'left', left: 'left',
textStyle:{ textStyle: {
fontWeight:'bold', fontWeight: 'bold',
fontSize:14, fontSize: 14,
color:'#333333', color: '#333333',
height:'30px' height: '30px'
}, },
padding: [ padding: [
20, // 上 20, // 上
...@@ -146,50 +162,53 @@ export default { ...@@ -146,50 +162,53 @@ export default {
type: 'category', type: 'category',
axisLine: { axisLine: {
show: false, show: false,
lineStyle:{ lineStyle: {
width:1 width: 1
} }
}, },
axisLabel:{}, axisLabel: {},
axisTick:false, axisTick: false,
data: then.dayList, data: then.dayList,
}, },
grid: { grid: {
x:25, x: 25,
y:60, y: 60,
x2:5, x2: 5,
y2:20, y2: 20,
containLabel: true containLabel: true
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
data:['10','20','30','40','50','60','70','80','90','100'], data: ['10', '20', '30', '40', '50', '60', '70', '80', '90', '100'],
axisLine: {show: false}, axisLine: {
axisTick:false, show: false
splitLine:{ },
show:false axisTick: false,
splitLine: {
show: false
}, },
scale: true, scale: true,
minInterval:1, minInterval: 1,
type: 'value', type: 'value',
axisLabel:{formatter:'{value} CNY'} axisLabel: {
formatter: '{value} CNY'
}
}, },
series: [ series: [{
{
name: '预期利润', name: '预期利润',
type: 'line', type: 'line',
smooth:false, smooth: false,
data:ProfitList, data: ProfitList,
lineStyle:{ lineStyle: {
width:2, width: 2,
color:'#0099F7', color: '#0099F7',
}, },
itemStyle:{ itemStyle: {
borderWidth:2, borderWidth: 2,
color:'#0099F7' color: '#0099F7'
}, },
symbol:'none', symbol: 'none',
areaStyle:{ areaStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
...@@ -197,9 +216,11 @@ export default { ...@@ -197,9 +216,11 @@ export default {
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [{
offset: 0, color:'rgba(230,230,230,0)' // 0% 处的颜色 offset: 0,
color: 'rgba(230,230,230,0)' // 0% 处的颜色
}, { }, {
offset: 1, color:'rgba(230,230,230,0)' // 100% 处的颜色 offset: 1,
color: 'rgba(230,230,230,0)' // 100% 处的颜色
}], }],
globalCoord: false // 缺省为 false globalCoord: false // 缺省为 false
} }
...@@ -208,18 +229,18 @@ export default { ...@@ -208,18 +229,18 @@ export default {
{ {
name: '实际利润', name: '实际利润',
type: 'line', type: 'line',
smooth:false, smooth: false,
data: RealProfitList, data: RealProfitList,
lineStyle:{ lineStyle: {
width:2, width: 2,
color:'#32DBBE', color: '#32DBBE',
}, },
itemStyle:{ itemStyle: {
borderWidth:2, borderWidth: 2,
color:'#32DBBE' color: '#32DBBE'
}, },
symbol:'none', symbol: 'none',
areaStyle:{ areaStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
...@@ -227,31 +248,34 @@ export default { ...@@ -227,31 +248,34 @@ export default {
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [{
offset: 0, color:'rgba(230,230,230,0)' // 0% 处的颜色 offset: 0,
color: 'rgba(230,230,230,0)' // 0% 处的颜色
}, { }, {
offset: 1, color:'rgba(230,230,230,0)' // 100% 处的颜色 offset: 1,
color: 'rgba(230,230,230,0)' // 100% 处的颜色
}], }],
globalCoord: false // 缺省为 false globalCoord: false // 缺省为 false
} }
} }
} }
] ]
},true) }, true)
}, },
getDataYear(){ getDataYear() {
this.MonthList=[]; this.MonthList = [];
let msg = { let msg = {
Year:this.YearS, Year: this.YearS,
Month:'' Month: '',
IsInter:this.IsInters
} }
this.apipost('Domestic_Ticket_post_GetProfitList',msg,r=>{ this.apipost('Domestic_Ticket_post_GetProfitList', msg, r => {
if(r.data.resultCode==1){ if (r.data.resultCode == 1) {
let data = r.data.data; let data = r.data.data;
let ProfitList = []; let ProfitList = [];
let RealProfitList = []; let RealProfitList = [];
let allProfit = 0; let allProfit = 0;
let allRealProfit = 0; let allRealProfit = 0;
data.forEach(y=>{ data.forEach(y => {
this.MonthList.push(y.Month); this.MonthList.push(y.Month);
ProfitList.push(y.Profit); ProfitList.push(y.Profit);
RealProfitList.push(y.RealProfit); RealProfitList.push(y.RealProfit);
...@@ -260,23 +284,23 @@ export default { ...@@ -260,23 +284,23 @@ export default {
}) })
this.allProfitYear = allProfit; this.allProfitYear = allProfit;
this.allRealProfitYear = allRealProfit; this.allRealProfitYear = allRealProfit;
this.chartsMap2(ProfitList,RealProfitList); this.chartsMap2(ProfitList, RealProfitList);
}else{ } else {
} }
},null) }, null)
}, },
chartsMap2(ProfitList,RealProfitList){ // 画饼 chartsMap2(ProfitList, RealProfitList) { // 画饼
var then = this; var then = this;
let myChart = this.$echarts.init(document.getElementById('chartsMapYear')); let myChart = this.$echarts.init(document.getElementById('chartsMapYear'));
myChart.setOption({ myChart.setOption({
title: { title: {
left: 'left', left: 'left',
textStyle:{ textStyle: {
fontWeight:'bold', fontWeight: 'bold',
fontSize:14, fontSize: 14,
color:'#333333', color: '#333333',
height:'30px' height: '30px'
}, },
padding: [ padding: [
20, // 上 20, // 上
...@@ -308,49 +332,52 @@ export default { ...@@ -308,49 +332,52 @@ export default {
type: 'category', type: 'category',
axisLine: { axisLine: {
show: false, show: false,
lineStyle:{ lineStyle: {
width:1 width: 1
} }
}, },
axisLabel:{}, axisLabel: {},
axisTick:false, axisTick: false,
data: then.MonthList, data: then.MonthList,
}, },
grid: { grid: {
x:25, x: 25,
y:60, y: 60,
x2:5, x2: 5,
y2:20, y2: 20,
containLabel: true containLabel: true
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
axisLine: {show: false}, axisLine: {
axisTick:false, show: false
splitLine:{ },
show:false axisTick: false,
splitLine: {
show: false
}, },
scale: true, scale: true,
minInterval:1, minInterval: 1,
type: 'value', type: 'value',
axisLabel:{formatter:'{value} CNY',} , axisLabel: {
formatter: '{value} CNY',
}, },
series: [ },
{ series: [{
name: '预期利润', name: '预期利润',
type: 'line', type: 'line',
smooth:false, smooth: false,
data:ProfitList, data: ProfitList,
lineStyle:{ lineStyle: {
width:2, width: 2,
color:'#0099F7', color: '#0099F7',
}, },
itemStyle:{ itemStyle: {
borderWidth:2, borderWidth: 2,
color:'#0099F7' color: '#0099F7'
}, },
symbol:'none', symbol: 'none',
areaStyle:{ areaStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
...@@ -358,9 +385,11 @@ export default { ...@@ -358,9 +385,11 @@ export default {
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [{
offset: 0, color:'rgba(230,230,230,0)' // 0% 处的颜色 offset: 0,
color: 'rgba(230,230,230,0)' // 0% 处的颜色
}, { }, {
offset: 1, color:'rgba(230,230,230,0)' // 100% 处的颜色 offset: 1,
color: 'rgba(230,230,230,0)' // 100% 处的颜色
}], }],
globalCoord: false // 缺省为 false globalCoord: false // 缺省为 false
} }
...@@ -369,18 +398,18 @@ export default { ...@@ -369,18 +398,18 @@ export default {
{ {
name: '实际利润', name: '实际利润',
type: 'line', type: 'line',
smooth:false, smooth: false,
data: RealProfitList, data: RealProfitList,
lineStyle:{ lineStyle: {
width:2, width: 2,
color:'#32DBBE', color: '#32DBBE',
}, },
itemStyle:{ itemStyle: {
borderWidth:2, borderWidth: 2,
color:'#32DBBE' color: '#32DBBE'
}, },
symbol:'none', symbol: 'none',
areaStyle:{ areaStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
...@@ -388,17 +417,19 @@ export default { ...@@ -388,17 +417,19 @@ export default {
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [{
offset: 0, color:'rgba(230,230,230,0)' // 0% 处的颜色 offset: 0,
color: 'rgba(230,230,230,0)' // 0% 处的颜色
}, { }, {
offset: 1, color:'rgba(230,230,230,0)' // 100% 处的颜色 offset: 1,
color: 'rgba(230,230,230,0)' // 100% 处的颜色
}], }],
globalCoord: false // 缺省为 false globalCoord: false // 缺省为 false
} }
} }
} }
] ]
},true) }, true)
}, },
} }
} }
</script> </script>
\ No newline at end of file
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