| @@ -32,7 +32,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -56,7 +56,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -89,7 +89,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -122,7 +122,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -370,14 +370,17 @@ | |||||
| // 当为全部时 | // 当为全部时 | ||||
| this['newlisttabinfo'+index]=[] | this['newlisttabinfo'+index]=[] | ||||
| // 当选择全部时 | // 当选择全部时 | ||||
| let arr=[] | |||||
| // 当两个都选择的时候 | // 当两个都选择的时候 | ||||
| result.map(item=>{ | result.map(item=>{ | ||||
| let obj={} | let obj={} | ||||
| obj.name=item.houseName | obj.name=item.houseName | ||||
| obj.zxl=item.data | obj.zxl=item.data | ||||
| this['newlisttabinfo'+index].push(obj) | |||||
| arr.push(obj) | |||||
| }) | }) | ||||
| arr=this.dealData(arr) | |||||
| this['newlisttabinfo'+index]=arr | |||||
| }) | }) | ||||
| }, | }, | ||||
| // 获取销奖能力 | // 获取销奖能力 | ||||
| @@ -431,7 +434,28 @@ | |||||
| uni.navigateTo({ | uni.navigateTo({ | ||||
| url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}` | url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}` | ||||
| }); | }); | ||||
| } | |||||
| }, | |||||
| // 定义一个公共方法对数据进行处理 | |||||
| dealData(arr){ | |||||
| // 获取最大值 | |||||
| let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3 | |||||
| // console.log(num) | |||||
| if(num>100){ | |||||
| // 获取最大值的下标 | |||||
| // let idx=arr.findIndex(item=>item.zxl==num) | |||||
| // console.log(idx,123) | |||||
| arr.map(item=>{ | |||||
| item.zxl1=Math.floor(item.zxl/num*100) | |||||
| }) | |||||
| // console.log(arr) | |||||
| return arr | |||||
| }else{ | |||||
| arr.map(item=>{ | |||||
| item.zxl1=item.zxl | |||||
| }) | |||||
| return arr | |||||
| } | |||||
| }, | |||||
| } | } | ||||
| }; | }; | ||||
| </script> | </script> | ||||
| @@ -74,7 +74,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -120,7 +120,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -166,7 +166,7 @@ | |||||
| <view class="jindu-boxche"> | <view class="jindu-boxche"> | ||||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | ||||
| <view style="width: 440rpx;margin-left: 10rpx;"> | <view style="width: 440rpx;margin-left: 10rpx;"> | ||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||||
| </view> | </view> | ||||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | ||||
| </view> | </view> | ||||
| @@ -795,6 +795,7 @@ | |||||
| // 先处理牌名数据,需要进行判断全部还是单个 | // 先处理牌名数据,需要进行判断全部还是单个 | ||||
| // 当为全部时 | // 当为全部时 | ||||
| this['newlisttabinfo'+index]=[] | this['newlisttabinfo'+index]=[] | ||||
| let arr=[] | |||||
| // 当选择全部时 | // 当选择全部时 | ||||
| if(!this.staff1.value&&!this.staff2.value){ | if(!this.staff1.value&&!this.staff2.value){ | ||||
| // console.log(1) | // console.log(1) | ||||
| @@ -802,8 +803,11 @@ | |||||
| let obj={} | let obj={} | ||||
| obj.name=item.deptName | obj.name=item.deptName | ||||
| obj.zxl=item.data | obj.zxl=item.data | ||||
| this['newlisttabinfo'+index].push(obj) | |||||
| arr.push(obj) | |||||
| }) | }) | ||||
| arr=this.dealData(arr) | |||||
| this['newlisttabinfo'+index]=arr | |||||
| } | } | ||||
| // 当选择只有一个时 | // 当选择只有一个时 | ||||
| else if(this.staff1.value&&!this.staff2.value){ | else if(this.staff1.value&&!this.staff2.value){ | ||||
| @@ -812,7 +816,7 @@ | |||||
| let obj={} | let obj={} | ||||
| obj.name=item.deptName | obj.name=item.deptName | ||||
| obj.zxl=item.data | obj.zxl=item.data | ||||
| this['newlisttabinfo'+index].push(obj) | |||||
| arr.push(obj) | |||||
| }) | }) | ||||
| // 判断是否显示平均 | // 判断是否显示平均 | ||||
| // 如果显示对比 | // 如果显示对比 | ||||
| @@ -821,9 +825,11 @@ | |||||
| let obj={} | let obj={} | ||||
| obj.name='平均' | obj.name='平均' | ||||
| obj.zxl=item.data | obj.zxl=item.data | ||||
| this['newlisttabinfo'+index].push(obj) | |||||
| arr.push(obj) | |||||
| }) | }) | ||||
| } | } | ||||
| arr=this.dealData(arr) | |||||
| this['newlisttabinfo'+index]=arr | |||||
| }else{ | }else{ | ||||
| // console.log(3) | // console.log(3) | ||||
| // 当两个都选择的时候 | // 当两个都选择的时候 | ||||
| @@ -831,14 +837,16 @@ | |||||
| let obj={} | let obj={} | ||||
| obj.name=item.deptName | obj.name=item.deptName | ||||
| obj.zxl=item.data | obj.zxl=item.data | ||||
| this['newlisttabinfo'+index].push(obj) | |||||
| arr.push(obj) | |||||
| }) | }) | ||||
| result[1].map(item=>{ | result[1].map(item=>{ | ||||
| let obj={} | let obj={} | ||||
| obj.name=item.deptName | obj.name=item.deptName | ||||
| obj.zxl=item.data | obj.zxl=item.data | ||||
| this['newlisttabinfo'+index].push(obj) | |||||
| arr.push(obj) | |||||
| }) | }) | ||||
| arr=this.dealData(arr) | |||||
| this['newlisttabinfo'+index]=arr | |||||
| } | } | ||||
| }else{ | }else{ | ||||
| // 当选择趋势时 | // 当选择趋势时 | ||||
| @@ -1002,7 +1010,27 @@ | |||||
| this.$forceUpdate() | this.$forceUpdate() | ||||
| }) | }) | ||||
| }, | }, | ||||
| // 定义一个公共方法对数据进行处理 | |||||
| dealData(arr){ | |||||
| // 获取最大值 | |||||
| let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3 | |||||
| // console.log(num) | |||||
| if(num>100){ | |||||
| // 获取最大值的下标 | |||||
| // let idx=arr.findIndex(item=>item.zxl==num) | |||||
| // console.log(idx,123) | |||||
| arr.map(item=>{ | |||||
| item.zxl1=Math.floor(item.zxl/num*100) | |||||
| }) | |||||
| // console.log(arr) | |||||
| return arr | |||||
| }else{ | |||||
| arr.map(item=>{ | |||||
| item.zxl1=item.zxl | |||||
| }) | |||||
| return arr | |||||
| } | |||||
| }, | |||||
| } | } | ||||
| }; | }; | ||||
| </script> | </script> | ||||