From 070df2478b2fadf0e6171aa447d867ce25c8ad04 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 15 Nov 2024 16:25:48 +0800 Subject: [PATCH] 1 --- pages-home/home/home.vue | 81 ++++++++++++++++++++++++++++++++-------- pages/index/index.vue | 42 +++++++++++++++------ pages/login/login.vue | 18 +++++++++ 3 files changed, 115 insertions(+), 26 deletions(-) diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue index 6926903..a08f7fb 100644 --- a/pages-home/home/home.vue +++ b/pages-home/home/home.vue @@ -12,7 +12,7 @@ {{ userInfo.nickname }} {{ userInfo.roleNames }} - 班组长 + 班组长 @@ -70,25 +70,35 @@ + + + + + {{ item }} + + + + + + 维修中 + {{ bossNum.workingNum }} + + + + 已完成 + {{ bossNum.doneNum }} + + + - + 待审批配件申请单 {{serviceNum}} - - - - 维修中 - {{ bossNum.workingNum }} - - - - 已完成 - {{ bossNum.doneNum }} - - 待办工单 @@ -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; diff --git a/pages/index/index.vue b/pages/index/index.vue index 6a65471..02338b1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,32 +24,52 @@ } } }, - onLoad() { - // #ifdef APP - //保活技术 - this.register() - // #endif - if(getToken()){ + onLoad() { + // #ifdef APP + //保活技术 + this.register() + // #endif + if (getToken()) { this.getNoReadNum() //跳转首页 //判断是否是仓管,仓管需要跳单独的首页 let userInfo = getUserInfo() - if(userInfo.roleCodes.includes('repair_warehouse')){ + if (userInfo.roleCodes.includes('repair_warehouse')) { //仓管 uni.navigateTo({ url: '/pages-warehouse/home/home' }) - }else{ + } else { uni.navigateTo({ url: '/pages-home/home/home' }) } - }else{ + } else { uni.navigateTo({ 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() { //注册 console.log(keepAlivePlugin, 'keepAlive'); diff --git a/pages/login/login.vue b/pages/login/login.vue index 74e416f..68c581c 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -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({