Browse Source

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

master
ljlong_2630 7 months ago
parent
commit
3c5a416f84
  1. 5
      src/api/eam/basic/classType/index.ts
  2. 14
      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 = () => { export const importTemplate = () => {
return request.download({ url: '/eam/class-type/get-import-template' }) 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 })
}

14
src/store/modules/user.ts

@ -4,6 +4,7 @@ import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getInfo, loginOut } from '@/api/login' import { getInfo, loginOut } from '@/api/login'
import { getUserProfile } from '@/api/system/user/profile' import { getUserProfile } from '@/api/system/user/profile'
import { getClassTypeNoPage } from '@/api/eam/basic/classType'
const { wsCache } = useCache() const { wsCache } = useCache()
@ -18,6 +19,7 @@ interface UserInfoVO {
isSetUser: boolean isSetUser: boolean
user: UserVO user: UserVO
userSelfInfo: object userSelfInfo: object
classType: object[]
} }
export const useUserStore = defineStore('admin-user', { export const useUserStore = defineStore('admin-user', {
@ -30,7 +32,8 @@ export const useUserStore = defineStore('admin-user', {
avatar: '', avatar: '',
nickname: '' nickname: ''
}, },
userSelfInfo:{} userSelfInfo: {},
classType: []
}), }),
getters: { getters: {
getPermissions(): string[] { getPermissions(): string[] {
@ -47,6 +50,9 @@ export const useUserStore = defineStore('admin-user', {
}, },
getUserSelfInfo(): UserVO { getUserSelfInfo(): UserVO {
return this.userSelfInfo return this.userSelfInfo
},
getClassTypeInfo(): object[] {
return this.classType
} }
}, },
actions: { actions: {
@ -64,6 +70,12 @@ export const useUserStore = defineStore('admin-user', {
this.roles = userInfo.roles this.roles = userInfo.roles
this.user = userInfo.user this.user = userInfo.user
this.isSetUser = true 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.USER, userInfo)
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus) 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 return false
} }
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){ }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 == ''){ }else if(row.requestNumber == null || row.requestNumber == ''){
if(row.status === 'COMPLETED' && type == 'VERIFY'){ if(row.status === 'COMPLETED' && type == 'VERIFY'){
return true return userStore.classType.some(item => {
return item?.type == row.type && item?.factoryAreaNumber == row.factoryAreaNumber;
});
} }
} }
// COMPLETEDAPPLYPASSCOMPLETEDfalse // COMPLETEDAPPLYPASSCOMPLETEDfalse

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

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

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

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

Loading…
Cancel
Save