|
@@ -76,7 +76,7 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="所属学校" prop="schoolId">
|
|
|
- <el-select v-model="form.schoolId" placeholder="请选择学校" style="width: 100%;">
|
|
|
+ <el-select v-model="form.schoolId" :disabled='form.schoolId !== null' placeholder="请选择学校" style="width: 100%;">
|
|
|
<el-option v-for="dict in dictTables.schoolDict" :key="dict.value" :label="dict.label"
|
|
|
:value="dict.value"></el-option>
|
|
|
</el-select>
|
|
@@ -102,40 +102,26 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 绑定班级对话框 -->
|
|
|
- <el-dialog title="绑定班级" :visible.sync="classVisible" width="30%" center>
|
|
|
- <el-form label-position="right" label-width="80px" :model="bindClassTeacherForm">
|
|
|
- <el-form-item label="老师姓名" prop="teacherName">
|
|
|
- <el-input v-model="bindClassTeacherForm.teacherName" disabled placeholder="请输入老师姓名" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="所属学校" prop="schoolId">
|
|
|
- <el-select v-model="bindClassTeacherForm.schoolId" disabled placeholder="请选择学校" style="width: 100%;">
|
|
|
- <el-option v-for="dict in dictTables.schoolDict" :key="dict.value" :label="dict.label"
|
|
|
- :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="绑定班级" prop="classId">
|
|
|
- <el-select v-model="bindClassTeacherForm.classId" :loading="bindOptionLoding" loading-text="正在加载中~~~"
|
|
|
- reserve-keyword @visible-change="searchClassOption" placeholder="请选择班级" style="width: 100%;">
|
|
|
- <el-option v-for="item in clazzOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="centerDialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ <bind-class-teacher
|
|
|
+ ref="bindClassTeacher"
|
|
|
+ :dictTables="dictTables"
|
|
|
+ @ok="getList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listTeacher, getTeacher, delTeacher, addTeacher, updateTeacher } from "@/api/system/teacher";
|
|
|
-import { listClazzOption } from '@/api/system/clazz'
|
|
|
import Textyixia from "@/mixin/Textyixia"
|
|
|
+import BindClassTeacher from './module/BindClassTeacher'
|
|
|
+
|
|
|
export default {
|
|
|
name: "Teacher",
|
|
|
mixins: [Textyixia],
|
|
|
dicts: ['sys_user_sex'],
|
|
|
+ components: {
|
|
|
+ BindClassTeacher
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -156,7 +142,6 @@ export default {
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- classVisible: false,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -187,11 +172,6 @@ export default {
|
|
|
schoolDict: [],
|
|
|
classDict: []
|
|
|
},
|
|
|
- // 绑定班级和教师表单对象
|
|
|
- bindClassTeacherForm: {},
|
|
|
- // 班级下拉列表
|
|
|
- clazzOption: [],
|
|
|
- bindOptionLoding: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -199,9 +179,6 @@ export default {
|
|
|
this.dictTableData("tb_school,school_name,id").then(data => {
|
|
|
this.dictTables.schoolDict = data
|
|
|
})
|
|
|
- // this.dictTableData("tb_school_class,class_name,id").then(data => {
|
|
|
- // this.dictTables.schoolDict = data
|
|
|
- // })
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询教师管理列表 */
|
|
@@ -298,24 +275,7 @@ export default {
|
|
|
},
|
|
|
/** 绑定班级按钮操作 */
|
|
|
handleBindClass(row) {
|
|
|
- // this.reset();
|
|
|
- this.classVisible = true
|
|
|
- this.bindClassTeacherForm = row
|
|
|
- // 先发请求去获取对应学校的班级 获取成功后,返回对应的班级列表
|
|
|
- // listClazzOption().then(response => {
|
|
|
- // this.clazzOption = response.data
|
|
|
- // })
|
|
|
- },
|
|
|
- /** 懒加载班级列表 */
|
|
|
- searchClassOption(openSelect) {
|
|
|
- if (openSelect) {
|
|
|
- this.bindOptionLoding = true
|
|
|
- listClazzOption(this.bindClassTeacherForm.schoolId).then(response => {
|
|
|
- console.log(response);
|
|
|
- this.clazzOption = response.data
|
|
|
- this.bindOptionLoding = false
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$refs.bindClassTeacher.handleBindClass(row);
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|