|
@@ -125,64 +125,70 @@ export default {
|
|
|
username: "",
|
|
|
orgLoading: false,
|
|
|
schoolLoading: false,
|
|
|
+ timer: null,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
submitForm() {
|
|
|
- // 检查必填字段
|
|
|
- if (!this.orgName) {
|
|
|
- this.$message.error("组织名称不能为空");
|
|
|
- return;
|
|
|
+ if (this.timer) {
|
|
|
+ clearTimeout(this.timer);
|
|
|
}
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ // 检查必填字段
|
|
|
+ if (!this.orgName) {
|
|
|
+ this.$message.error("组织名称不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- // if (!this.schoolName) {
|
|
|
- // this.$message.error("学校选择不能为空");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- if (!this.Name) {
|
|
|
- this.$message.error("姓名不能为空");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.username) {
|
|
|
- this.$message.error("账号不能为空");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!/\S+@\S+\.\S+/.test(this.username)) {
|
|
|
- this.$message.error("请输入有效的邮箱地址");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.phonenumber) {
|
|
|
- this.$message.error("联系电话不能为空");
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (!this.schoolName) {
|
|
|
+ // this.$message.error("学校选择不能为空");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ if (!this.Name) {
|
|
|
+ this.$message.error("姓名不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.username) {
|
|
|
+ this.$message.error("账号不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!/\S+@\S+\.\S+/.test(this.username)) {
|
|
|
+ this.$message.error("请输入有效的邮箱地址");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.phonenumber) {
|
|
|
+ this.$message.error("联系电话不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- // 添加审核接口
|
|
|
- let params = [
|
|
|
- {
|
|
|
- functionName: "addExamineUser2",
|
|
|
- org: this.orgName,
|
|
|
- un: this.Name,
|
|
|
- usern: this.username,
|
|
|
- phone: this.phonenumber,
|
|
|
- r: this.remark,
|
|
|
- },
|
|
|
- ];
|
|
|
+ // 添加审核接口
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ functionName: "addExamineUser2",
|
|
|
+ org: this.orgName,
|
|
|
+ un: this.Name,
|
|
|
+ usern: this.username,
|
|
|
+ phone: this.phonenumber,
|
|
|
+ r: this.remark,
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- if (res.data && res.data[0][0].success == 2) {
|
|
|
- this.$message.success("提交成功");
|
|
|
- this.reset()
|
|
|
- } else if (res.data && res.data[0][0].success == 1) {
|
|
|
- this.$message.error("此账号已创建,具体登录原因请联系管理员");
|
|
|
- }
|
|
|
- console.log("返回的结果为:", res.data);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("提交失败");
|
|
|
- console.error("请求失败,错误信息:", err);
|
|
|
- });
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data && res.data[0][0].success == 2) {
|
|
|
+ this.$message.success("提交成功");
|
|
|
+ this.reset()
|
|
|
+ } else if (res.data && res.data[0][0].success == 1) {
|
|
|
+ this.$message.error("此账号已创建,具体登录原因请联系管理员");
|
|
|
+ }
|
|
|
+ console.log("返回的结果为:", res.data);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("提交失败");
|
|
|
+ console.error("请求失败,错误信息:", err);
|
|
|
+ });
|
|
|
+ }, 300);
|
|
|
},
|
|
|
reset() {
|
|
|
this.orgName = "";
|