|
|
@@ -154,6 +154,7 @@ import { setTimeout, clearTimeout } from 'timers';
|
|
|
isqyaddress:false,//地址
|
|
|
isyzusername:false,
|
|
|
isheidemail:false,
|
|
|
+ iscompanyname:false,
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
@@ -324,12 +325,21 @@ import { setTimeout, clearTimeout } from 'timers';
|
|
|
},
|
|
|
// 选择要加入的企业
|
|
|
qylist(i){
|
|
|
- this.companyId = this.arr[i].id,
|
|
|
- this.admin = this.arr[i].admin,
|
|
|
- this.newindex = i,
|
|
|
- this.$refs.lookupqyname.value = this.arr[i].name,
|
|
|
+ let companyName = JSON.parse(window.sessionStorage.getItem("companyname"));
|
|
|
+ this.companyId = this.arr[i].id;
|
|
|
+ this.admin = this.arr[i].admin;
|
|
|
+ this.newindex = i;
|
|
|
+ this.$refs.lookupqyname.value = this.arr[i].name;
|
|
|
this.islookup = false;
|
|
|
- if (this.admin == this.mytoken.account.realname) {
|
|
|
+ for (let j = 0; j < companyName.length; j++) {
|
|
|
+ if (this.arr[i].name == companyName[j]) {
|
|
|
+ this.iscompanyname = true
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ this.iscompanyname = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.iscompanyname || this.admin == this.mytoken.account.realname) {
|
|
|
this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 账号已在企业服务中,不能重复加入';
|
|
|
} else {
|
|
|
this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
@@ -342,7 +352,6 @@ import { setTimeout, clearTimeout } from 'timers';
|
|
|
},
|
|
|
//加入企业提交按钮
|
|
|
Submission(){
|
|
|
- this.$store.state.isloading = true;
|
|
|
let token = this.mytoken.token;
|
|
|
let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
|
|
|
let username = this.$refs.lookupname.value.replace(/\s+/g, "");//姓名过滤空格
|
|
|
@@ -352,13 +361,14 @@ import { setTimeout, clearTimeout } from 'timers';
|
|
|
this.$message.error('企业或管理员不存在');
|
|
|
} else if (!this.companyId) {
|
|
|
this.$message.error('请选择要加入的企业');
|
|
|
- } else if (this.admin == this.mytoken.account.realname) {
|
|
|
+ } else if (this.admin == this.mytoken.account.realname || this.iscompanyname) {
|
|
|
this.$message.error('账号已在企业服务中,不能重复加入');
|
|
|
} else if (!this.isTestingname) {
|
|
|
this.$message.error('姓名不能为空');
|
|
|
} else if (!this.isregname) {
|
|
|
this.$message.error('姓名不能包含符号、数字等非法字符');
|
|
|
} else {
|
|
|
+ this.$store.state.isloading = true;
|
|
|
this.$ajax({
|
|
|
url: this.$url.api+'/api/account/accountCenter/company/join',
|
|
|
method:'POST',
|