mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-18 23:36:44 +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() {
|
||||
|
||||
@@ -167,7 +167,7 @@ import apiUser from "@/api/system/user.js";
|
||||
// console.log(aid,delIdx,'参数值');
|
||||
// //先从我关注的人中员列表中移除
|
||||
// //this.$nextTick(()=>{
|
||||
// this.follow.list.splice(delIdx,1);
|
||||
this.follow.list.splice(delIdx,1);
|
||||
// //})
|
||||
|
||||
// // this.follow.list.forEach(one=>{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<script>
|
||||
import usergroupApi from "@/api/modules/usergroup";
|
||||
import orgApi from "@/api/system/organiza";
|
||||
import apiUserBasic from "@/api/boe/userbasic";
|
||||
export default{
|
||||
props:{
|
||||
|
||||
@@ -42,12 +43,16 @@
|
||||
dlgShow:false,
|
||||
orgName:'',
|
||||
chooseOrg:{},
|
||||
treeData:[],
|
||||
departData:[],
|
||||
departProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
handleClose(){
|
||||
@@ -65,36 +70,99 @@
|
||||
}
|
||||
|
||||
},
|
||||
initTree(){
|
||||
apiUserBasic.findOrgsByKeyword('').then(rs=>{
|
||||
rs.result.forEach(item=>{
|
||||
let node={
|
||||
id:item.id,
|
||||
name:item.name,
|
||||
children:[]
|
||||
}
|
||||
if(item.treeChildList){
|
||||
node.children=[];
|
||||
}
|
||||
this.treeData.push(node)
|
||||
});
|
||||
});
|
||||
},
|
||||
readTreeNode(treeNode,listData){//递归加载组织机构树信息
|
||||
let $this=this;
|
||||
listData.forEach(item=>{
|
||||
let node={
|
||||
id:item.id,
|
||||
name:item.name,
|
||||
hrbpId:item.hrbpId,
|
||||
children:[]
|
||||
}
|
||||
if(item.treeChildList){
|
||||
$this.readTreeNode(node,item.treeChildList);
|
||||
}
|
||||
treeNode.children.push(node);
|
||||
})
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
var parentId = null;
|
||||
if (node.level === 0) {
|
||||
resolve([{name:'组织机构树',id:'-1'}]);
|
||||
}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);
|
||||
});
|
||||
}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([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
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) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleDepartNodeClick(data){
|
||||
this.chooseOrg.id = data.id;
|
||||
this.chooseOrg.name=data.name;
|
||||
this.chooseOrg.kid=data.kid;
|
||||
this.chooseOrg = data;
|
||||
},
|
||||
confirm(){
|
||||
if(!this.chooseOrg.id){
|
||||
|
||||
Reference in New Issue
Block a user