|
@@ -1,6 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="pb_content" style="background: unset">
|
|
<div class="pb_content" style="background: unset">
|
|
<div
|
|
<div
|
|
|
|
+ v-if="ctype==1"
|
|
class="pb_content_body"
|
|
class="pb_content_body"
|
|
style="
|
|
style="
|
|
background: #fff;
|
|
background: #fff;
|
|
@@ -11,7 +12,7 @@
|
|
>
|
|
>
|
|
<div class="pb_head top">
|
|
<div class="pb_head top">
|
|
<span>班级管理</span>
|
|
<span>班级管理</span>
|
|
- <div class="student_button">
|
|
|
|
|
|
+ <div class="student_button" style="border-radius: 4px;">
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
class="bgColor"
|
|
class="bgColor"
|
|
@@ -34,10 +35,12 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="pb_content_body">
|
|
|
|
|
|
+ <div class="pb_content_body" v-if="ctype==1">
|
|
<div class="student_table">
|
|
<div class="student_table">
|
|
<el-table
|
|
<el-table
|
|
|
|
+ v-if="ctype==1"
|
|
ref="table"
|
|
ref="table"
|
|
|
|
+ :key="1"
|
|
:data="tableData"
|
|
:data="tableData"
|
|
border
|
|
border
|
|
:height="tableHeight"
|
|
:height="tableHeight"
|
|
@@ -63,6 +66,12 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" min-width="20%">
|
|
<el-table-column label="操作" min-width="20%">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="getStudent(scope.row.id)"
|
|
|
|
+ >查看学生</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
size="small"
|
|
size="small"
|
|
@@ -91,6 +100,311 @@
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div
|
|
|
|
+ v-if="ctype==2"
|
|
|
|
+ class="pb_content_body"
|
|
|
|
+ style="
|
|
|
|
+ background: #fff;
|
|
|
|
+ padding: 0px 25px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <div class="pb_head top">
|
|
|
|
+ <span>查看学生</span>
|
|
|
|
+ <div class="student_button" style="border-radius: 4px;">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ class="bgColor"
|
|
|
|
+ @click="ctype = 1,getClass()"
|
|
|
|
+ >返回</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="student_head">
|
|
|
|
+ <div class="head_left">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="sPhoneUser"
|
|
|
|
+ class="student_input"
|
|
|
|
+ placeholder="请输入用户名"
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-select
|
|
|
|
+ disabled
|
|
|
|
+ v-model="cid"
|
|
|
|
+ placeholder="请选择班级"
|
|
|
|
+ class="student_input"
|
|
|
|
+ @change="searchStudent"
|
|
|
|
+ style="margin:0 10px"
|
|
|
|
+ >
|
|
|
|
+ <el-option label="所有人" value=""></el-option>
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in classJuri"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button class="student_button" @click="searchStudent"
|
|
|
|
+ >查询</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="head_right">
|
|
|
|
+ <el-button @click="addStudent">添加学生</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="pb_content_body" v-if="ctype==2">
|
|
|
|
+ <div class="student_table">
|
|
|
|
+ <el-table
|
|
|
|
+ v-if="ctype==2"
|
|
|
|
+ :key="2"
|
|
|
|
+ ref="table2"
|
|
|
|
+ :data="tableData2"
|
|
|
|
+ border
|
|
|
|
+ :height="tableHeight"
|
|
|
|
+ :fit="true"
|
|
|
|
+ v-loading="isLoading"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column label="姓名" min-width="10" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="userImg">
|
|
|
|
+ <div class="tx">
|
|
|
|
+ <img
|
|
|
|
+ :src="
|
|
|
|
+ scope.row.headportrait != null
|
|
|
|
+ ? scope.row.headportrait
|
|
|
|
+ : tx
|
|
|
|
+ "
|
|
|
|
+ alt
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ style="
|
|
|
|
+ width: 150px;
|
|
|
|
+ text-align: left;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ {{ scope.row.name }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="学生账号" min-width="15" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>{{ scope.row.un ? scope.row.un : "" }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="classname2"
|
|
|
|
+ label="班级"
|
|
|
|
+ min-width="15"
|
|
|
|
+ align="center"
|
|
|
|
+ >
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="250px">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="btnBox">
|
|
|
|
+ <el-button
|
|
|
|
+ class="de_button"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="iniPassword(scope.row.userid)"
|
|
|
|
+ >初始化密码</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ class="de_button"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="updateStudentA(scope.row)"
|
|
|
|
+ >修改</el-button
|
|
|
|
+ >
|
|
|
|
+ <div class="delete">
|
|
|
|
+ <img
|
|
|
|
+ src="../../assets/remove.png"
|
|
|
|
+ alt
|
|
|
|
+ @click="deleteStudent(scope.row.userid, scope.row.state)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="student_page">
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
+ :page-size="10"
|
|
|
|
+ :total="total2"
|
|
|
|
+ v-if="page2"
|
|
|
|
+ @current-change="handleCurrentChange2"
|
|
|
|
+ ></el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="dialogVisibleAddStudent"
|
|
|
|
+ :append-to-body="true"
|
|
|
|
+ width="700px"
|
|
|
|
+ :before-close="handleClose"
|
|
|
|
+ class="add_student"
|
|
|
|
+ >
|
|
|
|
+ <div slot="title" class="header-title">
|
|
|
|
+ <div class="logoImg">
|
|
|
|
+ <img src="../../assets/logo.png" alt />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_add_student">添加学生</div>
|
|
|
|
+ </div>
|
|
|
|
+ <el-form>
|
|
|
|
+ <el-form-item label="学生姓名" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生姓名"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="sName"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学生学号" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生学号"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="sId"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学生手机号" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生手机号"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="sPhone"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学生账号" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生账号"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="sMail"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="所属学校" :label-width="formLabelWidth">
|
|
|
|
+ <el-input
|
|
|
|
+ disabled
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ v-model="schoolName"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="班级" :label-width="formLabelWidth">
|
|
|
|
+ <el-select v-model="cid" placeholder="请选择班级" disabled>
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in classJuri"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <div style="text-align: center; color: #adb3b7">
|
|
|
|
+ 注:添加学生的账号密码为123456
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ <span slot="footer" class="dialog-footer flex">
|
|
|
|
+ <el-button class="right" @click="insertStudent">确认</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="dialogVisibleUpdate"
|
|
|
|
+ :append-to-body="true"
|
|
|
|
+ width="700px"
|
|
|
|
+ :before-close="handleClose"
|
|
|
|
+ class="add_student"
|
|
|
|
+ >
|
|
|
|
+ <div slot="title" class="header-title">
|
|
|
|
+ <div class="logoImg">
|
|
|
|
+ <img src="../../assets/logo.png" alt />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_add_student">修改学生</div>
|
|
|
|
+ </div>
|
|
|
|
+ <el-form>
|
|
|
|
+ <el-form-item label="学生名称" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生姓名"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="userinfo.name"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学生学号" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生学号"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="userinfo.studentid"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学生手机号" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生手机号"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="userinfo.phonenumber"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学生账号" :label-width="formLabelWidth">
|
|
|
|
+ <span>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入学生账号"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="userinfo.un"
|
|
|
|
+ class="add_input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="所属学校" :label-width="formLabelWidth">
|
|
|
|
+ <el-input
|
|
|
|
+ disabled
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ v-model="schoolName"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="班级" :label-width="formLabelWidth">
|
|
|
|
+ <el-select v-model="userinfo.classid" placeholder="请选择班级">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in classJuri"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <div style="text-align: center; color: #adb3b7">
|
|
|
|
+ 注:添加学生的账号密码为123456
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ <span slot="footer" class="dialog-footer flex">
|
|
|
|
+ <el-button class="right" @click="updateStudent">修改</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
<el-dialog
|
|
<el-dialog
|
|
title="添加班级"
|
|
title="添加班级"
|
|
:visible.sync="dialogVisible"
|
|
:visible.sync="dialogVisible"
|
|
@@ -114,7 +428,7 @@
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="添加班级"
|
|
|
|
|
|
+ title="修改班级"
|
|
:visible.sync="dialogVisible1"
|
|
:visible.sync="dialogVisible1"
|
|
:append-to-body="true"
|
|
:append-to-body="true"
|
|
width="25%"
|
|
width="25%"
|
|
@@ -151,16 +465,36 @@ export default {
|
|
classid: "",
|
|
classid: "",
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
dialogVisible1: false,
|
|
dialogVisible1: false,
|
|
|
|
+ dialogVisibleUpdate: false,
|
|
|
|
+ dialogVisibleAddStudent: false,
|
|
tableData: [],
|
|
tableData: [],
|
|
page: 1,
|
|
page: 1,
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ tableData2: [],
|
|
|
|
+ page2: 1,
|
|
|
|
+ total2: 0,
|
|
userid: this.$route.query.userid,
|
|
userid: this.$route.query.userid,
|
|
oid: this.$route.query.oid,
|
|
oid: this.$route.query.oid,
|
|
|
|
+ cid:"",
|
|
|
|
+ ctype:1,
|
|
|
|
+ sName: "",
|
|
|
|
+ sPhone: "",
|
|
|
|
+ sId: "",
|
|
|
|
+ schoolName: "",
|
|
|
|
+ sByClass: "",
|
|
|
|
+ sMail: "",
|
|
|
|
+ classJuri: [],
|
|
|
|
+ userinfo: {},
|
|
|
|
+ userinfoA: {},
|
|
|
|
+ sPhoneUser:"",
|
|
|
|
+ tx: require("../../assets/avatar.png"),
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.page = 1;
|
|
this.page = 1;
|
|
this.getClass();
|
|
this.getClass();
|
|
|
|
+ this.getClass2();
|
|
|
|
+ this.getSchoolName();
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.$nextTick(function () {
|
|
this.$nextTick(function () {
|
|
@@ -340,6 +674,260 @@ export default {
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ addStudent() {
|
|
|
|
+ this.dialogVisibleAddStudent = true;
|
|
|
|
+ (this.sName = ""), (this.sPhone = ""), (this.sByClass = ""), this.sMail;
|
|
|
|
+ this.getClass2();
|
|
|
|
+ },
|
|
|
|
+ //新增学生
|
|
|
|
+ insertStudent() {
|
|
|
|
+ if (this.sName === "") {
|
|
|
|
+ this.$message.error("学生姓名不能为空");
|
|
|
|
+ return;
|
|
|
|
+ } else if (
|
|
|
|
+ this.sPhone != "" &&
|
|
|
|
+ !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.sPhone)
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("手机号格式不正确");
|
|
|
|
+ return;
|
|
|
|
+ } else if (
|
|
|
|
+ !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("邮箱格式不正确");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.time()) {
|
|
|
|
+ let params = { un: this.sMail };
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "findMail", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.data[0].length > 0) {
|
|
|
|
+ this.$message.error("此学生账号已被注册");
|
|
|
|
+ } else {
|
|
|
|
+ this.add_Student();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ add_Student() {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ username: this.sMail,
|
|
|
|
+ userpassword: 123456,
|
|
|
|
+ alias: this.sName,
|
|
|
|
+ oid: this.oid,
|
|
|
|
+ ph: this.sPhone,
|
|
|
|
+ sid: this.sId,
|
|
|
|
+ cid: this.cid,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "batchRegistration", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ userid: res.data.uid,
|
|
|
|
+ username: this.sName,
|
|
|
|
+ sid: this.sId,
|
|
|
|
+ type: 2,
|
|
|
|
+ oid: res.data.oid,
|
|
|
|
+ phone: res.data.ph,
|
|
|
|
+ cid: res.data.cid,
|
|
|
|
+ intro: "",
|
|
|
|
+ sex: "0",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "updateUserByEdu", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "新增成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.dialogVisibleAddStudent = false;
|
|
|
|
+ this.sPhone = "";
|
|
|
|
+ this.sName = "";
|
|
|
|
+ this.sByClass = [];
|
|
|
|
+ this.sMail = "";
|
|
|
|
+ this.getStudent(this.cid);
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "新增失败",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ updateStudentA(res) {
|
|
|
|
+ this.userinfo = JSON.parse(JSON.stringify(res));
|
|
|
|
+ this.userinfoA = JSON.parse(JSON.stringify(res));
|
|
|
|
+ this.dialogVisibleUpdate = true;
|
|
|
|
+ },
|
|
|
|
+ updateStudent() {
|
|
|
|
+ if (this.userinfo.name === "") {
|
|
|
|
+ this.$message.error("学生姓名不能为空");
|
|
|
|
+ return;
|
|
|
|
+ } else if (!this.userinfo.classid) {
|
|
|
|
+ this.$message.error("请为学生选择班级");
|
|
|
|
+ return;
|
|
|
|
+ } else if (
|
|
|
|
+ this.userinfo.phonenumber &&
|
|
|
|
+ !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.userinfo.phonenumber)
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("手机号格式不正确");
|
|
|
|
+ return;
|
|
|
|
+ } else if (
|
|
|
|
+ !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
|
|
|
|
+ this.userinfo.un
|
|
|
|
+ )
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("邮箱格式不正确");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.time()) {
|
|
|
|
+ if (this.userinfoA.un != this.userinfo.un) {
|
|
|
|
+ let params = { un: this.userinfo.un };
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "findMail", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.data[0].length > 0) {
|
|
|
|
+ this.$message.error("此学生账号已被注册");
|
|
|
|
+ } else {
|
|
|
|
+ this.update_Student();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.update_Student();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ update_Student() {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ userid: this.userinfo.userid,
|
|
|
|
+ username: this.userinfo.un,
|
|
|
|
+ alias: this.userinfo.name,
|
|
|
|
+ ph: this.userinfo.phonenumber,
|
|
|
|
+ sid: this.userinfo.studentid,
|
|
|
|
+ cid: this.userinfo.classid,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "updateStudentInfo", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "修改成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.dialogVisibleUpdate = false;
|
|
|
|
+ this.getStudent(this.cid);
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "修改失败",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //获取班级列表
|
|
|
|
+ getClass2() {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ let params = {
|
|
|
|
+ oid: this.oid,
|
|
|
|
+ };
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "selectClassBySchool", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ this.classJuri = res.data[0];
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ getSchoolName() {
|
|
|
|
+ let params = {
|
|
|
|
+ oid: this.oid,
|
|
|
|
+ };
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "selectSchoolName2", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.schoolName = res.data[0][0].name;
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ searchStudent() {
|
|
|
|
+ this.page2 = 1;
|
|
|
|
+ this.getStudent(this.cid);
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange2(val) {
|
|
|
|
+ this.page2 = val;
|
|
|
|
+ this.getStudent(this.cid);
|
|
|
|
+ },
|
|
|
|
+ getStudent(cid) {
|
|
|
|
+ this.cid = cid
|
|
|
|
+ this.ctype = 2
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ let params = {
|
|
|
|
+ oid: this.oid,
|
|
|
|
+ cid: this.cid,
|
|
|
|
+ cu: "",
|
|
|
|
+ cn: this.sPhoneUser,
|
|
|
|
+ page: this.page2,
|
|
|
|
+ };
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "selectStudent2", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
|
+ this.tableData2 = res.data[0];
|
|
|
|
+ this.getClass2();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ iniPassword(id) {
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ uid: id,
|
|
|
|
+ pa: 123456,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "iniPassword", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "初始化密码成功!",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -395,7 +983,6 @@ export default {
|
|
}
|
|
}
|
|
.student_button {
|
|
.student_button {
|
|
display: flex;
|
|
display: flex;
|
|
- overflow: hidden;
|
|
|
|
height: 40px;
|
|
height: 40px;
|
|
}
|
|
}
|
|
.student_button .el-button--primary {
|
|
.student_button .el-button--primary {
|
|
@@ -429,4 +1016,152 @@ export default {
|
|
.student_table >>> .el-table__body-wrapper {
|
|
.student_table >>> .el-table__body-wrapper {
|
|
height: auto !important;
|
|
height: auto !important;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.student_head {
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ padding-bottom: 10px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.head_left {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.head_right {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
+ align-items: baseline;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.student_input >>> .el-input__inner {
|
|
|
|
+ width: 190px;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.student_button {
|
|
|
|
+ color: #fff;
|
|
|
|
+ background: #2268bc;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.head_right > button:nth-child(1) {
|
|
|
|
+ color: #fff;
|
|
|
|
+ background: #2268bc;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+.head_right > div {
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ color: #2a6dbe;
|
|
|
|
+ text-decoration: underline;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.userImg {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.tx {
|
|
|
|
+ width: 40px;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.delete {
|
|
|
|
+ width: 25px;
|
|
|
|
+ height: 25px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.tx > img,
|
|
|
|
+.delete > img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.btnBox {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-dialog__header {
|
|
|
|
+ padding: 20px 20px 10px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #32455b;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-dialog__title {
|
|
|
|
+ font-size: 14px !important;
|
|
|
|
+ color: #fff !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-dialog__headerbtn {
|
|
|
|
+ font-size: 20px !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-form-item__label {
|
|
|
|
+ margin-left: 65px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-form-item {
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-form-item__content {
|
|
|
|
+ margin: 0 !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_input {
|
|
|
|
+ width: 365px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.add_student >>> .el-dialog__footer {
|
|
|
|
+ text-align: center !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.right {
|
|
|
|
+ width: 250px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ background: #0e72e6;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.header-title {
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.logoImg {
|
|
|
|
+ width: 30px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.logoImg > img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.title_add_student {
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ color: #fff;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.upload-demo {
|
|
|
|
+ line-height: 0px !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.upload-demo >>> .el-button {
|
|
|
|
+ color: #fff;
|
|
|
|
+ background: #2268bc;
|
|
|
|
+ width: 70px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ line-height: 0 !important;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|