|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 |
- <template>
- <view class="box">
- <view class="boxtittab">
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 4 }" @click="tabtimetap(4)">近七天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 5 }" @click="tabtimetap(5)">近15天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 6 }" @click="tabtimetap(6)">近30天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3)">自定义</view>
- </view>
- </view>
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">接待量排名(TOP10)</view>
- </view>
- <view class="hejisan">
- <view class="sanbox1" >
- <view class="text1-2">{{newlisttabinfo1.total}}</view>
- <view class="text1-1">合计接待次数</view>
- </view>
- <view class="sanbox1" >
- <view class="text1-2">{{newlisttabinfo1.count}}</view>
- <view class="text1-1">顾问人数</view>
- </view>
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo1.avg}}</view>
- <view class="text1-1">人均接待次数</view>
- </view>
- </view>
-
- <view class="jindu" style="margin-top: 20rpx;">
- <view v-if="newlisttabinfo1.result.length" class="jindu-box" v-for="(item,index) in newlisttabinfo1.result" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
- <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
- <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
- <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
- <view class="sort-number" v-if="index>2">{{index+1}}</view>
- {{item.name.substring(0,4)}}</view>
- <view class="progress-cus">
- <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'" ></view>
- <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,1) + '%'" ></view>
- <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,1) + '%'" ></view>
- <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,1) + '%'" ></view>
- </view>
- <view class="jindu-zxl" >{{item.zxl==null?0:item.zxl}}次</view>
- </view>
- </view>
- <view v-if="newlisttabinfo1.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
- 暂无数据
- </view>
- </view>
- </view>
-
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">平均执行率排行(TOP10)</view>
- </view>
- <view class="hejisan">
- <view class="sanbox1" style="width: 40%;">
- <view class="text1-2">{{newlisttabinfo3.count}}</view>
- <view class="text1-1">顾问人数</view>
- </view>
- <view class="sanbox1" style="width: 25%;">
- <view class="text1-2">{{newlisttabinfo3.avg}}%</view>
- <view class="text1-1">人均执行率</view>
- </view>
- </view>
- <view class="jindu" style="margin-top: 20rpx;">
- <view v-if="newlisttabinfo3.result.length" class="jindu-box" v-for="(item,index) in newlisttabinfo3.result" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
- <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
- <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
- <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
- <view class="sort-number" v-if="index>2">{{index+1}}</view>
- {{item.name.substring(0,4)}}</view>
- <!-- <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view> -->
- <!-- <view class="progress-cus">
- <view class="color" :style="'width:'+ item.zxl||0 + '%'" ></view>
- </view> -->
- <view class="progress-cus">
- <view class="color1" v-if="index==0" :style="'width:'+ getPercent1(item.zxl) + '%'" ></view>
- <view class="color2" v-if="index==1" :style="'width:'+ getPercent1(item.zxl) + '%'" ></view>
- <view class="color3" v-if="index==2" :style="'width:'+ getPercent1(item.zxl) + '%'" ></view>
- <view class="color4" v-if="index>2" :style="'width:'+ getPercent1(item.zxl) + '%'" ></view>
- </view>
- <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
- </view>
- </view>
- <view v-if="newlisttabinfo3.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
- 暂无数据
- </view>
- </view>
- </view>
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">录音时长(TOP10)</view>
- </view>
- <view class="hejisan">
- <view class="sanbox1" >
- <view class="text1-2">{{newlisttabinfo2.total}}</view>
- <view class="text1-1">合计时长/分钟</view>
- </view>
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo2.count}}</view>
- <view class="text1-1">顾问人数</view>
- </view>
- <view class="sanbox1" >
- <view class="text1-2">{{newlisttabinfo2.avg}}</view>
- <view class="text1-1">人均录音时长/分钟</view>
- </view>
- </view>
- <view class="jindu" style="margin-top: 20rpx;">
- <view v-if="newlisttabinfo2.result.length" class="jindu-box" v-for="(item,index) in newlisttabinfo2.result" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
- <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
- <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
- <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
- <view class="sort-number" v-if="index>2">{{index+1}}</view>
- {{item.name.substring(0,4)}}</view>
- <view class="progress-cus">
- <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'" ></view>
- <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,2)+ '%'" ></view>
- <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,2)+ '%'" ></view>
- <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,2)+ '%'" ></view>
- </view>
- <view class="jindu-zxl u-line-1">{{item.zxl==null?0:item.zxl}}分钟</view>
- </view>
- </view>
- <view v-if="newlisttabinfo2.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
- 暂无数据
- </view>
- </view>
- </view>
-
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">违禁次数排名(TOP10)</view>
- </view>
- <view class="hejisan">
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo4.total}}</view>
- <view class="text1-1">合计次数</view>
- </view>
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo4.count}}人</view>
- <view class="text1-1">顾问人数</view>
- </view>
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo4.avg}}</view>
- <view class="text1-1">人均违禁次数</view>
- </view>
- </view>
- <view class="jindu" style="margin-top: 20rpx;min-height: 300rpx">
- <view v-if="newlisttabinfo4.result.length" class="jindu-box" v-for="(item,index) in newlisttabinfo4.result" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
- <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
- <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
- <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
- <view class="sort-number" v-if="index>2">{{index+1}}</view>
- {{item.name.substring(0,4)}}</view>
- <view class="progress-cus">
- <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'" ></view>
- <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,4)+ '%'" ></view>
- <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,4) + '%'" ></view>
- <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,4)+ '%'" ></view>
- </view>
- <view class="jindu-zxl" >{{item.zxl==null?0:item.zxl}}次</view>
- </view>
- </view>
- <view v-if="newlisttabinfo4.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
- 暂无数据
- </view>
- </view>
- </view>
-
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">接待未标顾问排名(TOP10)</view>
- </view>
- <view class="hejisan">
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo5.total||0}}</view>
- <view class="text1-1">合计</view>
- </view>
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo5.count||0}}人</view>
- <view class="text1-1">顾问</view>
- </view>
- <view class="sanbox1">
- <view class="text1-2">{{newlisttabinfo5.avg||0}}</view>
- <view class="text1-1">均值</view>
- </view>
- </view>
- <view class="jindu" style="margin-top: 20rpx;min-height: 300rpx">
- <view v-if="newlisttabinfo5.result.length!=0" class="jindu-box"
- v-for="(item,index) in newlisttabinfo5.result" :key="index">
- <view class="jindu-boxche" >
- <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
- <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
- <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
- <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
- <view class="sort-number" v-if="index>2">{{index+1}}</view>
- {{item.name.substring(0,4)}}</view>
- <view class="progress-cus">
- <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'" ></view>
- <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,5)+ '%'" ></view>
- <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,5) + '%'" ></view>
- <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,5)+ '%'" ></view>
- </view>
- <view class="jindu-zxl" >{{item.zxl==null?0:item.zxl}}次</view>
- </view>
- </view>
- <view v-if="newlisttabinfo5.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
- 暂无数据
- </view>
- </view>
- </view>
- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
-
- <!-- 加载组件 -->
- <u-loadings v-model="LOADING"></u-loadings>
-
- </view>
- </template>
-
- <script>
- var app = getApp();
- var util = require("../../../utils/util.js");
- var config = require("../../../config");
- export default {
- data() {
- return {
- activeTotal: 4,
- totalTimeShow: false,
- // 项目id
- houseId: '',
- lastEndDate: '',
- lastStartDate: '',
- newlisttabinfo1: {
- avg: '',
- count: '',
- total: '',
- result: [],
- },
- newlisttabinfo2: {
- avg: '',
- count: '',
- total: '',
- result: [],
- },
- newlisttabinfo3: {
- avg: '',
- count: '',
- total: '',
- result: [],
- },
- newlisttabinfo4: {
- avg: '',
- count: '',
- total: '',
- result: [],
- },
- newlisttabinfo5: {
- avg: '',
- count: '',
- total: '',
- result: [],
- },
- };
- },
- onLoad() {
- this.LOADING = true
- // 获取项目id
- this.houseId = uni.getStorageSync('buildingID').id;
- this.init()
- },
- computed: {
-
- },
- onPullDownRefresh(){
- this.init()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- methods: {
- getPercent(num,type) {
- if(this.newlisttabinfo1.result&&this.newlisttabinfo1.result.length&&type==1){
- console.log(this.newlisttabinfo1.result)
- let index0 = this.newlisttabinfo1.result[0]
- let percent = num/(index0.zxl) * 100
- // console.log(index0.zxl)
- // console.log(index0)
- // console.log('num',num)
- // console.log(percent)
- // console.log(percent.toFixed(2))
- return percent.toFixed(2)
-
- }else if(this.newlisttabinfo2.result&&this.newlisttabinfo2.result.length&&type==2){
- let index0 = this.newlisttabinfo2.result[0]
- let percent = num/(index0.zxl) * 100
- return percent.toFixed(2)
-
- }else if(this.newlisttabinfo4.result&&this.newlisttabinfo4.result.length&&type==4){
- let index0 = this.newlisttabinfo4.result[0]
- let percent = num/(index0.zxl) * 100
- return percent.toFixed(2)
- }else if(this.newlisttabinfo5.result&&this.newlisttabinfo5.result.length&&type==5){
- let index0 = this.newlisttabinfo5.result[0]
- let percent = num/(index0.zxl) * 100
- return percent.toFixed(2)
- }else{
- return 0
- }
- },
- getPercent1(num){
- console.log(num)
- return num||0
- },
- init(){
- this.newlisttabinfo1={
- avg:'',
- count:'',
- total:'',
- result:[],
- },
- this.newlisttabinfo2={
- avg:'',
- count:'',
- total:'',
- result:[],
- },
- this.newlisttabinfo3={
- avg:'',
- count:'',
- total:'',
- result:[],
- },
- this.newlisttabinfo4={
- avg:'',
- count:'',
- total:'',
- result:[],
- }
- this.newlisttabinfo2 = {
- avg: '',
- count: '',
- total: '',
- result: [],
- }
- this.newlisttabinfo3 = {
- avg: '',
- count: '',
- total: '',
- result: [],
- }
- this.newlisttabinfo4 = {
- avg: '',
- count: '',
- total: '',
- result: [],
- }
- this.newlisttabinfo5 = {
- avg: '',
- count: '',
- total: '',
- result: [],
- }
-
- var activeTotal = 0;
- if (this.activeTotal == 3) {
- activeTotal = null;
- } else {
- activeTotal = this.activeTotal;
- this.lastEndDate = '';
- this.lastStartDate = '';
- }
- var promse = {
- timeType: activeTotal,
- lastStartDate: this.lastStartDate,
- lastEndDate: this.lastEndDate,
- houseId: this.houseId
- }
- this.staffStatisticsReceptionTop10(promse)
- this.staffStatisticsRecordingTimTop10(promse)
- this.staffStatisticsExecutionRateTop10(promse)
- this.staffStatisticsProhibitedTop10(promse)
- this.staffStatisticsUnlabeledTop10(promse)
- },
- //接待量排名
- staffStatisticsReceptionTop10(promse) {
-
- this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10', promse).then(res => {
- res.result.forEach(item => {
- item.zxl = item.data
- item.name = item.accountName
- })
- res.result = this.dealData(res.result)
- this.newlisttabinfo1 = res;
- })
- },
- //录音时长
- staffStatisticsRecordingTimTop10(promse) {
- this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10', promse).then(res => {
- res.result.forEach(item => {
- item.zxl = item.data
- item.name = item.accountName
- })
- res.result = this.dealData(res.result)
- this.newlisttabinfo2 = res;
- })
- },
- //销讲
- staffStatisticsExecutionRateTop10(promse) {
- this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10', promse).then(res => {
- res.result.forEach(item => {
- item.zxl = item.data;
- item.zxl1 = item.data;
- item.name = item.accountName
- })
- this.newlisttabinfo3 = res;
- })
- },
- //j禁忌
- staffStatisticsProhibitedTop10(promse) {
- this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10', promse).then(res => {
- res.result.forEach(item => {
- item.zxl = item.data
- item.name = item.accountName
- })
- res.result = this.dealData(res.result)
- this.newlisttabinfo4 = res;
- })
- },
- //未标记客户数量排名,
- staffStatisticsUnlabeledTop10(promse) {
- this.$u.post('/cusLvStatistics/staffStatisticsUnlabeledTop', promse).then(res => {
- this.LOADING = false
- res.result.forEach(item => {
- item.zxl = item.tagCustomer
- item.name = item.accountName
- })
- res.result = this.dealData(res.result)
- this.newlisttabinfo5 = res;
- }).catch(e => {
- this.LOADING = false
- })
- },
-
- //自定义时间
- totalTimeChange(e) {
- console.log(e.startDate, e.endDate)
- this.activeTotal = 3;
- this.lastEndDate = e.endDate
- this.lastStartDate = e.startDate
- this.init()
- },
- //时间切换
- tabtimetap(index) {
- this.activeTotal = index;
- if (index == 3) {
- this.totalTimeShow = true;
- } else {
- this.lastEndDate='';
- this.lastStartDate='';
- this.init()
- }
- },
- // 定义一个公共方法对数据进行处理
- 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
- // }
- arr.map(item => {
- item.zxl1 = Math.floor(item.zxl / num * 100)
- })
- return arr
-
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- .box {
- width: 100%;
- height: 100%;
- background: #FAFAFA;
- }
-
- .single{
- padding-bottom: 20rpx;
- margin-top: 20rpx;
- }
- .boxtittab {
- position: sticky;
- top: var(--window-top);
- z-index: 999;
- }
-
- .hejisan {
- width: 92%;
- margin: 0 auto;
- display: flex;
- padding-top: 20rpx;
-
- padding-bottom:20rpx;
- .sanbox1{
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- position: relative;
- &::after{
- position: absolute;
- content: '';
- width: 1rpx;
- height: 86rpx;
- background: #E0E0E0;
- right: 0;
- top: 0;
- }
- &:last-child::after {
- position: absolute;
- content: '';
- width: 1rpx;
- height: 86rpx;
- right: 0;
- top: 0;
- background: #fff;
- }
- }
- .text1-1{
- font-size: 24rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 32rpx;
- }
-
- .text1-2 {
- color: #333333;
- font-size: 40rpx;
- line-height: 46rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- margin-bottom: 10rpx;
- }
- }
- .jindu-name{
- width: 180rpx;
- margin-left: 15rpx;
- }
- .sort-img{
- width: 44rpx;
- height: 44rpx;
- margin-right: 15rpx;
- }
- .sort-number{
- width: 40rpx;
- height: 40rpx;
- background: #E5F0FF;
- border-radius: 50%;
- font-size: 24rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- text-align: center;
- line-height: 40rpx;
- margin-right: 15rpx;
- }
- </style>
|