|
@@ -50,11 +50,16 @@
|
|
|
>{{ item.name }}</el-button
|
|
|
>
|
|
|
</div>
|
|
|
- <div v-for="(item, index) in courseList" :key="index" v-show="item.subjectId === newActiveSubjectId || !newActiveSubjectId">
|
|
|
- <p class="firstTop hoverStyle" @click="changeStatus(item)">
|
|
|
+ <div v-for="(courseItem, index) in goodsTeacher" :key="index">
|
|
|
+ <div v-for="(item, index) in courseItem.courseList" :key="index" v-show="item.subjectId === newActiveSubjectId || !newActiveSubjectId">
|
|
|
+ <div v-if="item.show == 1">
|
|
|
+ <p class="firstTop hoverStyle" >
|
|
|
<span class="iconStyle">课</span
|
|
|
><span class="titles">{{ item.courseName }}</span
|
|
|
- ><span class="showHide"
|
|
|
+ ><span v-if="courseItem.teaList && courseItem.teaList.length > 0" v-for="(tea, index) in courseItem.teaList" :key="index">
|
|
|
+ <el-button type="info" @click="switchTeacher(tea)" round>{{tea.aliasName}}</el-button>
|
|
|
+ </span
|
|
|
+ ><span class="showHide" @click="changeStatus(item)"
|
|
|
><span v-if="item.showStatus">收起∧</span
|
|
|
><span v-else>展开∨</span></span
|
|
|
>
|
|
@@ -556,6 +561,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<courseData ref="courseData" @backData="backData" />
|
|
@@ -625,6 +632,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
goodsData: {},
|
|
|
+ goodsTeacher: [],
|
|
|
courseList: [],
|
|
|
sysTime: 0,
|
|
|
showConfirm: false,
|
|
@@ -688,6 +696,7 @@ export default {
|
|
|
},
|
|
|
backData(item) {
|
|
|
this.goodsData = item;
|
|
|
+ this.goodsTeacher = [];
|
|
|
this.courseBusiness();
|
|
|
this.getGoodsCourseList(item);
|
|
|
},
|
|
@@ -709,6 +718,7 @@ export default {
|
|
|
gradeId: item.gradeId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
+ console.log(res,'res');
|
|
|
var array = [];
|
|
|
res.rows.forEach((element) => {
|
|
|
element.showStatus = false;
|
|
@@ -718,6 +728,70 @@ export default {
|
|
|
name: element.subjectName,
|
|
|
});
|
|
|
});
|
|
|
+ //获取商品双师资模板
|
|
|
+ this.$request.courseTeacherList({
|
|
|
+ goodsId: item.goodsId
|
|
|
+ }).then((res1) => {
|
|
|
+ console.log(res1,'res1');
|
|
|
+ if(res1.data && res1.data.length > 0){
|
|
|
+ //课程老师模板
|
|
|
+ let teacherTel = res1.data;
|
|
|
+ //商品课程
|
|
|
+ let courses = res.rows;
|
|
|
+ teacherTel.forEach((tea) => {
|
|
|
+ let dataList = []
|
|
|
+ let teacherList = []
|
|
|
+ courses.forEach((item) => {
|
|
|
+ if(tea.courseIds.search(item.courseId) > -1){
|
|
|
+ dataList.push(item)
|
|
|
+ teacherList = tea.courseList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let result = {
|
|
|
+ teaList:teacherList,
|
|
|
+ courseList:dataList
|
|
|
+ }
|
|
|
+ this.goodsTeacher.push(result)
|
|
|
+ })
|
|
|
+ if(this.goodsTeacher && this.goodsTeacher.length > 0){
|
|
|
+ let courseIds = []
|
|
|
+ this.goodsTeacher.forEach((item) => {
|
|
|
+ item.courseList.forEach((course) => {
|
|
|
+ courseIds.push(course.courseId)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if(courseIds.length > 0){
|
|
|
+ courses.forEach((item) => {
|
|
|
+ if(!courseIds.includes(item.courseId)){
|
|
|
+ let data = {
|
|
|
+ teaList:[],
|
|
|
+ courseList: []
|
|
|
+ }
|
|
|
+ data.courseList.push(item)
|
|
|
+ this.goodsTeacher.push(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.goodsTeacher.forEach((item) => {
|
|
|
+ if(item.courseList && item.courseList.length > 0){
|
|
|
+ item.courseList[0].show = 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //没有双师资模板
|
|
|
+ res.rows.forEach((item) => {
|
|
|
+ item.show = 1
|
|
|
+ let data = {
|
|
|
+ teaList:[],
|
|
|
+ courseList: []
|
|
|
+ }
|
|
|
+ data.courseList.push(item)
|
|
|
+ this.goodsTeacher.push(data)
|
|
|
+ })
|
|
|
+ console.log(this.goodsTeacher,'this.goodsTeacher');
|
|
|
+ }
|
|
|
+ })
|
|
|
this.courseList = res.rows;
|
|
|
array = this.uniqueFunc(array, "id");
|
|
|
array.unshift({
|
|
@@ -734,6 +808,26 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ //切换老师
|
|
|
+ switchTeacher(data){
|
|
|
+ console.log(data,'data');
|
|
|
+ this.goodsTeacher.forEach((item,index) => {
|
|
|
+ if(item.teaList && item.teaList.length > 0){
|
|
|
+ let list = item.teaList.filter(x => x.aliasName == data.aliasName)
|
|
|
+ if(list && list.length > 0){
|
|
|
+ item.courseList.forEach((course,courseIndex) => {
|
|
|
+ if(course.courseId == data.courseId){
|
|
|
+ console.log(index,'index');
|
|
|
+ console.log(courseIndex,'courseIndex');
|
|
|
+ this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",1)
|
|
|
+ }else{
|
|
|
+ this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getGoodsData(res) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.$request
|