|
@@ -15,9 +15,15 @@
|
|
|
<!-- 列表 -->
|
|
|
<!-- <div class="newBand"
|
|
|
@click="resetClass">班级调整</div> -->
|
|
|
+ <div class="newBand"
|
|
|
+ @click="postpone">课程顺延</div>
|
|
|
<div class="tableWrap">
|
|
|
<el-table :data='tableList'
|
|
|
- :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align='center'
|
|
|
prop="classGroupName"
|
|
|
label="班级名称">
|
|
@@ -51,6 +57,15 @@
|
|
|
prop="studyNum"
|
|
|
label="在读人数">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
+ label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-button type='text'
|
|
|
+ @click="signPostpone(scope.row)">顺延课程</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<!-- <el-table-column align='center'
|
|
|
prop="quitNum"
|
|
|
label="退团人数">
|
|
@@ -75,11 +90,49 @@
|
|
|
:page-sizes="rules.page_size"
|
|
|
@pagination="getList" />
|
|
|
</div>
|
|
|
+ <el-dialog title="课程顺延"
|
|
|
+ :visible.sync="postponeVisible"
|
|
|
+ width="600px"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-form :model="postponeForm"
|
|
|
+ ref="postponeForm"
|
|
|
+ :rules='postponeRules'>
|
|
|
+ <el-form-item label="顺延起始时间"
|
|
|
+ prop="stopTime">
|
|
|
+ <el-date-picker v-model="postponeForm.stopTime"
|
|
|
+ type="date"
|
|
|
+ :picker-options="bigin"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="顺延结束时间"
|
|
|
+ prop="resetTime">
|
|
|
+ <el-date-picker v-model="postponeForm.resetTime"
|
|
|
+ type="date"
|
|
|
+ :picker-options="options"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跳过节假日">
|
|
|
+ <el-checkbox v-model="postponeForm.holiday"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span style='color:#F56C6C;'>注意:将会把所选班级的课表,「顺延起始时间」之后的全部未开始课程;
|
|
|
+ 调整到「顺延结束时间」之后重新排课,可以勾选跳过节假日;</span>
|
|
|
+ <span slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
+ <el-button @click="postponeVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="submitInfo">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
-import { getClassList } from '@/api/buildTeam'
|
|
|
+import { getClassList, coursePostpone } from '@/api/buildTeam'
|
|
|
export default {
|
|
|
props: {
|
|
|
teamid: {
|
|
@@ -89,6 +142,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ postponeVisible: false,
|
|
|
searchLsit: [],
|
|
|
searchForm: {
|
|
|
name: '',
|
|
@@ -102,7 +156,19 @@ export default {
|
|
|
total: 0, // 总条数
|
|
|
page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
},
|
|
|
-
|
|
|
+ postponeForm: {
|
|
|
+ stopTime: '',
|
|
|
+ resetTime: '',
|
|
|
+ holiday: false
|
|
|
+ },
|
|
|
+ postponeRules: {
|
|
|
+ stopTime: [{ required: true, message: '请选择顺延开始时间', trigger: 'blur' },],
|
|
|
+ resetTime: [{ required: true, message: '请选择恢复开始时间', trigger: 'blur' },],
|
|
|
+ },
|
|
|
+ activeClass: '',
|
|
|
+ activeList: [],
|
|
|
+ options: this.processDate(),
|
|
|
+ bigin: this.beginDate()
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -124,7 +190,73 @@ export default {
|
|
|
resetClass () {
|
|
|
// 跳转到班级详情页
|
|
|
this.$router.push({ path: '/business/resetClass', query: { id: this.teamid } })
|
|
|
- }
|
|
|
+ },
|
|
|
+ postpone () {
|
|
|
+ if (this.activeList.length <= 0) {
|
|
|
+ this.$message.error('请至少选择一个班级');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.postponeVisible = true;
|
|
|
+ },
|
|
|
+ signPostpone (row) {
|
|
|
+ this.activeClass = row.classGroupId;
|
|
|
+ this.postponeVisible = true;
|
|
|
+ },
|
|
|
+ handleClose () {
|
|
|
+ // 弹窗关闭之前
|
|
|
+ this.postponeVisible = false;
|
|
|
+ this.$refs['postponeForm'].resetFields();
|
|
|
+ },
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.activeList = val;
|
|
|
+ let arr = val.map(item => {
|
|
|
+ return item.classGroupId
|
|
|
+ })
|
|
|
+ this.activeClass = arr.join(',')
|
|
|
+ },
|
|
|
+ submitInfo () {
|
|
|
+ this.$refs['postponeForm'].validate(res => {
|
|
|
+ if (res) {
|
|
|
+ let classGroupIds = this.activeClass;
|
|
|
+ let pauseDate = this.postponeForm.stopTime;
|
|
|
+ let recoveryDate = this.postponeForm.resetTime;
|
|
|
+ let skipHoliday = this.postponeForm.holiday;
|
|
|
+ let obj = {
|
|
|
+ classGroupIds,
|
|
|
+ pauseDate,
|
|
|
+ recoveryDate,
|
|
|
+ skipHoliday
|
|
|
+ }
|
|
|
+ coursePostpone(obj).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ processDate () {//提出结束时间必须大于提出开始时间
|
|
|
+ let self = this
|
|
|
+ return {
|
|
|
+ disabledDate (time) {
|
|
|
+ if (self.postponeForm.stopTime) {
|
|
|
+ return new Date(self.postponeForm.stopTime).getTime() > time.getTime()
|
|
|
+ } else {
|
|
|
+ return time.getTime() > Date.now()
|
|
|
+ //开始时间不选时,结束时间最大值小于等于当天
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beginDate () {
|
|
|
+ let self = this
|
|
|
+ return {
|
|
|
+ disabledDate (time) {
|
|
|
+ return time.getTime() + 86400000 <= new Date().getTime()//开始时间不选时,结束时间最大值小于等于当天
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|