课程审核的调整

This commit is contained in:
daihh
2023-01-06 12:22:23 +08:00
parent d90a3920b3
commit 3237d67af2
9 changed files with 194 additions and 444 deletions

View File

@@ -397,6 +397,7 @@ import apiTag from '../../api/modules/tag.js';
import apiHRBP from '../../api/boe/HRBP.js';
import apiUserBasic from '../../api/boe/userbasic.js';
import apiCourse from '../../api/modules/course.js';
import apiCourseAudit from '../../api/modules/courseAudit.js';
import apiOrg from '../../api/system/organiza.js';
import apiUser from '../../api/system/user.js';
import WxEditor from '@/components/Editor/index.vue';
@@ -1300,7 +1301,6 @@ export default {
return true;
},
submitCourse() {
if(this.biaoke.dlgShow && !this.unsavedContent()){
this.$message.error('您有未保存的内容,请先保存');
return;
@@ -1420,60 +1420,64 @@ export default {
};
this.btnLoading = true;
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;
// 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;
//2023-1-5 对于默认管理员不需要提交hrbp。直接提交并发布
let adminType=this.userInfo.adminType;
if(adminType==1){ //默认管理员,直接审核通过
apiCourseAudit.submitAndPublish(postData).then(res=>{
setTimeout(function() {
$this.btnLoading = false;
}, 1000);
if (res.status === 200) {
//提交成功,直接关闭当前窗口
this.$message.success('提交成功!!!');
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
//提交成功回调处理
this.$emit('submitSuccess');
} else {
this.$message.error(res.message);
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
this.$emit('submitSuccess');
}
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
this.$emit('submitSuccess');
});
}else{
$this.btnLoading = false;
this.$message.error('获取审核HRBP失败:'+rs.message);
}
}).catch(err=>{
//this.$message.error('获取审核HRBP失败:'+err);
this.$message.error('获取审核HRBP失败请检查资源归属下是否有HRBP审核人员');
$this.btnLoading = false;
})
}else{
//先获取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;
apiCourse.submitCourse(postData).then(res => {
//this.btnLoading=false;
setTimeout(function() {
$this.btnLoading = false;
}, 1000);
if (res.status === 200) {
//提交成功,直接关闭当前窗口
this.$message.success('提交成功!!!');
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
//提交成功回调处理
this.$emit('submitSuccess');
} else {
this.$message.error(res.message);
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
this.$emit('submitSuccess');
}
});
}else{
$this.btnLoading = false;
this.$message.error('获取审核HRBP失败:'+rs.message);
}
}).catch(err=>{
//this.$message.error('获取审核HRBP失败:'+err);
this.$message.error('获取审核HRBP失败请检查资源归属下是否有HRBP审核人员');
$this.btnLoading = false;
})
}
},
// 教师列标,远程查询
async remoteFindTeacher(query) {