| | |
| | | <div> |
| | | <el-form :inline="true" :model="searchForm" class="demo-form-inline"> |
| | | <el-form-item label="班级名称"> |
| | | <el-input v-model="searchForm.className" size="small" clearable @clear="page" |
| | | <el-input v-model="searchForm.className" size="small" clearable @clear="page" @input="page" |
| | | placeholder="班级名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="班级状态"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="page">查询</el-button> |
| | | <el-button type="primary" size="small" @click="page">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | | label="班级" |
| | | label="班级名称" |
| | | prop="className" |
| | | width="180px" |
| | | ></el-table-column> |
| | |
| | | <el-tag v-if="scope.row.status === '解散'" type="danger">{{ scope.row.status }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | width="100px" |
| | | align="center" |
| | | label="单位" |
| | | prop="unit" |
| | | ></el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- width="100px"--> |
| | | <!-- align="center"--> |
| | | <!-- label="单位"--> |
| | | <!-- prop="unit"--> |
| | | <!-- ></el-table-column>--> |
| | | <el-table-column |
| | | align="center" |
| | | width="100px" |
| | | width="300px" |
| | | label="教师" |
| | | prop="createUserName" |
| | | prop="teacherNamesStr" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | width="120px" |
| | | label="联系电话" |
| | | prop="teacherPhone" |
| | | ></el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- align="center"--> |
| | | <!-- width="120px"--> |
| | | <!-- label="联系电话"--> |
| | | <!-- prop="teacherPhone"--> |
| | | <!-- ></el-table-column>--> |
| | | <el-table-column |
| | | width="140px" |
| | | label="开班时间" |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button v-if="scope.row.status !== '解散'" size="small" @click="handlerEdit(scope.row)" |
| | | <el-button v-show="scope.row.status !== '解散'" size="small" @click="handlerEdit(scope.row)" |
| | | type="primary">修改 |
| | | </el-button> |
| | | <el-button v-if="scope.row.status !== '解散'" size="small" type="warning">班级验证</el-button> |
| | | <el-button v-if="scope.row.status !== '解散'" size="small" @click="handlerOpenNotify(scope.row)" |
| | | type="info">通知 |
| | | </el-button> |
| | | <el-button v-if="scope.row.status !== '解散'" @click="studentManager(scope.row.id)" size="small" |
| | | <!-- <el-button v-show="scope.row.status !== '解散'" size="small" type="warning">班级验证</el-button>--> |
| | | <!-- <el-button v-show="scope.row.status !== '解散'" size="small" @click="handlerOpenNotify(scope.row)"--> |
| | | <!-- type="info">通知--> |
| | | <!-- </el-button>--> |
| | | <el-button v-show="scope.row.status !== '解散'" @click="studentManager(scope.row.id,scope.row.className)" size="small" |
| | | type="success">成员管理 |
| | | </el-button> |
| | | <el-button v-if="scope.row.status !== '解散'" @click="dissolution(scope.row.id)" type="danger" |
| | | size="small">解散 |
| | | </el-button> |
| | | <el-popconfirm |
| | | class="confirm" |
| | | title="确定要解散该班级?" |
| | | @confirm="dissolution(scope.row.id)" |
| | | > |
| | | <el-button slot="reference" v-show="scope.row.status !== '解散'" type="danger" |
| | | size="small">解散 |
| | | </el-button> |
| | | </el-popconfirm> |
| | | <el-popconfirm |
| | | class="confirm" |
| | | title="确定要恢复该班级吗?" |
| | | @confirm="recover(scope.row.id)" |
| | | > |
| | | <el-button slot="reference" v-show="scope.row.status === '解散'" type="success" |
| | | size="small">恢复正常 |
| | | </el-button> |
| | | </el-popconfirm> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageIndex" |
| | | <pagination v-show="total>0" :total="total" :page.sync="searchForm.currentPage" |
| | | :limit.sync="searchForm.pageSize" |
| | | @pagination="page"/> |
| | | <el-dialog |
| | | title="班级通知" |
| | | :visible.sync="notifyOpen" |
| | | width="600px" |
| | | :before-close="handleClose"> |
| | | <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="通知班级:" prop="className"> |
| | | <span>{{ notifyForm.className }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="通知内容:" prop="notifyContent"> |
| | | <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleNotifyClose">取 消</el-button> |
| | | <el-button type="primary" @click="submitNotifyForm">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- <el-dialog--> |
| | | <!-- title="班级通知"--> |
| | | <!-- :visible.sync="notifyOpen"--> |
| | | <!-- width="600px"--> |
| | | <!-- :before-close="handleNotifyClose"--> |
| | | <!-- :close-on-click-modal="false">--> |
| | | <!-- <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm">--> |
| | | <!-- <el-form-item label="通知班级:" prop="className">--> |
| | | <!-- <span>{{ notifyForm.className }}</span>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="通知内容:" prop="notifyContent">--> |
| | | <!-- <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-form>--> |
| | | <!-- <span slot="footer" class="dialog-footer">--> |
| | | <!-- <el-button @click="handleNotifyClose">取 消</el-button>--> |
| | | <!-- <el-button type="primary" @click="submitNotifyForm">确 定</el-button>--> |
| | | <!-- </span>--> |
| | | <!-- </el-dialog>--> |
| | | |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="700px" |
| | | :before-close="handleClose"> |
| | | :before-close="handleClose" |
| | | :close-on-click-modal="false"> |
| | | <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="班级名称" prop="className"> |
| | | <el-input v-model="form.className" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="老师配置" prop="teacherList"> |
| | | <el-select v-model="form.teacherList" multiple clearable size="small" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in teacherList" |
| | | :key="item.id" |
| | | :label="item.realName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="班级时间" required> |
| | | <el-col :span="11"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addClasses, editClasses, getClassess, dissolution } from '@/api/classes' |
| | | import { addClasses, editClasses, getClassess, dissolution, recover, getTeacherList } from '@/api/classes' |
| | | import { addClassesNotify } from '@/api/classesNotify' |
| | | import Pagination from '@/components/Pagination' |
| | | |
| | |
| | | components: { Pagination }, |
| | | data () { |
| | | return { |
| | | teacherList: [], |
| | | notifyOpen: false, |
| | | notifyForm: { |
| | | className: '', |
| | |
| | | status: '', |
| | | subject: null, |
| | | pageSize: 10, |
| | | pageNum: 1 |
| | | currentPage: 1 |
| | | }, |
| | | form: { |
| | | id: null, |
| | | className: '', |
| | | teacherList: [], |
| | | status: '', |
| | | verifyStatus: '', |
| | | startTime: null, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getTeacherList () { |
| | | getTeacherList().then(res => { |
| | | this.teacherList = res.data.data |
| | | }) |
| | | }, |
| | | handlerOpenNotify (row) { |
| | | this.notifyOpen = true |
| | | this.notifyForm.className = row.className |
| | |
| | | this.form = { |
| | | id: null, |
| | | className: '', |
| | | teacherList: [], |
| | | status: '', |
| | | verifyStatus: '', |
| | | startTime: null, |
| | |
| | | this.page() |
| | | }) |
| | | }, |
| | | recover (id) { |
| | | recover(id).then(res => { |
| | | this.$message.success(res.data.message) |
| | | this.page() |
| | | }) |
| | | }, |
| | | handlerEdit (row) { |
| | | this.form = row |
| | | this.open = true |
| | |
| | | this.open = false |
| | | this.resetForm() |
| | | }, |
| | | handleNotifyClose () { |
| | | this.notifyOpen = false |
| | | this.resetNotifyForm() |
| | | }, |
| | | resetNotifyForm () { |
| | | this.notifyForm = { |
| | | className: '', |
| | | notifyContent: '', |
| | | classesId: null |
| | | } |
| | | }, |
| | | handlerAdd () { |
| | | this.open = true |
| | | this.title = '新增班级' |
| | | }, |
| | | // 跳转(查看班级人员情况) |
| | | studentManager (classesId) { |
| | | this.$router.push({ path: '/classes/class-management/Class-staff', query: { classesId: classesId } }) |
| | | studentManager (classesId,className) { |
| | | this.$router.push({ path: '/classes/class-management/Class-staff', query: { classesId: classesId, className: className } }) |
| | | }, |
| | | // 返回上一个页面 |
| | | goBack () { |
| | |
| | | }, |
| | | created () { |
| | | this.page() |
| | | }, |
| | | this.getTeacherList() |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .confirm { |
| | | margin-left: 5px; |
| | | } |
| | | .flex { |
| | | display: flex; |
| | | } |