合并调整冲突修改

This commit is contained in:
daihh
2022-09-09 16:33:35 +08:00
15 changed files with 620 additions and 565 deletions

View File

@@ -73,16 +73,11 @@
:props="{ value: 'id', label: 'name' }"
:options="sysTypeListMap"></el-cascader>
</el-form-item>
<!-- <el-form-item label="资源归属" required>
<el-cascader
placeholder="选择资源归属"
style="width: 100%;"
clearable
v-model="resOwnerArray"
:props="{ value: 'code', label: 'name' }"
:options="resOwnerListMap"
></el-cascader>
</el-form-item> -->
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="场景" v-show="!weike.onlyRequired">
<el-select v-model="courseInfo.forScene" style="width: 100%;">
<el-option v-for="item in sceneList" :key="item.id" :label="item.name" :value="item.id"></el-option>
@@ -219,15 +214,7 @@
:options="sysTypeListMap">
</el-cascader>
</el-form-item>
<!-- <el-form-item label="资源归属" required>
<el-cascader
placeholder="选择资源归属"
style="width: 100%;"
clearable
v-model="resOwnerArray"
:props="{ value: 'code', label: 'name' }"
:options="resOwnerListMap"></el-cascader>
</el-form-item> -->
<el-form-item label="场景">
<el-select v-model="courseInfo.forScene" style="width: 100%;">
<el-option v-for="item in sceneList" :key="item.id" :label="item.name" :value="item.id"></el-option>
@@ -254,6 +241,11 @@
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="目标人群" required>
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
</el-form-item>
@@ -378,6 +370,7 @@
</el-dialog>
<!--选择图片-->
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
<chooseOrg ref="refChooseOrg" @confirm="confirmChooseOrg"></chooseOrg>
</div>
</template>
<script>
@@ -391,19 +384,24 @@ import scene from '../../api/modules/scene.js';
import apiUserGroup from '../../api/modules/usergroup.js';
import apiTeacher from '../../api/modules/teacher.js';
import apiTag from '../../api/modules/tag.js';
import apiHRBP from '../../api/boe/HRBP.js';
import apiCourse from '../../api/modules/course.js';
import apiOrg from '../../api/system/organiza.js';
import apiUser from '../../api/system/user.js';
import WxEditor from '@/components/Editor/index.vue';
import catalogSort from '@/components/Course/catalogSort.vue';
import { courseType, getType } from '../../utils/tools.js';
import { mapGetters, mapActions } from 'vuex';
import filecloud from '@/components/FileCloud/index.vue';
import chooseOrg from '@/components/System/chooseOrg.vue';
export default {
props: {},
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice},
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice,chooseOrg},
data() {
return {
checked:false,
courseInfoFormCheckedShow:false,
orgChooseShow:false,
weikeReset: '',
onlineReset: '',
sysTypeListMap: [],
@@ -432,11 +430,14 @@ export default {
courseCoverurl: '', //显示的图片
btnLoading: false,
requireSaveCourse: false,
orgName:'',
orgKid:'',
courseInfo: {
id: '',
name: '',
orderStudy: false,
type: 10,
orgId:'',
coverImg: '',
source: 1,
forUsers: '',
@@ -493,7 +494,7 @@ export default {
this.getSceneData();
},
computed: {
...mapGetters(['resOwnerMap', 'sysTypeMap']),
...mapGetters(['resOwnerMap', 'sysTypeMap','userInfo','identity']),
catalogTree() {
let treeList = [];
let $this = this;
@@ -531,8 +532,19 @@ export default {
this.loadResOwners();
this.loadSysTypes();
this.loadUserGroup();
},
methods: {
showChooseOrg(){
this.$refs.refChooseOrg.dlgShow = true;
},
confirmChooseOrg(orgInfo){
//console.log(orgInfo,'orgInfo');
this.orgName=orgInfo.name;
this.orgKid=orgInfo.kid;
this.courseInfo.orgId=orgInfo.id;
this.$refs.refChooseOrg.dlgShow = false;
},
getTeacherList(res) {
this.teacherValues = res;
},
@@ -652,11 +664,29 @@ export default {
this.onlineReset = Math.round(Math.random()) + '';
this.courseChooseShow = true;
this.biaoke.tabIndex = 'base';
this.courseInfo.orgId=this.userInfo.departId;
if(!this.courseInfo.orgId){
this.courseInfo.orgId=this.userInfo.departId;
}
this.orgKid='';
if(this.courseInfo.orgId){
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
this.orgName=rrs.result.name;
this.orgKid=rrs.result.kid;
}
})
}
} else {
//console.log(editData,'editData');
this.weikeReset = editData.id;
this.onlineReset = editData.id;
//console.log("编辑课程?");
this.orgName=editData.orgName;
this.courseInfo.orgId=editData.orgId;
this.curCourseId = editData.id; //设置
this.courseInfo.type = editData.type; //设置课程类型,因为这里的课程对象可能不全,所以只能设置值,不能整个对象附值
this.getDetail(editData.id); //获取课程的详细信息
@@ -667,6 +697,7 @@ export default {
this.biaoke.dlgShow = true;
}
}
},
resetCurCourseContent() {
this.curContent = { id: '', contentType: 0, contentName: '', content: '', csectionId: '', contentName: '', contentRefId: '', courseId: this.courseInfo.id };
@@ -747,22 +778,53 @@ export default {
this.contentInfo.list = result.contents;
this.sectionInfo.list = result.sections;
this.courseTeachers = result.teachers; //课程的老师信息
if(!this.courseInfo.orgId){
//根据课程创建者获取机构id
apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{
if(ors.status==200){
$this.courseInfo.orgId=ors.result.id;
apiOrg.getSimple(ors.result.id).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid;
}
})
}else{
//
}
})
}else{
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid;
}
})
}
this.resOwnerArray=[];
if (result.course.resOwner1 == '') {
this.resOwnerArray.push(result.course.resOwner1);
}else if(result.course.resOwner2 == ''){
}
if(result.course.resOwner2 == ''){
this.resOwnerArray.push(result.course.resOwner2);
}else if(result.course.resOwner3 == ''){
}
if(result.course.resOwner3 == ''){
this.resOwnerArray.push(result.course.resOwner3);
}
if (result.course.sysType3 == '' && result.course.sysType2 == '') {
this.sysTypeList = [result.course.sysType1];
} else if (result.course.sysType3 == '') {
this.sysTypeList = [result.course.sysType1, result.course.sysType2];
} else {
this.sysTypeList = [result.course.sysType1, result.course.sysType2, result.course.sysType3];
this.sysTypeList=[];
if(result.course.sysType1!='' && result.course.sysType1!='0'){
this.sysTypeList.push(result.course.sysType1);
}
if(result.course.sysType2!='' && result.course.sysType2!='0'){
this.sysTypeList.push(result.course.sysType2);
}
if(result.course.sysType3!='' && result.course.sysType3!='0'){
this.sysTypeList.push(result.course.sysType3);
}
//console.log(this.sysTypeList,'this.sysTypeList');
//受众处理crowds
let crowdList=[];
if(result.crowds && result.crowds.length>0){
@@ -1116,6 +1178,7 @@ export default {
return pass;
},
submitCourse() {
if(this.biaoke.dlgShow && !this.unsavedContent()){
this.$message.error('您有未保存的内容,请先保存');
return;
@@ -1124,6 +1187,18 @@ export default {
this.$message.error('您有未保存的内容,请先保存');
return;
}
//console.log(this.courseInfo.orgId,'this.courseInfo.orgId');
//console.log(this.orgKid,'this.orgKid');
if(!this.courseInfo.orgId){
this.$message.error('请选择资源归属');
return;
}
if(!this.orgKid){
this.$message.error('资源归属无关联HRBP信息');
return;
}
//console.log(this.resOwnerListMap[0],'this.resOwnerListMap[0]');
//return;
let ownerCode=this.resOwnerListMap[0].code;
@@ -1214,22 +1289,39 @@ export default {
};
this.btnLoading = true;
let $this = this;
apiCourse.submitCourse(postData).then(res => {
//this.btnLoading=false;
setTimeout(function() {
//先获取课程内容
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
}
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);
}
});
}else{
$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.$message.error('获取审核HRBP失败:'+rs.message);
}
});
})
},
// 教师列标,远程查询
async remoteFindTeacher(query) {