mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 04:16:45 +08:00
提交修改
This commit is contained in:
@@ -109,8 +109,8 @@
|
||||
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="受众" v-if="!weike.onlyRequired">
|
||||
<el-select value-key="key" style="width: 100%;" v-model="courseCrowds" filterable multiple placeholder="请选择">
|
||||
<el-option v-for="item in userGroupList" :key="item.key" :label="item.value" :value="item"></el-option>
|
||||
<el-select value-key="id" style="width: 100%;" v-model="courseCrowds" filterable multiple :clearable="false" @remove-tag="removeCrowd" placeholder="请选择">
|
||||
<el-option v-for="item in userGroupList" :key="item.id" :disabled="item.disabled" :label="item.name" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程价值" v-if="!weike.onlyRequired">
|
||||
@@ -259,8 +259,8 @@
|
||||
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="受众"><!--:disabled="item.disabled"-->
|
||||
<el-select value-key="key" style="width: 100%;" v-model="courseCrowds" filterable multiple placeholder="请选择">
|
||||
<el-option v-for="item in userGroupList" :key="item.key" :label="item.value" :value="item"></el-option>
|
||||
<el-select value-key="id" style="width: 100%;" v-model="courseCrowds" filterable multiple placeholder="请选择">
|
||||
<el-option v-for="item in userGroupList" :key="item.id" :label="item.name" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程价值"><el-input maxlength="200" v-model="courseInfo.value" show-word-limit placeholder="课程价值(限200字以内)"></el-input></el-form-item>
|
||||
@@ -550,10 +550,22 @@ export default {
|
||||
showChooseOrg(){
|
||||
this.$refs.refChooseOrg.dlgShow = true;
|
||||
},
|
||||
removeCrowd(e){
|
||||
//console.log(e);
|
||||
if(e.disabled){
|
||||
this.$message.error("您不能移除创建人加的受众");
|
||||
this.courseCrowds.push(e);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
confirmChooseOrg(orgInfo){
|
||||
//console.log(orgInfo,'orgInfo');
|
||||
console.log(orgInfo,'orgInfo');
|
||||
if(!orgInfo.hrbpId || orgInfo.hrbpId=='0'){
|
||||
this.$message.error("此机构无HRBP审核人信息,请重新选择");
|
||||
return;
|
||||
}
|
||||
this.orgName=orgInfo.name;
|
||||
this.orgKid=orgInfo.kid;
|
||||
this.orgKid=orgInfo.kid; //kid已不存在
|
||||
this.courseInfo.orgId=orgInfo.id;
|
||||
this.$refs.refChooseOrg.dlgShow = false;
|
||||
},
|
||||
@@ -585,11 +597,31 @@ export default {
|
||||
loadSysTypes: 'sysType/loadSysTypes'
|
||||
}),
|
||||
loadUserGroup(){
|
||||
let $this=this;
|
||||
apiUserGroup.findByName('').then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.userGroupList=rs.result;
|
||||
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 == '') {
|
||||
@@ -780,6 +812,7 @@ export default {
|
||||
},
|
||||
async getDetail(id) {
|
||||
this.curCourseId = id;
|
||||
this.orgName='';
|
||||
let $this = this;
|
||||
try {
|
||||
const { result, status } = await apiCourse.detail(id);
|
||||
@@ -801,10 +834,13 @@ export default {
|
||||
$this.orgName=rrs.result.name;
|
||||
$this.orgKid=rrs.result.kid;
|
||||
$this.orgNamePath=rrs.result.namePath;
|
||||
}else{
|
||||
this.courseInfo.orgId='';
|
||||
//this.$message.error('资源归属已变更,请重新选择');
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//
|
||||
//this.$message.error('无机构关联,不需要提示');
|
||||
}
|
||||
})
|
||||
|
||||
@@ -814,6 +850,9 @@ export default {
|
||||
$this.orgName=rrs.result.name;
|
||||
$this.orgKid=rrs.result.kid;
|
||||
$this.orgNamePath=rrs.result.namePath;
|
||||
}else{
|
||||
$this.courseInfo.orgId='';
|
||||
$this.$message.error('资源归属已变更,请重新选择');
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -844,14 +883,13 @@ export default {
|
||||
if(result.crowds && result.crowds.length>0){
|
||||
result.crowds.forEach(crowd=>{
|
||||
let newCrowd={
|
||||
key:crowd.groupId,
|
||||
value:crowd.groupName,
|
||||
disabled:false,
|
||||
text:''
|
||||
id:crowd.groupId,
|
||||
name:crowd.groupName,
|
||||
disabled:false
|
||||
}
|
||||
crowdList.push(newCrowd);
|
||||
let hasUG=$this.userGroupList.some(ug=>{
|
||||
return ug.key==crowd.groupId;
|
||||
return ug.id==crowd.groupId;
|
||||
});
|
||||
if(!hasUG){
|
||||
newCrowd.disabled=true;
|
||||
@@ -1088,8 +1126,8 @@ export default {
|
||||
let crowds=[];
|
||||
this.courseCrowds.forEach(item=>{
|
||||
crowds.push({
|
||||
groupId:item.key,
|
||||
groupName:item.value
|
||||
groupId:item.id,
|
||||
groupName:item.name
|
||||
})
|
||||
});
|
||||
//以下是老师内容的处理
|
||||
@@ -1238,10 +1276,10 @@ export default {
|
||||
this.$message.error('请选择资源归属');
|
||||
return;
|
||||
}
|
||||
if(!this.orgKid){
|
||||
this.$message.error('资源归属无关联HRBP信息');
|
||||
return;
|
||||
}
|
||||
// if(!this.orgKid){
|
||||
// this.$message.error('资源归属无关联HRBP信息');
|
||||
// return;
|
||||
// }
|
||||
|
||||
//console.log(this.resOwnerListMap[0],'this.resOwnerListMap[0]');
|
||||
//return;
|
||||
@@ -1327,8 +1365,8 @@ export default {
|
||||
let crowds=[];
|
||||
this.courseCrowds.forEach(item=>{
|
||||
crowds.push({
|
||||
groupId:item.key,
|
||||
groupName:item.value
|
||||
groupId:item.id,
|
||||
groupName:item.name
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1343,18 +1381,31 @@ export default {
|
||||
};
|
||||
this.btnLoading = true;
|
||||
let $this = this;
|
||||
//先获取课程内容
|
||||
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;
|
||||
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.user_no,
|
||||
name:rs.result.name,
|
||||
aid:rs.result.id,
|
||||
orgId:rs.result.orgId
|
||||
}
|
||||
postData.course.orgName=rs.result.orgNamePath+'/'+$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;
|
||||
setTimeout(function() {
|
||||
|
||||
Reference in New Issue
Block a user