|
|
@@ -15,7 +15,7 @@
|
|
|
<ul>
|
|
|
<li style="margin: 0">
|
|
|
<span class="qy-biaoti"><span class="xingxing">*</span>企业名称</span>
|
|
|
- <input class="inpind" ref="qyname" @change= "spaceName" type="text" placeholder="请填写企业全称">
|
|
|
+ <input autofocus class="inpind" ref="qyname" @change= "spaceName" type="text" placeholder="请填写企业全称">
|
|
|
<div class="qy-Tips Tips-buttom"><span ref="qyno" style="color:red"></span></div>
|
|
|
</li>
|
|
|
<li>
|
|
|
@@ -72,27 +72,27 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="qy-conent jr-conent" :class= "{showqiye:nowindex == 1}">
|
|
|
- <ul style="padding:0">
|
|
|
+ <ul style="padding:0;position: relative;">
|
|
|
<li>
|
|
|
<span class="qy-biaoti"><span class="xingxing marght">*</span>查找企业</span>
|
|
|
- <input @blur.prevent="Testingqyname" @keyup.13="Testingqyname" ref="lookupqyname" class="inpind" type="text" placeholder="输入企业名称或管理员">
|
|
|
+ <input @input="Testingqyname" ref="lookupqyname" class="inpind" type="text" placeholder="输入企业名称或管理员">
|
|
|
<span class="warning" ref="warningqyname"></span>
|
|
|
</li>
|
|
|
<!-- 匹配企业后显示的内容 -->
|
|
|
- <li v-if="isqylist" class="hied" :class= "{showlookup:islookup}">
|
|
|
- <div class="lookup">
|
|
|
+ <!-- <li v-if="isqylist" class="hied" :class= "{showlookup:islookup}"> -->
|
|
|
+ <div class="lookup hied" :class= "{showlookup:islookup}">
|
|
|
<ul>
|
|
|
<li v-for="(d, i) in arr" :key="i" @click="qylist(i)" :class="{'hui':newindex === i}">
|
|
|
- <span class="maxtxt">{{d.name}}</span>
|
|
|
- <span class="maxtxt">{{d.admin}}</span>
|
|
|
<span>{{d.adminMobile}}</span>
|
|
|
+ <span>{{d.admin}}</span>
|
|
|
+ <span>{{d.name}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
- </li>
|
|
|
+ <!-- </li> -->
|
|
|
<li>
|
|
|
<span class="qy-biaoti"><span class="xingxing marght">*</span>姓<span style="width:2em;display: inline-block;"></span>名</span>
|
|
|
- <input @blur.prevent="Testingname" class="inpind" type="text" ref="lookupname" placeholder="输入真实姓名,待管理员审核">
|
|
|
+ <input @blur.prevent="Testingname" class="inpind" maxlength="5" type="text" ref="lookupname" placeholder="输入真实姓名,待管理员审核">
|
|
|
<span class="warning" ref="warningname"></span>
|
|
|
</li>
|
|
|
<li>
|
|
|
@@ -111,7 +111,7 @@
|
|
|
<script>
|
|
|
import Session from '@/utils/session'
|
|
|
// import VDistpicker from 'v-distpicker'
|
|
|
-import { setTimeout } from 'timers';
|
|
|
+import { setTimeout, clearTimeout } from 'timers';
|
|
|
export default {
|
|
|
data(){
|
|
|
return {
|
|
|
@@ -122,7 +122,7 @@ import { setTimeout } from 'timers';
|
|
|
Email: '',
|
|
|
mytoken: Session.get(),//本地储存的用户信息
|
|
|
reg: new RegExp(/[\@\#\$\%\&\*!!\¥]/),//非法字符
|
|
|
- regname:new RegExp(/[\@\#\$\%\&\*!!\¥0-9a-zA-Z]/),//非法字符加数字加中文
|
|
|
+ regname:new RegExp(/[\@\#\$\%\&\*!!\¥0-9a-zA-Z]/),//非法字符加数字加英文
|
|
|
isaddress: false,//公司地址验证
|
|
|
isaddressname: false,//公司地址是否为空
|
|
|
isname: true,//姓名验证
|
|
|
@@ -143,8 +143,9 @@ import { setTimeout } from 'timers';
|
|
|
isregname:false,
|
|
|
companyId:null,
|
|
|
admin:null,
|
|
|
- isqylist:true,
|
|
|
- arr:[]
|
|
|
+ isgsname:false,
|
|
|
+ arr:[],
|
|
|
+ times:null
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
@@ -197,40 +198,43 @@ import { setTimeout } from 'timers';
|
|
|
},
|
|
|
//检测企业名称2
|
|
|
Testingqyname(){
|
|
|
- this.$refs.lookupqyname.blur();
|
|
|
let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
|
|
|
let token = this.mytoken.token;
|
|
|
- if (qyname == '') {
|
|
|
+ clearTimeout(this.times);
|
|
|
+ if(qyname == ''){
|
|
|
this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 企业或管理员不能为空';
|
|
|
this.islookup = false;
|
|
|
} else {
|
|
|
- this.$ajax({
|
|
|
- url: this.$url.api+"/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.newindex = '';
|
|
|
- this.arr = res.data.data;
|
|
|
- this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
- this.islookup = true;
|
|
|
- this.isqylist = true;
|
|
|
- this.companyId = null;
|
|
|
- } else if (res.data.success == false && res.data.message == '公司不存在') {
|
|
|
- this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 该企业不存在';
|
|
|
- this.islookup = false;
|
|
|
- } else {
|
|
|
- this.$message.error('请求失败,请重试');
|
|
|
- this.islookup = false;
|
|
|
- this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt="">'
|
|
|
- }
|
|
|
- })
|
|
|
+ this.times = setTimeout(()=>{
|
|
|
+ this.$ajax({
|
|
|
+ url: this.$url.api+"/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.newindex = '';
|
|
|
+ this.arr = res.data.data;
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
+ this.islookup = true;
|
|
|
+ this.companyId = null;
|
|
|
+ this.isgsname = true;//公司是否存在
|
|
|
+ } else if (res.data.success == false && res.data.message == '公司不存在') {
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 该企业不存在';
|
|
|
+ this.islookup = false;
|
|
|
+ this.isgsname = false;//公司是否存在
|
|
|
+ } else {
|
|
|
+ this.$message.error('请求失败,请重试');
|
|
|
+ this.islookup = false;
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt="">'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },500)
|
|
|
}
|
|
|
},
|
|
|
//验证个人姓名1
|
|
|
@@ -271,14 +275,20 @@ import { setTimeout } from 'timers';
|
|
|
this.admin = this.arr[i].admin,
|
|
|
this.newindex = i,
|
|
|
this.$refs.lookupqyname.value = this.arr[i].name,
|
|
|
- this.isqylist = false
|
|
|
+ this.islookup = false;
|
|
|
+ if (this.admin == this.mytoken.account.realname) {
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 账号已在企业服务中,不能重复加入';
|
|
|
+ }
|
|
|
},
|
|
|
//加入企业提交按钮
|
|
|
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) {
|
|
|
+ if (qyname == '') {
|
|
|
this.$message.error('企业或管理员不能为空');
|
|
|
+ } else if(!this.isgsname) {
|
|
|
+ this.$message.error('该企业不存在');
|
|
|
} else if (!this.isTestingname) {
|
|
|
this.$message.error('姓名不能为空');
|
|
|
} else if (!this.isregname) {
|
|
|
@@ -302,7 +312,7 @@ import { setTimeout } from 'timers';
|
|
|
.then(res=>{
|
|
|
if (res.data.success) {
|
|
|
this.$message.success('提交成功,待管理员批准加入');
|
|
|
- this.$store.state.ishongdian = true;//显示红点
|
|
|
+ // this.$store.state.ishongdian = true;//显示红点
|
|
|
setTimeout(()=>{
|
|
|
this.$router.push({name:'company'});
|
|
|
document.documentElement.scrollTop = 0;
|
|
|
@@ -515,7 +525,7 @@ import { setTimeout } from 'timers';
|
|
|
background: #f5f4f4
|
|
|
}
|
|
|
.lookup > ul {
|
|
|
- height: 300px;
|
|
|
+ max-height: 170px;
|
|
|
overflow-y: scroll;
|
|
|
}
|
|
|
.maxtxt {
|