Commit 691c7fa2 authored by youjie's avatar youjie

no message

parent 4e28d303
......@@ -6,7 +6,7 @@
<div style="margin-left: 20px;">
<el-tag size="small" effect="dark"
style="margin-right: 5px;cursor: pointer;"
:type="Current==item.ID?'danger':'info'" v-for="(item,index) in types" :key="item.ID"
:type="Current==item.ID?'danger':'info'" v-for="(item,index) in BranchTitles" :key="item.ID"
@click="Current=item.ID,BranchChart()">{{item.Name}}</el-tag>
</div>
......@@ -22,13 +22,15 @@
<script>
export default {
props:['StatisticalData'],
props:['StatisticalData','msgData'],
data() {
return {
MonthList: [],//月份列表
BranchAnalysisData: [],
colorList:['#089bab','#FFA171','#72b8ff','#ff9cc6','#7b78ff','#28cc90','#ee8fff','#5cf2ff','#ff9a00','#4fc4f7','#738eff','#b0edff',
'#E43939','#F79A2C','#FFF60B','#3DD948','#39CAE4','#2C31F1','#7A39E4','#E65FC1','#D0B478','#000000','#BABABA',],
'#E43939','#F79A2C','#FFF60B','#3DD948','#39CAE4','#2C31F1','#7A39E4','#E65FC1','#D0B478','#BABABA',
'rgba(228,57,57,.7)','rgba(247,154,44,.7)','rgba(255,246,11,.7)','rgba(61,217,72,.7)','rgba(57,202,228,.7)','rgba(44,49,241,.7)','rgba(122,57,228,.7)'],
Stocklegend: {},
types:[
{Name: '收入',ID:1},
{Name: '收入占比 %',ID:2},
......@@ -38,6 +40,28 @@ export default {
{Name: '实际利率 %',ID:6},
],
Current: 1,
BranchTitles:[
{Name: '收入',value:'JiPiao',ID:1},
{Name: '占比 %',value:'JiPiaoRate',ID:2},
{Name: '毛利',value:'RoomFee',ID:3},
{Name: '毛利率 %',value:'RommFeeRate',ID:4},
{Name: '实际利润',value:'CarFee',ID:5},
{Name: '实际利率 %',value:'CarFeeRate',ID:6},
{Name: '联运收入',value:'MealFee',ID:7},
{Name: '营业利润',value:'MealFeeRate',ID:8},
{Name: '管销费用',value:'TicketFee',ID:9},
{Name: '净利润',value:'TicketFeeRate',ID:10},
],
BranchDataObj: {
name: '',
type: 'line',
showSymbol: false,
smooth: true,
symbolSize: 1,
stack: 'Total',
data: []
},
BranchDatas: [],
}
},
mounted() {
......@@ -45,41 +69,71 @@ export default {
},
methods: {
BranchChart(){
this.inBranchDatas()
let that = this
let titles = this.BranchAnalysisData.map(x=>{return x.Name})
let datas = []
let Newobj={};
for(let index=0;index<this.BranchTitles.length;index++){
for(let i=0;i<this.MonthList.length;i++){
this.BranchAnalysisData.forEach((z,indexs)=>{
let element = z
let MonthDatas = []
MonthDatas = z.DetailList.filter(y=>{
return y.Month==this.MonthList[i]
})
this.BranchDatas[indexs].name = z.Name
if(this.Current==1) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].Income.toFixed(2))
if(this.Current==2) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].IncomeRate.toFixed(2))
if(this.Current==3) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].MaoLi.toFixed(2))
if(this.Current==4) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].MaoLiRate.toFixed(2))
if(this.Current==5) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].Profit.toFixed(2))
if(this.Current==6) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].ProfitRate.toFixed(2))
if(this.Current==7) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].TransportIncome.toFixed(2))
if(this.Current==8) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].FinalProfit.toFixed(2))
if(this.Current==9) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].GXFY.toFixed(2))
if(this.Current==10) this.BranchDatas[indexs].data = this.BranchDatas[indexs].data.concat(MonthDatas[0].JLR.toFixed(2))
// if(this.msgData.LossType!='0'){
// if(indexs>4){
// let name=element.Name;
// Newobj[name]=false;
// }
// }else {
// if(indexs>5){
// let name=element.Name;
// Newobj[name]=false;
// }
// }
if(indexs>5){
let name=element.Name;
Newobj[name]=false;
}
this.Stocklegend=Newobj;
})
}
}
datas = this.BranchDatas
let chartDom = document.getElementById('BranchAnalysisChart');
let myChart = this.$echarts.init(chartDom);
// echarts.init(chartDom, 'dark');
let option;
option = {
color:that.colorList,
tooltip: {
backgroundColor:'transparent',
trigger: 'axis',
axisPointer: {
type: 'none',
label: {
// backgroundColor: '#6a7985'
}
},
position: function (point, params, dom, rect, size) {
return [point[0]-50, point[1]-dom.offsetHeight];
},
formatter: function(params) {
var res = `<div style="background:${params.color};position:relative;padding:6px 10px;border-radius:8px;">
${params.seriesName}:${params.data}
<div style="position: absolute;bottom: -8px;left: 35%;width:0;
height:0;
border-left:8px solid transparent;
border-right:8px solid transparent;
border-top:8px solid ${params.color};">
</div>
<div>`
return res;
axisPointer: {
lineStyle: {
type: 'dashed',
color: "#ddd"
}
}
},
legend: {
x:'left',
......@@ -87,21 +141,16 @@ export default {
type:'scroll',
icon: "circle",
padding: [5, 30, 20, 30] ,
type:'scroll',
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
data: titles,
selected: that.Stocklegend,
},
grid: {
left: 15, // 默认10%,给24就挺合适的。
top: 30, // 默认60
right: 15, // 默认10%
right: 45, // 默认10%
bottom: 70, // 默认60
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis : [
{
type : 'category',
......@@ -109,7 +158,6 @@ export default {
data :this.MonthList,
axisLine: {
lineStyle: {
// 设置x轴颜色
color: "transparent"
}
},
......@@ -117,8 +165,7 @@ export default {
textStyle: {
color: "#333333"
}
},
}
}
],
yAxis : [
......@@ -126,7 +173,6 @@ export default {
type : 'value',
axisLine: {
lineStyle: {
// 设置x轴颜色
color: "transparent",
width: 1,
}
......@@ -137,48 +183,23 @@ export default {
}
},
splitLine:{
show:true,
show:true,
lineStyle:{
// type:'dashed'
color:'#EEEEEE',
}
// type:'dashed',
color:'#EEEEEE',
}
}
}
],
series: [
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
series: datas
};
myChart.setOption(option,true)
},
inBranchDatas() {
this.BranchDatas = []
for(let i=0;i<this.BranchAnalysisData.length;i++){
this.BranchDatas.push(JSON.parse(JSON.stringify(this.BranchDataObj)))
}
}
},
watch: {
......@@ -244,12 +265,13 @@ export default {
padding: 5px 0;
}
.titleBox{
padding: 0 5px 5px 5px;
padding: 10px 10px 0 10px;
}
.row{
display: flex;
}
.echartsBox{
width: 100%;
background: #fff;
}
</style>
......@@ -41,14 +41,15 @@
<script>
export default {
props:['StatisticalData'],
props:['StatisticalData','msgData'],
data() {
return {
MonthList: [],//月份列表
LineAnalysisData: [],//各线路统计
CostAnalysisData: [],//各成本统计
colorList:['#089bab','#FFA171','#72b8ff','#ff9cc6','#7b78ff','#28cc90','#ee8fff','#5cf2ff','#ff9a00','#4fc4f7','#738eff','#b0edff',
'#E43939','#F79A2C','#FFF60B','#3DD948','#39CAE4','#2C31F1','#7A39E4','#E65FC1','#D0B478','#000000','#BABABA',],
'#E43939','#F79A2C','#FFF60B','#3DD948','#39CAE4','#2C31F1','#7A39E4','#E65FC1','#D0B478','#BABABA',
'rgba(228,57,57,.7)','rgba(247,154,44,.7)','rgba(255,246,11,.7)','rgba(61,217,72,.7)','rgba(57,202,228,.7)','rgba(44,49,241,.7)','rgba(122,57,228,.7)'],
Stocklegend: {},
types:[
{Name: '收入',ID:1},
......@@ -90,12 +91,13 @@ export default {
name: '',
type:'bar',
itemStyle:{
barBorderRadius: 15,
barBorderRadius: 5,
},
barWidth : 15,
barWidth : 10,
data: [],
},
CostDatas: []
CostDatas: [],
CostStocklegend: {},
}
},
mounted() {
......@@ -107,6 +109,7 @@ export default {
let that = this
let titles = this.costCurrent==1?this.costTitles.map(x=>{return x.Name}):this.incomeTitles.map(x=>{return x.Name})
let datas = []
let Newobj={};
for(let index=0;index<this.costTitles.length;index++){
for(let i=0;i<this.MonthList.length;i++){
let filter = this.CostAnalysisData.filter(z=>{return z.Month==this.MonthList[i]})
......@@ -177,13 +180,18 @@ export default {
})
}
}
if(this.msgData.LossType!='0'){
if(indexs>4){
let name=x.name;
Newobj[name]=false;
}
this.CostStocklegend=Newobj;
}else this.CostStocklegend = {}
})
}
}
}
datas = this.CostDatas
console.log(datas,'------------')
let chartDom = document.getElementById('costStatisticsChart');
let myChart = this.$echarts.init(chartDom);
let option;
......@@ -223,7 +231,7 @@ export default {
padding: [5, 30, 20, 30] ,
type:'scroll',
data: titles,
// selected: that.Stocklegend
selected: that.CostStocklegend
},
grid: {
left: 75, // 默认10%,给24就挺合适的。
......@@ -289,9 +297,9 @@ export default {
name: element.Name,
type:'bar',
itemStyle:{
barBorderRadius: 15,
barBorderRadius: 5,
},
barWidth : 15,
barWidth : 10,
// stack: 'Total',
data: [],
}
......@@ -304,9 +312,16 @@ export default {
if(that.Current==6) obj.data.push(`${element.DetailList[j].ProfitRate.toFixed(2)}`)
}
datas.push(obj)
if(i>5){
let name=element.Name;
Newobj[name]=false;
if(this.msgData.LossType!='0'){
if(i>3){
let name=element.Name;
Newobj[name]=false;
}
}else{
if(i>5){
let name=element.Name;
Newobj[name]=false;
}
}
this.Stocklegend=Newobj;
}
......@@ -468,12 +483,13 @@ export default {
padding: 5px 0;
}
.titleBox{
padding: 0 5px 5px 5px;
padding: 10px 10px 0 10px;
}
.row{
display: flex;
}
.echartsBox{
width: 100%;
background: #fff;
}
</style>
......@@ -145,7 +145,7 @@
:label="title" v-for="(title,i) in MonthList" :key="i" :prop="`${i}`"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.MonthData[i].toFixed(2)}}
{{scope.row.MonthData[i]}}
</template>
</el-table-column>
</el-table>
......
......@@ -98,7 +98,7 @@
</el-col>
<el-col :span="2" v-if="msg.Type!=3">
<el-form-item label="季度汇总">
<el-checkbox v-model="msg.LossType" true-label="1" false-label="0"></el-checkbox>
<el-checkbox v-model="msg.LossType" true-label="1" false-label="0" @change="getStatement"></el-checkbox>
</el-form-item>
</el-col>
</el-row>
......
......@@ -98,7 +98,7 @@
</el-col>
<el-col :span="2" v-if="msg.Type!=3">
<el-form-item label="季度汇总">
<el-checkbox v-model="msg.LossType" true-label="1" false-label="0"></el-checkbox>
<el-checkbox v-model="msg.LossType" true-label="1" false-label="0" @change="getStatement"></el-checkbox>
</el-form-item>
</el-col>
</el-row>
......@@ -115,9 +115,9 @@
</ul>
</div>
<div v-loading="loading" style="height: 78%;overflow: auto;">
<LinesChart v-if="activeName=='1'" :StatisticalData="StatisticalData"></LinesChart>
<CorporationsChart v-if="activeName=='2'" :StatisticalData="StatisticalData"></CorporationsChart>
<PacketsChart v-if="activeName=='3'" :StatisticalData="StatisticalData"></PacketsChart>
<LinesChart v-if="activeName=='1'" :msgData="msg" :StatisticalData="StatisticalData"></LinesChart>
<CorporationsChart v-if="activeName=='2'" :msgData="msg" :StatisticalData="StatisticalData"></CorporationsChart>
<PacketsChart v-if="activeName=='3'" :msgData="msg" :StatisticalData="StatisticalData"></PacketsChart>
</div>
</div>
</template>
......@@ -139,7 +139,7 @@ export default {
OutBranchId: -1,
StandardCurrencyId:0,
LineId: 0,
Type: '2',
Type: '1',
DataType:'-1',
LossType:'0'
},
......
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