修改部分bug
This commit is contained in:
@ -24,6 +24,8 @@ Page({
|
||||
monthRefundAmount: 0, // 本月退款总金额
|
||||
monthPromotionCount: 0, // 本月推广数量
|
||||
userRole: '', // 用户角色
|
||||
isShowArr: [],
|
||||
widthRate: '30%'
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@ -45,6 +47,13 @@ Page({
|
||||
break;
|
||||
}
|
||||
this.setData({ showRole });
|
||||
if (options.role === 'manger') this.setData({isShowArr: [true, true, true]})
|
||||
else if (options.role === 'supervisor') this.setData({isShowArr: [false, true, true]})
|
||||
else if (options.role === 'staff') this.setData({isShowArr: [false, false, true]})
|
||||
const trueCount = this.data.isShowArr.filter(v => v === true).length;
|
||||
if (trueCount === 3) this.setData({widthRate: '30%'})
|
||||
else if (trueCount === 2) this.setData({widthRate: '47.5%'})
|
||||
else if (trueCount === 1) this.setData({widthRate: '100%'})
|
||||
},
|
||||
|
||||
fetchPerformance() {
|
||||
|
@ -61,31 +61,36 @@
|
||||
</view>
|
||||
|
||||
<!-- 底部网格 -->
|
||||
<view class="grid pos">
|
||||
<view class="flex-col items-center grid-item">
|
||||
<view class="pos">
|
||||
<view class="flex-row" style="justify-content: space-between;">
|
||||
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[0]}}">
|
||||
<text class="font text_2">主管数量</text>
|
||||
<text class="mt-20 font_2">{{superCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item">
|
||||
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[1]}}">
|
||||
<text class="font text_3">员工数量</text>
|
||||
<text class="mt-20 font_2">{{empCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item">
|
||||
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[2]}}">
|
||||
<text class="font text_4">客户数量</text>
|
||||
<text class="mt-20 font_2">{{promoCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
</view>
|
||||
|
||||
<view class="flex-row" style="justify-content: space-between;">
|
||||
<view class="flex-col items-center grid-item_2" style="margin-right: 10rpx">
|
||||
<text class="font text_5">订单总金额</text>
|
||||
<text class="mt-20 font_2">¥{{totalAmount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<view class="flex-col items-center grid-item_2" style="margin: 40rpx 10rpx 0">
|
||||
<text class="font text_6">订单净成交</text>
|
||||
<text class="mt-20 font_2">¥{{netAmount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<view class="flex-col items-center grid-item_2" style="margin-left: 10rpx">
|
||||
<text class="font text_7">下单数量</text>
|
||||
<text class="mt-20 font_2">{{orderCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -232,6 +232,8 @@
|
||||
line-height: 24.54rpx;
|
||||
}
|
||||
.grid-item_2 {
|
||||
width: 30%;
|
||||
margin-top: 40rpx;
|
||||
padding: 22.5rpx 0;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
|
@ -135,7 +135,7 @@ Page({
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if( role === 'supervisor' ) {
|
||||
} else if( role === 'supervisor' || role === 'staff') {
|
||||
wx.request({
|
||||
url: baseUrl + '/perform/rank/staff', // 替换为实际API地址
|
||||
method: 'POST',
|
||||
@ -175,6 +175,7 @@ Page({
|
||||
onLoad(options) {
|
||||
// 根据身份确定角色
|
||||
const role = options.role;
|
||||
if (role === 'staff') this.setData({selectedSortField: '推广人数'})
|
||||
console.log('角色---->',options.role);
|
||||
this.setData({ role });
|
||||
let showRole = '';
|
||||
@ -185,6 +186,8 @@ Page({
|
||||
case 'supervisor':
|
||||
showRole = '员工';
|
||||
break;
|
||||
case 'staff':
|
||||
showRole = '员工'
|
||||
}
|
||||
this.setData({ showRole });
|
||||
this.onSearch()
|
||||
|
@ -28,7 +28,7 @@
|
||||
<image class="image" src="./images/bottom.png"/>
|
||||
</view>
|
||||
</picker>
|
||||
<picker mode="selector" wx:if="{{ role === 'supervisor' }}" range="{{sortFieldsBySupervisor}}" bindchange="onSortFieldChange">
|
||||
<picker mode="selector" wx:if="{{ role === 'supervisor' || role === 'staff'}}" range="{{sortFieldsBySupervisor}}" bindchange="onSortFieldChange">
|
||||
<view class="flex-row justify-between section_2">
|
||||
<text class="font text_1">{{selectedSortField}}</text>
|
||||
<image class="image" src="./images/bottom.png"/>
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
<!-- 绩效数据 -->
|
||||
<view class="flex-row mt-14">
|
||||
<view class="flex-col justify-start items-center text-wrapper_5">
|
||||
<view class="flex-col justify-start items-center text-wrapper_5" wx:if="{{role === 'supervisor'}}">
|
||||
<text class="font_5 text_11">员工:{{item.empCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col justify-start items-center text-wrapper_6 ml-8">
|
||||
|
@ -58,7 +58,7 @@ Page({
|
||||
onSearchSupId() {
|
||||
|
||||
const { supervisorUserId } = this.data;
|
||||
|
||||
|
||||
wx.request({
|
||||
url: baseUrl + '/perform/query/staff',
|
||||
method: 'POST',
|
||||
@ -98,6 +98,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
console.log('========>', options)
|
||||
this.setData({
|
||||
supervisorUserId: options.supId,
|
||||
})
|
||||
|
@ -28,12 +28,12 @@ Page({
|
||||
const { orderNumber, staffUserId } = this.data;
|
||||
|
||||
// 简单校验:非空
|
||||
if (!orderNumber) {
|
||||
return wx.showToast({
|
||||
title: '请输入订单号',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
// if (!orderNumber) {
|
||||
// return wx.showToast({
|
||||
// title: '请输入订单号',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// }
|
||||
|
||||
// 发起 POST 请求
|
||||
wx.request({
|
||||
|
Reference in New Issue
Block a user