This commit is contained in:
Vinjor 2024-11-15 16:25:48 +08:00
parent 9b9519176d
commit 070df2478b
3 changed files with 115 additions and 26 deletions

View File

@ -12,7 +12,7 @@
<view class="userInfo" @click="showUserDetail">
<text class="userName">{{ userInfo.nickname }}</text>
<text class="userType">{{ userInfo.roleNames }}</text>
<text class="userType" v-if="ifLeader || ifLeader=='true'">班组长</text>
<text class="userType" v-if="ifLeader">班组长</text>
</view>
<view class="msg-box" @click="gotoMsg">
<image mode="aspectFita" src="@/pages-home/static/msg.png" style="width: 48rpx;height: 48rpx"></image>
@ -70,15 +70,17 @@
<u-icon style="width: 20rpx" color="#999" name="arrow-right" size="12"></u-icon>
</view>
</view>
<!-- 服务顾问角色 -->
<view class="orderCount" v-if="userInfo.roleCodes.includes('service_advisor')" @click="serviceWork">
<view class="orderCountItem">
<text class="label">待审批配件申请单</text>
<text class="value">{{serviceNum}}</text>
<!-- 总检角色和维修业务管理员 -->
<view v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
<view class="body-top-tab">
<view v-for="(item, index) in timePicker" @click="activeTab(index)" :key="index"
:class="{ active: active === index }"
class="body-top-tab-item">
{{ item }}
<view v-if="index === active" class="activeLine"></view>
</view>
</view>
<!-- TODO 总检角色 -->
<view class="orderCount" v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
<view class="orderCount" >
<view class="orderCountItem">
<text class="label">维修中</text>
<text class="value">{{ bossNum.workingNum }}</text>
@ -89,6 +91,14 @@
<text class="value">{{ bossNum.doneNum }}</text>
</view>
</view>
</view>
<!-- 服务顾问角色 -->
<view class="orderCount" v-if="userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('weixiu')|| userInfo.roleCodes.includes('general_inspection')" @click="serviceWork">
<view class="orderCountItem">
<text class="label">待审批配件申请单</text>
<text class="value">{{serviceNum}}</text>
</view>
</view>
<view class="todoListBox">
<view class="title">
待办工单
@ -182,6 +192,9 @@ export default {
avatar: undefined,
nickname: ''
},
//--
timePicker:['当日','累计'],
active:0,
menuList: [
{
title: '新建工单',
@ -275,6 +288,11 @@ export default {
}
},
methods: {
activeTab(index) {
this.active = index
//
this.getBossTodo()
},
/**
* 作废
*/
@ -563,9 +581,13 @@ export default {
* 从总检的角度差维修中已完成的工单数量
*/
getBossTodo(){
let params={
selectType:this.active==0?"today":"all"
}
request({
url: '/admin-api/repair/tickets/getBossNum',
method: 'get',
params:params
}).then((res) => {
console.log(res)
if (res.code == 200) {
@ -932,7 +954,7 @@ export default {
}
}
.orderCount {
margin: 40rpx 32rpx;
margin: 0 40rpx 32rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 40rpx;
@ -1076,6 +1098,35 @@ export default {
}
}
.body-top-tab {
display: flex;
font-size: 30rpx;
margin: 0 32rpx;
.body-top-tab-item {
flex: 1;
width: 0;
text-align: center;
padding: 16rpx 20rpx;
position: relative;
&.active {
color: #0174F6;
}
.activeLine {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 96rpx;
height: 6rpx;
background: #0174F6;
border-radius: 4rpx 4rpx 0rpx 0rpx;
}
}
}
.repairShop {
width: 686rpx;
margin: 38rpx auto 0;

View File

@ -49,6 +49,26 @@
url: '/pages/login/login'
})
}
},
onShow(){
if (getToken()) {
//
let userInfo = getUserInfo()
if (userInfo.roleCodes.includes('repair_warehouse')) {
//
uni.navigateTo({
url: '/pages-warehouse/home/home'
})
} else {
uni.navigateTo({
url: '/pages-home/home/home'
})
}
} else {
uni.navigateTo({
url: '/pages/login/login'
})
}
},
methods: {
register() { //

View File

@ -48,6 +48,8 @@
loginApp
} from '@/api/login';
import {
getToken,
getUserInfo,
setToken,
setTenantId,
getTenantId,
@ -96,6 +98,22 @@
},
},
mounted() {},
onShow(){
if (getToken()) {
//
let userInfo = getUserInfo()
if (userInfo.roleCodes.includes('repair_warehouse')) {
//
uni.navigateTo({
url: '/pages-warehouse/home/home'
})
} else {
uni.navigateTo({
url: '/pages-home/home/home'
})
}
}
},
methods: {
wxlogin() {
uni.login({