gx
queenwuli
2021-01-06 4028034362cf7eb26223ea121d873bdd5210dee1
hive-app/pages/manager/employeeReport.vue
@@ -1,6 +1,6 @@
<template>
   <!-- 员工业绩报表 -->
   <view class="container" @click="hideFilter">
   <view class="container">
      <h-tabs
         class="tab"
         :tabData="tabs" 
@@ -29,16 +29,12 @@
                  <text>¥{{item.cashAmount | formatNum}}</text>
               </view>
               <view class="list-row">
                  <text>售卡业绩</text>
                  <text>¥{{item.cardAmount | formatNum}}</text>
               </view>
               <view class="list-row">
                  <text>产品业绩</text>
                  <text>¥{{item.goodsAmount | formatNum}}</text>
               </view>
               <view class="list-row">
                  <text>划扣业绩</text>
                  <text>¥{{item.cardUseAmount | formatNum}}</text>
               </view>
               <view class="list-row">
                  <text>订单提成</text>
                  <text>¥无数据</text>
               </view>
               <view class="list-row">
                  <text>本金消耗</text>
@@ -54,15 +50,15 @@
               </view>
               <view class="list-row">
                  <text>人头数</text>
                  <text>{{item.peopleNum}}</text>
                  <text>{{item.peopleNum}}人</text>
               </view>
               <view class="list-row">
                  <text>项目数</text>
                  <text>{{item.projNum}}</text>
                  <text>{{item.projNum}}个</text>
               </view>
               <view class="list-row">
                  <text>服务时长</text>
                  <text>{{item.serviceTime}}</text>
                  <text>{{item.serviceTime}}分钟</text>
               </view>
            </view>
         </view>
@@ -81,16 +77,12 @@
                  <text>现金业绩</text>
                  <text class="iconfont iconarrow-backimg"></text>
               </view>
               <view class="list-row-bordered" @click="toAnalyse('售卡业绩', 3)">
                  <text>售卡业绩</text>
                  <text class="iconfont iconarrow-backimg"></text>
               </view>
               <view class="list-row-bordered" @click="toAnalyse('产品业绩', 4)">
                  <text>产品业绩</text>
                  <text class="iconfont iconarrow-backimg"></text>
               </view>
               <view class="list-row-bordered" @click="toAnalyse('划扣业绩', 5)">
                  <text>划扣业绩</text>
                  <text class="iconfont iconarrow-backimg"></text>
               </view>
               <view class="list-row-bordered" @click="toAnalyse('订单提成', 3)">
                  <text>订单提成</text>
                  <text class="iconfont iconarrow-backimg"></text>
               </view>
               <view class="list-row-bordered" @click="toAnalyse('本金消耗', 6)">
@@ -120,11 +112,6 @@
            </view>
         </view>
      </view>
      <scroll-view scroll-y class="drop-down" v-show="isShowFilter">
         <view class="drop-down-row" v-for="item in employeeList">
            <text :class="item.id==staffId?'blue':''" @click="employeeChange(item)">{{item.name}}</text>
         </view>
      </scroll-view>
   </view>
</template>
@@ -151,8 +138,6 @@
               name: '专项'
            }
         ],
         isShowFilter:false,
         employeeList: [],
         list: [],
         staffId: ''
        }  
@@ -167,11 +152,10 @@
            })
         }
         if(e.width && e.index==1){
            this.isShowFilter=!this.isShowFilter
            uni.navigateTo({
               url: './selectEmployee?selectId='+this.staffId
            })
         }
      },
      onHide() {
         this.hideFilter()
      },
      methods:{
         tabChange(index){
@@ -184,28 +168,29 @@
               this.loadList()
            }
         },
         hideFilter(){
            this.isShowFilter = false
         },
         toAnalyse(title, type){
            uni.navigateTo({
               url: './analyse/index?staffId='+this.staffId+'&title='+title+'&type='+type+'&page=2'
            })
         },
         employeeChange(item){
            this.staffId = item.id;
            this.loadList()
         },
         loadEmloyeeList(){
            this.$httpUtils.request('/api/user/findAllUsers').then((res) => {
            this.$httpUtils.request('/api/user/findAllUsers', {}, 'POST').then((res) => {
               if(res.status == 200){
                  let result = res.rows;
                  this.employeeList = result;
                  if(result.length){
                     this.staffId = result[0].id;
                     uni.setNavigationBarTitle({
                        title: result[0].name+'的业绩报表'
                     })
                     this.loadList()
                  }else{
                     this.loadList()
                     // #ifdef APP-PLUS
                     let webView = this.$mp.page.$getAppWebview();
                     webView.setTitleNViewButtonStyle(1, {
                         width: 0,
                     });
                     // #endif
                  }
               }
            })
@@ -221,6 +206,15 @@
                  this.list = res.rows;
               }
            })
         },
         setData(item){
            this.staffId = item.id;
            this.loadList();
            setTimeout(() => {
               uni.setNavigationBarTitle({
                  title: item.name+'的业绩报表'
               });
            }, 500)
         }
      }
   }