|
@@ -14,14 +14,8 @@
|
|
|
</div>
|
|
|
<div class="student_head">
|
|
|
<div class="head_left">
|
|
|
- <el-input
|
|
|
- v-model="sPhoneUser"
|
|
|
- class="student_input"
|
|
|
- placeholder="请输入手机号或用户名"
|
|
|
- ></el-input>
|
|
|
- <el-button class="student_button" @click="searchStudent"
|
|
|
- >查询</el-button
|
|
|
- >
|
|
|
+ <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入手机号或用户名"></el-input>
|
|
|
+ <el-button class="student_button" @click="searchStudent">查询</el-button>
|
|
|
</div>
|
|
|
<div class="head_right">
|
|
|
<el-button @click="addStudent">添加学生</el-button>
|
|
@@ -34,9 +28,7 @@
|
|
|
accept=".xlsx"
|
|
|
>
|
|
|
<el-button size="primary" type="primary">批量添加</el-button>
|
|
|
- <div slot="tip" class="el-upload__tip" style="margin-left:10px;">
|
|
|
- 只能上传jpg/png文件,且不超过500kb
|
|
|
- </div>
|
|
|
+ <div slot="tip" class="el-upload__tip" style="margin-left:10px;">只能上传xlsx文件,且不超过500kb</div>
|
|
|
</el-upload>
|
|
|
<!-- <el-button @click="exportExcel">导出学生</el-button> -->
|
|
|
<div @click="getExcel">xls 上传样例</div>
|
|
@@ -66,7 +58,7 @@
|
|
|
? scope.row.headportrait
|
|
|
: tx
|
|
|
"
|
|
|
- alt=""
|
|
|
+ alt
|
|
|
/>
|
|
|
</div>
|
|
|
<div
|
|
@@ -77,40 +69,35 @@
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
"
|
|
|
- >
|
|
|
- {{ scope.row.name }}
|
|
|
- </div>
|
|
|
+ >{{ scope.row.name }}</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="phonenumber"
|
|
|
- label="电话"
|
|
|
- min-width="15"
|
|
|
- align="center"
|
|
|
- >
|
|
|
+ <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="studentid"
|
|
|
- label="学号"
|
|
|
- min-width="10"
|
|
|
- align="center"
|
|
|
- >
|
|
|
+ <el-table-column label="电话" min-width="15" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{scope.row.phonenumber ? scope.row.phonenumber : "" }}</div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="studentid" label="学号" min-width="10" align="center"></el-table-column>
|
|
|
<!-- <el-table-column
|
|
|
prop="school"
|
|
|
label="学校"
|
|
|
min-width="30"
|
|
|
align="center"
|
|
|
>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>-->
|
|
|
<!-- <el-table-column
|
|
|
prop="classname"
|
|
|
label="班级"
|
|
|
min-width="15"
|
|
|
align="center"
|
|
|
>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>-->
|
|
|
<el-table-column label="操作" min-width="20">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-button
|
|
@@ -119,12 +106,9 @@
|
|
|
size="small"
|
|
|
@click="deleteStudent(scope.row.userid, scope.row.state)"
|
|
|
>删除</el-button
|
|
|
- > -->
|
|
|
- <div
|
|
|
- class="delete"
|
|
|
- @click="deleteStudent(scope.row.userid, scope.row.state)"
|
|
|
- >
|
|
|
- <img src="../../assets/remove.png" alt="" />
|
|
|
+ >-->
|
|
|
+ <div class="delete" @click="deleteStudent(scope.row.userid, scope.row.state)">
|
|
|
+ <img src="../../assets/remove.png" alt />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -138,8 +122,7 @@
|
|
|
:total="total"
|
|
|
v-if="page"
|
|
|
@current-change="handleCurrentChange"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
+ ></el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-dialog
|
|
@@ -151,57 +134,33 @@
|
|
|
>
|
|
|
<div slot="title" class="header-title">
|
|
|
<div class="logoImg">
|
|
|
- <img src="../../assets/logo.png" alt="" />
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <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-input disabled style="width: 300px" v-model="schoolName"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="班级" :label-width="formLabelWidth">
|
|
|
<el-select v-model="sByClass" placeholder="请选择班级">
|
|
@@ -210,13 +169,10 @@
|
|
|
:key="index"
|
|
|
:label="item.name"
|
|
|
:value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <div style="text-align: center; color: #adb3b7">
|
|
|
- 注:添加学生的账号密码为123456
|
|
|
- </div>
|
|
|
+ <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>
|
|
@@ -617,11 +573,17 @@ export default {
|
|
|
this.da.map((v) => {
|
|
|
let obj = {};
|
|
|
let a = "";
|
|
|
+ var num = "";
|
|
|
+ for (var cj = 0; cj < 3; cj++) {
|
|
|
+ num += Math.floor(Math.random() * 10);
|
|
|
+ }
|
|
|
a =
|
|
|
- pinyin.getFullChars(v["学生姓名"]).toLowerCase() + "@cocorobo.cc";
|
|
|
+ pinyin.getFullChars(v["学生姓名"]).toLowerCase() +
|
|
|
+ num +
|
|
|
+ "@cocorobo.cc";
|
|
|
obj.sId = v["学号"];
|
|
|
obj.name = v["学生姓名"];
|
|
|
- obj.mail = v["学生邮箱"] != undefined ? v["学生邮箱"] : a;
|
|
|
+ obj.mail = v["学生邮箱"] ? v["学生邮箱"] : a;
|
|
|
obj.phone = v["学生手机号"];
|
|
|
obj.class = v["班级"];
|
|
|
arr.push(obj);
|
|
@@ -828,41 +790,7 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
// if (_b == 2) {
|
|
|
- let z = 2;
|
|
|
- let newArr = JSON.stringify(arr);
|
|
|
- let params = [
|
|
|
- {
|
|
|
- arr: newArr,
|
|
|
- userpassword: 123456,
|
|
|
- oid: _this.oid,
|
|
|
- },
|
|
|
- ];
|
|
|
- _this.ajax
|
|
|
- .post(_this.$store.state.api + "batchRegistrationMore", params)
|
|
|
- .then((res) => {
|
|
|
- if (res.data.type == 1) {
|
|
|
- _this.$message.error("有学生手机号码已被注册");
|
|
|
- z = 1;
|
|
|
- }
|
|
|
- if (res.data.type == 2) {
|
|
|
- _this.$message.error("有学生邮箱已被注册");
|
|
|
- z = 1;
|
|
|
- }
|
|
|
- if (res.data.type == 3) {
|
|
|
- _this.$message.error("有学生学号重复");
|
|
|
- z = 1;
|
|
|
- }
|
|
|
- if (z == 2) {
|
|
|
- _this.$message({
|
|
|
- message: "新增成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- }
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+
|
|
|
// for (var i = 0; i < arr.length; i++) {
|
|
|
// let _i = i;
|
|
|
// let item = arr[i];
|
|
@@ -924,9 +852,45 @@ export default {
|
|
|
// } else {
|
|
|
// loading.close();
|
|
|
}
|
|
|
-
|
|
|
+ let z = 2;
|
|
|
+ let newArr = JSON.stringify(arr);
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ arr: newArr,
|
|
|
+ userpassword: 123456,
|
|
|
+ oid: _this.oid,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ _this.ajax
|
|
|
+ .post(_this.$store.state.api + "batchRegistrationMore", params)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.type == 1) {
|
|
|
+ _this.$message.error("有学生手机号码已被注册");
|
|
|
+ z = 1;
|
|
|
+ }
|
|
|
+ if (res.data.type == 2) {
|
|
|
+ _this.$message.error("有学生邮箱已被注册");
|
|
|
+ z = 1;
|
|
|
+ }
|
|
|
+ if (res.data.type == 3) {
|
|
|
+ _this.$message.error("有学生学号重复");
|
|
|
+ z = 1;
|
|
|
+ }
|
|
|
+ if (z == 2) {
|
|
|
+ _this.$message({
|
|
|
+ message: "新增成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ _this.getStudent();
|
|
|
+ }
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
_this.fileListUpload = [];
|
|
|
};
|
|
|
+
|
|
|
reader.readAsArrayBuffer(f);
|
|
|
};
|
|
|
|
|
@@ -1007,9 +971,9 @@ export default {
|
|
|
}
|
|
|
.head_right {
|
|
|
display: flex;
|
|
|
- flex-direction: row;
|
|
|
- flex-wrap: nowrap;
|
|
|
- align-items: baseline;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ align-items: baseline;
|
|
|
}
|
|
|
.student_input >>> .el-input__inner {
|
|
|
height: 30px;
|
|
@@ -1150,10 +1114,10 @@ export default {
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
-.newCss{
|
|
|
+.newCss {
|
|
|
display: flex;
|
|
|
- flex-direction: row;
|
|
|
- flex-wrap: nowrap;
|
|
|
- align-items: baseline;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ align-items: baseline;
|
|
|
}
|
|
|
</style>
|