Commit 7ec58724 authored by liwei's avatar liwei

修改了bug

parent 37a0b9d1
......@@ -528,7 +528,7 @@
</div>
</el-dialog>
<el-dialog :title="`已选${selectedLessonCount}门课程`" :visible.sync="drawerController.lessonDrawer" width="600px" append-to-body :close-on-click-modal="false">
<el-dialog @close="handleCloseCourseDialog" :title="`已选${selectedLessonCount}门课程`" :visible.sync="drawerController.lessonDrawer" width="600px" append-to-body :close-on-click-modal="false">
<el-table :data="multipleSelection">
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="课程名称" :show-overflow-tooltip="true">
......@@ -543,7 +543,7 @@
</el-table-column>
<el-table-column label="操作" width="80" align="center" header-align="center">
<template slot-scope="scope">
<el-button style="color: red" type="text" @click="removeSeletedLesson(scope.$index)">移除</el-button>
<el-button style="color: red" type="text" @click="removeSeletedLesson(scope.row,scope.$index)">移除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -1354,6 +1354,8 @@ export default {
dicts: ['tec_classify', 'job_classify'],
data() {
return {
addFlag: false,
elseTableData: [],
courseDimensionsOptions: [],
intelligentClassroomOptions: [],
courseTypeOptions: [],
......@@ -1398,7 +1400,7 @@ export default {
lessonList: [],
difficultyOptions: [],
multipleSelection: [],
romoveType: false,
// 开始日期数组
dateRangeBegin: [],
// 结束日期
......@@ -1677,18 +1679,29 @@ export default {
}
}
},
handleCloseCourseDialog() {
console.log('close')
this.romoveType = false
},
// 移除选中的课程
removeSeletedLesson(index) {
const id = this.multipleSelection[index].businessId
removeSeletedLesson(row, index) {
this.romoveType = true
const id = row.businessId
this.multipleSelection.splice(index, 1)
this.selectedLessonCount = this.multipleSelection.length
console.log('id')
console.log('id:', id)
this.addFlag = false
this.lessonList.forEach(item => {
if (item.businessId === id) {
this.addFlag = true
console.log('lessonList', item)
this.$refs.multipleTable.toggleRowSelection(item, false)
}
})
if (this.addFlag === false) {
this.elseTableData.push(row)
console.log('this.elseTableData:', this.elseTableData)
}
},
// 显示选中的列表
showSelectedLesson() {
......@@ -1862,9 +1875,11 @@ export default {
return name
},
handleSelectionChange(val) {
this.multipleSelection = val
this.selectedLessonCount = this.multipleSelection.length
console.log('this.multipleSelection:', this.multipleSelection)
if (this.romoveType === false) {
this.multipleSelection = val
this.selectedLessonCount = this.multipleSelection.length
console.log('this.multipleSelection:', this.multipleSelection)
}
},
getRoKey(row) {
return row.businessId
......@@ -2066,6 +2081,18 @@ export default {
queryBLessonWithTrial(query).then(res => {
this.lessonList = res.records
this.total1 = res.total
console.log('11111')
console.log('this.lessonList:', this.lessonList)
console.log('this.elseTableData:', this.elseTableData)
for (let i = 0; i < this.lessonList.length; i++) {
this.elseTableData.forEach(item => {
if (item.businessId === this.lessonList[i].businessId) {
this.$nextTick(() => { // 确保DOM更新后再取消选择
this.$refs.multipleTable.toggleRowSelection(this.lessonList[i], false)
})
}
})
}
})
},
handleLessonQueryPage() {
......
......@@ -403,9 +403,9 @@
<span>{{ getCoursePlanCName( scope.row.classPlanSchool) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="技能端-前沿讲堂" prop="courseType" min-width="200px" :show-overflow-tooltip="true" v-if="queryParams.lessonType.includes('1') || queryParams.lessonType.length === 0">
<el-table-column align="center" label="技能端-前沿讲堂" prop="courseTypeC" min-width="200px" :show-overflow-tooltip="true" v-if="queryParams.lessonType.includes('1') || queryParams.lessonType.length === 0">
<template slot-scope="scope">
<span>{{ getCourseTypeName( scope.row.courseType) }}</span>
<span>{{ getCourseTypeName( scope.row.courseTypeC) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="技术分类" prop="tecClassifySchool" min-width="200px" :show-overflow-tooltip="true" v-if="queryParams.lessonType.includes('1') || queryParams.lessonType.length === 0">
......
......@@ -71,6 +71,7 @@
filterable
multiple
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in coursePlanOptions"
......@@ -88,6 +89,7 @@
v-model="form.courseType"
:disabled="form.lessonType === '0'"
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in courseTypeOptions"
......@@ -104,6 +106,7 @@
v-model="form.jobClassify"
:disabled="form.lessonType === '0'"
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in valueOptions"
......@@ -121,6 +124,7 @@
class="normalSelct"
v-model="form.difficultyClassify"
filterable
clearable
>
<el-option
v-for="(items,index) in difficultyLevlList"
......@@ -137,6 +141,7 @@
v-model="form.enterpriseCourseDimensions"
:disabled="form.lessonType === '0'"
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in enterpriseCourseDimensionsOptions"
......@@ -153,6 +158,7 @@
v-model="form.intelligentClassroom"
:disabled="form.lessonType === '0'"
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in intelligentClassroomOptions"
......@@ -178,6 +184,7 @@
filterable
multiple
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in coursePlanOptionsC"
......@@ -194,6 +201,7 @@
v-model="form.courseTypeC"
:disabled="form.lessonTypeSchool === '0'"
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in courseTypeOptions"
......@@ -210,6 +218,7 @@
v-model="form.tecClassifySchool"
:disabled="form.lessonTypeSchool === '0'"
class="normalSelct"
clearable
>
<el-option
v-for="(items,index) in courseDirection"
......
......@@ -386,8 +386,6 @@ export default {
// 取消按钮
cancel() {
this.open = false
// 去除this.userList最后一个对象
this.userList.pop()
this.reset()
},
// 表单重置
......@@ -438,6 +436,7 @@ export default {
this.reset()
this.open = true
this.title = '添加单位'
this.getUserList()
},
/** 修改按钮操作 */
handleUpdate(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment