|
|
@@ -41,15 +41,15 @@
|
|
|
<option value="其他">其他</option>
|
|
|
</select>
|
|
|
</li>
|
|
|
- <li>
|
|
|
+ <li style="margin:0">
|
|
|
<span class="qy-biaoti"><span class="xingxing">*</span>企业地址</span>
|
|
|
<input ref="address" @change="address" class="inpind" type="text" placeholder="输入企业详细地址">
|
|
|
<!-- <div class="addbiaoqian">
|
|
|
<v-distpicker @selected= 'selected' @province= 'qyprovince' :placeholders= 'placeholder'></v-distpicker>
|
|
|
<input ref="address" @change="address" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
|
|
|
</div> -->
|
|
|
- <div class="qy-Tips left">
|
|
|
- <span ref="ress" style="color:red;margin-left:40px;"></span>
|
|
|
+ <div class="qy-Tips Tips-buttom">
|
|
|
+ <span ref="ress" style="color:red"></span>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li style="margin:0">
|
|
|
@@ -78,13 +78,14 @@
|
|
|
<input @blur.prevent="Testingqyname" ref="lookupqyname" class="inpind" type="text" value="" placeholder="输入企业名称或管理员">
|
|
|
<span class="warning" ref="warningqyname"></span>
|
|
|
</li>
|
|
|
+ <!-- 匹配企业后显示的内容 -->
|
|
|
<li class="hied" :class= "{showlookup:islookup}">
|
|
|
<div class="lookup">
|
|
|
<ul>
|
|
|
- <li v-for="(d, i) in arr" :key="i">
|
|
|
- <span>企业名称:</span><span>{{d.qyname}}</span>
|
|
|
- <span class="saasguanli">SaaS管理员:</span><span>{{d.saas}}</span>
|
|
|
- <span>联系方式:</span><span>{{d.phone}}</span>
|
|
|
+ <li v-for="(d, i) in arr" :key="i" @click="qylist(i)" :class="{'hui':newindex === i}">
|
|
|
+ <span>企业名称:</span><span>{{d.name}}</span>
|
|
|
+ <span class="saasguanli">SaaS管理员:</span><span>{{d.admin}}</span>
|
|
|
+ <span>联系方式:</span><span>{{d.adminMobile}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
@@ -109,7 +110,7 @@
|
|
|
|
|
|
<script>
|
|
|
import Session from '@/utils/session'
|
|
|
-import VDistpicker from 'v-distpicker'
|
|
|
+// import VDistpicker from 'v-distpicker'
|
|
|
import { setTimeout } from 'timers';
|
|
|
export default {
|
|
|
data(){
|
|
|
@@ -136,22 +137,20 @@ import { setTimeout } from 'timers';
|
|
|
// {name:'加入企业'},
|
|
|
],
|
|
|
nowindex:0,
|
|
|
+ newindex:'',
|
|
|
islookup:false,
|
|
|
isTestingname:false,
|
|
|
isregname:false,
|
|
|
- arr:[
|
|
|
- {qyname:'XX房贷首付范德萨发达企业',saas:'反倒是地方反对法管理员',phone:'13456789023'},
|
|
|
- {qyname:'XX企业',saas:'管理员',phone:'13456789023'},
|
|
|
- {qyname:'XX企业',saas:'管理员',phone:'13456789023'},
|
|
|
- ]
|
|
|
+ companyId:null,
|
|
|
+ arr:[]
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
- VDistpicker
|
|
|
+ // VDistpicker
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.$refs.name.value = this.mytoken.account.realname == this.mytoken.account.mobile ? '' : this.mytoken.account.realname
|
|
|
- this.$refs.email.value = this.mytoken.account.email
|
|
|
+ this.$refs.name.value = this.mytoken.account.realname;
|
|
|
+ this.$refs.email.value = this.mytoken.account.email;
|
|
|
},
|
|
|
methods: {
|
|
|
tabwith(i){
|
|
|
@@ -188,7 +187,7 @@ import { setTimeout } from 'timers';
|
|
|
this.$refs.qyno.innerHTML = '<span style="color:green">该企业可创建</span>';
|
|
|
} else {
|
|
|
this.$refs.qyno.innerHTML = '该企业已在优软云注册';
|
|
|
- this.qymingzi = false
|
|
|
+ this.qymingzi = false;
|
|
|
}
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
@@ -200,26 +199,47 @@ import { setTimeout } from 'timers';
|
|
|
//检测企业名称2
|
|
|
Testingqyname(){
|
|
|
let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
|
|
|
+ let token = this.mytoken.token;
|
|
|
if (qyname == '') {
|
|
|
this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 企业或管理员不能为空';
|
|
|
- this.islookup = false
|
|
|
+ this.islookup = false;
|
|
|
} else {
|
|
|
- this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
- this.islookup = true
|
|
|
+ this.$ajax({
|
|
|
+ url: "http://192.168.253.41:8560/api/account/accountCenter/company/isOpen",//http://192.168.253.41:8560
|
|
|
+ method:'GET',
|
|
|
+ params: {
|
|
|
+ companyName: qyname
|
|
|
+ },
|
|
|
+ headers:{
|
|
|
+ "Authorization":token,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then(res=>{
|
|
|
+ if (res.data.success) {
|
|
|
+ this.arr = res.data.data
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
+ this.islookup = true;
|
|
|
+ } else if (res.data.success = false && res.data.message != null){
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 该企业不存在';
|
|
|
+ } else {
|
|
|
+ this.$message.error('请求失败,请重试');
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
//验证个人姓名1
|
|
|
yzusername(){
|
|
|
let name = this.$refs.name.value.replace(/\s+/g, "");//姓名过滤空格
|
|
|
if (name == '') {
|
|
|
- this.$refs.usname.innerHTML = '个人姓名不能为空'
|
|
|
+ this.$refs.usname.innerHTML = '个人姓名不能为空';
|
|
|
} else {
|
|
|
if (this.reg.test(name)) {
|
|
|
- this.$refs.usname.innerHTML = '不能包含符号等非法字符'
|
|
|
- this.isname = false
|
|
|
+ this.$refs.usname.innerHTML = '不能包含符号等非法字符';
|
|
|
+ this.isname = false;
|
|
|
} else {
|
|
|
- this.$refs.usname.innerHTML = ''
|
|
|
- this.isname = true
|
|
|
+ this.$refs.usname.innerHTML = '';
|
|
|
+ this.isname = true;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -240,35 +260,62 @@ import { setTimeout } from 'timers';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 选择要加入的企业
|
|
|
+ qylist(i){
|
|
|
+ this.companyId = this.arr[i].id,
|
|
|
+ this.newindex = i
|
|
|
+ },
|
|
|
//加入企业提交按钮
|
|
|
Submission(){
|
|
|
+ let token = this.mytoken.token;
|
|
|
+ let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
|
|
|
+ let username = this.$refs.lookupname.value.replace(/\s+/g, "");//姓名过滤空格
|
|
|
if (!this.islookup) {
|
|
|
this.$message.error('企业或管理员不能为空');
|
|
|
} else if (!this.isTestingname) {
|
|
|
this.$message.error('姓名不能为空');
|
|
|
} else if (!this.isregname) {
|
|
|
this.$message.error('姓名不能包含符号、数字等非法字符');
|
|
|
+ } else if (this.companyId){
|
|
|
+ this.$ajax({
|
|
|
+ url:'http://192.168.253.41:8560/api/account/accountCenter/company/join',
|
|
|
+ method:'POST',
|
|
|
+ data:{
|
|
|
+ username:username,
|
|
|
+ accountId:this.mytoken.account.id,
|
|
|
+ companyId:this.companyId,
|
|
|
+ },
|
|
|
+ headers:{
|
|
|
+ "Authorization":token,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then(res=>{
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$message.success('提交成功,待管理员批准加入');
|
|
|
+ this.$store.state.ishongdian = true;//显示红点
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$router.push({name:'company'});
|
|
|
+ },3000)
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$message({
|
|
|
- message: '提交成功,待管理员批准加入',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
+ this.$message.error('请选择要加入的企业');
|
|
|
}
|
|
|
},
|
|
|
//验证公司详细地址
|
|
|
address(){
|
|
|
let address = this.$refs.address.value.replace(/\s+/g, "");//过滤空格
|
|
|
if (address == '') {
|
|
|
- this.$refs.ress.innerHTML = '企业地址不能为空'
|
|
|
- this.isaddressname = false
|
|
|
+ this.$refs.ress.innerHTML = '企业地址不能为空';
|
|
|
+ this.isaddressname = false;
|
|
|
} else {
|
|
|
- this.isaddressname = true
|
|
|
+ this.isaddressname = true;
|
|
|
if (this.reg.test(address)) {
|
|
|
- this.$refs.ress.innerHTML = '不能包含符号等非法字符'
|
|
|
- this.isaddress = false
|
|
|
+ this.$refs.ress.innerHTML = '不能包含符号等非法字符';
|
|
|
+ this.isaddress = false;
|
|
|
} else {
|
|
|
- this.$refs.ress.innerHTML = ''
|
|
|
- this.isaddress = true
|
|
|
+ this.$refs.ress.innerHTML = '';
|
|
|
+ this.isaddress = true;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -277,11 +324,11 @@ import { setTimeout } from 'timers';
|
|
|
let email = this.$refs.email.value;//邮箱
|
|
|
if (email == '') {
|
|
|
this.isemail = true;
|
|
|
- this.Email = ''
|
|
|
+ this.Email = '';
|
|
|
} else {
|
|
|
if (!reg.test(email)) {
|
|
|
this.Email = '请填写正确的邮箱';
|
|
|
- this.isemail = false
|
|
|
+ this.isemail = false;
|
|
|
} else {
|
|
|
this.Email = '';
|
|
|
this.isemail = true;
|
|
|
@@ -290,7 +337,7 @@ import { setTimeout } from 'timers';
|
|
|
},
|
|
|
//保存
|
|
|
Preservation(){
|
|
|
- this.listLoading = true
|
|
|
+ this.listLoading = true;
|
|
|
let qyname = this.$refs.qyname.value.replace(/\s+/g, "");//公司名字
|
|
|
let qyindustry = this.$refs.qyindustry.value;//所属行业
|
|
|
let address = this.$refs.address.value.replace(/\s+/g, "");//公司详细地址
|
|
|
@@ -301,7 +348,7 @@ import { setTimeout } from 'timers';
|
|
|
let uu = mytoken.account.uu;
|
|
|
let mobile = mytoken.account.mobile;//手机号
|
|
|
let company = {'name':qyname,'address':address,'type':qyindustry};
|
|
|
- let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu}
|
|
|
+ let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu};
|
|
|
// console.log('姓名',name)//个人姓名
|
|
|
// console.log('企业',qyname)//企业姓名
|
|
|
// console.log('企业名字',this.qymingzi)//企业有没有注册
|
|
|
@@ -314,9 +361,9 @@ import { setTimeout } from 'timers';
|
|
|
} else if (qyname == '') {
|
|
|
this.$message.error('企业名称不能为空');
|
|
|
} else {
|
|
|
- switch (this.qymingzi && this.isaddress && this.isname && this.isspaceName && this.isemail && this.isaddressname) {
|
|
|
- case this.qymingzi:
|
|
|
- if (this.qymingzi) {
|
|
|
+ switch (this.isspaceName && this.isaddress && this.isname && this.qymingzi && this.isemail && this.isaddressname) {
|
|
|
+ case this.isspaceName:
|
|
|
+ if (this.isspaceName) {
|
|
|
this.$ajax({
|
|
|
url: this.$url.api+"/api/account/accountCenter/companyAccount/save",//http://192.168.253.31:8560
|
|
|
method: 'post',
|
|
|
@@ -333,18 +380,21 @@ import { setTimeout } from 'timers';
|
|
|
this.isadd = true;//添加成功弹窗
|
|
|
setTimeout(()=>{
|
|
|
document.documentElement.scrollTop = 0;
|
|
|
+ let session = JSON.parse(window.localStorage.getItem('app-state-session'));
|
|
|
+ session.account.realname = name;
|
|
|
+ Session.set(session);
|
|
|
// this.$router.push({name:'company'})
|
|
|
- this.$router.push({path: '/enterprise'})
|
|
|
+ this.$router.push({path: '/enterprise'});
|
|
|
},3000)
|
|
|
})
|
|
|
- this.$message({
|
|
|
- message: '保存成功,待管理员批准',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
+ this.$message.success('保存成功,待管理员批准');
|
|
|
} else {
|
|
|
- this.$message.error('该企业已在优软云注册');
|
|
|
+ this.$message.error('企业名称不能包含符号等非法字符');
|
|
|
}
|
|
|
break;
|
|
|
+ case this.qymingzi:
|
|
|
+ this.$message.error('该企业已在优软云注册');
|
|
|
+ break;
|
|
|
case this.isaddressname:
|
|
|
this.$message.error('企业地址不能为空');
|
|
|
break;
|
|
|
@@ -354,15 +404,12 @@ import { setTimeout } from 'timers';
|
|
|
case this.isname:
|
|
|
this.$message.error('个人姓名不能包含符号等非法字符');
|
|
|
break;
|
|
|
- case this.isspaceName:
|
|
|
- this.$message.error('企业名称不能包含符号等非法字符');
|
|
|
- break;
|
|
|
case this.isemail:
|
|
|
this.$message.error('请填写正确的邮箱');
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- this.listLoading = false
|
|
|
+ this.listLoading = false;
|
|
|
},
|
|
|
//获取省市区
|
|
|
// selected(data){
|
|
|
@@ -371,9 +418,9 @@ import { setTimeout } from 'timers';
|
|
|
// this.area = data.area.value;
|
|
|
// this.disabled= false
|
|
|
// },
|
|
|
- qyprovince(){
|
|
|
- this.placeholder = this.placeholde
|
|
|
- },
|
|
|
+ // qyprovince(){
|
|
|
+ // this.placeholder = this.placeholde
|
|
|
+ // },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -448,4 +495,7 @@ import { setTimeout } from 'timers';
|
|
|
.marght {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
+.hui {
|
|
|
+ background: #c5c5c5;
|
|
|
+}
|
|
|
</style>
|