|
@@ -1,72 +1,142 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
<div class>
|
|
|
+ <div class="newBand"
|
|
|
+ @click="resetCourses"
|
|
|
+ v-permission="'courseSchedule/practiceGroupTeacherAdjust'">课程交移</div>
|
|
|
<div class="m-core">
|
|
|
<div class="tableWrap">
|
|
|
- <el-table
|
|
|
- style="width: 100%"
|
|
|
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
|
|
|
- :data="tableList"
|
|
|
- >
|
|
|
- <el-table-column align="center" prop="id" label="课程编号"></el-table-column>
|
|
|
- <el-table-column align="center" prop="name" label="课程名称"></el-table-column>
|
|
|
+ <el-table style="width: 100%"
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ :data="tableList">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ :selectable='selectable'
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="id"
|
|
|
+ label="课程组编号"></el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="name"
|
|
|
+ label="课程组名称"></el-table-column>
|
|
|
<!-- <el-table-column align="center" prop="subjectName" label="声部"></el-table-column>
|
|
|
<el-table-column align="center" prop="teacherName" label="指导老师"></el-table-column> -->
|
|
|
- <el-table-column align="center" prop="type" label="课程组类型" width="100">
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="type"
|
|
|
+ label="课程组类型"
|
|
|
+ width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<p>{{scope.row.type | comType}}</p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" prop="groupStatus" label="课程组状态">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <el-table-column align="center"
|
|
|
+ prop="groupStatus"
|
|
|
+ label="课程组状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
<div>
|
|
|
<p>{{scope.row.groupStatus | comCourseGroup}}</p>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" label="开始时间">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <div>{{scope.row.coursesStartDate|dateForMinFormat}}</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" label="结束时间">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <div>{{scope.row.coursesExpireDate|dateForMinFormat}}</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ label="开始时间">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <div>{{scope.row.coursesStartDate|dateForMinFormat}}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
+ label="结束时间">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <div>{{scope.row.coursesExpireDate|dateForMinFormat}}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="是否可调整"
|
|
|
+ align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.hasRestClass>0?'是':'否' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作"
|
|
|
+ align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-button type="text"
|
|
|
+ v-permission="'courseSchedule/practiceGroupTeacherAdjust'"
|
|
|
+ @click="resetCourse(scope.row)">操作</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"
|
|
|
- />
|
|
|
+ <pagination :total="rules.total"
|
|
|
+ :page.sync="rules.page"
|
|
|
+ :limit.sync="rules.limit"
|
|
|
+ :page-sizes="rules.page_size"
|
|
|
+ @pagination="getList" />
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <el-dialog title='课程移交'
|
|
|
+ :visible.sync="maskVisible"
|
|
|
+ width="400px">
|
|
|
+ <el-form :model="maskForm"
|
|
|
+ ref="maskForm">
|
|
|
+ <el-form-item label="选择老师"
|
|
|
+ prop="educationalTeacherId"
|
|
|
+ :rules="[{ required: true, message: '请选择老师',trigger: 'blur'}]">
|
|
|
+ <el-select v-model="maskForm.educationalTeacherId"
|
|
|
+ clearable
|
|
|
+ filterable>
|
|
|
+ <el-option v-for="(item,index) in teacherList"
|
|
|
+ :label="item.realName"
|
|
|
+ :value="item.id"
|
|
|
+ :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="备注"
|
|
|
+ :rules="[{ required: true, message: '请填写备注',trigger: 'blur'}]"
|
|
|
+ prop='memo'>
|
|
|
+ <el-input type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ v-model="maskForm.memo"></el-input>
|
|
|
+ </el-form-item> -->
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
+ <el-button @click="maskVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="submitReset">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import load from "@/utils/loading";
|
|
|
-import { practiceGroupManage } from "@/api/buildTeam";
|
|
|
+import { practiceGroupManage, getTeacher, practiceGroupTeacherAdjust } from "@/api/buildTeam";
|
|
|
export default {
|
|
|
components: { pagination },
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
search: null
|
|
|
},
|
|
|
teacherId: null,
|
|
|
tableList: [],
|
|
|
-
|
|
|
+ isMultiple: false,
|
|
|
+ maskVisible: false,
|
|
|
+ teacherList: [],
|
|
|
+ chioseList: [],
|
|
|
+ maskForm: {
|
|
|
+ educationalTeacherId: null,
|
|
|
+ memo: null
|
|
|
+ },
|
|
|
rules: {
|
|
|
// 分页规则
|
|
|
limit: 10, // 限制显示条数
|
|
@@ -77,21 +147,29 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
+ created () { },
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
+ getTeacher({}).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.teacherList = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
// 获取分部
|
|
|
this.init();
|
|
|
},
|
|
|
- activated() {
|
|
|
+ activated () {
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
- init() {
|
|
|
- this.teacherId = this.$route.query.teacherId
|
|
|
+ selectable (row, index) {
|
|
|
+ return row.hasRestClass > 0
|
|
|
+ },
|
|
|
+ init () {
|
|
|
+ this.teacherId = this.$route.query.teacherId
|
|
|
this.getList();
|
|
|
},
|
|
|
- getList() {
|
|
|
+ getList () {
|
|
|
practiceGroupManage({
|
|
|
teacherId: this.teacherId,
|
|
|
page: this.rules.page,
|
|
@@ -102,6 +180,56 @@ export default {
|
|
|
this.rules.total = res.data.total;
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ resetCourse (row) {
|
|
|
+ this.activeRow = row;
|
|
|
+ this.isMultiple = false
|
|
|
+ this.maskVisible = true
|
|
|
+ },
|
|
|
+ resetCourses () {
|
|
|
+ if (this.chioseList.length <= 0) {
|
|
|
+ this.$message.error('请至少选择一个乐团')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isMultiple = true
|
|
|
+ this.maskVisible = true
|
|
|
+ },
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.chioseList = val
|
|
|
+ },
|
|
|
+ submitReset () {
|
|
|
+ this.$refs['maskForm'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let obj = {};
|
|
|
+ if (this.isMultiple) {
|
|
|
+ // 批量调整
|
|
|
+ obj.practiceGroupId = this.chioseList.map(res => {
|
|
|
+ return res.id
|
|
|
+ }).join(',')
|
|
|
+ } else {
|
|
|
+ // 单词调整
|
|
|
+ obj.practiceGroupId = this.activeRow.id
|
|
|
+ }
|
|
|
+ obj.educationalTeacherId = this.maskForm.educationalTeacherId;
|
|
|
+ obj.teacherId = this.teacherId;
|
|
|
+ // obj.memo = this.maskForm.memo;
|
|
|
+ practiceGroupTeacherAdjust(obj).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.maskVisible = false;
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ maskVisible (val) {
|
|
|
+ if (!val) {
|
|
|
+ this.maskForm.educationalTeacherId = null;
|
|
|
+ this.maskForm.memo = null
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|