|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="fixedBox">
|
|
|
+ <div class="fixedBox" @click="isLook = true">
|
|
|
<el-card>
|
|
|
<div class="boxWrap">
|
|
|
<p>
|
|
@@ -7,7 +7,7 @@
|
|
|
{{ compoundList.length }}
|
|
|
</span>
|
|
|
</p>
|
|
|
- <el-popover placement="top" v-model="isLook" trigger="click">
|
|
|
+ <el-popover placement="top" v-model="isLook" trigger="manual">
|
|
|
<div>
|
|
|
<p class="title">
|
|
|
待处理课程列表<i
|
|
@@ -22,69 +22,67 @@
|
|
|
>清空列表</el-button
|
|
|
>
|
|
|
<div>
|
|
|
- <el-table
|
|
|
- :data="dataList"
|
|
|
- height="300px"
|
|
|
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
+ <el-table
|
|
|
+ :data="dataList"
|
|
|
+ height="300px"
|
|
|
+ :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
+ >
|
|
|
+ <el-table-column align="center" label="课程编号" width="110">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.id }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ width="180px"
|
|
|
+ label="课程名称"
|
|
|
+ prop="name"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column align="center" label="课程类型">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.type | coursesType }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ width="180px"
|
|
|
+ prop="teacherName"
|
|
|
+ label="指导老师"
|
|
|
>
|
|
|
- <el-table-column align="center" label="课程编号" width="110">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>{{ scope.row.id }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- width="180px"
|
|
|
- label="课程名称"
|
|
|
- prop="name"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column align="center" label="课程类型">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>{{ scope.row.type | coursesType }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- width="180px"
|
|
|
- prop="teacherName"
|
|
|
- label="指导老师"
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{ scope.row.teacherName }}({{ scope.row.actualTeacherId }})
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" width="200px" label="上课时间">
|
|
|
+ <template slot-scope="scope"
|
|
|
+ >{{
|
|
|
+ scope.row.startClassTime
|
|
|
+ ? scope.row.startClassTime.substr(0, 16)
|
|
|
+ : ""
|
|
|
+ }}-{{
|
|
|
+ scope.row.endClassTime
|
|
|
+ ? scope.row.endClassTime.substr(11, 5)
|
|
|
+ : ""
|
|
|
+ }}</template
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{ scope.row.teacherName }}({{
|
|
|
- scope.row.actualTeacherId
|
|
|
- }})
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" width="200px" label="上课时间">
|
|
|
- <template slot-scope="scope"
|
|
|
- >{{
|
|
|
- scope.row.startClassTime
|
|
|
- ? scope.row.startClassTime.substr(0, 16)
|
|
|
- : ""
|
|
|
- }}-{{
|
|
|
- scope.row.endClassTime
|
|
|
- ? scope.row.endClassTime.substr(11, 5)
|
|
|
- : ""
|
|
|
- }}</template
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" width="100px" label="是否结算">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{ scope.row.isSettlement ? "是" : "否" }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="cancleCom(scope.row)"
|
|
|
+ >取消</el-button
|
|
|
>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" width="100px" label="是否结算">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{ scope.row.isSettlement ? "是" : "否" }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="cancleCom(scope.row)"
|
|
|
- >取消</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
<div class="addBtnList">
|
|
|
<el-button
|
|
@@ -95,10 +93,11 @@
|
|
|
size="mini"
|
|
|
>批量删除</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitClass"
|
|
|
- size="mini"
|
|
|
+
|
|
|
+ <el-button type="primary" @click="resetClass" size="mini"
|
|
|
+ >课程调整</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="submitClass" size="mini"
|
|
|
>课程合并</el-button
|
|
|
>
|
|
|
</div>
|
|
@@ -109,27 +108,45 @@
|
|
|
</el-card>
|
|
|
<el-dialog
|
|
|
:visible.sync="show"
|
|
|
+ v-if="show"
|
|
|
title="临时合课信息"
|
|
|
append-to-body
|
|
|
width="800px"
|
|
|
>
|
|
|
<compoundClass
|
|
|
- :show="show"
|
|
|
- v-if="show"
|
|
|
@closeReset="closeReset"
|
|
|
+ @cancaleMerge="cancaleMerge"
|
|
|
:isDisabled="true"
|
|
|
@getList="getList"
|
|
|
:idList="idList"
|
|
|
- :dataList='dataList'
|
|
|
+ :dataList="dataList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="resetCourseVisible"
|
|
|
+ v-if="resetCourseVisible"
|
|
|
+ @closeReset="closeReset"
|
|
|
+ title="课程调整"
|
|
|
+ append-to-body
|
|
|
+ width="800px"
|
|
|
+ >
|
|
|
+ <resetCourse
|
|
|
+ :idList="idList"
|
|
|
+ :dataList="dataList"
|
|
|
+ @getList="getList"
|
|
|
+ @cancaleMerge="cancaleMerge"
|
|
|
+ @closeReset="closeReset"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import compoundClass from "./compoundClass";
|
|
|
+import resetCourse from "./resetCourse";
|
|
|
export default {
|
|
|
props: ["compoundList"],
|
|
|
- components: { compoundClass },
|
|
|
+ components: { compoundClass, resetCourse },
|
|
|
data() {
|
|
|
return {
|
|
|
radio: "",
|
|
@@ -137,6 +154,8 @@ export default {
|
|
|
isLook: false,
|
|
|
show: false,
|
|
|
idList: "",
|
|
|
+ courseTime: 0,
|
|
|
+ resetCourseVisible: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -151,17 +170,55 @@ export default {
|
|
|
// this.$message.error("请选择一节主课");
|
|
|
// return;
|
|
|
// }
|
|
|
- // let arr = []
|
|
|
+ let arr = [];
|
|
|
let idList = [];
|
|
|
+ let isFlage = false;
|
|
|
this.dataList.forEach((com) => {
|
|
|
- // arr.push(com.type)
|
|
|
+ arr.push(com.type);
|
|
|
idList.push(com.id);
|
|
|
+ if (
|
|
|
+ com.groupType != "MUSIC" ||
|
|
|
+ com.type == "MUSIC_NETWORK" ||
|
|
|
+ com.type == "HIGH_ONLINE"
|
|
|
+ ) {
|
|
|
+ this.$message.error("只有乐团课的下线课可以合并");
|
|
|
+ isFlage = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (com.status != "NOT_START") {
|
|
|
+ this.$message.error("只有未开始的课可以合并");
|
|
|
+ isFlage = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (com.newCourseId > 0 || com.beMerged) {
|
|
|
+ this.$message.error("已经合并课程不可再次合并");
|
|
|
+ isFlage = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (com.isLock) {
|
|
|
+ this.$message.error("已锁定的课程不能合并");
|
|
|
+ isFlage = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
});
|
|
|
- // arr = [... new Set(arr)]
|
|
|
- // if (arr.length != 1) {
|
|
|
- // this.$message.error('请选择相同的课程类型')
|
|
|
- // return
|
|
|
- // }
|
|
|
+ if (isFlage) return;
|
|
|
+ /**
|
|
|
+ * scope.row.groupType == 'MUSIC' &&
|
|
|
+ scope.row.type != 'MUSIC_NETWORK' &&
|
|
|
+ scope.row.type != 'HIGH_ONLINE' &&
|
|
|
+ scope.row.status == 'NOT_START' &&
|
|
|
+ scope.row.newCourseId <= 0
|
|
|
+ !scope.row.beMerged &&
|
|
|
+ !scope.row.isLock
|
|
|
+ */
|
|
|
+ if (arr.indexOf("HIGH") != -1) {
|
|
|
+ arr = [...new Set(arr)];
|
|
|
+ if (arr.length != 1) {
|
|
|
+ this.$message.error("基础技能课只能和基础技能课合并");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (this.dataList.length <= 1) {
|
|
|
this.$message.error("请至少选择2节课程");
|
|
|
return;
|
|
@@ -169,23 +226,78 @@ export default {
|
|
|
// 做判断
|
|
|
this.idList = idList.join(",");
|
|
|
this.show = true;
|
|
|
- this.isLook = false;
|
|
|
+ // this.isLook = false;
|
|
|
},
|
|
|
getList() {},
|
|
|
closeReset() {
|
|
|
this.clearCom();
|
|
|
this.show = false;
|
|
|
+ this.isLook = false;
|
|
|
+ this.resetCourseVisible = false
|
|
|
this.$emit("getList");
|
|
|
},
|
|
|
+ cancaleMerge() {
|
|
|
+ this.show = false;
|
|
|
+ this.resetCourseVisible = false;
|
|
|
+ this.isLook = true;
|
|
|
+ },
|
|
|
removeCourse() {
|
|
|
this.$emit("removeCourse");
|
|
|
},
|
|
|
+ resetClass() {
|
|
|
+ // 判断条件
|
|
|
+ console.log(this.dataList);
|
|
|
+ if (!this.checkCourseTimer()) {
|
|
|
+ this.$message.error("请选择相同的课程时长");
|
|
|
+ }
|
|
|
+ let isclassGroup;
|
|
|
+ let isNotStart = false;
|
|
|
+ let arr = [];
|
|
|
+ let idList =[];
|
|
|
+ this.dataList.forEach((course) => {
|
|
|
+ idList.push(course.id)
|
|
|
+ arr.push(course.classGroupId);
|
|
|
+ if (course.status != "NOT_START") {
|
|
|
+ isNotStart = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (isNotStart) {
|
|
|
+ this.$message.error("请选择未开始的课程");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ((arr = [...new Set(arr)].length != 1)) {
|
|
|
+ this.$message.error("请选择相同的课程组");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.idList = idList;
|
|
|
+ // 开始选择课程
|
|
|
+ this.resetCourseVisible = true;
|
|
|
+ },
|
|
|
+ checkCourseTimer() {
|
|
|
+ let arr = [];
|
|
|
+ this.dataList.forEach((course) => {
|
|
|
+ let dayjs = this.$helpers.dayjs;
|
|
|
+ arr.push(
|
|
|
+ Math.abs(
|
|
|
+ dayjs(course.startClassTime).diff(course.endClassTime, "Minute")
|
|
|
+ )
|
|
|
+ );
|
|
|
+ });
|
|
|
+ if ((arr = [...new Set(arr)].length != 1)) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ this.courseTime = arr[0];
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
compoundList(val) {
|
|
|
- console.log(val);
|
|
|
this.dataList = val;
|
|
|
},
|
|
|
+ isLook(val) {
|
|
|
+ console.log(val);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|