From 01b55d7e82c3b13554a412e9c5be0fc96a4906a3 Mon Sep 17 00:00:00 2001
From: li-guang <153605324@qq.com>
Date: Tue, 05 Jan 2021 18:22:04 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/jyyforjava/hive-app

---
 hive-app/pages/manager/employeeReport.vue |  121 +++++++++++++++++++++++++---------------
 1 files changed, 76 insertions(+), 45 deletions(-)

diff --git a/hive-app/pages/manager/employeeReport.vue b/hive-app/pages/manager/employeeReport.vue
index 71b9631..6180b5d 100644
--- a/hive-app/pages/manager/employeeReport.vue
+++ b/hive-app/pages/manager/employeeReport.vue
@@ -14,55 +14,55 @@
 				underLineWidth: 60,
 			}"
 		/>
-		<view v-if="tabIndex==0 || tabIndex==1">
-			<view class="list-item">
+		<view v-if="tabIndex==1 || tabIndex==2">
+			<view class="list-item" v-for="item in list">
 				<view class="list-header">
-					<text>2020年12月24日</text>
+					<text>{{item.time}}</text>
 				</view>
 				<view class="list-content">
 					<view class="list-row">
 						<text>订单业绩</text>
-						<text>¥12,122</text>
+						<text>¥{{item.orderAmount | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>现金业绩</text>
-						<text>¥12,122</text>
+						<text>¥{{item.cashAmount | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>售卡业绩</text>
-						<text>¥12,122</text>
+						<text>¥{{item.cardAmount | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>产品业绩</text>
-						<text>¥12,122</text>
+						<text>¥{{item.goodsAmount | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>划扣业绩</text>
-						<text>¥12,122</text>
+						<text>¥{{item.cardUseAmount | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>本金消耗</text>
-						<text>¥12,122</text>
+						<text>¥{{item.hisConsume | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>赠送消耗</text>
-						<text>¥12,122</text>
+						<text>¥{{item.freeConsume | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>服务提成</text>
-						<text>¥12,122</text>
+						<text>¥{{item.commission | formatNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>人头数</text>
-						<text>12,122</text>
+						<text>{{item.peopleNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>项目数</text>
-						<text>12,122</text>
+						<text>{{item.projNum}}</text>
 					</view>
 					<view class="list-row">
 						<text>服务时长</text>
-						<text>12,122</text>
+						<text>{{item.serviceTime}}</text>
 					</view>
 				</view>
 			</view>
@@ -73,58 +73,58 @@
 					<text class="font-bold">专项数据</text>
 				</view>
 				<view class="list-content-bordered">
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('订单业绩', 1)">
 						<text>订单业绩</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('现金业绩', 2)">
 						<text>现金业绩</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('售卡业绩', 3)">
 						<text>售卡业绩</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('产品业绩', 4)">
 						<text>产品业绩</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('划扣业绩', 5)">
 						<text>划扣业绩</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('本金消耗', 6)">
 						<text>本金消耗</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('赠送消耗', 7)">
 						<text>赠送消耗</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('服务提成', 8)">
 						<text>服务提成</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('人头数', 9)">
 						<text>人头数</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('项目数', 10)">
 						<text>项目数</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
-					<view class="list-row-bordered" @click="toAnalyse">
+					<view class="list-row-bordered" @click="toAnalyse('服务时长', 11)">
 						<text>服务时长</text>
 						<text class="iconfont iconarrow-backimg"></text>
 					</view>
 				</view>
 			</view>
 		</view>
-		<view class="drop-down" v-show="isShowFilter">
-			<view class="drop-down-row" v-for="item in timeList">
-				<text @click="employeeChange(item)">{{item.label}}</text>
+		<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>
-		</view>
+		</scroll-view>
 	</view>
 </template>
 
@@ -136,7 +136,7 @@
 		},
 		data() {
 		  return {
-			tabIndex: 0,
+			tabIndex: 1,
 		    tabs:[
 				{
 					state: 1,
@@ -152,20 +152,13 @@
 				}
 			],
 			isShowFilter:false,
-			timeList: [{
-				label: '张三',
-				value: 3
-			},{
-				label: '李四',
-				value: 2
-			},{
-				label: '王麻子',
-				value: 1
-			}]
+			employeeList: [],
+			list: [],
+			staffId: ''
 		  }  
 		},
 		onLoad(options) {
-			
+			this.loadEmloyeeList();
 		},
 		onNavigationBarButtonTap(e){
 			if(e.index==0){
@@ -182,14 +175,51 @@
 		},
 		methods:{
 			tabChange(index){
-				this.tabIndex = index;
+				let val = index + 1;
+				if(val == this.tabIndex){
+					return
+				}
+				this.tabIndex = val;
+				if(val != 3){
+					this.loadList()
+				}
 			},
 			hideFilter(){
 				this.isShowFilter = false
 			},
-			toAnalyse(){
+			toAnalyse(title, type){
 				uni.navigateTo({
-					url: './analyse'
+					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) => {
+					if(res.status == 200){
+						let result = res.rows;
+						this.employeeList = result;
+						if(result.length){
+							this.staffId = result[0].id;
+							this.loadList()
+						}else{
+							this.loadList()
+						}
+					}
+				})
+			},
+			loadList(){
+				this.$httpUtils.request('/api/statistics/findVipAchieve', {
+					"pageNum": 1,
+					"pageSize": 100,
+					"staffId": this.staffId,
+					"type": this.tabIndex
+				}, 'POST').then((res) => {
+					if(res.status == 200){
+						this.list = res.rows;
+					}
 				})
 			}
 		}
@@ -253,7 +283,8 @@
 		color: #a5abaf
 	}
 	.drop-down{
-		min-width: 56px;
+		height: 200px;
+		width: 60px;
 		background: #FFFFFF;
 		border: 1px solid #EDEAF4;
 		border-radius: 4px;

--
Gitblit v1.9.1