<template>
|
<!-- 员工业绩报表 -->
|
<view class="container">
|
<h-tabs
|
class="tab"
|
:tabData="tabs"
|
@tabClick="tabChange"
|
:config="{
|
color: '#abb1cc',
|
activeColor: '#518EFF',
|
underLineColor: '#518EFF',
|
underLineHeight: 6,
|
fontSize: '28',
|
underLineWidth: 60,
|
}"
|
/>
|
<view v-if="tabIndex==1 || tabIndex==2">
|
<view class="list-item" v-for="item in list">
|
<view class="list-header">
|
<text>{{item.time}}</text>
|
</view>
|
<view class="list-content">
|
<view class="list-row">
|
<text>订单业绩</text>
|
<text>¥{{item.orderAmount | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>现金业绩</text>
|
<text>¥{{item.cashAmount | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>划扣业绩</text>
|
<text>¥{{item.cardUseAmount | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>订单提成</text>
|
<text>¥{{item.goodsAmount | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>本金消耗</text>
|
<text>¥{{item.hisConsume | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>赠送消耗</text>
|
<text>¥{{item.freeConsume | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>服务提成</text>
|
<text>¥{{item.commission | formatNum}}</text>
|
</view>
|
<view class="list-row">
|
<text>人头数</text>
|
<text>{{item.peopleNum}}人</text>
|
</view>
|
<view class="list-row">
|
<text>项目数</text>
|
<text>{{item.projNum}}个</text>
|
</view>
|
<view class="list-row">
|
<text>服务时长</text>
|
<text>{{item.serviceTime}}分钟</text>
|
</view>
|
</view>
|
</view>
|
<view v-if="list.length">
|
<uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more>
|
</view>
|
</view>
|
<view v-else>
|
<view class="list-item">
|
<view class="list-header">
|
<text class="font-bold">专项数据</text>
|
</view>
|
<view class="list-content-bordered">
|
<view class="list-row-bordered" @click="toAnalyse('订单业绩', 1)">
|
<text>订单业绩</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
<view class="list-row-bordered" @click="toAnalyse('现金业绩', 2)">
|
<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)">
|
<text>本金消耗</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
<view class="list-row-bordered" @click="toAnalyse('赠送消耗', 7)">
|
<text>赠送消耗</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
<view class="list-row-bordered" @click="toAnalyse('服务提成', 8)">
|
<text>服务提成</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
<view class="list-row-bordered" @click="toAnalyse('人头数', 9)">
|
<text>人头数</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
<view class="list-row-bordered" @click="toAnalyse('项目数', 10)">
|
<text>项目数</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
<view class="list-row-bordered" @click="toAnalyse('服务时长', 11)">
|
<text>服务时长</text>
|
<text class="iconfont iconarrow-backimg"></text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
import HTabs from "@/components/liuyuno-tabs/liuyuno-tabs.vue";
|
export default {
|
components: {
|
HTabs,
|
uniLoadMore
|
},
|
data() {
|
return {
|
tabIndex: 1,
|
tabs:[
|
{
|
state: 1,
|
name: '每日'
|
},
|
{
|
state: 2,
|
name: '每月'
|
},
|
{
|
state: 3,
|
name: '专项'
|
}
|
],
|
list: [],
|
staffId: '',
|
loadStatus: 'more',
|
pageNum: 1
|
}
|
},
|
onLoad(options) {
|
this.initTitle();
|
this.loadEmloyeeList();
|
this.loadList()
|
},
|
onPullDownRefresh(){
|
this.reloadData();
|
let timer = setTimeout(function () {
|
uni.stopPullDownRefresh();
|
clearTimeout(timer);
|
timer = null;
|
}, 800);
|
},
|
onReachBottom(){
|
this.loadList()
|
},
|
onNavigationBarButtonTap(e){
|
if(e.index==0){
|
uni.navigateTo({
|
url:"./hint?type=2"
|
})
|
}
|
if(e.width && e.index==1){
|
uni.navigateTo({
|
url: './selectEmployee?selectId='+this.staffId
|
})
|
}
|
},
|
methods:{
|
reloadData(){
|
this.list = [];
|
this.pageNum = 1;
|
this.loadStatus = 'more';
|
this.loadList();
|
},
|
initTitle(){
|
let roleInfo = this.$httpUtils.getRoleInfo();
|
if(roleInfo){
|
this.staffId = roleInfo.id;
|
uni.setNavigationBarTitle({
|
title: roleInfo.name+'的业绩报表'
|
})
|
}
|
},
|
tabChange(index){
|
let val = index + 1;
|
if(val == this.tabIndex){
|
return
|
}
|
this.tabIndex = val;
|
if(val != 3){
|
this.reloadData()
|
}
|
},
|
toAnalyse(title, type){
|
uni.navigateTo({
|
url: './analyse/index?staffId='+this.staffId+'&title='+title+'&type='+type+'&page=2'
|
})
|
},
|
loadEmloyeeList(){
|
this.$httpUtils.request('/api/user/findAllUsers', {}, 'POST').then((res) => {
|
if(res.status == 200){
|
let result = res.rows;
|
if(!result.length){
|
// #ifdef APP-PLUS
|
let webView = this.$mp.page.$getAppWebview();
|
webView.setTitleNViewButtonStyle(1, {
|
width: 0,
|
});
|
// #endif
|
}
|
}
|
})
|
},
|
loadList(){
|
if(this.loadStatus!=='more'){
|
return;
|
}
|
this.$httpUtils.request('/api/statistics/findVipAchieve', {
|
"pageNum": this.pageNum,
|
"pageSize": 10,
|
"staffId": this.staffId,
|
"type": this.tabIndex
|
}, 'POST').then((res) => {
|
if(res.status == 200){
|
let result = res.rows;
|
if(result.length < 10){
|
this.loadStatus = 'noMore';
|
} else {
|
this.pageNum ++ ;
|
this.loadStatus = 'more';
|
}
|
this.list = this.list.concat(result);
|
}
|
})
|
},
|
setData(selectItem){
|
let item = selectItem[0];
|
this.staffId = item.id;
|
this.reloadData();
|
setTimeout(() => {
|
uni.setNavigationBarTitle({
|
title: item.name+'的业绩报表'
|
});
|
}, 500)
|
}
|
}
|
}
|
</script>
|
|
<style>
|
page{
|
background: #F6F6F8;
|
height: 100%;
|
}
|
.container{
|
min-height: 100%;
|
}
|
.tab{
|
background: #FFFFFF;
|
border-bottom: #EDEAF4;
|
border-bottom-left-radius: 4px;
|
border-bottom-right-radius: 4px;
|
box-shadow:0 6px 6px rgba(237,234,244,0.5);
|
}
|
.list-item{
|
margin: 10px 10px 0;
|
padding: 0 10px;
|
background: #FFFFFF;
|
border: 1px solid #EDEAF4;
|
border-radius: 4px;
|
}
|
.list-header{
|
border-bottom: 1px solid #EDEAF4;
|
padding: 12px 5px;
|
font-size: 14px;
|
}
|
.list-content{
|
padding: 8px 5px;
|
font-size: 13px;
|
color: #333;
|
}
|
.list-row{
|
display: flex;
|
justify-content: space-between;
|
line-height: 30px;
|
}
|
.list-row text:nth-last-of-type(1){
|
color: #666
|
}
|
.list-content-bordered{
|
padding: 0 5px;
|
font-size: 13px;
|
}
|
.list-row-bordered{
|
display: flex;
|
justify-content: space-between;
|
line-height: 40px;
|
border-bottom: 1px solid #EDEAF4;
|
}
|
.list-row-bordered:nth-last-of-type(1){
|
border-bottom: 0;
|
}
|
.list-row-bordered text:nth-last-of-type(1){
|
color: #a5abaf
|
}
|
.drop-down{
|
height: 200px;
|
width: 60px;
|
background: #FFFFFF;
|
border: 1px solid #EDEAF4;
|
border-radius: 4px;
|
padding: 0 10px;
|
position: fixed;
|
right: 35px;
|
top: 0;
|
z-index: 99;
|
color: #a5abaf;
|
font-size: 12px;
|
}
|
.drop-down-row{
|
border-bottom: 1px solid #EDEAF4;
|
padding: 5px 0;
|
text-align: center;
|
}
|
.drop-down-row:nth-last-child(1){
|
border: 0;
|
}
|
</style>
|