还原机构的调用

This commit is contained in:
daihh
2022-12-07 12:50:02 +08:00
parent 94cf379aad
commit bca831ad7c
6 changed files with 175 additions and 173 deletions

View File

@@ -719,20 +719,20 @@ export default {
} }
this.orgKid=''; this.orgKid='';
if(this.courseInfo.orgId){ if(this.courseInfo.orgId){
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ // apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){ // if(rrs.status==200){
this.orgName=rrs.result.name; // this.orgName=rrs.result.name;
this.orgKid=rrs.result.kid; // this.orgKid=rrs.result.kid;
this.orgNamePath=rrs.result.namePath; // this.orgNamePath=rrs.result.namePath;
}
});
// apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
// if(rs.status==200){
// this.orgName=rs.result.name;
// //this.orgKid=rs.result.kid;
// this.orgNamePath=rs.result.namePath;
// } // }
// }); // });
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
if(rs.status==200){
this.orgName=rs.result.name;
//this.orgKid=rs.result.kid;
this.orgNamePath=rs.result.namePath;
}
});
} }
} else { } else {
@@ -839,49 +839,49 @@ export default {
apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{ apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{
if(ors.status==200){ if(ors.status==200){
$this.courseInfo.orgId=ors.result.id; $this.courseInfo.orgId=ors.result.id;
apiOrg.getSimple(ors.result.id).then(rrs=>{ // apiOrg.getSimple(ors.result.id).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid;
$this.orgNamePath=rrs.result.namePath;
}
})
// apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{
// if(rrs.status==200){ // if(rrs.status==200){
// $this.orgName=rrs.result.name; // $this.orgName=rrs.result.name;
// //$this.orgKid=rrs.result.kid; // $this.orgKid=rrs.result.kid;
// $this.orgNamePath=rrs.result.namePath; // $this.orgNamePath=rrs.result.namePath;
// }else{
// this.courseInfo.orgId='';
// //this.$message.error('资源归属已变更,请重新选择');
// } // }
// }) // })
apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
//$this.orgKid=rrs.result.kid;
$this.orgNamePath=rrs.result.namePath;
}else{
this.courseInfo.orgId='';
//this.$message.error('资源归属已变更,请重新选择');
}
})
}else{ }else{
//this.$message.error('无机构关联,不需要提示'); //this.$message.error('无机构关联,不需要提示');
} }
}) })
}else{ }else{
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ // apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){ // if(rrs.status==200){
$this.orgName=rrs.result.name; // $this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid; // $this.orgKid=rrs.result.kid;
$this.orgNamePath=rrs.result.namePath; // $this.orgNamePath=rrs.result.namePath;
}else{
$this.courseInfo.orgId='';
$this.$message.error('资源归属已变更,请重新选择');
}
});
// apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
// if(rs.status==200){
// $this.orgName=rs.result.name;
// //$this.orgKid=rs.result.kid;
// $this.orgNamePath=rs.result.namePath;
// }else{ // }else{
// $this.courseInfo.orgId=''; // $this.courseInfo.orgId='';
// $this.$message.error('资源归属已变更,请重新选择'); // $this.$message.error('资源归属已变更,请重新选择');
// } // }
// }); // });
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
if(rs.status==200){
$this.orgName=rs.result.name;
//$this.orgKid=rs.result.kid;
$this.orgNamePath=rs.result.namePath;
}else{
$this.courseInfo.orgId='';
$this.$message.error('资源归属已变更,请重新选择');
}
});
} }
this.resOwnerArray=[]; this.resOwnerArray=[];
@@ -1410,29 +1410,28 @@ export default {
let $this = this; let $this = this;
//console.log(this.courseInfo.orgId,'this.courseInfo.orgId') //console.log(this.courseInfo.orgId,'this.courseInfo.orgId')
//先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息 //先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息
// apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{
if(rs.status==200 && rs.result){
// 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={ postData.auditUser={
email:hrbpUser.email, email:rs.result.email,
code:hrbpUser.user_no, code:rs.result.userNo,
name:hrbpUser.real_name, name:rs.result.name,
kid:hrbpUser.user_id, aid:rs.result.id,
orgId:hrbpUser.orgnization_id orgId:rs.result.orgId
} }
postData.course.orgName=hrbpUser.orgnization_name_path+'/'+$this.orgName; 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;
apiCourse.submitCourse(postData).then(res => { apiCourse.submitCourse(postData).then(res => {
//this.btnLoading=false; //this.btnLoading=false;

View File

@@ -434,7 +434,7 @@ export default {
arrange:this.info.arrange, arrange:this.info.arrange,
passLine:this.info.passLine, passLine:this.info.passLine,
randomMode:this.info.randomMode, randomMode:this.info.randomMode,
score:this.lastScore,//分数需要计算,在检查是否填写完整性时就可以计算出分数 score:testScore,
paperJson:JSON.stringify(this.paper),//原来是对象,这里要也要对象 paperJson:JSON.stringify(this.paper),//原来是对象,这里要也要对象
//startTime:formatDate(this.startTime),//此时间需要格式化,格式化时间可以放在util中 //startTime:formatDate(this.startTime),//此时间需要格式化,格式化时间可以放在util中
//endTime:formatDate(now), //endTime:formatDate(now),

View File

@@ -107,55 +107,54 @@
let $this=this; let $this=this;
if(node.level === 1){ if(node.level === 1){
parentId = '-1'; parentId = '-1';
apiUserBasic.findOrgsByKeyword('').then(rs=>{
// apiUserBasic.findOrgsByKeyword('').then(rs=>{ let treeList=[];
// let treeList=[]; rs.result.forEach(item=>{
// rs.result.forEach(item=>{ let node={
// let node={ id:item.id,
// id:item.id, name:item.name,
// name:item.name, hrbpId:item.hrbpId,
// hrbpId:item.hrbpId, children:[]
// children:[] }
// } treeList.push(node);
// treeList.push(node); });
// }); resolve(treeList);
// resolve(treeList); });
// });
}else{ }else{
parentId = node.data.id; parentId = node.data.id;
// apiUserBasic.getOrgInfo(parentId).then(rs=>{ apiUserBasic.getOrgInfo(parentId).then(rs=>{
// if(rs.status==200){ if(rs.status==200){
// let treeList=[]; let treeList=[];
// if(rs.result.directChildList){ if(rs.result.directChildList){
// rs.result.directChildList.forEach(item=>{ rs.result.directChildList.forEach(item=>{
// let node={ let node={
// id:item.id, id:item.id,
// name:item.name, name:item.name,
// hrbpId:item.hrbpId, hrbpId:item.hrbpId,
// children:[] children:[]
// }
// treeList.push(node);
// });
// }
// resolve(treeList);
// }else{
// resolve([]);
// }
// });
} }
usergroupApi.userOrgs(parentId).then(res =>{ treeList.push(node);
if (res.status == 200) { });
if(res.result != null && res.result.length > 0){ }
resolve(res.result); resolve(treeList);
}else{ }else{
resolve([]); 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) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;

View File

@@ -208,48 +208,18 @@ export default {
type: 'warning' type: 'warning'
}).then(()=>{ }).then(()=>{
//新的提交流程 //新的提交流程
// apiUserBasic.getOrgHrbpInfo(row.orgId).then(rs=>{ apiUserBasic.getOrgHrbpInfo(row.orgId).then(rs=>{
// if(rs.status==200 && rs.result){ 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={ let req={
courseId:row.id, courseId:row.id,
email:hrbpUser.email, email:rs.result.email,
courseUser:row.sysCreateBy, courseUser:row.sysCreateBy,
courseName:row.name, courseName:row.name,
ucode:hrbpUser.user_no, ucode:rs.result.userNo,
auditUser:hrbpUser.real_name, auditUser:rs.result.name,
ukid:hrbpUser.user_id, //ukid:hrbpUser.user_id,
orgId:row.orgId, orgId:row.orgId,
orgName:rs.result.orgnization_name_path+'/'+rrs.result.name orgName:rs.result.orgNamePath +'/'+rs.result.name
} }
apiCourse.sumbits(req).then(res=>{ apiCourse.sumbits(req).then(res=>{
if(res.status==200){ if(res.status==200){
@@ -263,11 +233,41 @@ export default {
}else{ }else{
$this.$message.error("获取HRBP审核人员失败:"+rs.message); $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) { delItem(row) {

View File

@@ -82,7 +82,10 @@
<div class="title">{{item.section.name}}</div> <div class="title">{{item.section.name}}</div>
<div class="subnode" v-for="(it,itIdx) in item.contents" :key="it.id"> <div class="subnode" v-for="(it,itIdx) in item.contents" :key="it.id">
<div class="sub-title"> <div class="sub-title">
<div class="tip"><span class="tip-type">{{getType(it.contentType)}}</span>{{it.contentName}}</div> <div class="tip">
<span class="tip-type">{{getType(it.contentType)}}</span>
<a :href="'studyindex?id='+it.courseId+'&contentId='+it.id"> {{it.contentName}}</a>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -392,6 +392,7 @@
mounted() { mounted() {
this.$watermark.set(this.userInfo.name + this.userInfo.loginName); this.$watermark.set(this.userInfo.name + this.userInfo.loginName);
this.courseId = this.$route.query.id; this.courseId = this.$route.query.id;
this.initContentId = this.$route.query.contentId;
this.loadData(); this.loadData();
//console.log(this.$xpage.constants.fileBaseUrl,'this.$xpage.constants.fileBaseUrl'); //console.log(this.$xpage.constants.fileBaseUrl,'this.$xpage.constants.fileBaseUrl');
}, },