|
@@ -1,6 +1,15 @@
|
|
|
<template>
|
|
|
<div class='father-Wrap'>
|
|
|
+ <div class="topWrap">
|
|
|
+ <el-page-header @back="goback"
|
|
|
+ style='padding-bottom:30px;'
|
|
|
+ content="批量排课">
|
|
|
+ </el-page-header>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class='course-container'>
|
|
|
+
|
|
|
<div class="left">
|
|
|
<el-form :model="leftFrom"
|
|
|
ref='leftFrom'
|
|
@@ -90,8 +99,16 @@
|
|
|
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
+ <div class="newBand"
|
|
|
+ style='float:right'
|
|
|
+ @click="multipleReset">批量修改</div>
|
|
|
<el-table :data='tableList'
|
|
|
- :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ style="width: 100%"
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="课次"
|
|
|
width="180">
|
|
|
<template slot-scope="scope">
|
|
@@ -124,8 +141,7 @@
|
|
|
label="上课时间"
|
|
|
width="180">
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column label="操作"
|
|
|
- width="180">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<el-button type="text"
|
|
@@ -175,7 +191,11 @@
|
|
|
<span slot="footer"
|
|
|
class="dialog-footer">
|
|
|
<div class="okBtns"
|
|
|
- @click="resetMix">确定</div>
|
|
|
+ v-if="!isMultiple"
|
|
|
+ @click="resetMix(tableActive)">确定</div>
|
|
|
+ <div class="okBtns"
|
|
|
+ v-if="isMultiple"
|
|
|
+ @click="multipleResetMix">确定</div>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog :visible.sync="openSignListVisible"
|
|
@@ -225,14 +245,14 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
- <div class="btnWrap"
|
|
|
+ <!-- <div class="btnWrap"
|
|
|
style="margin-top:20px;">
|
|
|
<div class="nextBtn"
|
|
|
@click="goback">返回</div>
|
|
|
- <!-- <div class="okBtn"
|
|
|
+ <div class="okBtn"
|
|
|
style="margin-right:30px;"
|
|
|
- @click="gotoNext">确定</div> -->
|
|
|
- </div>
|
|
|
+ @click="gotoNext">确定</div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -326,7 +346,9 @@ export default {
|
|
|
tableActive: null, // 当前操作的行
|
|
|
startClassTimeStr: '',
|
|
|
endClassTimeStr: '',
|
|
|
- teamid: ''
|
|
|
+ teamid: '',
|
|
|
+ activeList: [], // 勾选中的项
|
|
|
+ isMultiple: false
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -352,6 +374,10 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 勾选table触发
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.activeList = val;
|
|
|
+ },
|
|
|
// 确定排课
|
|
|
submitInfo () {
|
|
|
this.$confirm('课表无误,确定排课', '提示', {
|
|
@@ -363,10 +389,14 @@ export default {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('恭喜您排课成功')
|
|
|
this.classCardList = [];
|
|
|
+ this.SignList = [];
|
|
|
+ this.tableList = [];
|
|
|
}
|
|
|
}).catch(res => {
|
|
|
// this.tableList = [];
|
|
|
this.classCardList = [];
|
|
|
+ this.SignList = [];
|
|
|
+ this.tableList = [];
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
|
|
@@ -428,12 +458,15 @@ export default {
|
|
|
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;
|
|
|
- }
|
|
|
- })
|
|
|
+ // Object.assign(this.$data, this.$options.data());
|
|
|
+ // getAllClass({ musicGroupId: this.teamid }).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.maxClassList = res.data;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ this.classCardList = [];
|
|
|
+ this.SignList = [];
|
|
|
+ this.tableList = [];
|
|
|
this.leftFrom.all = activeVal
|
|
|
|
|
|
}
|
|
@@ -457,15 +490,24 @@ export default {
|
|
|
this.activeTime = row.classDate; // 选中那一行的日期
|
|
|
this.startClassTimeStr = row.startClassTimeStr
|
|
|
this.endClassTimeStr = row.endClassTimeStr;
|
|
|
- // 选中那一行的开始时间
|
|
|
- // 选中那一行的结束时间
|
|
|
this.chioseType = row.type;
|
|
|
this.tableActive = row;
|
|
|
},
|
|
|
resetClass () {
|
|
|
this.signBtnActive = !this.signBtnActive;
|
|
|
},
|
|
|
- skipClass (row) {
|
|
|
+ // 批量修改
|
|
|
+ multipleReset () {
|
|
|
+ if (this.activeList.length <= 1) {
|
|
|
+ this.$message.error('请选至少2已上课时')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isMultiple = true;
|
|
|
+ this.resetAllClassVisible = true;
|
|
|
+ this.resetAllTitle = `批量修改`;
|
|
|
+ // this.resetMixCourse()
|
|
|
+ },
|
|
|
+ skipClass () {
|
|
|
// 这里是跳过此天
|
|
|
let loadingInstance = Loading.service({
|
|
|
lock: true,
|
|
@@ -514,16 +556,29 @@ export default {
|
|
|
// this.$message.success('修改成功');
|
|
|
|
|
|
},
|
|
|
- resetMix () {
|
|
|
+ multipleResetMix () {
|
|
|
+ this.isMultiple = false;
|
|
|
+ // 批量更变课程类型
|
|
|
+ console.log('点击批量修改')
|
|
|
+ for (let i in this.activeList) {
|
|
|
+ this.resetMix(this.activeList[i])
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resetMix (row) {
|
|
|
// 当前行的课程类型
|
|
|
- let activeTpye = this.tableActive.type;
|
|
|
+ this.activeTime = row.classDate; // 选中那一行的日期
|
|
|
+ this.startClassTimeStr = row.startClassTimeStr
|
|
|
+ this.endClassTimeStr = row.endClassTimeStr;
|
|
|
+ console.log(row.classDate);
|
|
|
+
|
|
|
+ // let activeTpye = this.tableActive.type;
|
|
|
let startClassTime;
|
|
|
let endClassTime;
|
|
|
if (this.chioseType.indexOf('MIX') != -1) {
|
|
|
// 改合奏
|
|
|
// 删除真实课表里的所有相关单技课
|
|
|
for (let i = 0; i < this.classCardList.length; i++) {
|
|
|
- if (this.activeTime == this.classCardList[i].classDate && this.startClassTimeStr == this.classCardList[i].startClassTimeStr && this.endClassTimeStr == this.classCardList[i].endClassTimeStr) {
|
|
|
+ if (row.classDate == this.classCardList[i].classDate && this.startClassTimeStr == this.classCardList[i].startClassTimeStr && this.endClassTimeStr == this.classCardList[i].endClassTimeStr) {
|
|
|
|
|
|
this.classCardList.splice(i, 1);
|
|
|
i--;
|
|
@@ -531,9 +586,9 @@ export default {
|
|
|
}
|
|
|
// 修改提交表里的时间
|
|
|
// 单技改合奏
|
|
|
- console.log(this.tableList)
|
|
|
+
|
|
|
for (let i in this.tableList) {
|
|
|
- if (this.activeTime == this.tableList[i].classDate && this.startClassTimeStr == this.tableList[i].startClassTimeStr && this.endClassTimeStr == this.tableList[i].endClassTimeStr) {
|
|
|
+ if (row.classDate == this.tableList[i].classDate && this.startClassTimeStr == this.tableList[i].startClassTimeStr && this.endClassTimeStr == this.tableList[i].endClassTimeStr) {
|
|
|
console.log('修改合奏课的类型')
|
|
|
this.tableList[i].type = this.chioseType;
|
|
|
startClassTime = this.tableList[i].startClassTime;
|
|
@@ -544,26 +599,25 @@ export default {
|
|
|
}
|
|
|
//
|
|
|
} else if (this.chioseType.indexOf('SINGLE') != -1 || this.chioseType.indexOf('CLASSROOM') != -1) {
|
|
|
-
|
|
|
+ console.log(this.tableList)
|
|
|
// 合奏改单技
|
|
|
for (let i in this.tableList) {
|
|
|
- if (this.activeTime == this.tableList[i].classDate && this.startClassTimeStr == this.tableList[i].startClassTimeStr && this.endClassTimeStr == this.tableList[i].endClassTimeStr) {
|
|
|
+ if (row.classDate == this.tableList[i].classDate && this.startClassTimeStr == this.tableList[i].startClassTimeStr && this.endClassTimeStr == this.tableList[i].endClassTimeStr) {
|
|
|
this.tableList[i].type = this.chioseType;
|
|
|
startClassTime = this.tableList[i].startClassTime;
|
|
|
endClassTime = this.tableList[i].endClassTime;
|
|
|
}
|
|
|
}
|
|
|
let activeTableItem = {};
|
|
|
- console.log(this.activeTime);
|
|
|
// 修改提交表里的状态
|
|
|
for (let j = 0; j < this.classCardList.length; j++) {
|
|
|
for (let i in this.tableList) {
|
|
|
- if (this.activeTime == this.classCardList[j].classDate && this.startClassTimeStr == this.classCardList[j].startClassTimeStr && this.endClassTimeStr == this.classCardList[j].endClassTimeStr) {
|
|
|
+ if (row.classDate == this.classCardList[j].classDate && this.startClassTimeStr == this.classCardList[j].startClassTimeStr && this.endClassTimeStr == this.classCardList[j].endClassTimeStr) {
|
|
|
|
|
|
this.classCardList.splice(j, 1);
|
|
|
j--
|
|
|
}
|
|
|
- if (this.activeTime == this.tableList[i].classDate && this.startClassTimeStr == this.tableList[i].startClassTimeStr && this.endClassTimeStr == this.tableList[i].endClassTimeStr) {
|
|
|
+ if (row.classDate == this.tableList[i].classDate && this.startClassTimeStr == this.tableList[i].startClassTimeStr && this.endClassTimeStr == this.tableList[i].endClassTimeStr) {
|
|
|
activeTableItem = this.tableList[i];
|
|
|
}
|
|
|
}
|
|
@@ -588,7 +642,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+ console.log(this.classCardList)
|
|
|
this.resetAllClassVisible = false;
|
|
|
},
|
|
|
// 排课逻辑
|
|
@@ -683,6 +737,7 @@ export default {
|
|
|
// 点击查看
|
|
|
OpenSign (row) {
|
|
|
this.SignList = [];
|
|
|
+ console.log(this.classCardList)
|
|
|
for (let i in this.classCardList) {
|
|
|
if (this.classCardList[i].mixid == row.mixid && this.classCardList[i].classDate == row.classDate && row.startClassTimeStr == this.classCardList[i].startClassTimeStr && row.endClassTimeStr == this.classCardList[i].endClassTimeStr) {
|
|
|
this.SignList.push(this.classCardList[i])
|
|
@@ -816,9 +871,14 @@ export default {
|
|
|
.father-Wrap {
|
|
|
padding: 47px 30px;
|
|
|
background-color: #fff;
|
|
|
+ .topWrap {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
}
|
|
|
.course-container {
|
|
|
- border-bottom: 1px solid #ccc;
|
|
|
+ // border-bottom: 1px solid #ccc;
|
|
|
height: 600px;
|
|
|
overflow-y: auto;
|
|
|
|
|
@@ -873,7 +933,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.right {
|
|
|
- width: 1160px;
|
|
|
+ // width: 1160px;
|
|
|
|
|
|
.is-selected {
|
|
|
color: #1989fa;
|