|
@@ -218,7 +218,8 @@ export default {
|
|
sPhoneUser: "",
|
|
sPhoneUser: "",
|
|
userid: this.$route.query.userid,
|
|
userid: this.$route.query.userid,
|
|
oid: this.$route.query.oid,
|
|
oid: this.$route.query.oid,
|
|
- cid: this.$route.query.cid,
|
|
|
|
|
|
+ org: this.$route.query.org,
|
|
|
|
+ cid: '',
|
|
tx: require("../../assets/avatar.png"),
|
|
tx: require("../../assets/avatar.png"),
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -363,10 +364,11 @@ export default {
|
|
ph: this.sPhone,
|
|
ph: this.sPhone,
|
|
sid: this.sId,
|
|
sid: this.sId,
|
|
cid: this.sByClass,
|
|
cid: this.sByClass,
|
|
|
|
+ org: this.org,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
this.ajax
|
|
this.ajax
|
|
- .post(this.$store.state.api + "batchRegistration", params)
|
|
|
|
|
|
+ .post(this.$store.state.api + "batchRegistrationOrg", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// console.log(res.data.uid, res.data.ph, res.data.oid, res.data.cid);
|
|
// console.log(res.data.uid, res.data.ph, res.data.oid, res.data.cid);
|
|
// this.isLoading = false;
|
|
// this.isLoading = false;
|
|
@@ -585,16 +587,16 @@ export default {
|
|
let obj = {};
|
|
let obj = {};
|
|
let a = "";
|
|
let a = "";
|
|
var num = "";
|
|
var num = "";
|
|
- for (var cj = 0; cj < 3; cj++) {
|
|
|
|
- num += Math.floor(Math.random() * 10);
|
|
|
|
- }
|
|
|
|
- a =
|
|
|
|
- pinyin.getFullChars(v["学生姓名"]).toLowerCase() +
|
|
|
|
- num +
|
|
|
|
- "@cocorobo.cc";
|
|
|
|
|
|
+ // for (var cj = 0; cj < 3; cj++) {
|
|
|
|
+ // num += Math.floor(Math.random() * 10);
|
|
|
|
+ // }
|
|
|
|
+ // a =
|
|
|
|
+ // pinyin.getFullChars(v["学生姓名"]).toLowerCase() +
|
|
|
|
+ // num +
|
|
|
|
+ // "@cocorobo.cc";
|
|
obj.sId = v["学号"];
|
|
obj.sId = v["学号"];
|
|
obj.name = v["学生姓名"];
|
|
obj.name = v["学生姓名"];
|
|
- obj.mail = v["学生邮箱"] ? v["学生邮箱"] : a;
|
|
|
|
|
|
+ obj.mail = v["学生邮箱"];
|
|
obj.phone = v["学生手机号"];
|
|
obj.phone = v["学生手机号"];
|
|
obj.class = v["班级"];
|
|
obj.class = v["班级"];
|
|
arr.push(obj);
|
|
arr.push(obj);
|
|
@@ -614,17 +616,7 @@ export default {
|
|
} else if (item.sId === "") {
|
|
} else if (item.sId === "") {
|
|
_b = 1;
|
|
_b = 1;
|
|
_this.$message.error("学生学号不能为空,请重新上传");
|
|
_this.$message.error("学生学号不能为空,请重新上传");
|
|
- }
|
|
|
|
- // else if (item.phone === "") {
|
|
|
|
- // _b = 1;
|
|
|
|
- // _this.$message.error("学生手机号不能为空,请重新上传");
|
|
|
|
- // break;
|
|
|
|
- // } else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(item.phone)) {
|
|
|
|
- // _b = 1;
|
|
|
|
- // _this.$message.error("有学生手机号格式不正确,请重新上传");
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- else if (item.mail === "") {
|
|
|
|
|
|
+ }else if (item.mail === "") {
|
|
_b = 1;
|
|
_b = 1;
|
|
_this.$message.error("学生邮箱不能为空,请重新上传");
|
|
_this.$message.error("学生邮箱不能为空,请重新上传");
|
|
break;
|
|
break;
|
|
@@ -637,231 +629,6 @@ export default {
|
|
_this.$message.error("有学生邮箱格式不正确,请重新上传");
|
|
_this.$message.error("有学生邮箱格式不正确,请重新上传");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- // else if (item.school === "") {
|
|
|
|
- // _b = 1;
|
|
|
|
- // _this.$message.error("学生学校不能为空,请重新上传");
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // else if (item.sex === "") {
|
|
|
|
- // _b = 1;
|
|
|
|
- // _this.$message.error("学生性别不能为空,请重新上传");
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // if (item.class != "") {
|
|
|
|
- // let _a;
|
|
|
|
- // let params = {
|
|
|
|
- // className: item.class,
|
|
|
|
- // };
|
|
|
|
-
|
|
|
|
- // _$.ajax({
|
|
|
|
- // url: _this.$store.state.api + "selectC", //url路径
|
|
|
|
- // type: "GET", //GET
|
|
|
|
- // async: false, //或false,是否异步
|
|
|
|
- // data: params,
|
|
|
|
- // timeout: 5000, //超时时间
|
|
|
|
- // dataType: "json", //返回的数据格式:
|
|
|
|
- // beforeSend: function (xhr) {},
|
|
|
|
- // success: function (res, textStatus, jqXHR) {
|
|
|
|
- // if (res[0].length == 0) {
|
|
|
|
- // _a = 1;
|
|
|
|
- // _this.$message.error(
|
|
|
|
- // "有学生班级不存在,请去添加后并重新上传"
|
|
|
|
- // );
|
|
|
|
- // } else {
|
|
|
|
- // item.classid = res[0][0].id;
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // error: function (xhr, textStatus) {
|
|
|
|
- // console.log(textStatus);
|
|
|
|
- // },
|
|
|
|
- // complete: function () {},
|
|
|
|
- // });
|
|
|
|
- // if (_a == 1) {
|
|
|
|
- // _b = 1;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // if (item.school != "") {
|
|
|
|
- // let _a;
|
|
|
|
- // let params = {
|
|
|
|
- // schoolName: item.school,
|
|
|
|
- // };
|
|
|
|
-
|
|
|
|
- // _$.ajax({
|
|
|
|
- // url: _this.$store.state.api + "selectS", //url路径
|
|
|
|
- // type: "GET", //GET
|
|
|
|
- // async: false, //或false,是否异步
|
|
|
|
- // data: params,
|
|
|
|
- // timeout: 5000, //超时时间
|
|
|
|
- // dataType: "json", //返回的数据格式:
|
|
|
|
- // beforeSend: function (xhr) {},
|
|
|
|
- // success: function (res, textStatus, jqXHR) {
|
|
|
|
- // if (res[0].length == 0) {
|
|
|
|
- // _a = 1;
|
|
|
|
- // _this.$message.error(
|
|
|
|
- // "有学生学校不存在,请去添加后并重新上传"
|
|
|
|
- // );
|
|
|
|
- // } else {
|
|
|
|
- // item.schoolid = res[0][0].id;
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // error: function (xhr, textStatus) {
|
|
|
|
- // console.log(textStatus);
|
|
|
|
- // },
|
|
|
|
- // complete: function () {},
|
|
|
|
- // });
|
|
|
|
- // if (_a == 1) {
|
|
|
|
- // _b = 1;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // for (var k = 0; k < arr.length; k++) {
|
|
|
|
- // if (item.phone != "") {
|
|
|
|
- // let params = { un: item.phone };
|
|
|
|
- // let _a;
|
|
|
|
- // _$.ajax({
|
|
|
|
- // url: _this.$store.state.api + "findPhone", //url路径
|
|
|
|
- // type: "GET", //GET
|
|
|
|
- // async: false, //或false,是否异步
|
|
|
|
- // data: params,
|
|
|
|
- // timeout: 5000, //超时时间
|
|
|
|
- // dataType: "json", //返回的数据格式:
|
|
|
|
- // beforeSend: function (xhr) {},
|
|
|
|
- // success: function (res, textStatus, jqXHR) {
|
|
|
|
- // if (res[0].length > 0) {
|
|
|
|
- // _this.$message.error("有学生手机号码已被注册");
|
|
|
|
- // _a = 1;
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // error: function (xhr, textStatus) {
|
|
|
|
- // console.log(textStatus);
|
|
|
|
- // },
|
|
|
|
- // complete: function () {},
|
|
|
|
- // });
|
|
|
|
- // if (_a == 1) {
|
|
|
|
- // _b = 1;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // if (item.mail != "") {
|
|
|
|
- // let params = { un: item.mail };
|
|
|
|
- // let _a;
|
|
|
|
- // _$.ajax({
|
|
|
|
- // url: _this.$store.state.api + "findMail", //url路径
|
|
|
|
- // type: "GET", //GET
|
|
|
|
- // async: false, //或false,是否异步
|
|
|
|
- // data: params,
|
|
|
|
- // timeout: 5000, //超时时间
|
|
|
|
- // dataType: "json", //返回的数据格式:
|
|
|
|
- // beforeSend: function (xhr) {},
|
|
|
|
- // success: function (res, textStatus, jqXHR) {
|
|
|
|
- // if (res[0].length > 0) {
|
|
|
|
- // _this.$message.error("有学生邮箱已被注册");
|
|
|
|
- // _a = 1;
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // error: function (xhr, textStatus) {
|
|
|
|
- // console.log(textStatus);
|
|
|
|
- // },
|
|
|
|
- // complete: function () {},
|
|
|
|
- // });
|
|
|
|
- // if (_a == 1) {
|
|
|
|
- // _b = 1;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // if (item.sId != "") {
|
|
|
|
- // let params = { un: item.sId };
|
|
|
|
- // let _a;
|
|
|
|
- // _$.ajax({
|
|
|
|
- // url: _this.$store.state.api + "findSid", //url路径
|
|
|
|
- // type: "GET", //GET
|
|
|
|
- // async: false, //或false,是否异步
|
|
|
|
- // data: params,
|
|
|
|
- // timeout: 5000, //超时时间
|
|
|
|
- // dataType: "json", //返回的数据格式:
|
|
|
|
- // beforeSend: function (xhr) {},
|
|
|
|
- // success: function (res, textStatus, jqXHR) {
|
|
|
|
- // if (res[0].length > 0) {
|
|
|
|
- // _this.$message.error("有学生学号重复");
|
|
|
|
- // _a = 1;
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // error: function (xhr, textStatus) {
|
|
|
|
- // console.log(textStatus);
|
|
|
|
- // },
|
|
|
|
- // complete: function () {},
|
|
|
|
- // });
|
|
|
|
- // if (_a == 1) {
|
|
|
|
- // _b = 1;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // _b = 2;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // if (_b == 2) {
|
|
|
|
-
|
|
|
|
- // for (var i = 0; i < arr.length; i++) {
|
|
|
|
- // let _i = i;
|
|
|
|
- // let item = arr[i];
|
|
|
|
- // let params = [
|
|
|
|
- // {
|
|
|
|
- // alias: item.name,
|
|
|
|
- // username: item.mail,
|
|
|
|
- // userpassword: 123456,
|
|
|
|
- // oid: _this.oid,
|
|
|
|
- // ph: item.phone,
|
|
|
|
- // cid: item.class,
|
|
|
|
- // },
|
|
|
|
- // ];
|
|
|
|
-
|
|
|
|
- // _this.ajax
|
|
|
|
- // .post(_this.$store.state.api + "batchRegistration", params)
|
|
|
|
- // .then((res) => {
|
|
|
|
- // let params = [
|
|
|
|
- // {
|
|
|
|
- // userid: res.data.uid,
|
|
|
|
- // username: item.name,
|
|
|
|
- // sId: item.sId,
|
|
|
|
- // type: 2,
|
|
|
|
- // oid: res.data.oid,
|
|
|
|
- // phone: res.data.ph ? res.data.ph : "",
|
|
|
|
- // cid: res.data.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);
|
|
|
|
- // });
|
|
|
|
- // loading.close();
|
|
|
|
- // // _this.$message({
|
|
|
|
- // // message: "新增成功",
|
|
|
|
- // // type: "success",
|
|
|
|
- // // });
|
|
|
|
- // _this.getStudent();
|
|
|
|
- // // if (_i == arr.length - 1) {
|
|
|
|
- // // loading.close();
|
|
|
|
- // // _this.$message({
|
|
|
|
- // // message: "上传成功",
|
|
|
|
- // // type: "success",
|
|
|
|
- // // });
|
|
|
|
- // // _this.getStudent();
|
|
|
|
- // // }
|
|
|
|
- // })
|
|
|
|
- // .catch((err) => {
|
|
|
|
- // _this.$message.error("上传失败");
|
|
|
|
- // console.error(err);
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // loading.close();
|
|
|
|
}
|
|
}
|
|
let z = 2;
|
|
let z = 2;
|
|
let newArr = JSON.stringify(arr);
|
|
let newArr = JSON.stringify(arr);
|
|
@@ -870,10 +637,11 @@ export default {
|
|
arr: newArr,
|
|
arr: newArr,
|
|
userpassword: 123456,
|
|
userpassword: 123456,
|
|
oid: _this.oid,
|
|
oid: _this.oid,
|
|
|
|
+ org: _this.org,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
_this.ajax
|
|
_this.ajax
|
|
- .post(_this.$store.state.api + "batchRegistrationMore", params)
|
|
|
|
|
|
+ .post(_this.$store.state.api + "batchRegistrationMoreOrg", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.data.type == 1) {
|
|
if (res.data.type == 1) {
|
|
_this.$message.error("有学生手机号码已被注册");
|
|
_this.$message.error("有学生手机号码已被注册");
|