|
|
@@ -4,21 +4,18 @@
|
|
|
<div class="tc-conent"><img src="/static/img/qiye/dengji@1x.png" alt=""></div>
|
|
|
<div class="tc-text"><span>添加企业成功</span></div>
|
|
|
</div>
|
|
|
- <span class="tjtishi" ref="tjtishi"></span>
|
|
|
<div>
|
|
|
<div class="gs-worp qy-worp tj-up">
|
|
|
<div class="qy-title" style="position: relative;">
|
|
|
- <span>完善企业信息</span>
|
|
|
- <div class="qy-anniu" style="position: absolute;top: 0;right: 20px;margin-top: 0;">
|
|
|
- <span @click= "Preservation" class="qy-xiugai dianji" style="left: -2px">保存</span>
|
|
|
- <span @click= "tjquxiao" class="qy-quxiao xs">取消</span>
|
|
|
- </div>
|
|
|
+ <ul class="over">
|
|
|
+ <li style="width:100%" class="left xs" v-for="(d, i) in tab" :key="i" :class= "{qyactive:nowindex == i}" @click="tabwith(i)">{{d.name}}</li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
- <div class="qy-conent">
|
|
|
+ <div class="qy-conent" :class= "{showqiye:nowindex == 0}" style="padding-top: 60px;">
|
|
|
<ul>
|
|
|
<li style="margin: 0">
|
|
|
- <span class="qy-biaoti"><span class="xingxing">*</span>公司名称</span>
|
|
|
- <input class="inpind" ref="qyname" @change= "spaceName" type="text" placeholder="请填写公司全称">
|
|
|
+ <span class="qy-biaoti"><span class="xingxing">*</span>企业名称</span>
|
|
|
+ <input class="inpind" ref="qyname" @change= "spaceName" type="text" placeholder="请填写企业全称">
|
|
|
<dir class="qy-Tips"><span ref="qyno" style="color:red"></span></dir>
|
|
|
</li>
|
|
|
<li>
|
|
|
@@ -44,28 +41,17 @@
|
|
|
<option value="其他">其他</option>
|
|
|
</select>
|
|
|
</li>
|
|
|
- <li style="height:70px;">
|
|
|
- <span class="qy-biaoti left"><span class="xingxing">*</span>公司地址</span>
|
|
|
- <div class="addbiaoqian">
|
|
|
- <!-- <v-distpicker @province= 'qyprovince' @city= 'qycity' @area= 'qyarea'></v-distpicker> -->
|
|
|
- <!-- <v-distpicker @selected= 'selected' province="广东省" city="广州市" area="荔湾区" :placeholders= 'placeholder'></v-distpicker> -->
|
|
|
+ <li>
|
|
|
+ <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" :disabled="disabled" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
|
|
|
-
|
|
|
- </div>
|
|
|
+ <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>
|
|
|
</li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="gs-worp qy-worp tj-down">
|
|
|
- <div class="qy-title">
|
|
|
- <span>完善个人信息</span>
|
|
|
- </div>
|
|
|
- <div class="qy-conent">
|
|
|
- <ul>
|
|
|
<li style="margin:0">
|
|
|
<span class="qy-biaoti"><span class="xingxing">*</span>姓名</span>
|
|
|
<input class="inpind" @change= "yzusername" ref="name" type="text" value="">
|
|
|
@@ -77,6 +63,43 @@
|
|
|
<input class="inpind" @change="email" ref="email" type="email" value="">
|
|
|
<div class="qy-Tips Tips-buttom"><span style="color:red">{{Email}}</span></div>
|
|
|
</li>
|
|
|
+ <li>
|
|
|
+ <div class="qy-anniu">
|
|
|
+ <span @click= "Preservation" class="qy-xiugai dianji" style="left: -2px">保存</span>
|
|
|
+ <span @click= "tjquxiao" class="qy-quxiao xs">取消</span>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="qy-conent jr-conent" :class= "{showqiye:nowindex == 1}">
|
|
|
+ <ul style="padding:0">
|
|
|
+ <li>
|
|
|
+ <span class="qy-biaoti"><span class="xingxing marght">*</span>查找企业</span>
|
|
|
+ <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>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </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="输入真实姓名,待管理员审核">
|
|
|
+ <span class="warning" ref="warningname"></span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div class="qy-anniu" style="margin-top: 70px;">
|
|
|
+ <span @click="Submission" class="qy-xiugai dianji" style="left: -2px">提交</span>
|
|
|
+ <span @click= "tjquxiao" class="qy-quxiao xs">取消</span>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -91,25 +114,35 @@ import { setTimeout } from 'timers';
|
|
|
export default {
|
|
|
data(){
|
|
|
return {
|
|
|
- province:'',//省
|
|
|
- city:'',//市
|
|
|
- area:'',//区
|
|
|
+ // province:'',//省
|
|
|
+ // city:'',//市
|
|
|
+ // area:'',//区
|
|
|
qymingzi: false,//企业名是否注册
|
|
|
Email: '',
|
|
|
mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
|
|
|
reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
|
|
|
+ regname:new RegExp(/[\@\#\$\%\&\*!\¥0-9]/),//非法字符加数字
|
|
|
isaddress: false,//公司地址验证
|
|
|
isaddressname: false,//公司地址是否为空
|
|
|
isname: true,//姓名验证
|
|
|
isspaceName: false,//公司名验证
|
|
|
isemail: true,//验证邮箱
|
|
|
- disabled: true,
|
|
|
+ // disabled: true,
|
|
|
isadd: false,//添加成功弹窗
|
|
|
- placeholder:{province:"省", city:"市", area:"区"},
|
|
|
- placeholde:{province:"", city:"", area:""},
|
|
|
+ // placeholder:{province:"省", city:"市", area:"区"},
|
|
|
+ // placeholde:{province:"", city:"", area:""},
|
|
|
tab:[
|
|
|
{name:'创建新企业'},
|
|
|
- {name:'加入企业'},
|
|
|
+ // {name:'加入企业'},
|
|
|
+ ],
|
|
|
+ nowindex:0,
|
|
|
+ islookup:false,
|
|
|
+ isTestingname:false,
|
|
|
+ isregname:false,
|
|
|
+ arr:[
|
|
|
+ {qyname:'XX房贷首付范德萨发达企业',saas:'反倒是地方反对法管理员',phone:'13456789023'},
|
|
|
+ {qyname:'XX企业',saas:'管理员',phone:'13456789023'},
|
|
|
+ {qyname:'XX企业',saas:'管理员',phone:'13456789023'},
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
@@ -121,19 +154,22 @@ import { setTimeout } from 'timers';
|
|
|
this.$refs.email.value = this.mytoken.account.email
|
|
|
},
|
|
|
methods: {
|
|
|
+ tabwith(i){
|
|
|
+ this.nowindex = i;
|
|
|
+ },
|
|
|
//取消添加企业
|
|
|
tjquxiao(){
|
|
|
document.documentElement.scrollTop = 0;
|
|
|
this.$router.push({name:'company',});
|
|
|
},
|
|
|
- //检测企业名称
|
|
|
+ //检测企业名称1
|
|
|
spaceName(){
|
|
|
let qyname = this.$refs.qyname.value.replace(/\s+/g, "");//公司名字过滤空格
|
|
|
if(qyname == ''){
|
|
|
- this.$refs.qyno.innerHTML = '企业名字不能为空';
|
|
|
+ this.$refs.qyno.innerHTML = '企业名称不能为空';
|
|
|
} else {
|
|
|
if (this.reg.test(qyname)) {
|
|
|
- this.$refs.qyno.innerHTML = '不能包含非法字符';
|
|
|
+ this.$refs.qyno.innerHTML = '不能包含符号等非法字符';
|
|
|
this.isspaceName = false;
|
|
|
} else {
|
|
|
this.$refs.qyno.innerHTML = '';
|
|
|
@@ -149,6 +185,7 @@ import { setTimeout } from 'timers';
|
|
|
.then(res=>{
|
|
|
if (res.data.data.success) {
|
|
|
this.qymingzi = true;
|
|
|
+ this.$refs.qyno.innerHTML = '<span style="color:green">该企业可创建</span>';
|
|
|
} else {
|
|
|
this.$refs.qyno.innerHTML = '该企业已在优软云注册';
|
|
|
this.qymingzi = false
|
|
|
@@ -160,14 +197,25 @@ import { setTimeout } from 'timers';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //验证个人姓名
|
|
|
+ //检测企业名称2
|
|
|
+ Testingqyname(){
|
|
|
+ let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
|
|
|
+ if (qyname == '') {
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 企业或管理员不能为空';
|
|
|
+ this.islookup = false
|
|
|
+ } else {
|
|
|
+ this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
+ this.islookup = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //验证个人姓名1
|
|
|
yzusername(){
|
|
|
let name = this.$refs.name.value.replace(/\s+/g, "");//姓名过滤空格
|
|
|
if (name == '') {
|
|
|
this.$refs.usname.innerHTML = '个人姓名不能为空'
|
|
|
} else {
|
|
|
if (this.reg.test(name)) {
|
|
|
- this.$refs.usname.innerHTML = '不能包含非法字符'
|
|
|
+ this.$refs.usname.innerHTML = '不能包含符号等非法字符'
|
|
|
this.isname = false
|
|
|
} else {
|
|
|
this.$refs.usname.innerHTML = ''
|
|
|
@@ -175,6 +223,38 @@ import { setTimeout } from 'timers';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ //验证个人姓名2
|
|
|
+ Testingname(){
|
|
|
+ let name = this.$refs.lookupname.value.replace(/\s+/g, "");//姓名过滤空格
|
|
|
+ if (name == '') {
|
|
|
+ this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 姓名不能为空';
|
|
|
+ this.isTestingname = false;
|
|
|
+ } else {
|
|
|
+ this.isTestingname = true;
|
|
|
+ if (this.regname.test(name)) {
|
|
|
+ this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 姓名不能包含符号、数字等非法字符';
|
|
|
+ this.isregname = false;
|
|
|
+ } else {
|
|
|
+ this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
|
|
|
+ this.isregname = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //加入企业提交按钮
|
|
|
+ Submission(){
|
|
|
+ if (!this.islookup) {
|
|
|
+ this.$message.error('企业或管理员不能为空');
|
|
|
+ } else if (!this.isTestingname) {
|
|
|
+ this.$message.error('姓名不能为空');
|
|
|
+ } else if (!this.isregname) {
|
|
|
+ this.$message.error('姓名不能包含符号、数字等非法字符');
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '提交成功,待管理员批准加入',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
//验证公司详细地址
|
|
|
address(){
|
|
|
let address = this.$refs.address.value.replace(/\s+/g, "");//过滤空格
|
|
|
@@ -184,7 +264,7 @@ import { setTimeout } from 'timers';
|
|
|
} else {
|
|
|
this.isaddressname = true
|
|
|
if (this.reg.test(address)) {
|
|
|
- this.$refs.ress.innerHTML = '不能包含非法字符'
|
|
|
+ this.$refs.ress.innerHTML = '不能包含符号等非法字符'
|
|
|
this.isaddress = false
|
|
|
} else {
|
|
|
this.$refs.ress.innerHTML = ''
|
|
|
@@ -213,7 +293,7 @@ import { setTimeout } from 'timers';
|
|
|
this.listLoading = true
|
|
|
let qyname = this.$refs.qyname.value.replace(/\s+/g, "");//公司名字
|
|
|
let qyindustry = this.$refs.qyindustry.value;//所属行业
|
|
|
- let address = this.province+this.city+this.area+this.$refs.address.value.replace(/\s+/g, "");//公司详细地址
|
|
|
+ let address = this.$refs.address.value.replace(/\s+/g, "");//公司详细地址
|
|
|
let name = this.$refs.name.value.replace(/\s+/g, "");//个人姓名
|
|
|
let email = this.$refs.email.value;//邮箱
|
|
|
let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
|
|
|
@@ -230,11 +310,9 @@ import { setTimeout } from 'timers';
|
|
|
// console.log('企业名字',this.isspaceName)//企业名字正则
|
|
|
// console.log('邮箱',this.isemail)//邮箱正则
|
|
|
if (name == '') {
|
|
|
- this.$refs.tjtishi.innerHTML = '个人姓名不能为空';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('个人姓名不能为空');
|
|
|
} else if (qyname == '') {
|
|
|
- this.$refs.tjtishi.innerHTML = '企业名字不能为空';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('企业名称不能为空');
|
|
|
} else {
|
|
|
switch (this.qymingzi && this.isaddress && this.isname && this.isspaceName && this.isemail && this.isaddressname) {
|
|
|
case this.qymingzi:
|
|
|
@@ -252,62 +330,47 @@ import { setTimeout } from 'timers';
|
|
|
}
|
|
|
})
|
|
|
.then(res=>{
|
|
|
- let id = res.data.data;
|
|
|
- let logoUrl = null;
|
|
|
- let addenterprise = {'id':id, 'logoUrl': logoUrl, 'name': qyname};
|
|
|
- let session = JSON.parse(window.localStorage.getItem('app-state-session'));
|
|
|
- session.account.companies.push(addenterprise);
|
|
|
- session.account.realname = name;
|
|
|
- Session.set(session);
|
|
|
- this.isadd = true;
|
|
|
+ this.isadd = true;//添加成功弹窗
|
|
|
setTimeout(()=>{
|
|
|
document.documentElement.scrollTop = 0;
|
|
|
// this.$router.push({name:'company'})
|
|
|
this.$router.push({path: '/enterprise'})
|
|
|
- },1000)
|
|
|
+ },3000)
|
|
|
})
|
|
|
- this.$refs.tjtishi.innerHTML = '';
|
|
|
+ this.$message({
|
|
|
+ message: '保存成功,待管理员批准',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.$refs.tjtishi.innerHTML = '该企业已在优软云注册';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('该企业已在优软云注册');
|
|
|
}
|
|
|
break;
|
|
|
case this.isaddressname:
|
|
|
- this.$refs.tjtishi.innerHTML = '企业地址不能为空';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('企业地址不能为空');
|
|
|
break;
|
|
|
case this.isaddress:
|
|
|
- this.$refs.tjtishi.innerHTML = '企业地址不能包含非法字符';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('企业地址不能包含符号等非法字符');
|
|
|
break;
|
|
|
case this.isname:
|
|
|
- this.$refs.tjtishi.innerHTML = '个人姓名不能包含非法字符';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('个人姓名不能包含符号等非法字符');
|
|
|
break;
|
|
|
case this.isspaceName:
|
|
|
- this.$refs.tjtishi.innerHTML = '企业名字不能包含非法字符';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('企业名称不能包含符号等非法字符');
|
|
|
break;
|
|
|
case this.isemail:
|
|
|
- this.$refs.tjtishi.innerHTML = '请填写正确的邮箱';
|
|
|
- this.remotxt()
|
|
|
+ this.$message.error('请填写正确的邮箱');
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
this.listLoading = false
|
|
|
},
|
|
|
- remotxt(){
|
|
|
- setTimeout(()=>{
|
|
|
- this.$refs.tjtishi.innerHTML = ' ';
|
|
|
- },3000)
|
|
|
- },
|
|
|
//获取省市区
|
|
|
- selected(data){
|
|
|
- this.province = data.province.value;
|
|
|
- this.city = data.city.value;
|
|
|
- this.area = data.area.value;
|
|
|
- this.disabled= false
|
|
|
- },
|
|
|
+ // selected(data){
|
|
|
+ // this.province = data.province.value;
|
|
|
+ // this.city = data.city.value;
|
|
|
+ // this.area = data.area.value;
|
|
|
+ // this.disabled= false
|
|
|
+ // },
|
|
|
qyprovince(){
|
|
|
this.placeholder = this.placeholde
|
|
|
},
|
|
|
@@ -316,12 +379,6 @@ import { setTimeout } from 'timers';
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.tjtishi {
|
|
|
- color: red;
|
|
|
- display: block;
|
|
|
- text-align: center;
|
|
|
- height: 20px;
|
|
|
-}
|
|
|
.addspace {
|
|
|
height: 200px;
|
|
|
border: 1px solid #cccccc
|
|
|
@@ -329,7 +386,6 @@ import { setTimeout } from 'timers';
|
|
|
.tj-up {
|
|
|
width: 100%;
|
|
|
margin-bottom: 0px;
|
|
|
- border-bottom: 0;
|
|
|
padding-bottom: 1px;
|
|
|
border-radius: 4px 4px 0 0;
|
|
|
/* margin-top: -30px; */
|
|
|
@@ -367,4 +423,29 @@ import { setTimeout } from 'timers';
|
|
|
.inpind {
|
|
|
padding-left: 10px;
|
|
|
}
|
|
|
+.qyactive {
|
|
|
+ border-bottom: 3px solid #1E88F5;
|
|
|
+}
|
|
|
+.qy-conent {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+.showqiye {
|
|
|
+ display: block !important;
|
|
|
+}
|
|
|
+.warning {
|
|
|
+ color: red;
|
|
|
+ margin-left: 25px;
|
|
|
+ font-size: 12px;
|
|
|
+ position: absolute;
|
|
|
+ display: inline-block;
|
|
|
+ width: 150px;
|
|
|
+ text-align: left;
|
|
|
+ text-indent: -16px;
|
|
|
+}
|
|
|
+.warning img {
|
|
|
+ width: 14px;
|
|
|
+}
|
|
|
+.marght {
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
</style>
|