|
|
|
@ -21,11 +21,11 @@ |
|
|
|
<view class="right"> |
|
|
|
<view class="title">目标金额</view> |
|
|
|
<view class="content"> |
|
|
|
<text class="strong">¥100000</text> |
|
|
|
<text class="strong">¥{{infoData.goal}}</text> |
|
|
|
</view> |
|
|
|
<view class="title">完成金额</view> |
|
|
|
<view class="content"> |
|
|
|
<text class="strong">¥100000</text> |
|
|
|
<text class="strong">¥{{infoData.wx_performance}}</text> |
|
|
|
<text>较上月</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -146,7 +146,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
// import user from '@/api/user.js'; |
|
|
|
import marketApi from '@/api/market.js'; |
|
|
|
import AQTabber from "@/components/AQ/AQTabber.vue" |
|
|
|
|
|
|
|
|
|
|
|
@ -157,6 +157,8 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
|
|
|
|
infoData:{},//详情数据 |
|
|
|
|
|
|
|
//统计图相关 |
|
|
|
chartData: {}, |
|
|
|
opts: { |
|
|
|
@ -181,7 +183,7 @@ export default { |
|
|
|
color: "#666666" // 主标题颜色 |
|
|
|
}, |
|
|
|
subtitle: { |
|
|
|
name: "40%", // 副标题文本 |
|
|
|
name: "0%", // 副标题文本 |
|
|
|
fontSize: 18, // 副标题字体大小 |
|
|
|
color: "#7cb5ec" // 副标题颜色 |
|
|
|
}, |
|
|
|
@ -243,36 +245,76 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
onLoad() {}, |
|
|
|
onShow() { |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async init(){ |
|
|
|
this.getPerformance() |
|
|
|
}, |
|
|
|
|
|
|
|
async getPerformance(){ |
|
|
|
let res= await marketApi.performance({}) |
|
|
|
if (res.code != 1) { |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
console.log('xx',res) |
|
|
|
this.infoData = res.data |
|
|
|
|
|
|
|
//计算 |
|
|
|
let mb = this.infoData.wx_performance//总计 |
|
|
|
let xp =this.infoData.new_performance//新签 |
|
|
|
let xf =this.infoData.renew_performance//续费 |
|
|
|
|
|
|
|
// 如果总业绩为0,百分比设为0(避免除以0错误) |
|
|
|
let xp_percent = mb != 0 ? parseInt((xp / mb) * 100) : 0; |
|
|
|
let xf_percent = mb != 0 ? parseInt((xf / mb) * 100) : 0; |
|
|
|
let wwc_percent = 100 - xp_percent - xf_percent >= 0 ? '0' : 100 - xp_percent - xf_percent//未完成 |
|
|
|
wwc_percent = parseInt(wwc_percent) |
|
|
|
|
|
|
|
let w_c_d = ((xp + xf) - mb) * -1 * 100 //完成度 |
|
|
|
w_c_d = w_c_d >= 0 ? 0 : w_c_d |
|
|
|
w_c_d = 100 - w_c_d |
|
|
|
let w_c_d_rounded = Math.round(w_c_d * 10) / 10; |
|
|
|
console.log('zzz',[xp_percent,xf_percent,wwc_percent,w_c_d_rounded]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//环形统计图相关 |
|
|
|
let chartData_1 = { |
|
|
|
series: [ |
|
|
|
{ |
|
|
|
data: [ |
|
|
|
{ |
|
|
|
"name": "新签", |
|
|
|
"value": 50, |
|
|
|
"name": "未完成", |
|
|
|
"value": wwc_percent, |
|
|
|
"labelShow": false |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "续费", |
|
|
|
"value": 30, |
|
|
|
"value": xf_percent, |
|
|
|
"labelShow": false |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "未完成", |
|
|
|
"value": 20, |
|
|
|
"name": "新签", |
|
|
|
"value": xp_percent, |
|
|
|
"labelShow": false |
|
|
|
} |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
] |
|
|
|
}; |
|
|
|
this.chartData = JSON.parse(JSON.stringify(chartData_1)); |
|
|
|
this.opts.subtitle = { |
|
|
|
name: `${w_c_d_rounded}%`, // 副标题文本 |
|
|
|
fontSize: 18, // 副标题字体大小 |
|
|
|
color: "#7cb5ec" // 副标题颜色 |
|
|
|
} |
|
|
|
|
|
|
|
//销售分析统计图相关 |
|
|
|
let chartDataB = { |
|
|
|
@ -308,8 +350,11 @@ export default { |
|
|
|
] |
|
|
|
}; |
|
|
|
this.chartData_2 = JSON.parse(JSON.stringify(chartDataB)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//切换tag |
|
|
|
changeTag(type){ |
|
|
|
this.tagType = type |
|
|
|
|