|
@@ -211,13 +211,6 @@
|
|
type="primary"
|
|
type="primary"
|
|
>导出课表</el-button
|
|
>导出课表</el-button
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
- v-permission="'courseSchedule/batchDelete?page=teamCourseList'"
|
|
|
|
- @click="removeCourse"
|
|
|
|
- :disabled="!deleteList.length > 0"
|
|
|
|
- type="primary"
|
|
|
|
- >批量删除</el-button
|
|
|
|
- >
|
|
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</save-form>
|
|
</save-form>
|
|
@@ -225,8 +218,10 @@
|
|
<div class="tableWrap" style="margin-top: 20px">
|
|
<div class="tableWrap" style="margin-top: 20px">
|
|
<el-table
|
|
<el-table
|
|
:data="tableList"
|
|
:data="tableList"
|
|
|
|
+ ref="tableList"
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
|
|
+ row-key="id"
|
|
>
|
|
>
|
|
>
|
|
>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -343,8 +338,10 @@
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
@click="common(scope.row)"
|
|
@click="common(scope.row)"
|
|
- v-if=" scope.row.newCourseId > 0 &&
|
|
|
|
- scope.row.newCourseId != scope.row.id"
|
|
|
|
|
|
+ v-if="
|
|
|
|
+ scope.row.newCourseId > 0 &&
|
|
|
|
+ scope.row.newCourseId != scope.row.id
|
|
|
|
+ "
|
|
>
|
|
>
|
|
被合并课
|
|
被合并课
|
|
</el-button>
|
|
</el-button>
|
|
@@ -393,7 +390,7 @@
|
|
>调整</el-button
|
|
>调整</el-button
|
|
>
|
|
>
|
|
|
|
|
|
- <el-button
|
|
|
|
|
|
+ <!-- <el-button
|
|
type="text"
|
|
type="text"
|
|
@click="addCompound(scope.row)"
|
|
@click="addCompound(scope.row)"
|
|
v-if="
|
|
v-if="
|
|
@@ -417,7 +414,7 @@
|
|
"
|
|
"
|
|
@click="cancleCompound(scope.row)"
|
|
@click="cancleCompound(scope.row)"
|
|
>取消合课</el-button
|
|
>取消合课</el-button
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
v-if="
|
|
v-if="
|
|
@@ -627,10 +624,11 @@
|
|
/>
|
|
/>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<addCompound
|
|
<addCompound
|
|
- :compoundList="compoundList"
|
|
|
|
|
|
+ :compoundList="deleteList"
|
|
v-if="permission('courseSchedule/courseMerge')"
|
|
v-if="permission('courseSchedule/courseMerge')"
|
|
@clearCom="clearCom"
|
|
@clearCom="clearCom"
|
|
@getList="getList"
|
|
@getList="getList"
|
|
|
|
+ @removeCourse="removeCourse"
|
|
@cancleCompound="cancleCompound"
|
|
@cancleCompound="cancleCompound"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -718,6 +716,7 @@ export default {
|
|
compoundList: [],
|
|
compoundList: [],
|
|
deleteList: [],
|
|
deleteList: [],
|
|
isMainGo: false,
|
|
isMainGo: false,
|
|
|
|
+ isDetele: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
@@ -766,8 +765,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 课程时间段异常,不需要时间搜索
|
|
// 课程时间段异常,不需要时间搜索
|
|
- if(query.searchType == 'COURSE_TIME_ERROR') {
|
|
|
|
- this.searchForm.timer = []
|
|
|
|
|
|
+ if (query.searchType == "COURSE_TIME_ERROR") {
|
|
|
|
+ this.searchForm.timer = [];
|
|
}
|
|
}
|
|
|
|
|
|
if (query.organId) {
|
|
if (query.organId) {
|
|
@@ -792,13 +791,21 @@ export default {
|
|
},
|
|
},
|
|
async removeCourse(row) {
|
|
async removeCourse(row) {
|
|
if (this.deleteList.length < 1 && !row) {
|
|
if (this.deleteList.length < 1 && !row) {
|
|
- this.$message.error("请自少选择一个班级");
|
|
|
|
|
|
+ this.$message.error("请自少选择一节课");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ let flag = false;
|
|
let arr = this.deleteList.map((course) => {
|
|
let arr = this.deleteList.map((course) => {
|
|
|
|
+ console.log(course.status, course.isSettlement);
|
|
|
|
+ if (course.isSettlement || course.status == "UNDERWAY") {
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
return course.id;
|
|
return course.id;
|
|
});
|
|
});
|
|
|
|
+ if (flag) {
|
|
|
|
+ this.$message.error("已结算或进行中的课程无法删除");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
let courseScheduleIds = arr.join(",") || row.id;
|
|
let courseScheduleIds = arr.join(",") || row.id;
|
|
try {
|
|
try {
|
|
await this.$confirm("是否确认删除此数据?", "提示", {
|
|
await this.$confirm("是否确认删除此数据?", "提示", {
|
|
@@ -931,6 +938,20 @@ export default {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.tableList = res.data.rows;
|
|
this.tableList = res.data.rows;
|
|
this.rules.total = res.data.total;
|
|
this.rules.total = res.data.total;
|
|
|
|
+ let idList = this.deleteList.map((course) => {
|
|
|
|
+ return course.id;
|
|
|
|
+ });
|
|
|
|
+ this.isDetele = true;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.tableList.forEach((course) => {
|
|
|
|
+ if (idList.indexOf(course.id) != -1) {
|
|
|
|
+ this.$refs.tableList.toggleRowSelection(course, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.isDetele = false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // let arr = this.$helpers.lodash.differenceWith( this.tableList, this.deleteList,'id')
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -982,32 +1003,36 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
- addCompound(row) {
|
|
|
|
- this.compoundList.push(row);
|
|
|
|
- this.compoundList = [...new Set(this.compoundList)];
|
|
|
|
- },
|
|
|
|
- isAddCom(row) {
|
|
|
|
- let flag = false;
|
|
|
|
- this.compoundList.forEach((com) => {
|
|
|
|
- if (com.id == row.id) {
|
|
|
|
- flag = true;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- return flag;
|
|
|
|
- },
|
|
|
|
|
|
+ // addCompound(row) {
|
|
|
|
+ // this.compoundList.push(row);
|
|
|
|
+ // this.compoundList = [...new Set(this.compoundList)];
|
|
|
|
+ // },
|
|
|
|
+ // isAddCom(row) {
|
|
|
|
+ // let flag = false;
|
|
|
|
+ // this.compoundList.forEach((com) => {
|
|
|
|
+ // if (com.id == row.id) {
|
|
|
|
+ // flag = true;
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // return flag;
|
|
|
|
+ // },
|
|
cancleCompound(row) {
|
|
cancleCompound(row) {
|
|
- let indexNum = null;
|
|
|
|
- this.compoundList.forEach((com, index) => {
|
|
|
|
- if (com.id == row.id) {
|
|
|
|
- indexNum = index;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- if (indexNum + "") {
|
|
|
|
- this.compoundList.splice(indexNum, 1);
|
|
|
|
- }
|
|
|
|
|
|
+ // let indexNum = null;
|
|
|
|
+ // this.deleteList.forEach((com, index) => {
|
|
|
|
+ // if (com.id == row.id) {
|
|
|
|
+ // indexNum = index;
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // if (indexNum + "") {
|
|
|
|
+ // this.deleteList.splice(indexNum, 1);
|
|
|
|
+ // }
|
|
|
|
+ console.log(row);
|
|
|
|
+ this.$refs.tableList.toggleRowSelection(row);
|
|
},
|
|
},
|
|
clearCom() {
|
|
clearCom() {
|
|
- this.compoundList = [];
|
|
|
|
|
|
+ // this.deleteList = [];
|
|
|
|
+ // this.$set(this,'deleteList',[])
|
|
|
|
+ this.$refs.tableList.clearSelection();
|
|
},
|
|
},
|
|
resetCompound(row) {
|
|
resetCompound(row) {
|
|
this.$confirm("您确定取消合并该课程?", "提示", {
|
|
this.$confirm("您确定取消合并该课程?", "提示", {
|
|
@@ -1026,7 +1051,36 @@ export default {
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
handleSelectionChange(arr) {
|
|
handleSelectionChange(arr) {
|
|
- this.deleteList = arr;
|
|
|
|
|
|
+ // this.deleteList = arr;
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
+ console.log("添加");
|
|
|
|
+
|
|
|
|
+ this.deleteList = this.deleteList.concat(arr);
|
|
|
|
+ this.deleteList = this.$helpers.lodash.uniqBy(this.deleteList, "id");
|
|
|
|
+ } else {
|
|
|
|
+ if (this.isDetele) return;
|
|
|
|
+ // 有2种 1是新页
|
|
|
|
+ // 2是点击反选
|
|
|
|
+ let idList = this.deleteList.map((course) => {
|
|
|
|
+ return course.id;
|
|
|
|
+ });
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ let tableIdList = [];
|
|
|
|
+ this.tableList.forEach((course) => {
|
|
|
|
+ tableIdList.push(course.id);
|
|
|
|
+ if (idList.indexOf(course.id) != -1) {
|
|
|
|
+ this.$refs.tableList.toggleRowSelection(course, false);
|
|
|
|
+ // 删除这个元素
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.deleteList = this.$helpers.lodash.remove(
|
|
|
|
+ this.deleteList,
|
|
|
|
+ function (item) {
|
|
|
|
+ return tableIdList.indexOf(item.id) == -1;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|