Commit b6aa91fe authored by daywrite's avatar daywrite

'销售分析'

parent 7068dda5
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
url: '/vue/analysis/get-implement-chart' url: '/vue/analysis/get-implement-chart'
}, },
getFilterImplementChart: { getFilterImplementChart: {
url: '/vue/supplier/get-filter-implement-chart' url: '/vue/analysis/get-filter-implement-chart'
}, },
getFilterSalesGoal: { getFilterSalesGoal: {
url: '/vue/analysis/get-filter-sales-goal' url: '/vue/analysis/get-filter-sales-goal'
......
...@@ -14,8 +14,10 @@ export default { ...@@ -14,8 +14,10 @@ export default {
text: '' text: ''
}, },
xAxis: { xAxis: {
type: 'category', title: {
gridLineWidth: 1, text: data.name
},
categories: _data.categories,
labels: { labels: {
useHTML:true useHTML:true
} }
...@@ -24,40 +26,71 @@ export default { ...@@ -24,40 +26,71 @@ export default {
title: { title: {
text: '' text: ''
}, },
gridLineWidth: 1, labels: {
labels: {
formatter: function () { formatter: function () {
return (this.value / 10000) + '万' let _value = (this.value / 10000) | 0
}, if (_value > 1) {
return (this.value / 10000) + '万'
} else {
return this.value
}
}
}, },
gridLineWidth: 1,
plotLines:[{ plotLines:[{
color:'red', color:'red',
dashStyle:'solid', dashStyle:'solid',
value: _data.average, value: _data.average,
label: _data.average + '', label: _data.average + '',
width:2 width:2
}] }],
// 柱状图顶部 总计
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
}, },
legend: { legend: {
enabled: false enabled: false
}, },
plotOptions: { plotOptions: {
column: {
stacking: 'normal'
},
series: { series: {
borderWidth: 0, borderWidth: 0,
dataLabels: { dataLabels: {
enabled: true, // enabled: true,
format: '{point.y}' format: '{point.y}'
} }
} }
}, },
tooltip: { tooltip: {
headerFormat: '<span style="font-size:12px">业绩分析</span><br>', formatter: function () {
pointFormat: '<span>{point.name}</span>: <b>{point.y}</b><br/>' let ret = ''
let _x = this.x
if (_x === '平均') {
ret += `<b>${_x}</b><br/>${this.point.stackTotal}`
} else {
ret += `<b>${this.series.name}</b><br/>`
if (this.series.userOptions.title) {
ret += `项目名称:<b>${this.series.userOptions.title}</b><br/>`
}
if (this.series.userOptions.pbudget) {
ret += `商机金额:${this.series.userOptions.pbudget}元<br/>`
}
if (this.series.userOptions.bargain_date) {
ret += `成交日期:${this.series.userOptions.bargain_date}<br/>`
}
ret += `商机批注:${this.series.userOptions.comment}`
}
return ret
}
}, },
series: [{ series: _data.series
colorByPoint: true,
data: _data.summary
}]
}); });
} }
} }
......
...@@ -19,7 +19,11 @@ ...@@ -19,7 +19,11 @@
<div class="header-title header-flex" style="height: 100%;"> <div class="header-title header-flex" style="height: 100%;">
<div> <div>
<span class="title-two">实施工程师统计信息</span> <span class="title-two">实施工程师统计信息</span>
<div id="key" style="height:400px;"></div> <div id="individualImplementHours" style="height:400px;"></div>
</div>
<div>
<span class=""></span>
<div id="individualImplementTimes" style="height:400px;"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -78,7 +82,8 @@ export default { ...@@ -78,7 +82,8 @@ export default {
requestAPI(api.getImplementChart, params) requestAPI(api.getImplementChart, params)
.then(res => { .then(res => {
this.result.countList = res.counts this.result.countList = res.counts
this.c('key', res.chars.individualJournalContributions) this.c('individualImplementHours', res.chars.individualImplementHours)
this.c('individualImplementTimes', res.chars.individualImplementTimes)
}) })
}, },
......
...@@ -14,8 +14,10 @@ export default { ...@@ -14,8 +14,10 @@ export default {
text: '' text: ''
}, },
xAxis: { xAxis: {
type: 'category', title: {
gridLineWidth: 1, text: data.name
},
categories: _data.categories,
labels: { labels: {
useHTML:true useHTML:true
} }
...@@ -24,40 +26,71 @@ export default { ...@@ -24,40 +26,71 @@ export default {
title: { title: {
text: '' text: ''
}, },
gridLineWidth: 1, labels: {
labels: {
formatter: function () { formatter: function () {
return (this.value / 10000) + '万' let _value = (this.value / 10000) | 0
}, if (_value > 1) {
return (this.value / 10000) + '万'
} else {
return this.value
}
}
}, },
gridLineWidth: 1,
plotLines:[{ plotLines:[{
color:'red', color:'red',
dashStyle:'solid', dashStyle:'solid',
value: _data.average, value: _data.average,
label: _data.average + '', label: _data.average + '',
width:2 width:2
}] }],
// 柱状图顶部 总计
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
}, },
legend: { legend: {
enabled: false enabled: false
}, },
plotOptions: { plotOptions: {
column: {
stacking: 'normal'
},
series: { series: {
borderWidth: 0, borderWidth: 0,
dataLabels: { dataLabels: {
enabled: true, // enabled: true,
format: '{point.y}' format: '{point.y}'
} }
} }
}, },
tooltip: { tooltip: {
headerFormat: '<span style="font-size:12px">业绩分析</span><br>', formatter: function () {
pointFormat: '<span>{point.name}</span>: <b>{point.y}</b><br/>' let ret = ''
let _x = this.x
if (_x === '平均') {
ret += `<b>${_x}</b><br/>${this.point.stackTotal}`
} else {
ret += `<b>${this.series.name}</b><br/>`
if (this.series.userOptions.title) {
ret += `项目名称:<b>${this.series.userOptions.title}</b><br/>`
}
if (this.series.userOptions.pbudget) {
ret += `商机金额:${this.series.userOptions.pbudget}元<br/>`
}
if (this.series.userOptions.bargain_date) {
ret += `成交日期:${this.series.userOptions.bargain_date}<br/>`
}
ret += `商机批注:${this.series.userOptions.comment}`
}
return ret
}
}, },
series: [{ series: _data.series
colorByPoint: true,
data: _data.summary
}]
}); });
} }
} }
......
...@@ -19,7 +19,19 @@ ...@@ -19,7 +19,19 @@
<div class="header-title header-flex" style="height: 100%;"> <div class="header-title header-flex" style="height: 100%;">
<div> <div>
<span class="title-two">售前工程师统计信息</span> <span class="title-two">售前工程师统计信息</span>
<div id="key" style="height:400px;"></div> <div id="individualJournalContributions" style="height:400px;"></div>
</div>
<div>
<span class=""></span>
<div id="individualContributions" style="height:400px;"></div>
</div>
<div>
<span class=""></span>
<div id="individualPreSalesTimes" style="height:400px;"></div>
</div>
<div>
<span class=""></span>
<div id="$ndividualPreSalesSuccessTimes" style="height:400px;"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -78,7 +90,10 @@ export default { ...@@ -78,7 +90,10 @@ export default {
requestAPI(api.getPreSalesChart, params) requestAPI(api.getPreSalesChart, params)
.then(res => { .then(res => {
this.result.countList = res.counts this.result.countList = res.counts
this.c('key', res.chars.individualJournalContributions) this.c('individualJournalContributions', res.chars.individualJournalContributions)
this.c('individualContributions', res.chars.individualContributions)
this.c('individualPreSalesTimes', res.chars.individualPreSalesTimes)
this.c('$ndividualPreSalesSuccessTimes', res.chars.$ndividualPreSalesSuccessTimes)
}) })
}, },
......
...@@ -74,6 +74,7 @@ export default { ...@@ -74,6 +74,7 @@ export default {
let t = this let t = this
requestAPI(api.getSalesGoal, params) requestAPI(api.getSalesGoal, params)
.then(res => { .then(res => {
this.chartTypeArray = []
res.data.list.forEach(item => { res.data.list.forEach(item => {
this.chartTypeArray.push({ this.chartTypeArray.push({
key: item.name, key: item.name,
......
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