Commit 7ec58724 authored by liwei's avatar liwei

修改了bug

parent 37a0b9d1
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
</div> </div>
</el-dialog> </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 :data="multipleSelection">
<el-table-column label="序号" type="index" width="55" /> <el-table-column label="序号" type="index" width="55" />
<el-table-column label="课程名称" :show-overflow-tooltip="true"> <el-table-column label="课程名称" :show-overflow-tooltip="true">
...@@ -543,7 +543,7 @@ ...@@ -543,7 +543,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80" align="center" header-align="center"> <el-table-column label="操作" width="80" align="center" header-align="center">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -1354,6 +1354,8 @@ export default { ...@@ -1354,6 +1354,8 @@ export default {
dicts: ['tec_classify', 'job_classify'], dicts: ['tec_classify', 'job_classify'],
data() { data() {
return { return {
addFlag: false,
elseTableData: [],
courseDimensionsOptions: [], courseDimensionsOptions: [],
intelligentClassroomOptions: [], intelligentClassroomOptions: [],
courseTypeOptions: [], courseTypeOptions: [],
...@@ -1398,7 +1400,7 @@ export default { ...@@ -1398,7 +1400,7 @@ export default {
lessonList: [], lessonList: [],
difficultyOptions: [], difficultyOptions: [],
multipleSelection: [], multipleSelection: [],
romoveType: false,
// 开始日期数组 // 开始日期数组
dateRangeBegin: [], dateRangeBegin: [],
// 结束日期 // 结束日期
...@@ -1677,18 +1679,29 @@ export default { ...@@ -1677,18 +1679,29 @@ export default {
} }
} }
}, },
handleCloseCourseDialog() {
console.log('close')
this.romoveType = false
},
// 移除选中的课程 // 移除选中的课程
removeSeletedLesson(index) { removeSeletedLesson(row, index) {
const id = this.multipleSelection[index].businessId this.romoveType = true
const id = row.businessId
this.multipleSelection.splice(index, 1) this.multipleSelection.splice(index, 1)
this.selectedLessonCount = this.multipleSelection.length this.selectedLessonCount = this.multipleSelection.length
console.log('id') console.log('id:', id)
this.addFlag = false
this.lessonList.forEach(item => { this.lessonList.forEach(item => {
if (item.businessId === id) { if (item.businessId === id) {
this.addFlag = true
console.log('lessonList', item) console.log('lessonList', item)
this.$refs.multipleTable.toggleRowSelection(item, false) this.$refs.multipleTable.toggleRowSelection(item, false)
} }
}) })
if (this.addFlag === false) {
this.elseTableData.push(row)
console.log('this.elseTableData:', this.elseTableData)
}
}, },
// 显示选中的列表 // 显示选中的列表
showSelectedLesson() { showSelectedLesson() {
...@@ -1862,9 +1875,11 @@ export default { ...@@ -1862,9 +1875,11 @@ export default {
return name return name
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
if (this.romoveType === false) {
this.multipleSelection = val this.multipleSelection = val
this.selectedLessonCount = this.multipleSelection.length this.selectedLessonCount = this.multipleSelection.length
console.log('this.multipleSelection:', this.multipleSelection) console.log('this.multipleSelection:', this.multipleSelection)
}
}, },
getRoKey(row) { getRoKey(row) {
return row.businessId return row.businessId
...@@ -2066,6 +2081,18 @@ export default { ...@@ -2066,6 +2081,18 @@ export default {
queryBLessonWithTrial(query).then(res => { queryBLessonWithTrial(query).then(res => {
this.lessonList = res.records this.lessonList = res.records
this.total1 = res.total 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() { handleLessonQueryPage() {
......
...@@ -403,9 +403,9 @@ ...@@ -403,9 +403,9 @@
<span>{{ getCoursePlanCName( scope.row.classPlanSchool) }}</span> <span>{{ getCoursePlanCName( scope.row.classPlanSchool) }}</span>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span>{{ getCourseTypeName( scope.row.courseType) }}</span> <span>{{ getCourseTypeName( scope.row.courseTypeC) }}</span>
</template> </template>
</el-table-column> </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"> <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 @@ ...@@ -71,6 +71,7 @@
filterable filterable
multiple multiple
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in coursePlanOptions" v-for="(items,index) in coursePlanOptions"
...@@ -88,6 +89,7 @@ ...@@ -88,6 +89,7 @@
v-model="form.courseType" v-model="form.courseType"
:disabled="form.lessonType === '0'" :disabled="form.lessonType === '0'"
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in courseTypeOptions" v-for="(items,index) in courseTypeOptions"
...@@ -104,6 +106,7 @@ ...@@ -104,6 +106,7 @@
v-model="form.jobClassify" v-model="form.jobClassify"
:disabled="form.lessonType === '0'" :disabled="form.lessonType === '0'"
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in valueOptions" v-for="(items,index) in valueOptions"
...@@ -121,6 +124,7 @@ ...@@ -121,6 +124,7 @@
class="normalSelct" class="normalSelct"
v-model="form.difficultyClassify" v-model="form.difficultyClassify"
filterable filterable
clearable
> >
<el-option <el-option
v-for="(items,index) in difficultyLevlList" v-for="(items,index) in difficultyLevlList"
...@@ -137,6 +141,7 @@ ...@@ -137,6 +141,7 @@
v-model="form.enterpriseCourseDimensions" v-model="form.enterpriseCourseDimensions"
:disabled="form.lessonType === '0'" :disabled="form.lessonType === '0'"
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in enterpriseCourseDimensionsOptions" v-for="(items,index) in enterpriseCourseDimensionsOptions"
...@@ -153,6 +158,7 @@ ...@@ -153,6 +158,7 @@
v-model="form.intelligentClassroom" v-model="form.intelligentClassroom"
:disabled="form.lessonType === '0'" :disabled="form.lessonType === '0'"
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in intelligentClassroomOptions" v-for="(items,index) in intelligentClassroomOptions"
...@@ -178,6 +184,7 @@ ...@@ -178,6 +184,7 @@
filterable filterable
multiple multiple
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in coursePlanOptionsC" v-for="(items,index) in coursePlanOptionsC"
...@@ -194,6 +201,7 @@ ...@@ -194,6 +201,7 @@
v-model="form.courseTypeC" v-model="form.courseTypeC"
:disabled="form.lessonTypeSchool === '0'" :disabled="form.lessonTypeSchool === '0'"
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in courseTypeOptions" v-for="(items,index) in courseTypeOptions"
...@@ -210,6 +218,7 @@ ...@@ -210,6 +218,7 @@
v-model="form.tecClassifySchool" v-model="form.tecClassifySchool"
:disabled="form.lessonTypeSchool === '0'" :disabled="form.lessonTypeSchool === '0'"
class="normalSelct" class="normalSelct"
clearable
> >
<el-option <el-option
v-for="(items,index) in courseDirection" v-for="(items,index) in courseDirection"
......
...@@ -386,8 +386,6 @@ export default { ...@@ -386,8 +386,6 @@ export default {
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
// 去除this.userList最后一个对象
this.userList.pop()
this.reset() this.reset()
}, },
// 表单重置 // 表单重置
...@@ -438,6 +436,7 @@ export default { ...@@ -438,6 +436,7 @@ export default {
this.reset() this.reset()
this.open = true this.open = true
this.title = '添加单位' this.title = '添加单位'
this.getUserList()
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { 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