|  | @@ -15,7 +15,7 @@
 | 
	
		
			
				|  |  |                         :label="item.name"></el-option>
 | 
	
		
			
				|  |  |            </el-select>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | -        <el-form-item label="排课起始时间"
 | 
	
		
			
				|  |  | +        <el-form-item label="排课时间"
 | 
	
		
			
				|  |  |                        prop="time">
 | 
	
		
			
				|  |  |            <!-- value-format="yyyy-MM-dd" -->
 | 
	
		
			
				|  |  |            <el-date-picker v-model="leftFrom.time"
 | 
	
	
		
			
				|  | @@ -50,7 +50,7 @@
 | 
	
		
			
				|  |  |              <el-time-select placeholder="结束"
 | 
	
		
			
				|  |  |                              v-model="item.endTime"
 | 
	
		
			
				|  |  |                              :picker-options="{
 | 
	
		
			
				|  |  | -                            start: '08:30',
 | 
	
		
			
				|  |  | +                            start: '06:30',
 | 
	
		
			
				|  |  |                              step: '00:15',
 | 
	
		
			
				|  |  |                              end: '23:30',
 | 
	
		
			
				|  |  |                              minTime: item.startTime
 | 
	
	
		
			
				|  | @@ -60,11 +60,14 @@
 | 
	
		
			
				|  |  |          </el-checkbox-group>
 | 
	
		
			
				|  |  |          <div class="holidayWrap">
 | 
	
		
			
				|  |  |            <el-checkbox v-model="isholiday">跳过节假日</el-checkbox>
 | 
	
		
			
				|  |  | +          <div class="quickBtn"
 | 
	
		
			
				|  |  | +               @click="classCard">一件排课</div>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |          <div class="btnWrap">
 | 
	
		
			
				|  |  | -          <div class="closeBtn">取消排课</div>
 | 
	
		
			
				|  |  | +          <div class="closeBtn"
 | 
	
		
			
				|  |  | +               @click='resetaLL'>取消排课</div>
 | 
	
		
			
				|  |  |            <div class="okBtn"
 | 
	
		
			
				|  |  | -               @click="classCard">一件排课</div>
 | 
	
		
			
				|  |  | +               @click="submitCardList">确定</div>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -78,7 +81,7 @@
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |          </el-table-column>
 | 
	
		
			
				|  |  | -        <el-table-column prop="dateString"
 | 
	
		
			
				|  |  | +        <el-table-column prop="classDate"
 | 
	
		
			
				|  |  |                           label="日期"
 | 
	
		
			
				|  |  |                           width="180">
 | 
	
		
			
				|  |  |          </el-table-column>
 | 
	
	
		
			
				|  | @@ -86,9 +89,13 @@
 | 
	
		
			
				|  |  |                           label="星期"
 | 
	
		
			
				|  |  |                           width="180">
 | 
	
		
			
				|  |  |          </el-table-column>
 | 
	
		
			
				|  |  | -        <el-table-column prop="type"
 | 
	
		
			
				|  |  | -                         label="课程类型"
 | 
	
		
			
				|  |  | +        <el-table-column label="课程类型"
 | 
	
		
			
				|  |  |                           width="180">
 | 
	
		
			
				|  |  | +          <template slot-scope="scope">
 | 
	
		
			
				|  |  | +            <div>
 | 
	
		
			
				|  |  | +              {{scope.row.type |coursesType }}
 | 
	
		
			
				|  |  | +            </div>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  |          </el-table-column>
 | 
	
		
			
				|  |  |          <el-table-column prop="name"
 | 
	
		
			
				|  |  |                           label="课程名称"
 | 
	
	
		
			
				|  | @@ -102,22 +109,96 @@
 | 
	
		
			
				|  |  |                           width="180">
 | 
	
		
			
				|  |  |            <template slot-scope="scope">
 | 
	
		
			
				|  |  |              <div>
 | 
	
		
			
				|  |  | -              <el-button type="text">展开</el-button>
 | 
	
		
			
				|  |  | -              <el-button type="text">修改</el-button>
 | 
	
		
			
				|  |  | +              <el-button type="text"
 | 
	
		
			
				|  |  | +                         @click="OpenSign(scope.row)">展开</el-button>
 | 
	
		
			
				|  |  | +              <el-button type="text"
 | 
	
		
			
				|  |  | +                         @click='resetMixCourse(scope.row)'>修改</el-button>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |          </el-table-column>
 | 
	
		
			
				|  |  |        </el-table>
 | 
	
		
			
				|  |  |        <div class="btnWrap"
 | 
	
		
			
				|  |  |             style="margin-top:40px;">
 | 
	
		
			
				|  |  | -        <div class="nextBtn">下一步</div>
 | 
	
		
			
				|  |  | -        <div class="okBtn">确定</div>
 | 
	
		
			
				|  |  | +        <div class="nextBtn"
 | 
	
		
			
				|  |  | +             @click='gotoNext'>下一步</div>
 | 
	
		
			
				|  |  | +        <div class="okBtn">返回</div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  | +    <el-dialog :visible.sync="resetAllClassVisible"
 | 
	
		
			
				|  |  | +               width="450px">
 | 
	
		
			
				|  |  | +      <p style='margin-bottom:20px'>{{resetAllTitle}}</p>
 | 
	
		
			
				|  |  | +      <div class="resetWrap">
 | 
	
		
			
				|  |  | +        <!-- signBtnActive: false,
 | 
	
		
			
				|  |  | +      skipBtnActive: false -->
 | 
	
		
			
				|  |  | +        <div class="restBtn"
 | 
	
		
			
				|  |  | +             :class="signBtnActive?'active':''"
 | 
	
		
			
				|  |  | +             v-if='buttonType == "SINGLE"'
 | 
	
		
			
				|  |  | +             @click="resetClass">修改为合奏课</div>
 | 
	
		
			
				|  |  | +        <!--  -->
 | 
	
		
			
				|  |  | +        <div class="restBtn"
 | 
	
		
			
				|  |  | +             v-if='buttonType == "MIX"'
 | 
	
		
			
				|  |  | +             :class="signBtnActive?'active':''"
 | 
	
		
			
				|  |  | +             @click="resetClass">修改为单技课</div>
 | 
	
		
			
				|  |  | +        <div class="restBtn"
 | 
	
		
			
				|  |  | +             @click='skipClass'
 | 
	
		
			
				|  |  | +             :class="skipBtnActive?'active':''">跳过此天</div>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +      <span slot="footer"
 | 
	
		
			
				|  |  | +            class="dialog-footer">
 | 
	
		
			
				|  |  | +        <div class="okBtns"
 | 
	
		
			
				|  |  | +             @click="resetMix">确定</div>
 | 
	
		
			
				|  |  | +      </span>
 | 
	
		
			
				|  |  | +    </el-dialog>
 | 
	
		
			
				|  |  | +    <el-dialog :visible.sync="openSignListVisible"
 | 
	
		
			
				|  |  | +               width="450px">
 | 
	
		
			
				|  |  | +      <el-table :data='SignList'>
 | 
	
		
			
				|  |  | +        <el-table-column prop="name"
 | 
	
		
			
				|  |  | +                         label="班级">
 | 
	
		
			
				|  |  | +        </el-table-column>
 | 
	
		
			
				|  |  | +        <el-table-column prop="startClassTime"
 | 
	
		
			
				|  |  | +                         label="开始时间">
 | 
	
		
			
				|  |  | +          <template slot-scope="scope">
 | 
	
		
			
				|  |  | +            <div>
 | 
	
		
			
				|  |  | +              <p v-if="scope.row.option == 1">{{scope.row.startClassTimeStr  }}</p>
 | 
	
		
			
				|  |  | +              <el-input v-if="scope.row.option == 2"
 | 
	
		
			
				|  |  | +                        v-model="scope.row.startClassTimeStr"></el-input>
 | 
	
		
			
				|  |  | +            </div>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  | +        </el-table-column>
 | 
	
		
			
				|  |  | +        <el-table-column prop="endClassTimeStr"
 | 
	
		
			
				|  |  | +                         label="结束时间">
 | 
	
		
			
				|  |  | +          <template slot-scope="scope">
 | 
	
		
			
				|  |  | +            <div>
 | 
	
		
			
				|  |  | +              <p v-if="scope.row.option == 1">{{scope.row.endClassTimeStr  }}</p>
 | 
	
		
			
				|  |  | +              <el-input v-if="scope.row.option == 2"
 | 
	
		
			
				|  |  | +                        v-model="scope.row.endClassTimeStr"></el-input>
 | 
	
		
			
				|  |  | +            </div>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  | +        </el-table-column>
 | 
	
		
			
				|  |  | +        <el-table-column prop="date"
 | 
	
		
			
				|  |  | +                         label="操作">
 | 
	
		
			
				|  |  | +          <template slot-scope="scope">
 | 
	
		
			
				|  |  | +            <div>
 | 
	
		
			
				|  |  | +              <el-button type="text"
 | 
	
		
			
				|  |  | +                         v-if="scope.row.option == 2"
 | 
	
		
			
				|  |  | +                         @click="savecolumn(scope.row)">保存</el-button>
 | 
	
		
			
				|  |  | +              <el-button type="text"
 | 
	
		
			
				|  |  | +                         v-if="scope.row.option == 1"
 | 
	
		
			
				|  |  | +                         @click="savecolumn(scope.row)">修改</el-button>
 | 
	
		
			
				|  |  | +            </div>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  | +        </el-table-column>
 | 
	
		
			
				|  |  | +      </el-table>
 | 
	
		
			
				|  |  | +      <span slot="footer"
 | 
	
		
			
				|  |  | +            class="dialog-footer">
 | 
	
		
			
				|  |  | +        <div class="okBtns"
 | 
	
		
			
				|  |  | +             @click="resetSiginClass">确定</div>
 | 
	
		
			
				|  |  | +      </span>
 | 
	
		
			
				|  |  | +    </el-dialog>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | -import { getAllClass, getAllSignClass } from '@/api/buildTeam'
 | 
	
		
			
				|  |  | +import { getAllClass, getAllSignClass, workOut, checkCourse } from '@/api/buildTeam'
 | 
	
		
			
				|  |  |  import axios from 'axios'
 | 
	
		
			
				|  |  |  import qs from 'qs'
 | 
	
		
			
				|  |  |  export default {
 | 
	
	
		
			
				|  | @@ -129,6 +210,9 @@ export default {
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    data () {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | +      resetAllClassVisible: false, //修改合奏课弹窗
 | 
	
		
			
				|  |  | +      openSignListVisible: false, // 修改单个单技课的弹窗
 | 
	
		
			
				|  |  | +      first: true,
 | 
	
		
			
				|  |  |        leftFrom: {
 | 
	
		
			
				|  |  |          all: '',
 | 
	
		
			
				|  |  |          time: '',
 | 
	
	
		
			
				|  | @@ -192,7 +276,13 @@ export default {
 | 
	
		
			
				|  |  |          all: [{ required: true, message: '请输选择合奏班', trigger: 'blur' }],
 | 
	
		
			
				|  |  |          time: [{ required: true, message: '请选择排课时间', trigger: 'blur' }],
 | 
	
		
			
				|  |  |          num: [{ required: true, message: '请输入排课次数', trigger: 'blur' }]
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      resetAllTitle: '', // 弹窗名
 | 
	
		
			
				|  |  | +      buttonType: '',
 | 
	
		
			
				|  |  | +      activeTime: '', // 选中的当前时间课
 | 
	
		
			
				|  |  | +      signBtnActive: false,
 | 
	
		
			
				|  |  | +      skipBtnActive: false,
 | 
	
		
			
				|  |  | +      SignList: [] // 存储当前合奏课里当天的所有单机课
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted () {
 | 
	
	
		
			
				|  | @@ -202,14 +292,9 @@ export default {
 | 
	
		
			
				|  |  |          this.maxClassList = res.data;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  | -    // getHolidays({ d: '20191016' }).then(res => {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // })
 | 
	
		
			
				|  |  |      let year = new Date().getFullYear();
 | 
	
		
			
				|  |  |      axios.post('/jiari/', qs.stringify({ d: year })).then(res => {
 | 
	
		
			
				|  |  |        this.holidayList = Object.keys(res.data[year])
 | 
	
		
			
				|  |  | -      // this.holidayList = res.data[year]
 | 
	
		
			
				|  |  | -      // console.log(this.holidayList)
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    },
 | 
	
	
		
			
				|  | @@ -228,55 +313,8 @@ export default {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        let classCount = parseInt(this.leftFrom.num);
 | 
	
		
			
				|  |  |        let date = this.leftFrom.time;
 | 
	
		
			
				|  |  | -      let startWeekday = this.leftFrom.time.getDay();
 | 
	
		
			
				|  |  | -      // 第一次循环把所有要排的时间记录下来 请求接口 判断是否节假日 
 | 
	
		
			
				|  |  | -      while (classCount && classCount > 0) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        for (let i in this.checkList) {
 | 
	
		
			
				|  |  | -          let num; // 下次上课上几天后
 | 
	
		
			
				|  |  | -          this.checkList[i] - date.getDay() >= 0 ? num = this.checkList[i] : num = this.checkList[i] - date.getDay() + 7
 | 
	
		
			
				|  |  | -          let dataStr = this.getThinkDate(date, num);
 | 
	
		
			
				|  |  | -          let monthDay = this.getThinkDate(date, num, 2)
 | 
	
		
			
				|  |  | -          if (this.isholiday) {
 | 
	
		
			
				|  |  | -            if (this.holidayList.indexOf(monthDay) != -1) {
 | 
	
		
			
				|  |  | -              // 这里说明有节假日
 | 
	
		
			
				|  |  | -              continue
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -          let className;
 | 
	
		
			
				|  |  | -          this.maxClassList.map(item => {
 | 
	
		
			
				|  |  | -            if (item.id == this.leftFrom.all) {
 | 
	
		
			
				|  |  | -              className = item.name;
 | 
	
		
			
				|  |  | -              return item.name
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -          })
 | 
	
		
			
				|  |  | -          // 排的是合奏班 
 | 
	
		
			
				|  |  | -          this.tableList.push({
 | 
	
		
			
				|  |  | -            'dateString': dataStr,
 | 
	
		
			
				|  |  | -            'week': this.week[this.checkList[i]].name,
 | 
	
		
			
				|  |  | -            'type': 'SINGLE',
 | 
	
		
			
				|  |  | -            'id': this.leftFrom.all,
 | 
	
		
			
				|  |  | -            date,
 | 
	
		
			
				|  |  | -            'name': className,
 | 
	
		
			
				|  |  | -            'classTime': this.week[this.checkList[i]].startTime + '-' + this.week[this.checkList[i]].endTime
 | 
	
		
			
				|  |  | -          })
 | 
	
		
			
				|  |  | -          // 这里我排单技课
 | 
	
		
			
				|  |  | -          for (let j in this.activeSingleList) {
 | 
	
		
			
				|  |  | -            this.classCardList.push({
 | 
	
		
			
				|  |  | -              'classDate': dataStr,
 | 
	
		
			
				|  |  | -              'classGroupId': this.activeSingleList[j].id,
 | 
	
		
			
				|  |  | -              'startClassTime': this.week[this.checkList[i]].startTime,
 | 
	
		
			
				|  |  | -              'endClassTime': this.week[this.checkList[i]].endTime,
 | 
	
		
			
				|  |  | -              'type': 'SINGLE',
 | 
	
		
			
				|  |  | -              'mixid': this.activeSingleList[j].mixid
 | 
	
		
			
				|  |  | -            })
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -          classCount--
 | 
	
		
			
				|  |  | -          if (classCount == 0) break
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -      // console.log(this.tableList)
 | 
	
		
			
				|  |  | -      // 清除现在所选的值
 | 
	
		
			
				|  |  | +      this.workOut(date, classCount, this.checkList, this.leftFrom.all);
 | 
	
		
			
				|  |  |        this.$refs['leftFrom'].resetFields();
 | 
	
		
			
				|  |  |        this.week = this.$options.data().week;
 | 
	
		
			
				|  |  |        this.checkList = [];
 | 
	
	
		
			
				|  | @@ -311,9 +349,21 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      changeMixClass (val) {
 | 
	
		
			
				|  |  |        // 根据合奏班id获取合奏班下的所有单技班
 | 
	
		
			
				|  |  | +      console.log(this.first);
 | 
	
		
			
				|  |  | +      let activeVal = val;
 | 
	
		
			
				|  |  | +      if (!this.first) {
 | 
	
		
			
				|  |  | +        Object.assign(this.$data, this.$options.data());
 | 
	
		
			
				|  |  | +        getAllClass({ musicGroupId: this.teamid }).then(res => {
 | 
	
		
			
				|  |  | +          if (res.code == 200) {
 | 
	
		
			
				|  |  | +            this.maxClassList = res.data;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        this.leftFrom.all = activeVal
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      this.first = false;
 | 
	
		
			
				|  |  |        this.activeSingleList = [];
 | 
	
		
			
				|  |  |        getAllSignClass({ musicGroupId: this.teamid, mixClassGroupId: val }).then(res => {
 | 
	
		
			
				|  |  |          if (res.code == 200) {
 | 
	
	
		
			
				|  | @@ -323,8 +373,258 @@ export default {
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    resetMixCourse (row) {
 | 
	
		
			
				|  |  | +      this.resetAllClassVisible = true;
 | 
	
		
			
				|  |  | +      this.resetAllTitle = `将${row.classDate} ,${row.week}修改`;
 | 
	
		
			
				|  |  | +      this.buttonType = row.type;
 | 
	
		
			
				|  |  | +      this.activeTime = row.classDate;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // console.log(row)
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    resetClass () {
 | 
	
		
			
				|  |  | +      this.signBtnActive = !this.signBtnActive;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    skipClass () {
 | 
	
		
			
				|  |  | +      this.skipBtnActive = !this.skipBtnActive;
 | 
	
		
			
				|  |  | +      // 选中跳过此天
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    resetMix () {
 | 
	
		
			
				|  |  | +      // 修改
 | 
	
		
			
				|  |  | +      if (this.signBtnActive) {
 | 
	
		
			
				|  |  | +        // 点击了修改单技课或者合奏课
 | 
	
		
			
				|  |  | +        let startClassTime;
 | 
	
		
			
				|  |  | +        let endClassTime;
 | 
	
		
			
				|  |  | +        if (this.buttonType == 'SINGLE') {
 | 
	
		
			
				|  |  | +          // 单技改合奏 
 | 
	
		
			
				|  |  | +          for (let i = 0; i < this.classCardList.length; i++) {
 | 
	
		
			
				|  |  | +            if (this.activeTime == this.classCardList[i].classDate) {
 | 
	
		
			
				|  |  | +              this.classCardList.splice(i, 1);
 | 
	
		
			
				|  |  | +              i--;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          // 修改提交表里的时间
 | 
	
		
			
				|  |  | +          // 单技改合奏
 | 
	
		
			
				|  |  | +          for (let i in this.tableList) {
 | 
	
		
			
				|  |  | +            if (this.activeTime == this.tableList[i].classDate) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +              this.tableList[i].type = "MIX";
 | 
	
		
			
				|  |  | +              startClassTime = this.tableList[i].startClassTime;
 | 
	
		
			
				|  |  | +              endClassTime = this.tableList[i].endClassTime;
 | 
	
		
			
				|  |  | +              // this.tableList[i].classGroupId =  this.tableList[i].id;
 | 
	
		
			
				|  |  | +              this.classCardList.push(this.tableList[i]);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        } else if (this.buttonType == 'MIX') {
 | 
	
		
			
				|  |  | +          // 合奏改单技
 | 
	
		
			
				|  |  | +          for (let i in this.tableList) {
 | 
	
		
			
				|  |  | +            // console.log(this.activeTime)
 | 
	
		
			
				|  |  | +            if (this.activeTime == this.tableList[i].classDate) {
 | 
	
		
			
				|  |  | +              // console.log(this.tableList[i])
 | 
	
		
			
				|  |  | +              this.tableList[i].type = "SINGLE";
 | 
	
		
			
				|  |  | +              startClassTime = this.tableList[i].startClassTime;
 | 
	
		
			
				|  |  | +              endClassTime = this.tableList[i].endClassTime;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          let activeTableItem = {};
 | 
	
		
			
				|  |  | +          // 修改提交表里的状态
 | 
	
		
			
				|  |  | +          for (let j = 0; j < this.classCardList.length; j++) {
 | 
	
		
			
				|  |  | +            for (let i in this.tableList) {
 | 
	
		
			
				|  |  | +              console.log(this.classCardList[j].classDate, this.tableList[i].classDate)
 | 
	
		
			
				|  |  | +              if (this.activeTime == this.classCardList[j].classDate && this.activeTime == this.tableList[i].classDate) {
 | 
	
		
			
				|  |  | +                // this.classCardList[j].type = "SINGLE";
 | 
	
		
			
				|  |  | +                // this.classCardList[j].startClassTime = startClassTime;
 | 
	
		
			
				|  |  | +                // this.classCardList[j].endClassTime = endClassTime;
 | 
	
		
			
				|  |  | +                activeTableItem = this.tableList[i];
 | 
	
		
			
				|  |  | +                this.classCardList.splice(j, 1);
 | 
	
		
			
				|  |  | +                j--
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          //添加单机班课
 | 
	
		
			
				|  |  | +          for (let z in this.activeSingleList) {
 | 
	
		
			
				|  |  | +            let obj = {
 | 
	
		
			
				|  |  | +              'classDate': activeTableItem.classDate,
 | 
	
		
			
				|  |  | +              'week': activeTableItem.week,
 | 
	
		
			
				|  |  | +              'type': 'SINGLE',
 | 
	
		
			
				|  |  | +              'id': this.activeSingleList[z].id,
 | 
	
		
			
				|  |  | +              'date': activeTableItem.date,
 | 
	
		
			
				|  |  | +              'name': this.activeSingleList[z].name,
 | 
	
		
			
				|  |  | +              'classTime': activeTableItem.classTime,
 | 
	
		
			
				|  |  | +              'startClassTimeStr': activeTableItem.startClassTimeStr,
 | 
	
		
			
				|  |  | +              'endClassTimeStr': activeTableItem.endClassTimeStr,
 | 
	
		
			
				|  |  | +              'weekNum': activeTableItem.weekNum,
 | 
	
		
			
				|  |  | +              'classGroupId': this.activeSingleList[z].id,
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            this.classCardList.push(obj);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          console.log(this.classCardList)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if (this.skipBtnActive) {
 | 
	
		
			
				|  |  | +        // 这里是跳过此天
 | 
	
		
			
				|  |  | +        let lastTime = this.tableList[this.tableList.length - 1].date;
 | 
	
		
			
				|  |  | +        let weekNum = this.tableList[this.tableList.length - 1].weekNum;
 | 
	
		
			
				|  |  | +        let id = this.tableList[this.tableList.length - 1].id;
 | 
	
		
			
				|  |  | +        let startClassTime = this.tableList[this.tableList.length - 1].startClassTimeStr;
 | 
	
		
			
				|  |  | +        let endClassTime = this.tableList[this.tableList.length - 1].endClassTimeStr;
 | 
	
		
			
				|  |  | +        for (let i in this.tableList) {
 | 
	
		
			
				|  |  | +          if (this.tableList[i].classDate == this.activeTime) {
 | 
	
		
			
				|  |  | +            this.tableList.splice(i, 1);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        for (let j in this.classCardList) {
 | 
	
		
			
				|  |  | +          if (this.classCardList[j].classDate == this.activeTime) {
 | 
	
		
			
				|  |  | +            this.classCardList.splice(j, 1);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // console.log(lastTime, weekNum, id);
 | 
	
		
			
				|  |  | +        this.workOut(lastTime, 1, [weekNum], id, startClassTime, endClassTime);
 | 
	
		
			
				|  |  | +        this.$message.success('修改成功');
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      this.resetAllClassVisible = false;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 排课逻辑
 | 
	
		
			
				|  |  | +    workOut (date, classCount, weekArr, id, startTime = '', endTime = '') {
 | 
	
		
			
				|  |  | +      let date1 = date;
 | 
	
		
			
				|  |  | +      while (classCount && classCount > 0) {
 | 
	
		
			
				|  |  | +        for (let i in weekArr) {
 | 
	
		
			
				|  |  | +          let num; // 下次上课上几天后
 | 
	
		
			
				|  |  | +          weekArr - date.getDay() >= 0 ? num = weekArr : num = weekArr - date.getDay() + 7
 | 
	
		
			
				|  |  | +          let dataStr = this.getThinkDate(date, num);
 | 
	
		
			
				|  |  | +          let monthDay = this.getThinkDate(date1, num, 2)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +          if (this.isholiday) {
 | 
	
		
			
				|  |  | +            if (this.holidayList.indexOf(monthDay) != -1) {
 | 
	
		
			
				|  |  | +              // 这里说明有节假日
 | 
	
		
			
				|  |  | +              continue
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          let className;
 | 
	
		
			
				|  |  | +          this.maxClassList.map(item => {
 | 
	
		
			
				|  |  | +            if (item.id == id) {
 | 
	
		
			
				|  |  | +              className = item.name;
 | 
	
		
			
				|  |  | +              return item.name
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  | +          // 排的是合奏班 
 | 
	
		
			
				|  |  | +          if (!startTime) {
 | 
	
		
			
				|  |  | +            // 有这个说明是修改=> 没有说明是添加
 | 
	
		
			
				|  |  | +            if (!this.week[weekArr[i]].startTime || !this.week[weekArr[i]].endTime) {
 | 
	
		
			
				|  |  | +              // 提示 上课时间必填
 | 
	
		
			
				|  |  | +              // console.log('进入时间判断')
 | 
	
		
			
				|  |  | +              this.$message.error('勾选日期的上课时间段必填');
 | 
	
		
			
				|  |  | +              return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          let nowStartTime = this.week[weekArr[i]].startTime || startTime;
 | 
	
		
			
				|  |  | +          let nowEndTime = this.week[weekArr[i]].endTime || endTime;
 | 
	
		
			
				|  |  | +          this.tableList.push({
 | 
	
		
			
				|  |  | +            'classDate': dataStr,
 | 
	
		
			
				|  |  | +            'week': this.week[weekArr[i]].name,
 | 
	
		
			
				|  |  | +            'type': 'SINGLE',
 | 
	
		
			
				|  |  | +            'id': id,
 | 
	
		
			
				|  |  | +            date,
 | 
	
		
			
				|  |  | +            'name': className,
 | 
	
		
			
				|  |  | +            'classTime': nowStartTime + '-' + nowEndTime,
 | 
	
		
			
				|  |  | +            'startClassTimeStr': nowStartTime,
 | 
	
		
			
				|  |  | +            'endClassTimeStr': nowEndTime,
 | 
	
		
			
				|  |  | +            'weekNum': weekArr[i],
 | 
	
		
			
				|  |  | +            'classGroupId': id
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  | +          // 这里我排单技课
 | 
	
		
			
				|  |  | +          for (let j in this.activeSingleList) {
 | 
	
		
			
				|  |  | +            this.classCardList.push({
 | 
	
		
			
				|  |  | +              'classDate': dataStr,
 | 
	
		
			
				|  |  | +              'classGroupId': this.activeSingleList[j].id,
 | 
	
		
			
				|  |  | +              'startClassTimeStr': nowStartTime,
 | 
	
		
			
				|  |  | +              'endClassTimeStr': nowEndTime,
 | 
	
		
			
				|  |  | +              'type': 'SINGLE',
 | 
	
		
			
				|  |  | +              'mixid': this.activeSingleList[j].mixid,
 | 
	
		
			
				|  |  | +              date,
 | 
	
		
			
				|  |  | +              'weekNum': weekArr[i],
 | 
	
		
			
				|  |  | +              'name': this.activeSingleList[j].name,
 | 
	
		
			
				|  |  | +              'option': 1
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          classCount--
 | 
	
		
			
				|  |  | +          if (classCount == 0) break
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 取消排课
 | 
	
		
			
				|  |  | +    resetaLL () {
 | 
	
		
			
				|  |  | +      Object.assign(this.$data, this.$options.data());
 | 
	
		
			
				|  |  | +      getAllClass({ musicGroupId: this.teamid }).then(res => {
 | 
	
		
			
				|  |  | +        if (res.code == 200) {
 | 
	
		
			
				|  |  | +          this.maxClassList = res.data;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      let year = new Date().getFullYear();
 | 
	
		
			
				|  |  | +      axios.post('/jiari/', qs.stringify({ d: year })).then(res => {
 | 
	
		
			
				|  |  | +        this.holidayList = Object.keys(res.data[year])
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 点击展开
 | 
	
		
			
				|  |  | +    OpenSign (row) {
 | 
	
		
			
				|  |  | +      let id = row.id;
 | 
	
		
			
				|  |  | +      this.SignList = [];
 | 
	
		
			
				|  |  | +      for (let i in this.classCardList) {
 | 
	
		
			
				|  |  | +        if (this.classCardList[i].mixid == row.id && this.classCardList[i].classDate == row.classDate) {
 | 
	
		
			
				|  |  | +          console.log(this.classCardList[i])
 | 
	
		
			
				|  |  | +          this.SignList.push(this.classCardList[i])
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      console.log(this.SignList);
 | 
	
		
			
				|  |  | +      this.openSignListVisible = true;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    savecolumn (row) {
 | 
	
		
			
				|  |  | +      // console.log(row);
 | 
	
		
			
				|  |  | +      row.option == 1 ? row.option = 2 : row.option = 1
 | 
	
		
			
				|  |  | +      console.log(this.SignList);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 重置单技课
 | 
	
		
			
				|  |  | +    resetSiginClass () {
 | 
	
		
			
				|  |  | +      for (let i in this.classCardList) {
 | 
	
		
			
				|  |  | +        for (let j in this.SignList) {
 | 
	
		
			
				|  |  | +          if (this.SignList[j].classDate == this.classCardList[i].classDate && this.SignList[j].classGroupId == this.classCardList[i].classGroupId) {
 | 
	
		
			
				|  |  | +            this.classCardList[i] = this.SignList[j];
 | 
	
		
			
				|  |  | +            this.$message.success('修改成功');
 | 
	
		
			
				|  |  | +            this.openSignListVisible = false;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    submitCardList () {
 | 
	
		
			
				|  |  | +      console.log(this.classCardList);
 | 
	
		
			
				|  |  | +      return;
 | 
	
		
			
				|  |  | +      workOut({ musicGroupID: this.teamid, courseSchedules: this.classCardList }).then(res => {
 | 
	
		
			
				|  |  | +        if (res.code == 200) {
 | 
	
		
			
				|  |  | +          this.$message.success('恭喜您排课成功')
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    gotoNext () {
 | 
	
		
			
				|  |  | +      checkCourse({ musicGroupId: this.teamid }).then(res => {
 | 
	
		
			
				|  |  | +        if (res.code == 200) {
 | 
	
		
			
				|  |  | +          // ...跳转
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }).catch(res => {
 | 
	
		
			
				|  |  | +        this.$message.error(res.msg)
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | +  watch: {
 | 
	
		
			
				|  |  | +    resetAllClassVisible (val) {
 | 
	
		
			
				|  |  | +      if (!val) {
 | 
	
		
			
				|  |  | +        this.signBtnActive = false;
 | 
	
		
			
				|  |  | +        this.skipBtnActive = false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 | 
	
	
		
			
				|  | @@ -351,9 +651,16 @@ export default {
 | 
	
		
			
				|  |  |        margin-top: 34px;
 | 
	
		
			
				|  |  |        margin-bottom: 40px;
 | 
	
		
			
				|  |  |        display: flex;
 | 
	
		
			
				|  |  | -      flex-direction: column;
 | 
	
		
			
				|  |  | -      justify-items: center;
 | 
	
		
			
				|  |  | +      flex-direction: row;
 | 
	
		
			
				|  |  | +      justify-content: space-between;
 | 
	
		
			
				|  |  |        align-items: center;
 | 
	
		
			
				|  |  | +      .quickBtn {
 | 
	
		
			
				|  |  | +        font-size: 16px;
 | 
	
		
			
				|  |  | +        color: #f85043;
 | 
	
		
			
				|  |  | +        text-decoration: underline;
 | 
	
		
			
				|  |  | +        padding-right: 25px;
 | 
	
		
			
				|  |  | +        cursor: pointer;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      .btnWrap {
 | 
	
		
			
				|  |  |        display: flex;
 | 
	
	
		
			
				|  | @@ -371,9 +678,6 @@ export default {
 | 
	
		
			
				|  |  |        .closeBtn {
 | 
	
		
			
				|  |  |          background-color: #777;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      .okBtn {
 | 
	
		
			
				|  |  | -        background-color: #14928a;
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    .right {
 | 
	
	
		
			
				|  | @@ -405,5 +709,37 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  .resetWrap {
 | 
	
		
			
				|  |  | +    display: flex;
 | 
	
		
			
				|  |  | +    flex-direction: row;
 | 
	
		
			
				|  |  | +    justify-content: space-around;
 | 
	
		
			
				|  |  | +    .restBtn {
 | 
	
		
			
				|  |  | +      width: 150px;
 | 
	
		
			
				|  |  | +      height: 50px;
 | 
	
		
			
				|  |  | +      background: rgba(255, 255, 255, 1);
 | 
	
		
			
				|  |  | +      border-radius: 5px;
 | 
	
		
			
				|  |  | +      border: 1px solid rgba(20, 146, 138, 1);
 | 
	
		
			
				|  |  | +      text-align: center;
 | 
	
		
			
				|  |  | +      cursor: pointer;
 | 
	
		
			
				|  |  | +      line-height: 50px;
 | 
	
		
			
				|  |  | +      color: #14928a;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    .restBtn.active {
 | 
	
		
			
				|  |  | +      background-color: #14928a;
 | 
	
		
			
				|  |  | +      color: #fff;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  .okBtns {
 | 
	
		
			
				|  |  | +    background-color: #f97215;
 | 
	
		
			
				|  |  | +    width: 120px;
 | 
	
		
			
				|  |  | +    height: 40px;
 | 
	
		
			
				|  |  | +    line-height: 40px;
 | 
	
		
			
				|  |  | +    text-align: center;
 | 
	
		
			
				|  |  | +    color: #fff;
 | 
	
		
			
				|  |  | +    border-radius: 4px;
 | 
	
		
			
				|  |  | +    margin-right: 20px;
 | 
	
		
			
				|  |  | +    cursor: pointer;
 | 
	
		
			
				|  |  | +    margin: 0 auto;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </style>
 |