diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index bbdefbed..04e4f24f 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -560,10 +560,10 @@ export default { }, confirmChooseOrg(orgInfo){ //console.log(orgInfo,'orgInfo'); - // if(!orgInfo.hrbpId || orgInfo.hrbpId=='0'){ - // this.$message.error("此机构无HRBP审核人信息,请重新选择"); - // return; - // } + if(!orgInfo.hrbpId || orgInfo.hrbpId=='0'){ + this.$message.error("此机构无HRBP审核人信息,请重新选择"); + return; + } this.orgName=orgInfo.name; this.orgKid=orgInfo.kid; //kid已不存在 this.courseInfo.orgId=orgInfo.id; @@ -598,30 +598,30 @@ export default { }), loadUserGroup(){ let $this=this; - apiUserGroup.findByName('').then(rs=>{ - if(rs.status==200){ - let crowdList=[]; - rs.result.forEach(item=>{ - crowdList.push({ - id:item.key, - name:item.value, - disabled:false - }) - }) - this.userGroupList=crowdList; - } - }); - // apiUserBasic.getUserCrowds().then(rs=>{ - // if(rs.status==200){ - // let crowdList=[]; - // rs.result.forEach(item=>{ - // crowdList.push({ - // id:item.kid, - // name:item.audienceName + // apiUserGroup.findByName('').then(rs=>{ + // if(rs.status==200){ + // let crowdList=[]; + // rs.result.forEach(item=>{ + // crowdList.push({ + // id:item.key, + // name:item.value, + // disabled:false // }) - // }) - // } - // }) + // }) + // this.userGroupList=crowdList; + // } + // }); + apiUserBasic.getUserCrowds().then(rs=>{ + if(rs.status==200){ + let crowdList=[]; + rs.result.forEach(item=>{ + crowdList.push({ + id:item.kid, + name:item.audienceName + }) + }) + } + }) }, resOwnerName(code) { if (code == '') { @@ -1383,28 +1383,28 @@ export default { let $this = this; console.log(this.courseInfo.orgId,'this.courseInfo.orgId') //先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息 - // apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ - // if(rs.status==200 && rs.result){ - // postData.auditUser={ - // email:rs.result.email, - // code:rs.result.userNo, - // name:rs.result.name, - // aid:rs.result.id, - // orgId:rs.result.orgId - // } - // postData.course.orgName=rs.result.orgNamePath+'/'+rs.result.orgName; + apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ + if(rs.status==200 && rs.result){ + postData.auditUser={ + email:rs.result.email, + code:rs.result.userNo, + name:rs.result.name, + aid:rs.result.id, + orgId:rs.result.orgId + } + postData.course.orgName=rs.result.orgNamePath+'/'+rs.result.orgName; - apiHRBP.getHRBP(this.orgKid).then(rs=>{ - if(rs.status==200 && rs.result.length>0){ - let hrbpUser=rs.result[0]; - postData.auditUser={ - email:hrbpUser.email, - code:hrbpUser.user_no, - name:hrbpUser.real_name, - kid:hrbpUser.user_id, - orgId:hrbpUser.orgnization_id - } - postData.course.orgName=hrbpUser.orgnization_name_path+'/'+$this.orgName; + // apiHRBP.getHRBP(this.orgKid).then(rs=>{ + // if(rs.status==200 && rs.result.length>0){ + // let hrbpUser=rs.result[0]; + // postData.auditUser={ + // email:hrbpUser.email, + // code:hrbpUser.user_no, + // name:hrbpUser.real_name, + // kid:hrbpUser.user_id, + // orgId:hrbpUser.orgnization_id + // } + // postData.course.orgName=hrbpUser.orgnization_name_path+'/'+$this.orgName; apiCourse.submitCourse(postData).then(res => { //this.btnLoading=false; diff --git a/src/components/System/chooseOrg.vue b/src/components/System/chooseOrg.vue index eef1ce99..80c41006 100644 --- a/src/components/System/chooseOrg.vue +++ b/src/components/System/chooseOrg.vue @@ -106,56 +106,56 @@ }else{ let $this=this; if(node.level === 1){ - parentId = '-1'; - // apiUserBasic.findOrgsByKeyword('').then(rs=>{ - // let treeList=[]; - // rs.result.forEach(item=>{ - // let node={ - // id:item.id, - // name:item.name, - // hrbpId:item.hrbpId, - // children:[] - // } - // treeList.push(node); - // }); - // resolve(treeList); - // }); + // parentId = '-1'; + apiUserBasic.findOrgsByKeyword('').then(rs=>{ + let treeList=[]; + rs.result.forEach(item=>{ + let node={ + id:item.id, + name:item.name, + hrbpId:item.hrbpId, + children:[] + } + treeList.push(node); + }); + resolve(treeList); + }); }else{ parentId = node.data.id; - // apiUserBasic.findOrgTreeByOrgId(parentId).then(rs=>{ - // if(rs.status==200){ - // let treeList=[]; - // if(rs.result.length>0 && rs.result[0].treeChildList){ - // rs.result[0].treeChildList.forEach(item=>{ - // let node={ - // id:item.id, - // name:item.name, - // hrbpId:item.hrbpId, - // children:[] - // } - // if(item.treeChildList){ - // $this.readTreeNode(node,item.treeChildList); - // } - // treeList.push(node); - // }); - // } - // resolve(treeList); - // }else{ - // resolve([]); - // } - // }); + apiUserBasic.findOrgTreeByOrgId(parentId).then(rs=>{ + if(rs.status==200){ + let treeList=[]; + if(rs.result.length>0 && rs.result[0].treeChildList){ + rs.result[0].treeChildList.forEach(item=>{ + let node={ + id:item.id, + name:item.name, + hrbpId:item.hrbpId, + children:[] + } + if(item.treeChildList){ + $this.readTreeNode(node,item.treeChildList); + } + treeList.push(node); + }); + } + resolve(treeList); + }else{ + resolve([]); + } + }); } - usergroupApi.userOrgs(parentId).then(res =>{ - if (res.status == 200) { - if(res.result != null && res.result.length > 0){ - resolve(res.result); - }else{ - resolve([]); - } - }else{ - this.$message.error('查询用户的机构失败'); - } - }); + // usergroupApi.userOrgs(parentId).then(res =>{ + // if (res.status == 200) { + // if(res.result != null && res.result.length > 0){ + // resolve(res.result); + // }else{ + // resolve([]); + // } + // }else{ + // this.$message.error('查询用户的机构失败'); + // } + // }); } }, handleSelectionChange(val) { diff --git a/src/views/course/TeacherList.vue b/src/views/course/TeacherList.vue index b76b34a0..6f321b1b 100644 --- a/src/views/course/TeacherList.vue +++ b/src/views/course/TeacherList.vue @@ -208,66 +208,66 @@ export default { type: 'warning' }).then(()=>{ //新的提交流程 - // apiUserBasic.getOrgHrbpInfo(row.orgId).then(rs=>{ - // if(rs.status==200 && rs.result){ - // let req={ - // courseId:row.id, - // email:rs.result.email, - // courseUser:row.sysCreateBy, - // courseName:row.name, - // ucode:rs.result.userNo, - // auditUser:rs.result.name, - // //ukid:hrbpUser.user_id, - // orgId:row.orgId, - // orgName:rs.result.orgNamePath +'/'+rs.result.name - // } - // apiCourse.sumbits(req).then(res=>{ - // if(res.status==200){ - // $this.$message.success('提交成功'); - // row.status=2 - // } - // if(res.status==400){ - // $this.$message.error('提交失败:'+res.message); - // } - // }) - // }else{ - // $this.$message.error("获取HRBP审核人员失败:"+rs.message); - // } - // }); + apiUserBasic.getOrgHrbpInfo(row.orgId).then(rs=>{ + if(rs.status==200 && rs.result){ + let req={ + courseId:row.id, + email:rs.result.email, + courseUser:row.sysCreateBy, + courseName:row.name, + ucode:rs.result.userNo, + auditUser:rs.result.name, + //ukid:hrbpUser.user_id, + orgId:row.orgId, + orgName:rs.result.orgNamePath +'/'+rs.result.name + } + apiCourse.sumbits(req).then(res=>{ + if(res.status==200){ + $this.$message.success('提交成功'); + row.status=2 + } + if(res.status==400){ + $this.$message.error('提交失败:'+res.message); + } + }) + }else{ + $this.$message.error("获取HRBP审核人员失败:"+rs.message); + } + }); - apiOrg.getSimple(row.orgId).then(rrs=>{ - if(rrs.status==200){ - apiHRBP.getHRBP(rrs.result.kid).then(rs=>{ - if(rs.status==200 && rs.result.length>0){ - let hrbpUser=rs.result[0]; - let req={ - courseId:row.id, - email:hrbpUser.email, - courseUser:row.sysCreateBy, - courseName:row.name, - ucode:hrbpUser.user_no, - auditUser:hrbpUser.real_name, - ukid:hrbpUser.user_id, - orgId:row.orgId, - orgName:rs.result.orgnization_name_path+'/'+rrs.result.name - } - apiCourse.sumbits(req).then(res=>{ - if(res.status==200){ - $this.$message.success('提交成功'); - row.status=2 - } - if(res.status==400){ - $this.$message.error('提交失败:'+res.message); - } - }) - }else{ - $this.$message.error("获取HRBP审核人员失败:"+rs.message); - } - }) - }else{ - $this.$message.error("处理资源归属失败,请重新设置资源归属"); - } - }) + // apiOrg.getSimple(row.orgId).then(rrs=>{ + // if(rrs.status==200){ + // apiHRBP.getHRBP(rrs.result.kid).then(rs=>{ + // if(rs.status==200 && rs.result.length>0){ + // let hrbpUser=rs.result[0]; + // let req={ + // courseId:row.id, + // email:hrbpUser.email, + // courseUser:row.sysCreateBy, + // courseName:row.name, + // ucode:hrbpUser.user_no, + // auditUser:hrbpUser.real_name, + // ukid:hrbpUser.user_id, + // orgId:row.orgId, + // orgName:rs.result.orgnization_name_path+'/'+rrs.result.name + // } + // apiCourse.sumbits(req).then(res=>{ + // if(res.status==200){ + // $this.$message.success('提交成功'); + // row.status=2 + // } + // if(res.status==400){ + // $this.$message.error('提交失败:'+res.message); + // } + // }) + // }else{ + // $this.$message.error("获取HRBP审核人员失败:"+rs.message); + // } + // }) + // }else{ + // $this.$message.error("处理资源归属失败,请重新设置资源归属"); + // } + // }) }) }, delItem(row) {