KindergartenUI/src/views/system/teacherInfo/index.vue
2022-08-26 16:38:43 +08:00

1101 lines
31 KiB
Vue

<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="所属幼儿园" prop="kindergartenId" label-width="85px">
<el-select
v-model="queryParams.kindergartenId"
clearable
placeholder="所属幼儿园"
style="width: 208px"
>
<el-option
v-for="item in kindergartenInfoList"
:key="item.value"
:label="item.kindergartenName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="教师名称" prop="teacherName">
<el-input
v-model="queryParams.teacherName"
placeholder="请输入教师名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="身份证号" prop="cardNo">
<el-input
v-model="queryParams.cardNo"
placeholder="请输入身份证号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="teacherPhone">
<el-input
v-model="queryParams.teacherPhone"
placeholder="请输入联系电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery1"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:teacherInfo:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:teacherInfo:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:teacherInfo:remove']"
>删除</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:teacherInfo:export']"
>导出</el-button
>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="teacherInfoList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="所属幼儿园"
align="center"
prop="kindergartenName"
/>
<el-table-column label="所属班级" align="center" prop="classInfoList">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="teacherInfo(scope.row)"
>查看</el-button
>
</template>
</el-table-column>
<el-table-column label="教师名称" align="center" prop="teacherName" />
<el-table-column label="身份证号" align="center" prop="cardNo" />
<el-table-column label="联系电话" align="center" prop="teacherPhone" />
<el-table-column label="性别" align="center" prop="teacherSex">
<template slot-scope="scope">
{{ scope.row.teacherSex == "MALE" ? "男" : "女" }}
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:teacherInfo:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:teacherInfo:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改教师信息管理对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="500px"
append-to-body
:before-close="cancel"
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="所属幼儿园" prop="kindergartenId">
<el-button
@click="innerVisible2 = true"
style="width: 360px; text-align: left; height: 36px; color: #c0c4cc"
v-if="kindergartenName == '请选择所在幼儿园'"
>{{ kindergartenName }}</el-button
>
<el-button
@click="innerVisible2 = true"
style="width: 360px; text-align: left; height: 36px"
v-else
>{{ kindergartenName }}</el-button
>
</el-form-item>
<el-form-item
label="所属班级"
prop="classInfoList"
class="is-required"
>
<el-button
@click="innerVisibleclick"
style="width: 360px; text-align: left; height: 36px; color: #c0c4cc"
v-if="classinfoName.length == 0"
>请选择所属班级</el-button
>
<el-tag
v-for="(tag, index) in classinfoName"
v-else
:key="index"
closable
type=""
:disable-transitions="true"
@close="handleClose(tag, index)"
style="margin-right: 10px"
>
{{ tag.className }}
</el-tag>
<el-tag
v-if="classinfoName.length != 0"
type="primary"
plain
:disable-transitions="true"
@click="innerVisibletrue2"
style="float: right; margin-top: 4px"
>选择所属班级</el-tag
>
</el-form-item>
<el-form-item label="教师名称" prop="teacherName">
<el-input v-model="form.teacherName" placeholder="请输入教师名称" />
</el-form-item>
<el-form-item label="身份证号" prop="cardNo">
<el-input v-model="form.cardNo" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="性别" prop="teacherSex">
<el-radio-group v-model="form.teacherSex">
<el-radio :label="male">男</el-radio>
<el-radio :label="female">女</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="联系电话" prop="teacherPhone">
<el-input
v-model="form.teacherPhone"
placeholder="请输入联系电话"
maxlength="11"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- //幼儿园 -->
<el-dialog
width="850px"
title="选择所属幼儿园"
:visible.sync="innerVisible2"
append-to-body
:before-close="cancel2"
>
<el-form
:model="queryParams2"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="幼儿园名称" prop="kindergartenName">
<el-input
v-model="queryParams2.kindergartenName"
placeholder="请输入幼儿园名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="幼儿园地址" prop="kindergartenAddress">
<el-input
v-model="queryParams2.kindergartenAddress"
placeholder="请输入幼儿园地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery3"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery2"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="kindergartenInfoList">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
v-if="kindergartenid == scope.row.id"
style="width: 15px; height: 15px"
circle
@click="kindergartenNameclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="kindergartenNameclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="kindergartenName"
label="幼儿园名字"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="kindergartenAddress"
label="幼儿园地址"
width="150"
align="center"
>
</el-table-column>
<el-table-column
label="幼儿园所在组织"
align="center"
prop="organizeName"
width="150"
>
</el-table-column>
<el-table-column
property="contacts"
label="联系人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total3 > 0"
:total="total3"
:page.sync="queryParams2.pageNum"
:limit.sync="queryParams2.pageSize"
@pagination="getList"
/>
</el-dialog>
<!-- //班级 -->
<el-dialog
width="1000px"
title="选择所属班级"
:visible.sync="innerVisible"
append-to-body
:before-close="cancel3"
>
<el-form
:model="classinfoList2"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="班级名称" prop="className">
<el-input
style="width: 150px"
v-model="classinfoList2.className"
placeholder="请输入班级名称"
clearable
@keyup.enter.native="handleQuery2"
/>
</el-form-item>
<el-form-item label="班级类型" prop="classType">
<el-select
v-model="classinfoList2.classType"
placeholder="请选择"
style="width: 150px"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.classType"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="班主任姓名" prop="classTeacher">
<el-input
v-model="classinfoList2.classTeacher"
placeholder="请输入班主任姓名"
style="width: 150px"
clearable
@keyup.enter.native="handleQuery2"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery2"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery3"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="classinfoList" align="center" style="margin-top: 10px">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 20px; height: 20px"
v-if="containsclass(scope.row.id)"
circle
@click="classinfoclick2(scope.row)"
></el-button>
<!-- v-if="form.classInfoList.find((e) => e == scope.row.id)" -->
<el-button
v-else
style="width: 20px; height: 20px"
circle
@click="classinfoclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="kindergartenName"
label="幼儿园名称"
width="190"
align="center"
/>
<el-table-column
property="className"
label="班级名称"
width="180"
align="center"
>
</el-table-column>
<el-table-column
property="classType"
label="班级类型"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.classType == dictValue1 ? "大班" : "" }}
{{ scope.row.classType == dictValue2 ? "中班" : "" }}
{{ scope.row.classType == dictValue3 ? "小班" : "" }}
{{ scope.row.classType == dictValue4 ? "毕业" : "" }}
</template>
</el-table-column>
<el-table-column
property="classTeacher"
label="班主任姓名"
width="180"
align="center"
>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="190"
align="center"
>
</el-table-column>
</el-table>
<el-button
type="success"
plain
size="mini"
@click="cancel3"
style="margin-top: 30px; margin-left: 20px"
>选择完成</el-button
>
<pagination
v-show="total2 > 0"
:total="total2"
:page.sync="classinfoList2.pageNum"
:limit.sync="classinfoList2.pageSize"
@pagination="getList"
/>
</el-dialog>
<el-dialog
width="750px"
title="教师所属班级"
:visible.sync="innerVisible3"
append-to-body
:before-close="cancel4"
style="margin-top: 100px"
>
<el-table
:data="teacherrclassinfo"
align="center"
style="margin-top: 10px"
>
<el-table-column
property="className"
label="班级名称"
width="180"
align="center"
>
</el-table-column>
<el-table-column
property="classType"
label="班级类型"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.classType == dictValue1 ? "大班" : "" }}
{{ scope.row.classType == dictValue2 ? "中班" : "" }}
{{ scope.row.classType == dictValue3 ? "小班" : "" }}
{{ scope.row.classType == dictValue4 ? "毕业" : "" }}
</template>
</el-table-column>
<el-table-column
property="classTeacher"
label="班主任姓名"
width="180"
align="center"
>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="190"
align="center"
>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import {
listTeacherInfo,
getTeacherInfo,
delTeacherInfo,
addTeacherInfo,
updateTeacherInfo,
getClassInfo,
} from "@/api/system/teacherInfo";
import { listClassinfo } from "@/api/system/classinfo";
import {
listKindergartenInfo,
tKindergartenInfo,
} from "@/api/system/kindergartenInfo";
export default {
name: "TeacherInfo",
data() {
// const checkMobile =/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/;
// 验证手机号的规则
var checkMobile = (rule, value, cb) => {
// 验证手机号的正则表达式
if (value == null) {
cb();
} else if (value == "") {
cb();
} else {
const regMobile =
/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/;
const reg = /^(0[0-9]{2,3}\-)([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/;
const isTel = reg.test(value);
if (value.length == 11) {
if (regMobile.test(value)) {
return cb();
}
} else if (11 < value.length <= 13) {
if (isTel) {
return cb();
}
}
cb(new Error("请输入正确的联系电话"));
}
};
//验证身份证
var isCardId = (rule, value, callback) => {
if (!value) {
return new Error("请输入身份证号)");
} else {
const reg =
/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/;
const card = reg.test(value);
if (!card) {
callback(new Error("身份证号格式有误!"));
} else {
callback();
}
}
};
return {
//性别
male: "MALE",
female: "FEMALE",
// 遮罩层
loading: true,
innerVisible: false,
innerVisible2: false,
innerVisible3: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
total3: 0,
//教师班级
teacherrclassinfo: [],
// 教师信息管理表格数据
teacherInfoList: [],
//youery
kindergartenInfoList: [],
kindergartenid: "",
kindergartenName: "请选择所在幼儿园",
//班级表
classinfoList: [],
classinfoList2: {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
className: null,
classType: null,
},
dictValue1: "",
dictValue2: "",
dictValue3: "",
dictValue4: "",
ClassType: "class_type",
classinfoid: "",
classinfoName: [],
options: [
{
classType: "",
label: "大班",
},
{
classType: "",
label: "中班",
},
{
classType: "",
label: "小班",
},
{
classType: "",
label: "毕业",
},
],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
kindergartenId: "", //幼儿园id
teacherName: "",
cardNo: "",
teacherPhone: "",
teacherSex: "",
},
queryParams2: {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
className: null,
classType: null,
},
// 表单参数
form: {
id: null,
kindergartenId: null,
teacherName: null,
cardNo: null,
teacherPhone: null,
teacherSex: null,
classInfoList: [],
},
// 表单校验
rules: {
teacherSex: [
{ required: true, message: "请选择性别", trigger: "blur" },
],
teacherPhone: [
{
validator: checkMobile,
trigger: "blur",
message: "请输入正确的手机号",
},
],
teacherName: [
{ required: true, message: "请输入教师名称", trigger: "blur" },
],
cardNo: [
{ required: true, message: "请输入证件号", trigger: "blur" },
{ validator: isCardId, trigger: "blur" },
],
classInfoList: [
{ required: true, message: "所属班级不能为空", trigger: "blur" },
],
kindergartenId: [
{ required: true, message: "所属幼儿园不能为空", trigger: "blur" },
],
},
};
},
computed: {
//传入的id 等于这个数组的id 的情况下为true 为蓝色按钮
containsclass() {
return function (id) {
return this.form.classInfoList.find((e) => e == id);
};
},
},
created() {
this.getList();
},
methods: {
//选择班级
getclassinfo() {
listClassinfo(this.classinfoList2).then((response) => {
this.classinfoList = response.rows;
this.total2 = response.total;
});
},
//移除tage
handleClose(tag, index) {
this.form.classInfoList.splice(index, 1);
this.classinfoName.splice(index, 1);
},
// containsclass(item) {
// let a = this.form.classInfoList.find((e) => e == item.id);
// if (a) {
// return true;
// } else {
// return false;
// }
// },
classInfoListif(id) {},
innerVisibleclick() {
if (this.form.kindergartenId == "") {
this.$message.error("请先选择幼儿园");
} else {
this.classinfoList2.kindergartenId = this.form.kindergartenId;
this.innerVisible = true;
this.getclassinfo();
}
},
classinfoclick2(item) {
this.form.classInfoList = this.form.classInfoList.filter(
(e) => e != item.id
);
this.classinfoName = this.classinfoName.filter((e) => e.id != item.id);
},
classinfoclick(item) {
this.form.classInfoList.push(item.id);
// if (res.data.length > 1) {
// this.classinfoName = res.data.map((e) => e.className).join(",");
// } else if (res.data.length == 1) {
// this.classinfoName = JSON.parse(res.data.map((e) => e.className));
// }
if (Array.isArray(this.classinfoName)) {
this.classinfoName.push(item);
} else {
this.classinfoName = this.classinfoName.split(",");
this.classinfoName.push(item);
}
},
//教师班级
teacherInfo(row) {
this.innerVisible3 = true;
getClassInfo({
id: row.id,
}).then((res) => {
this.teacherrclassinfo = res.data;
});
},
kindergartenNameclick(row) {
this.form.kindergartenId = row.id;
this.kindergartenid = row.id;
this.kindergartenName = row.kindergartenName;
this.classinfoList2.kindergartenId = row.id;
this.innerVisible2 = false;
// this.getclassinfo();
},
resetQuery3() {
this.classinfoList2 = {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
className: null,
classType: null,
};
this.handleQuery2();
},
//banjisousuo
handleQuery2() {
listClassinfo(this.classinfoList2).then((response) => {
this.classinfoList = response.rows;
this.total2 = response.total;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
// this.resetQuery();
this.kindergartenid = "";
this.kindergartenName = "请选择所在幼儿园";
this.classinfoName = [];
this.classinfoid = "";
},
cancel4() {
this.innerVisible3 = false;
},
cancel2() {
// this.kindergartenid = "";
// this.kindergartenName = "请选择所在幼儿园";
this.queryParams2 = {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
className: null,
classType: null,
};
this.handleQuery3();
this.innerVisible = false;
this.innerVisible2 = false;
},
cancel3() {
// if (Array.isArray(this.classinfoName)) {
// this.classinfoName = this.classinfoName.join(",");
// } else {
// }
this.innerVisible = false;
this.innerVisible2 = false;
this.classinfoList2 = {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
className: null,
classType: null,
};
this.handleQuery2();
// this.classinfoName = "请选择所属班级";
// this.classinfoid = "";
// if (this.classinfoName > 1) {
// } else if (this.classinfoName.length == 1) {
// this.classinfoName = JSON.parse(this.classinfoName);
// }
},
// 表单重置
reset() {
this.form = {
id: null,
kindergartenId: "",
teacherName: null,
cardNo: null,
teacherPhone: null,
teacherSex: null,
classInfoList: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
listTeacherInfo(this.queryParams).then((response) => {
this.teacherInfoList = response.rows;
this.total = response.total;
});
},
resetQuery1() {
this.resetForm("queryForm");
this.handleQuery();
},
resetQuery2() {
this.queryParams2 = {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
className: null,
classType: null,
};
this.handleQuery3();
},
/** 搜索按钮操作 */
handleQuery3() {
this.queryParams2.pageNum = 1;
listKindergartenInfo(this.queryParams2).then((response) => {
this.kindergartenInfoList = response.rows;
this.total3 = response.total;
});
},
/** 重置按钮操作 */
// resetQuery() {
// this.resetForm("queryForm");
// this.queryParams2 = {
// pageNum: 1,
// pageSize: 10,
// kindergartenId: null,
// className: null,
// classType: null,
// };
// this.classinfoList2 = {
// pageNum: 1,
// pageSize: 10,
// kindergartenId: null,
// className: null,
// classType: null,
// };
// listClassinfo(this.classinfoList2).then((response) => {
// this.classinfoList = response.rows;
// this.total2 = response.total;
// });
// listKindergartenInfo(this.queryParams2).then((response) => {
// this.kindergartenInfoList = response.rows;
// this.total3 = response.total;
// });
// listTeacherInfo(this.queryParams).then((response) => {
// this.teacherInfoList = response.rows;
// this.total = response.total;
// this.loading = false;
// });
// },
/** 查询教师信息管理列表 */
getList() {
this.loading = true;
listKindergartenInfo(this.queryParams2).then((response) => {
this.kindergartenInfoList = response.rows;
this.total3 = response.total;
});
listTeacherInfo(this.queryParams).then((response) => {
this.teacherInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
tKindergartenInfo(this.ClassType).then((res) => {
this.options[0].classType = res.data[0].dictValue;
this.options[1].classType = res.data[1].dictValue;
this.options[2].classType = res.data[2].dictValue;
this.options[3].classType = res.data[3].dictValue;
this.dictValue1 = res.data[0].dictValue;
this.dictValue2 = res.data[1].dictValue;
this.dictValue3 = res.data[2].dictValue;
this.dictValue4 = res.data[3].dictValue;
});
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加教师信息管理";
},
innerVisibletrue2() {
if (this.form.kindergartenId == "") {
this.$message.error("请先选择幼儿园");
} else {
this.classinfoList2.kindergartenId = this.form.kindergartenId;
this.innerVisible = true;
this.getclassinfo();
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.classinfoName = [];
const id = row.id || this.ids;
getTeacherInfo(id)
.then((response) => {
response.data.classInfoList = [];
this.form = response.data;
this.open = true;
this.title = "修改教师信息管理";
this.kindergartenName = this.form.kindergartenName;
this.kindergartenid = this.form.kindergartenId;
this.classinfoList2.kindergartenId = this.form.kindergartenId;
})
.then((el) => {
this.getclassinfo();
})
.then((val) => {
getClassInfo({
id: row.id,
}).then((res) => {
this.form.classInfoList = res.data.map((e) => e.id);
this.form.classInfoList.join(",");
res.data.map((e) => this.classinfoName.push(e));
});
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateTeacherInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.kindergartenid = "";
this.kindergartenName = "请选择所在幼儿园";
this.classinfoName = [];
this.resetQuery1();
});
} else {
addTeacherInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.resetQuery1();
this.kindergartenid = "";
this.kindergartenName = "请选择所在幼儿园";
this.classinfoName = [];
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除此教师的数据?")
.then(function () {
return delTeacherInfo(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/teacherInfo/export",
{
...this.queryParams,
},
`teacherInfo_${new Date().getTime()}.xlsx`
);
},
},
};
</script>