|
@@ -95,7 +95,7 @@
|
|
|
<el-table-column align="center"
|
|
|
label="操作"
|
|
|
fixed="right"
|
|
|
- width="120px">
|
|
|
+ width="180px">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- v-if="permission('teamCourseList/details')" -->
|
|
|
<div>
|
|
@@ -108,6 +108,9 @@
|
|
|
<el-button type="text"
|
|
|
v-if="!scope.row.isSettlement && permission('courseSchedule/practiceCourseAdjust')&&scope.row.groupType==='PRACTICE'"
|
|
|
@click="resetClass(scope.row)">调整</el-button>
|
|
|
+ <el-button type="text"
|
|
|
+ v-if="scope.row.status == 'NOT_START'&&scope.row.practiceGroupType!='TRIAL'&& permission('courseSchedule/practiceCourseTeacherAdjust')"
|
|
|
+ @click="resetTeacher(scope.row)">更换老师</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -241,10 +244,89 @@
|
|
|
@click="submitResetVipClass">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 网管课调整 -->
|
|
|
+ <el-dialog title="课程调整"
|
|
|
+ width="400px"
|
|
|
+ :visible.sync="practiceVisible">
|
|
|
+ <el-form :model="practiceForm"
|
|
|
+ ref="practiceForm"
|
|
|
+ :rules="practiceRules"
|
|
|
+ label-position="right"
|
|
|
+ label-width="80px;"
|
|
|
+ :inline="true">
|
|
|
+ <el-form-item label="上课日期"
|
|
|
+ prop="date"
|
|
|
+ v-if="practiceForm.courseType != 'TRIAL'">
|
|
|
+ <el-date-picker v-model.trim="practiceForm.date"
|
|
|
+ style="width:200px!important;"
|
|
|
+ type="date"
|
|
|
+ :picker-options="courseOption"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上课日期"
|
|
|
+ prop="date"
|
|
|
+ v-else>
|
|
|
+ <el-date-picker v-model.trim="practiceForm.date"
|
|
|
+ style="width:200px!important;"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :picker-options="{
|
|
|
+ firstDayOfWeek: 1
|
|
|
+ }"
|
|
|
+ placeholder="选择日期"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="开始时间"
|
|
|
+ prop="startTime">
|
|
|
+ <el-time-select placeholder="起始时间"
|
|
|
+ style="width:200px!important;"
|
|
|
+ v-model.trim="startCourseTime"
|
|
|
+ :picker-options="{
|
|
|
+ start: '07:00',
|
|
|
+ step: '00:05',
|
|
|
+ end: '23:00'
|
|
|
+ }"></el-time-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
+ <el-button @click="practiceVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="submitPracticeResetClass">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 老师调整 -->
|
|
|
+ <el-dialog title="课程组调整"
|
|
|
+ width="400px"
|
|
|
+ :visible.sync="teacherVisible">
|
|
|
+ <el-form :model="teacherForm"
|
|
|
+ ref="teacherForm"
|
|
|
+ :rules="teacherRules"
|
|
|
+ label-position="right"
|
|
|
+ label-width="80px;"
|
|
|
+ :inline="true">
|
|
|
+ <el-form-item label="指导老师">
|
|
|
+ <el-select v-model.trim="teacherForm.teacher"
|
|
|
+ filterable
|
|
|
+ clearable>
|
|
|
+ <el-option v-for="(item,index) in teacherList"
|
|
|
+ :key="index"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.realName"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
+ <el-button @click="teacherVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="subresetTeacher">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { superFindCourseSchedules, getTeacher, resetCourse } from "@/api/buildTeam";
|
|
|
+import { superFindCourseSchedules, getTeacher, resetCourse, practiceCourseAdjus, practiceCourseTeacherAdjust } from "@/api/buildTeam";
|
|
|
import { setDate, getCurrentMonthFirst, getCurrentMonthLast } from "@/utils/date"
|
|
|
import { getTeachSchool } from "@/api/teacherManager";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
@@ -262,6 +344,7 @@ export default {
|
|
|
tableList: [],
|
|
|
teacherList: [],
|
|
|
schoolList: [],
|
|
|
+ educationList: [],
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
rules: {
|
|
@@ -297,20 +380,38 @@ export default {
|
|
|
},
|
|
|
vipRules: {
|
|
|
date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
|
|
|
-
|
|
|
+ },
|
|
|
+ practiceRules: {
|
|
|
+ date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
|
|
|
},
|
|
|
startCourseTime: '',
|
|
|
endCourseTime: '',
|
|
|
- practiceForm: {},
|
|
|
+ practiceForm: {
|
|
|
+ id: '',
|
|
|
+ date: '',
|
|
|
+ courseType: '',
|
|
|
+ coursesExpireDate: ''
|
|
|
+ },
|
|
|
+ courseOption: null,
|
|
|
pickerOptions: {
|
|
|
firstDayOfWeek: 1,
|
|
|
disabledDate (time) {
|
|
|
return time.getTime() + 86400000 <= new Date().getTime();
|
|
|
}
|
|
|
},
|
|
|
+ teacherForm: {
|
|
|
+ teacher: null,
|
|
|
+ courseScheduleId: null
|
|
|
+ },
|
|
|
+ teacherRules: {
|
|
|
+ teacher: [{ required: true, message: "请选择老师", trigger: "blur" }],
|
|
|
+ educationalTeacherId: [{ required: true, message: "请选择教务老师", trigger: "blur" }]
|
|
|
+ },
|
|
|
+ teacherVisible: false
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
+ this.courseOption = this.coursesDate();
|
|
|
this.getCalendatList()
|
|
|
getTeacher().then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -324,6 +425,7 @@ export default {
|
|
|
this.schoolList = res.data;
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
// 点击上个月
|
|
|
let prevBtn1 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(1)');
|
|
@@ -340,6 +442,7 @@ export default {
|
|
|
// 点击下个月
|
|
|
let prevBtn3 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(3)');
|
|
|
prevBtn3.addEventListener('click', () => {
|
|
|
+
|
|
|
this.value = new Date(this.value.setMonth(this.value.getMonth() + 1, 1))
|
|
|
this.setCourseList(this.value)
|
|
|
})
|
|
@@ -394,7 +497,8 @@ export default {
|
|
|
showDate (scope) {
|
|
|
this.startTime = scope.data.day
|
|
|
this.endTime = scope.data.day
|
|
|
- this.value = scope.data.day
|
|
|
+ this.value = scope.date
|
|
|
+
|
|
|
this.getList()
|
|
|
},
|
|
|
reduceArray (array, str) {
|
|
@@ -406,16 +510,19 @@ export default {
|
|
|
return array
|
|
|
},
|
|
|
setCourseList (val) {
|
|
|
- this.getCalendatList()
|
|
|
this.startTime = setDate(val)
|
|
|
this.endTime = setDate(val)
|
|
|
this.getList()
|
|
|
+ this.getCalendatList()
|
|
|
+
|
|
|
},
|
|
|
permission (str, parent) {
|
|
|
return permission(str, parent);
|
|
|
},
|
|
|
resetClass (row) {
|
|
|
- console.log(row)
|
|
|
+
|
|
|
+ this.value = new Date(row.classDate.replace(/-/g, '/'))
|
|
|
+ console.log(this.value)
|
|
|
switch (row.groupType) {
|
|
|
case 'MUSIC': {
|
|
|
this.$nextTick(() => {
|
|
@@ -439,11 +546,23 @@ export default {
|
|
|
})
|
|
|
break
|
|
|
}
|
|
|
+ case 'PRACTICE': {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.practiceForm.date = row.classDate;
|
|
|
+ this.startCourseTime = row.startClassTime.split(' ')[1].substring(0, 5);
|
|
|
+ this.practiceForm.id = row.id;
|
|
|
+ this.practiceForm.courseType = row.practiceGroupType
|
|
|
+ this.practiceForm.coursesExpireDate = row.practiceGroup.coursesExpireDate
|
|
|
+ this.practiceVisible = true;
|
|
|
+
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|
|
|
changeStartTime () {
|
|
|
- this.endTime = '';
|
|
|
+ this.endCourseTime = '';
|
|
|
},
|
|
|
submitResetClass () {
|
|
|
if (!this.startCourseTime || !this.endCourseTime) {
|
|
@@ -462,6 +581,7 @@ export default {
|
|
|
resetCourse(obj).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success("修改成功");
|
|
|
+ console.log(this.value)
|
|
|
this.setCourseList(this.value)
|
|
|
this.musicVisible = false;
|
|
|
}
|
|
@@ -504,6 +624,65 @@ export default {
|
|
|
// this.$message.error(res.msg)
|
|
|
// }
|
|
|
});
|
|
|
+ },
|
|
|
+ submitPracticeResetClass () {
|
|
|
+ if (!this.startCourseTime) {
|
|
|
+ this.$message.error("请填写修改时间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ startClassTimeStr: this.startCourseTime,
|
|
|
+ id: this.practiceForm.id,
|
|
|
+ classDate: this.practiceForm.date
|
|
|
+ };
|
|
|
+ practiceCourseAdjus(obj).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.practiceVisible = false;
|
|
|
+ this.setCourseList(this.value)
|
|
|
+ } //else {
|
|
|
+ // this.$message.error(res.msg)
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ coursesDate () {
|
|
|
+ let self = this;
|
|
|
+ return {
|
|
|
+ firstDayOfWeek: 1,
|
|
|
+ disabledDate: time => {
|
|
|
+ // if (self.leftForm.courseStart) {
|
|
|
+ // let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
|
|
|
+ // coursesExpireDate
|
|
|
+ let date = new Date(this.practiceForm.coursesExpireDate.replace(/-/, "/"));
|
|
|
+ return time.getTime() > date.getTime();
|
|
|
+ // }
|
|
|
+ // return;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ resetTeacher (row) {
|
|
|
+ this.teacherForm.teacher = row.actualTeacherId;
|
|
|
+ this.teacherForm.courseScheduleId = row.id;
|
|
|
+ this.teacherVisible = true;
|
|
|
+ },
|
|
|
+ subresetTeacher () {
|
|
|
+ this.$refs.teacherForm.validate(some => {
|
|
|
+ if (some) {
|
|
|
+ // 修改单节课老师
|
|
|
+ practiceCourseTeacherAdjust({
|
|
|
+ courseScheduleId: this.teacherForm.courseScheduleId,
|
|
|
+ teacherId: this.teacherForm.teacher
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.teacherVisible = false;
|
|
|
+ this.setCourseList(this.value)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -530,6 +709,19 @@ export default {
|
|
|
schoolId: "",
|
|
|
teachMode: ""
|
|
|
}
|
|
|
+ this.$refs['vipForm'].resetFields()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ practiceVisible (val) {
|
|
|
+ if (!val) {
|
|
|
+ this.startCourseTime = ""
|
|
|
+ this.practiceForm = {
|
|
|
+ id: '',
|
|
|
+ date: '',
|
|
|
+ courseType: '',
|
|
|
+ coursesExpireDate: ''
|
|
|
+ }
|
|
|
+ this.$refs['practiceForm'].resetFields()
|
|
|
}
|
|
|
}
|
|
|
}
|