|
@@ -22,7 +22,7 @@
|
|
|
@click="newClass">新建班级</div>
|
|
|
<div class="newBand"
|
|
|
@click="arrangeStart">批量排课</div>
|
|
|
- <div class="newBand">删除排课</div>
|
|
|
+ <!-- <div class="newBand">删除排课</div> -->
|
|
|
<!-- <p class="expectMsg">基础技能班参考数量: 线上:XX/线下:XX</p> -->
|
|
|
</div>
|
|
|
<div class="tableWrap">
|
|
@@ -66,8 +66,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center"
|
|
|
- prop="totalClassTimes"
|
|
|
+ <el-table-column prop="totalClassTimes"
|
|
|
label="排课课次"></el-table-column>
|
|
|
<el-table-column align="center"
|
|
|
prop=""
|
|
@@ -184,17 +183,17 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="助教老师"
|
|
|
prop="teaching"
|
|
|
- :rules="[{ required: true, message: '请选择助教老师',trigger: 'blur'}]">
|
|
|
- <el-select placeholder="请选择助教老师"
|
|
|
- v-model="newClassForm.teaching"
|
|
|
- @change="setAssistant1"
|
|
|
- clearable
|
|
|
- multiple
|
|
|
- filterable>
|
|
|
- <el-option v-for="(item,index) in teacherList"
|
|
|
- :label="item.realName"
|
|
|
- :value="item.id"
|
|
|
- :key="index"></el-option>
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择助教老师"
|
|
|
+ v-model="newClassForm.teaching"
|
|
|
+ @change="setAssistant1"
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ filterable>
|
|
|
+ <el-option v-for="(item,index) in teacherList"
|
|
|
+ :label="item.realName"
|
|
|
+ :value="item.id"
|
|
|
+ :key="index"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -513,15 +512,26 @@
|
|
|
:label="item.label"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="上课形式"
|
|
|
+ prop="teachMode"
|
|
|
+ :rules="[{ required: true, message: '请选择课程类型',trigger: 'blur'}]">
|
|
|
+ <el-select v-model.trim="arrangeForm.teachMode"
|
|
|
+ disabled>
|
|
|
+ <el-option value="ONLINE"
|
|
|
+ label="线上"></el-option>
|
|
|
+ <el-option value="OFFLINE"
|
|
|
+ label="线下"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item label="开始日期"
|
|
|
prop="courseTime"
|
|
|
:rules="[{ required: true, message: '请选择开始日期',trigger: 'blur'}]">
|
|
|
+ <!-- value-format="yyyy-MM-dd" -->
|
|
|
<el-date-picker v-model.trim="arrangeForm.courseTime"
|
|
|
:picker-options="pickerOptions"
|
|
|
style="width:200px!important;"
|
|
|
type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
placeholder="选择日期"></el-date-picker>
|
|
|
<!-- <el-checkbox style="margin-left:10px;"
|
|
|
v-model.trim="teacherForm.checked">是否跳过节假日</el-checkbox> -->
|
|
@@ -596,7 +606,7 @@ import axios from "axios";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import load from "@/utils/loading";
|
|
|
-import { getTeacher, getEmployeeOrgan, getMusicGroupClass, createClass, getSoundTree, findSound, getMusicGroupStuNoClassType, classGroupUpdate, removeSingleClass } from "@/api/buildTeam";
|
|
|
+import { getTeacher, getEmployeeOrgan, getMusicGroupClass, createClass, getSoundTree, findSound, getMusicGroupStuNoClassType, classGroupUpdate, removeSingleClass, workOut } from "@/api/buildTeam";
|
|
|
import {
|
|
|
getClassAllStudent,
|
|
|
removeStudents,
|
|
@@ -632,8 +642,7 @@ export default {
|
|
|
{ value: "NORMAL", label: "单技班" },
|
|
|
{ value: "MIX", label: "合奏班" },
|
|
|
{ value: "HIGH", label: "基础技能班" },
|
|
|
- { value: "SNAP", label: "临时班" },
|
|
|
- { value: "HIGH_ONLINE", label: "线上基础技能班" }
|
|
|
+ { value: "HIGH_ONLINE", label: "基础技能班(线上)" }
|
|
|
],
|
|
|
rules: {
|
|
|
// 分页规则
|
|
@@ -703,6 +712,8 @@ export default {
|
|
|
courseNum: null,
|
|
|
classNum: null,
|
|
|
courseType: null,
|
|
|
+ courseTime: null,
|
|
|
+ teachMode: null
|
|
|
}, // 排课信息
|
|
|
chioseTab: [], // 记录选中的项
|
|
|
isholiday: false,
|
|
@@ -996,7 +1007,7 @@ export default {
|
|
|
}
|
|
|
case "HIGH_ONLINE": {
|
|
|
this.courseTypeList = [
|
|
|
- { value: "HIGH", label: "基础技能课" },
|
|
|
+ { value: "HIGH_ONLINE", label: "线上基础技能课" },
|
|
|
];
|
|
|
break;
|
|
|
}
|
|
@@ -1219,36 +1230,55 @@ export default {
|
|
|
this.setType(this.chioseTab[0].type);
|
|
|
this.arrangeForm.courseType = this.courseTypeList[0].value;
|
|
|
this.arrangeVisible = true;
|
|
|
+ if (this.arrangeForm.courseType == 'HIGH_ONLINE') {
|
|
|
+ this.arrangeForm.teachMode = 'ONLINE'
|
|
|
+ } else {
|
|
|
+ this.arrangeForm.teachMode = 'OFFLINE'
|
|
|
+ }
|
|
|
},
|
|
|
selectionTable (val) {
|
|
|
this.chioseTab = val;
|
|
|
this.arrangeForm.classNum = val.length;
|
|
|
- console.log(val)
|
|
|
},
|
|
|
// 开始排课
|
|
|
arrangeFormSubmit () {
|
|
|
// 获取要排课的班级 id
|
|
|
- console.log(this.weekList.length)
|
|
|
- if (this.weekList.length < 0 || !this.weekList[0].week) {
|
|
|
+ if (this.weekList.length < 0 || !this.weekList[0].dayOfWeek) {
|
|
|
this.$message.error('请设置排课周期')
|
|
|
return
|
|
|
}
|
|
|
+ // 组拼课程信息
|
|
|
+ this.$refs['arrangeForm'].validate(res => {
|
|
|
+ if (res) {
|
|
|
+ let date = this.arrangeForm.courseTime
|
|
|
+ let classCount = this.arrangeForm.courseNum
|
|
|
+ let weekArr = this.weekList;
|
|
|
+ let courseType = this.arrangeForm.courseType
|
|
|
+ let teachMode = this.arrangeForm.teachMode
|
|
|
+ this.classCardList = [];
|
|
|
+ this.workOut(date, classCount, weekArr, courseType, teachMode)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- let date = this.
|
|
|
- // 组拼课程信息
|
|
|
- this.classCardList = [];
|
|
|
- console.log(this.weekList)
|
|
|
- this.workOut()
|
|
|
},
|
|
|
// 排课: 开始日期 几节课 星期几 什么类型的课
|
|
|
- workOut (date, classCount, weekArr, courseType) {
|
|
|
+ workOut (date, classCount, weekArr, courseType, teachMode) {
|
|
|
+ // 验证是不是添加的循环周期里每一项都有值
|
|
|
+ let flag = weekArr.every(item => {
|
|
|
+ return item.dayOfWeek && item.startClassTime && item.endClassTime
|
|
|
+ })
|
|
|
+ if (!flag) {
|
|
|
+ this.$message.error('请保证循环周期信息完整')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 这里是一天排一节课 现在要改成一天排多节
|
|
|
while (classCount && classCount > 0) {
|
|
|
for (let i in weekArr) {
|
|
|
let date1 = new Date(date.getTime());
|
|
|
let num; // 下次上课上几天后
|
|
|
// 星期4 - 当前是星期几 =>
|
|
|
- weekArr[i].week - date.getDay() >= 0 ? num = weekArr[i].week - date.getDay() : num = weekArr[i].week - date.getDay() + 7
|
|
|
+ weekArr[i].dayOfWeek - date.getDay() >= 0 ? num = weekArr[i].dayOfWeek - date.getDay() : num = weekArr[i].dayOfWeek - date.getDay() + 7
|
|
|
|
|
|
let dataStr = this.getThinkDate(date, num);
|
|
|
let monthDay = this.getThinkDate(date1, num, 2)
|
|
@@ -1260,18 +1290,19 @@ export default {
|
|
|
continue
|
|
|
}
|
|
|
}
|
|
|
- let nowStartTime = this.week[i].startTime
|
|
|
- let nowEndTime = this.week[i].endTime
|
|
|
+ let nowStartTime = weekArr[i].startClassTime
|
|
|
+ let nowEndTime = weekArr[i].endClassTime
|
|
|
// 这里开始排课 哪几个班
|
|
|
- for (let j in this.this.chioseTab) {
|
|
|
+ for (let j in this.chioseTab) {
|
|
|
this.classCardList.push({
|
|
|
'classDate': dataStr,
|
|
|
- 'classGroupId': this.this.chioseTab[j].id,
|
|
|
+ 'classGroupId': this.chioseTab[j].id,
|
|
|
'startClassTimeStr': nowStartTime,
|
|
|
'endClassTimeStr': nowEndTime,
|
|
|
'type': courseType,
|
|
|
- 'weekNum': weekArr[i].weekNum,
|
|
|
+ 'weekNum': weekArr[i].dayOfWeek,
|
|
|
'name': this.chioseTab[j].name,
|
|
|
+ 'teachMode': teachMode,
|
|
|
'option': 1
|
|
|
})
|
|
|
}
|
|
@@ -1280,7 +1311,19 @@ export default {
|
|
|
}
|
|
|
date.setDate(date.getDate() + 7);
|
|
|
}
|
|
|
- console.log(this.classCardList)
|
|
|
+ // 直接调接口排课进去
|
|
|
+ workOut({ musicGroupID: this.teamid, courseSchedules: this.classCardList }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('恭喜您排课成功')
|
|
|
+ this.classCardList = [];
|
|
|
+ this.arrangeVisible = false;
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ }).catch(res => {
|
|
|
+ // this.tableList = [];
|
|
|
+ this.classCardList = [];
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
getThinkDate (date, num, type = 1) {
|
|
|
let Stamp = new Date(date.getTime());
|