修改部分bug
This commit is contained in:
@ -18,6 +18,7 @@ Page({
|
||||
isShowOrder: true,
|
||||
qrcode: "", // 设置二维码图片的路径
|
||||
userRole: "",
|
||||
title: '查看绩效',
|
||||
id: 0,
|
||||
},
|
||||
|
||||
@ -149,7 +150,9 @@ Page({
|
||||
userRole: result.userRole,
|
||||
id: result.id,
|
||||
})
|
||||
if (result.userRole !== 'user') this.setData({ isShowOrder: false });
|
||||
console.log(result.userRole)
|
||||
if (result.userRole !== 'user') this.setData({ isShowOrder: false});
|
||||
if (result.userRole === 'staff') this.setData({title: '客户订单'});
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -198,22 +201,51 @@ Page({
|
||||
wx.navigateTo({
|
||||
url: `/pages/dashboardModule/supervisorPerformance/supervisorPerformance?role=${userRole}&id=${id}`,
|
||||
})
|
||||
} else if (userRole === 'staff') {
|
||||
wx.navigateTo({
|
||||
url: `/pages/dashboardModule/userOrderPerformance/userOrderPerformance?userId=${id}`,
|
||||
})
|
||||
} else {
|
||||
wx.navigateTo({
|
||||
url: `/pages/dashboardModule/staffPerformance/staffPerformance?role=${userRole}&id=${id}`,
|
||||
url: `/pages/dashboardModule/staffPerformance/staffPerformance?role=${userRole}&supId=${id}`,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转排名
|
||||
gotoRank(e) {
|
||||
// 跳转主管排名
|
||||
gotoSupervisorRank(e) {
|
||||
console.log(e);
|
||||
const userRole = e.currentTarget.dataset.userrole;
|
||||
const {userRole} = this.data
|
||||
console.log('========fds===>', userRole)
|
||||
if (userRole === 'staff' || userRole === 'user') {
|
||||
wx.showToast({
|
||||
title: '无权限',
|
||||
icon: 'error'
|
||||
})
|
||||
return ;
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=${userRole}`,
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转员工排名
|
||||
gotoStaffRank(e) {
|
||||
console.log(e);
|
||||
const {userRole} = this.data
|
||||
console.log('===========>', userRole)
|
||||
if (userRole === 'user') {
|
||||
wx.showToast({
|
||||
title: '无权限',
|
||||
icon: 'error'
|
||||
})
|
||||
return ;
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=${userRole}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -253,16 +253,16 @@
|
||||
class="image_5"
|
||||
src="./images/zhijinxiangqing.png"
|
||||
/>
|
||||
<text class="font text_5 mt-6">查看绩效</text>
|
||||
<text class="font text_5 mt-6">{{title}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center equal-division-item_2 equal-division-item" bind:tap="gotoRank" data-userRole="{{ 'manager' }}">
|
||||
<view class="flex-col items-center equal-division-item_2 equal-division-item" bind:tap="gotoSupervisorRank" data-userRole="{{ 'manager' }}">
|
||||
<image
|
||||
class="image_5"
|
||||
src="./images/tixianzhanghu.png"
|
||||
/>
|
||||
<text class="font text_6 mt-6">主管排名</text>
|
||||
</view>
|
||||
<view class="flex-col items-center equal-division-item_3 group_5" bind:tap="gotoRank" data-userRole="{{ 'supervisor' }}">
|
||||
<view class="flex-col items-center equal-division-item_3 group_5" bind:tap="gotoStaffRank" data-userRole="{{ 'supervisor' }}">
|
||||
<image
|
||||
class="image_5"
|
||||
src="./images/tixianjilu.png"
|
||||
@ -284,7 +284,7 @@
|
||||
src="./images/xiajiantou.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="gotoDashboard">
|
||||
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="gotoDashboard" wx:if="{{ userRole !== 'user' }}">
|
||||
<view class="flex-row items-center">
|
||||
<image
|
||||
class="shrink-0 image_6"
|
||||
|
Reference in New Issue
Block a user