Browse Source

feat(market): 业绩看板展示优化

- 动态展示销售排行,移除静态数据- 添加获取统计信息功能
- 优化进度条显示,根据实际数据计算百分比
-调整数据展示格式,提高可读性
master
liutong 12 months ago
parent
commit
e67f343ee4
  1. 70
      pages/market/data/index.vue

70
pages/market/data/index.vue

@ -106,33 +106,11 @@
<!-- 销售排名--> <!-- 销售排名-->
<view class="section_box_2" v-else> <view class="section_box_2" v-else>
<view class="itme"> <view class="itme" v-for="(v,k) in infoData.staff_list" :key="k">
<view class="title">01 李小刚</view> <view class="title">{{k+1}} {{v.name}}</view>
<view class="money">100000</view> <view class="money">{{v.goal}}</view>
<view class="plan"> <view class="plan">
<fui-progress :percent="80" height="15" radius="15" background="#e4e4e4" activeColor="#4bced0"></fui-progress> <fui-progress :percent="getPercent(v.wx_yj,v.goal)" height="15" radius="100" background="#e4e4e4" activeColor="#4bced0"></fui-progress>
</view>
</view>
<view class="itme">
<view class="title">02 张刚</view>
<view class="money">100000</view>
<view class="plan">
<fui-progress :percent="80" height="15" radius="15" background="#e4e4e4" activeColor="#4bced0"></fui-progress>
</view>
</view>
<view class="itme">
<view class="title">03 李华</view>
<view class="money">100000</view>
<view class="plan">
<fui-progress :percent="80" height="15" radius="15" background="#e4e4e4" activeColor="#4bced0"></fui-progress>
</view>
</view>
<view class="itme">
<view class="title">04 王明</view>
<view class="money">100000</view>
<view class="plan">
<fui-progress :percent="80" height="15" radius="15" background="#e4e4e4" activeColor="#4bced0"></fui-progress>
</view> </view>
</view> </view>
</view> </view>
@ -157,7 +135,9 @@ export default {
data() { data() {
return { return {
infoData:{},// infoData:{
staff_list:[],//
},//
// //
chartData: {}, chartData: {},
@ -254,6 +234,7 @@ export default {
this.getPerformance() this.getPerformance()
}, },
//
async getPerformance(){ async getPerformance(){
let res= await marketApi.performance({}) let res= await marketApi.performance({})
if (res.code != 1) { if (res.code != 1) {
@ -263,7 +244,7 @@ export default {
}); });
return return
} }
console.log('xx',res) // console.log('xx',res)
this.infoData = res.data this.infoData = res.data
// //
@ -278,10 +259,10 @@ export default {
wwc_percent = parseInt(wwc_percent) wwc_percent = parseInt(wwc_percent)
let w_c_d = ((xp + xf) - mb) * -1 * 100 // let w_c_d = ((xp + xf) - mb) * -1 * 100 //
w_c_d = w_c_d >= 0 ? 0 : w_c_d w_c_d = w_c_d <= 0 ? 0 : w_c_d
w_c_d = 100 - w_c_d w_c_d = 100 - w_c_d
let w_c_d_rounded = Math.round(w_c_d * 10) / 10; 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]) // console.log('zzz',[xp_percent,xf_percent,wwc_percent,w_c_d_rounded])
@ -323,24 +304,24 @@ export default {
data: [ data: [
{ {
"name": "跟进中", // "name": "跟进中", //
"centerText": "70", // "centerText": this.infoData.gj_count, //
"value": 70, // 50 "value": this.infoData.gj_lv, // 50
// "labelText":'' // "labelText":''
"labelShow":false, "labelShow":false,
"color": "#FFCB31", // "color": "#FFCB31", //
}, },
{ {
"name": "试听", "name": "试听",
"centerText": "30", "centerText": this.infoData.st_count,
"value": 30, "value": this.infoData.st_lv,
// "labelText":"" // "labelText":""
"labelShow":false, "labelShow":false,
"color": "#4DA3FF", // "color": "#4DA3FF", //
}, },
{ {
"name": "已成交", "name": "已成交",
"centerText": "10", "centerText": this.infoData.cj_count,
"value": 10, "value": this.infoData.cj_lv,
// "labelText":"" // "labelText":""
"labelShow":false, "labelShow":false,
"color": "#12E7E8", // "color": "#12E7E8", //
@ -353,6 +334,23 @@ export default {
}, },
//
getPercent(num1,total){
//
if(!total){
return 0
}
let num_percent = (num1 / total) * 100;
if(num_percent <= 0){
num_percent = 0
}else{
num_percent = Math.ceil((num1 / total) * 100);
}
// console.log('qqq',[num_percent,num1,total])
return num_percent
},
//tag //tag

Loading…
Cancel
Save