|
@@ -0,0 +1,302 @@
|
|
|
+<template>
|
|
|
+ <div class="m-container">
|
|
|
+ <el-calendar style="minWidth:810px">
|
|
|
+ <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
|
|
|
+ <template slot="dateCell"
|
|
|
+ slot-scope="scope">
|
|
|
+ <div @click="showDate(scope)">
|
|
|
+ <p>
|
|
|
+ {{scope.data.day.substring(8)}}
|
|
|
+ </p>
|
|
|
+ <div>
|
|
|
+ <span v-for="(item,index) in newList"
|
|
|
+ class='newDot'
|
|
|
+ :key="item.id"
|
|
|
+ v-if="item.classDate.substring(0,10) === scope.data.day&&item.groupType==='PRACTICE'">
|
|
|
+ 网
|
|
|
+ </span>
|
|
|
+ <span v-for="(item,index) in vipList"
|
|
|
+ class='vipDot'
|
|
|
+ :key="item.id"
|
|
|
+ v-if="item.classDate.substring(0,10) === scope.data.day&&item.groupType==='VIP'">
|
|
|
+ vip
|
|
|
+ </span>
|
|
|
+ <span v-for="(item,index) in teamList"
|
|
|
+ class='teamDot'
|
|
|
+ :key="item.id"
|
|
|
+ v-if="item.classDate.substring(0,10) === scope.data.day&&item.groupType==='MUSIC'">
|
|
|
+ 乐
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-calendar>
|
|
|
+ <div class="tableWrap"
|
|
|
+ v-if='tableList.length>0'>
|
|
|
+ <el-table :data="tableList"
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="organName"
|
|
|
+ label="分部名称"></el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ width="130px"
|
|
|
+ prop="musicGroupId"
|
|
|
+ label="乐团/课程组编号"></el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="id"
|
|
|
+ label="课程编号"></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" prop="groupName" label="乐团/VIP名"></el-table-column> -->
|
|
|
+ <!-- <el-table-column align="center" prop="classGroupName" label="班级名称"></el-table-column> -->
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="studentId"
|
|
|
+ label="学生ID">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.groupType != 'MUSIC'">{{scope.row.studentId}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="subjectName"
|
|
|
+ label="声部"></el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="name"
|
|
|
+ label="课程名称"></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"
|
|
|
+ label="教学模式">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.teachMode | teachMode}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="schoolName"
|
|
|
+ label="教学点">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="courseScheduleStatus"
|
|
|
+ label="课程状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.status | coursesStatus }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ label="操作"
|
|
|
+ fixed="right"
|
|
|
+ width="120px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- v-if="permission('teamCourseList/details')" -->
|
|
|
+ <div>
|
|
|
+ <el-button type="text"
|
|
|
+ v-if="scope.row.groupType ==='MUSIC'"
|
|
|
+ @click="lookDetail(scope.row)">调整</el-button>
|
|
|
+ <el-button v-if="!scope.row.settlementTime && permission('courseSchedule/classStartDateAdjust')&&scope.row.groupType ==='MUSIC'"
|
|
|
+ type="text"
|
|
|
+ @click="resetClass(scope.row)">调整</el-button>
|
|
|
+ <el-button type="text"
|
|
|
+ @click="lookDetail(scope.row)">调整</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination :total="rules.total"
|
|
|
+ :page.sync="rules.page"
|
|
|
+ :limit.sync="rules.limit"
|
|
|
+ :page-sizes="rules.page_size"
|
|
|
+ @pagination="getList" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { superFindCourseSchedules, getTeacher } from "@/api/buildTeam";
|
|
|
+import { setDate, getCurrentMonthFirst, getCurrentMonthLast } from "@/utils/date"
|
|
|
+import pagination from "@/components/Pagination/index";
|
|
|
+export default {
|
|
|
+ components: { pagination },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+
|
|
|
+ dataList: [],
|
|
|
+ value: new Date(),
|
|
|
+ teacherIdList: '',
|
|
|
+ vipList: [],
|
|
|
+ teamList: [],
|
|
|
+ newList: [],
|
|
|
+ tableList: [],
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
+ rules: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 10, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getCalendatList()
|
|
|
+ getTeacher().then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.teacherList = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 点击上个月
|
|
|
+ let prevBtn1 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(1)');
|
|
|
+ prevBtn1.addEventListener('click', () => {
|
|
|
+ this.value = new Date(this.value.setMonth(this.value.getMonth() + -1, 1))
|
|
|
+ this.setCourseList(this.value)
|
|
|
+ })
|
|
|
+ // 点击今天
|
|
|
+ let prevBtn2 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(2)');
|
|
|
+ prevBtn2.addEventListener('click', () => {
|
|
|
+ this.value = new Date()
|
|
|
+ this.setCourseList(this.value)
|
|
|
+ })
|
|
|
+ // 点击下个月
|
|
|
+ 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)
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList () {
|
|
|
+ superFindCourseSchedules({
|
|
|
+ teacherIdList: this.teacherIdList, page: this.rules.page,
|
|
|
+ rows: this.rules.limit, startTime: this.startTime, endTime: this.endTime
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.tableList = res.data.rows
|
|
|
+ this.rules.total = res.data.total
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCalendatList () {
|
|
|
+ this.teacherIdList = this.$route.query.teacherId
|
|
|
+ // 获取当前月第一天和最后一天
|
|
|
+ let startTime = setDate(getCurrentMonthFirst(this.value))
|
|
|
+ let endTime = setDate(getCurrentMonthLast(this.value))
|
|
|
+ superFindCourseSchedules({ teacherIdList: this.teacherIdList, rows: 9999, page: 1, startTime, endTime }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.dataList = res.data.rows
|
|
|
+ // 过滤数据
|
|
|
+ this.vipList = []
|
|
|
+ this.teamList = []
|
|
|
+ this.newList = []
|
|
|
+ for (let i in this.dataList) {
|
|
|
+ if (this.dataList[i].groupType === 'VIP') {
|
|
|
+ this.vipList.push(this.dataList[i])
|
|
|
+ }
|
|
|
+ if (this.dataList[i].groupType === 'MUSIC') {
|
|
|
+ this.teamList.push(this.dataList[i])
|
|
|
+ }
|
|
|
+ if (this.dataList[i].groupType === 'PRACTICE') {
|
|
|
+ this.newList.push(this.dataList[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.vipList = this.reduceArray(this.vipList, 'classDate')
|
|
|
+ this.teamList = this.reduceArray(this.teamList, 'classDate')
|
|
|
+ this.newList = this.reduceArray(this.newList, 'classDate')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showDate (scope) {
|
|
|
+ this.startTime = scope.data.day
|
|
|
+ this.endTime = scope.data.day
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ reduceArray (array, str) {
|
|
|
+ let hash = {}
|
|
|
+ array = array.reduce(function (arr, current) {
|
|
|
+ hash[current[str]] ? '' : hash[current[str]] = true && arr.push(current);
|
|
|
+ return arr
|
|
|
+ }, [])
|
|
|
+ return array
|
|
|
+ },
|
|
|
+ setCourseList (val) {
|
|
|
+ this.getCalendatList()
|
|
|
+ this.startTime = setDate(val)
|
|
|
+ this.endTime = setDate(val)
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+/deep/ .el-calendar-day {
|
|
|
+ box-sizing: border-box;
|
|
|
+ height: 80px !important;
|
|
|
+ min-width: 118px;
|
|
|
+}
|
|
|
+/deep/.current.is-selected {
|
|
|
+ border: 2px solid #137f79;
|
|
|
+
|
|
|
+ .el-calendar-day {
|
|
|
+ height: 76px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+// /deep/.current {
|
|
|
+// border-bottom: 2px solid #ebeef5;
|
|
|
+// border-right: 2px solid #ebeef5;
|
|
|
+// }
|
|
|
+
|
|
|
+.vipDot {
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ margin-top: 10px;
|
|
|
+ background-color: #2aaea6;
|
|
|
+ display: inline-block;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 30px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+.teamDot {
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ margin-top: 10px;
|
|
|
+ background-color: #5a79f6;
|
|
|
+ display: inline-block;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 30px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+.newDot {
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ margin-top: 10px;
|
|
|
+ background-color: #34b1f6;
|
|
|
+ display: inline-block;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 30px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+</style>
|