123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <div class="c-container">
- <!-- 搜索标题 -->
- <!-- <el-form :inline="true"
- class="searchForm"
- v-model="searchForm">
- <el-form-item>
- <el-select v-model="searchForm.name"
- placeholder="课程类型">
- <el-option label="哈哈哈"
- value="1"></el-option>
- </el-select>
- </el-form-item>
- </el-form> -->
- <!-- 列表 -->
- <!-- <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'}"
- @selection-change="handleSelectionChange">
- <el-table-column type="selection"
- width="55">
- </el-table-column>
- <el-table-column align='center'
- prop="classGroupName"
- label="班级名称">
- </el-table-column>
- <el-table-column align='center'
- label="班级类型">
- <template slot-scope="scope">
- <div>
- {{ scope.row.classGroupType | classType}}
- </div>
- </template>
- </el-table-column>
- <el-table-column align='center'
- prop="masterTeacher"
- label="主教老师">
- </el-table-column>
- <el-table-column align='center'
- prop='subTeacher'
- label="助教老师">
- </el-table-column>
- <el-table-column align='center'
- prop="currentClassTimes"
- label="当前课次">
- <template slot-scope="scope">
- <div>
- {{ scope.row.currentClassTimes+'/'+scope.row.totalClassTimes}}
- </div>
- </template>
- </el-table-column>
- <el-table-column align='center'
- 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="退团人数">
- </el-table-column> -->
- <!-- <el-table-column align='center'
- label="新增人数">
- </el-table-column> -->
- <!-- <el-table-column align='center'
- label="退团人数">
- <template slot-scope="scope">
- <div>
- <el-button type='text'>添加学员</el-button>
- <el-button type='text'>老师修改</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>
- <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, coursePostpone } from '@/api/buildTeam'
- export default {
- props: {
- teamid: {
- type: String,
- required: true
- },
- },
- data () {
- return {
- postponeVisible: false,
- searchLsit: [],
- searchForm: {
- name: '',
- status: ''
- },
- tableList: [],
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- 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: {
- pagination
- },
- mounted () {
- this.getList();
- },
- methods: {
- getList () {
- // search: this.teamid
- getClassList({ search: this.teamid, page: this.rules.page, rows: this.rules.limit }).then(res => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.rules.total = res.data.total
- }
- })
- },
- 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>
- <style lang="scss" scope>
- </style>
|