Browse Source

维修工单报修人能验证bug修复

master
ljlong_2630 6 months ago
parent
commit
3c5a416f84
  1. 5
      src/api/eam/basic/classType/index.ts
  2. 16
      src/store/modules/user.ts
  3. 8
      src/views/eam/device/devicemaintenancejob/index.vue
  4. 8
      src/views/eam/device/techmaintenancejob/index.vue
  5. 8
      src/views/eam/mold/moldmaintenancejob/index.vue

5
src/api/eam/basic/classType/index.ts

@ -52,3 +52,8 @@ export const exportClassType = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/eam/class-type/get-import-template' })
}
// 查询厂区班组角色数据维护列表
export const getClassTypeNoPage = async (params) => {
return await request.get({ url: `/eam/class-type/noPage`, params })
}

16
src/store/modules/user.ts

@ -4,6 +4,7 @@ import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getInfo, loginOut } from '@/api/login'
import { getUserProfile } from '@/api/system/user/profile'
import { getClassTypeNoPage } from '@/api/eam/basic/classType'
const { wsCache } = useCache()
@ -17,7 +18,8 @@ interface UserInfoVO {
roles: string[]
isSetUser: boolean
user: UserVO
userSelfInfo:object
userSelfInfo: object
classType: object[]
}
export const useUserStore = defineStore('admin-user', {
@ -30,7 +32,8 @@ export const useUserStore = defineStore('admin-user', {
avatar: '',
nickname: ''
},
userSelfInfo:{}
userSelfInfo: {},
classType: []
}),
getters: {
getPermissions(): string[] {
@ -47,6 +50,9 @@ export const useUserStore = defineStore('admin-user', {
},
getUserSelfInfo(): UserVO {
return this.userSelfInfo
},
getClassTypeInfo(): object[] {
return this.classType
}
},
actions: {
@ -64,6 +70,12 @@ export const useUserStore = defineStore('admin-user', {
this.roles = userInfo.roles
this.user = userInfo.user
this.isSetUser = true
this.classType = await getClassTypeNoPage({});
this.classType = this.classType.filter(item => {
return this.userSelfInfo?.roles.some(role => {
return role.id == item.workerRoleId || role.id == item.engineerRoleId;
});
});
wsCache.set(CACHE_KEY.USER, userInfo)
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
},

8
src/views/eam/device/devicemaintenancejob/index.vue

@ -371,10 +371,14 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
return false
}
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
}else if(row.requestNumber == null || row.requestNumber == ''){
if(row.status === 'COMPLETED' && type == 'VERIFY'){
return true
return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
}
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse

8
src/views/eam/device/techmaintenancejob/index.vue

@ -345,10 +345,14 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
return false
}
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
}else if(row.requestNumber == null || row.requestNumber == ''){
if(row.status === 'COMPLETED' && type == 'VERIFY'){
return true
return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
}
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse

8
src/views/eam/mold/moldmaintenancejob/index.vue

@ -1169,10 +1169,14 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
return false
}
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
}else if(row.requestNumber == null || row.requestNumber == ''){
if(row.status === 'COMPLETED' && type == 'VERIFY'){
return true
return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
}
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse

Loading…
Cancel
Save