| | |
| | | this.getHGroupList() |
| | | this.getHShiftsList() |
| | | this.getHProcList() |
| | | this.getHShiftCurrent() |
| | | //先获取角色列表,然后获取用户绑定的角色 |
| | | this.getRoleList().then(() => { |
| | | this.getUserBoundRoles(); |
| | |
| | | } |
| | | } |
| | | }, |
| | | async getHShiftCurrent() { |
| | | // 根据当前用户绑定的工作中心和部门获取到班次信息(没有则不获取) |
| | | let HDeptID = getUserInfo()["HDeptID"] |
| | | let HCenterID = getUserInfo()["HWorkCenterID"] |
| | | console.log(HDeptID, HCenterID) |
| | | if(!HDeptID || !HCenterID) { |
| | | return |
| | | } |
| | | try{ |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Gy_ShiftsController/Get_HWorkShift", |
| | | data: { |
| | | HDeptID, |
| | | HCenterID |
| | | } |
| | | }) |
| | | |
| | | let {count, data,Message} = res.data |
| | | if(count == 1) { |
| | | this.hform.HShiftsID = data[0]["HInterID"] |
| | | this.hform.HShiftsName = data[0]["班次"] |
| | | }else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取班次信息失败: ${Message}` |
| | | }) |
| | | } |
| | | }catch(err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取班次信息失败: ${err.message}` |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | // 获取用户已绑定的角色 |
| | | async getUserBoundRoles() { |
| | | try { |