Browse Source

添加邀请页面

jinsy 7 years ago
parent
commit
07d5e839d8

+ 13 - 7
frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -75,11 +75,11 @@
                     <ul style="padding:0">
                     <ul style="padding:0">
                         <li>
                         <li>
                             <span class="qy-biaoti"><span class="xingxing marght">*</span>查找企业</span>
                             <span class="qy-biaoti"><span class="xingxing marght">*</span>查找企业</span>
-                            <input @blur.prevent="Testingqyname" ref="lookupqyname" class="inpind" type="text" value="" placeholder="输入企业名称或管理员">
+                            <input @blur.prevent="Testingqyname" @keyup.13="Testingqyname" ref="lookupqyname" class="inpind" type="text"  placeholder="输入企业名称或管理员">
                             <span class="warning" ref="warningqyname"></span>
                             <span class="warning" ref="warningqyname"></span>
                         </li>
                         </li>
                         <!-- 匹配企业后显示的内容 -->
                         <!-- 匹配企业后显示的内容 -->
-                        <li class="hied" :class= "{showlookup:islookup}">
+                        <li v-if="isqylist" class="hied" :class= "{showlookup:islookup}">
                             <div class="lookup">
                             <div class="lookup">
                                 <ul>
                                 <ul>
                                     <li v-for="(d, i) in arr" :key="i" @click="qylist(i)" :class="{'hui':newindex === i}">
                                     <li v-for="(d, i) in arr" :key="i" @click="qylist(i)" :class="{'hui':newindex === i}">
@@ -121,8 +121,8 @@ import { setTimeout } from 'timers';
                 qymingzi: false,//企业名是否注册
                 qymingzi: false,//企业名是否注册
                 Email: '',
                 Email: '',
                 mytoken: Session.get(),//本地储存的用户信息
                 mytoken: Session.get(),//本地储存的用户信息
-                reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
-                regname:new RegExp(/[\@\#\$\%\&\*!\¥0-9]/),//非法字符加数字
+                reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
+                regname:new RegExp(/[\@\#\$\%\&\*!\¥0-9a-zA-Z]/),//非法字符加数字加中文
                 isaddress: false,//公司地址验证
                 isaddress: false,//公司地址验证
                 isaddressname: false,//公司地址是否为空
                 isaddressname: false,//公司地址是否为空
                 isname: true,//姓名验证
                 isname: true,//姓名验证
@@ -143,6 +143,7 @@ import { setTimeout } from 'timers';
                 isregname:false,
                 isregname:false,
                 companyId:null,
                 companyId:null,
                 admin:null,
                 admin:null,
+                isqylist:true,
                 arr:[]
                 arr:[]
             }
             }
         },
         },
@@ -196,6 +197,7 @@ import { setTimeout } from 'timers';
             },
             },
             //检测企业名称2
             //检测企业名称2
             Testingqyname(){
             Testingqyname(){
+                this.$refs.lookupqyname.blur();
                 let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
                 let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
                 let token = this.mytoken.token;
                 let token = this.mytoken.token;
                 if (qyname == '') {
                 if (qyname == '') {
@@ -217,7 +219,9 @@ import { setTimeout } from 'timers';
                             this.newindex = '';
                             this.newindex = '';
                             this.arr = res.data.data;
                             this.arr = res.data.data;
                             this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
                             this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
-                            this.islookup = true;   
+                            this.islookup = true;
+                            this.isqylist = true;
+                            this.companyId = null;
                         } else if (res.data.success == false && res.data.message == '公司不存在') {
                         } else if (res.data.success == false && res.data.message == '公司不存在') {
                             this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 该企业不存在';
                             this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 该企业不存在';
                             this.islookup = false; 
                             this.islookup = false; 
@@ -253,7 +257,7 @@ import { setTimeout } from 'timers';
                 } else {
                 } else {
                     this.isTestingname = true;
                     this.isTestingname = true;
                     if (this.regname.test(name)) {
                     if (this.regname.test(name)) {
-                        this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 姓名不能包含符号、数字等非法字符';
+                        this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 姓名不能包含符号、数字、英文等非法字符';
                         this.isregname = false;
                         this.isregname = false;
                     } else {
                     } else {
                         this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
                         this.$refs.warningname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
@@ -265,7 +269,9 @@ import { setTimeout } from 'timers';
             qylist(i){
             qylist(i){
                 this.companyId = this.arr[i].id,
                 this.companyId = this.arr[i].id,
                 this.admin = this.arr[i].admin,
                 this.admin = this.arr[i].admin,
-                this.newindex = i
+                this.newindex = i,
+                this.$refs.lookupqyname.value = this.arr[i].name,
+                this.isqylist = false
             },
             },
             //加入企业提交按钮
             //加入企业提交按钮
             Submission(){
             Submission(){

+ 23 - 3
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -17,6 +17,7 @@
             </div>
             </div>
             <div class="collapse navbar-collapse navbar-right" role="navigation">
             <div class="collapse navbar-collapse navbar-right" role="navigation">
                 <ul id="nav" class="nav navbar-nav menu">
                 <ul id="nav" class="nav navbar-nav menu">
+                    <!-- <li><router-link to="/invitation">邀请</router-link></li> -->
                     <li><router-link to="/home"><a href="#" @click="setTurnHome"><span style="color: white">首页</span></a></router-link></li>
                     <li><router-link to="/home"><a href="#" @click="setTurnHome"><span style="color: white">首页</span></a></router-link></li>
                     <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
                     <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
                     <li style="margin-left:30px;margin-top: 13px;cursor: pointer;">
                     <li style="margin-left:30px;margin-top: 13px;cursor: pointer;">
@@ -187,7 +188,7 @@ import { setTimeout } from 'timers';
                 ],
                 ],
                 arr: [],
                 arr: [],
                 listtotal:1,
                 listtotal:1,
-                size:10,//每页显示数量
+                size: 10,//每页显示数量
             }
             }
         },
         },
         mounted(){
         mounted(){
@@ -240,7 +241,15 @@ import { setTimeout } from 'timers';
                     })
                     })
                     .then(res=>{
                     .then(res=>{
                         if (res.data.success) {
                         if (res.data.success) {
-                            this.arr = res.data.data.list;
+                            let list = res.data.data.list;
+                            for (let i = 0; i < list.length - 1; i++) {
+                                for (let j = 0; j < list.length - i - 1; j++) {
+                                    if (list[i].companyName == list[j].companyName && list[i].status == 0) {
+                                        delete list[i]
+                                    }
+                                }
+                                this.arr.push(list[i])
+                            }
                             this.listtotal = res.data.data.total;
                             this.listtotal = res.data.data.total;
                             this.$store.state.ishongdian = false;
                             this.$store.state.ishongdian = false;
                         }
                         }
@@ -297,7 +306,18 @@ import { setTimeout } from 'timers';
                 })
                 })
                 .then(res=>{
                 .then(res=>{
                     if (res.data.success) {
                     if (res.data.success) {
-                        this.arr = res.data.data.list;
+                        // this.arr = res.data.data.list;
+                        let arr2 = [];
+                        let list = res.data.data.list;
+                        for (let i = 0; i < list.length - 1; i++) {
+                            for (let j = 0; j < list.length - i - 1; j++) {
+                                if (list[i].companyName == list[j].companyName && list[i].status == 0) {
+                                    delete list[i]
+                                }
+                            }
+                            arr2.push(list[i])
+                        }
+                        this.arr = arr2
                     }
                     }
                 })
                 })
             },
             },

+ 320 - 0
frontend/saas-portal-web/src/components/conenter/invitation.vue

@@ -0,0 +1,320 @@
+<template>
+    <div class="invitation">
+        <img src="/static/img/beijing.png" alt="">
+        <div class="centent">
+            <img src="/static/img/assets/logo@2x.png" alt="">
+            <p class="inv-logo">U企云服</p>
+            <div class="inv-title">
+                <p>{{enterprise.username}}</p>
+                <p>
+                    <span class="inv-text">邀请您加入</span>
+                    <span>{{enterprise.companyName}}</span>
+                    <span class="inv-text">SAAS服务</span>
+                </p>
+            </div>
+            <input type="text" ref="phone" @blur="phone" placeholder="请输入手机号">
+            <div class="Verification">
+                <input type="text" ref="Verification" @change="validCode" placeholder="请输入验证码">
+                <span v-if="isobtaincode" class="xs" @click="Obtaincode">获取验证码</span>
+                <span v-if="!isobtaincode" ref="obtaincode">{{time}}</span>
+            </div>
+            <input type="text" ref="name" @blur="name" placeholder="请输入姓名">
+            <select class="role" ref="role" @blur="roles">
+                <option value="">岗位角色</option>
+                <option v-for="(d,i) in arr" :key="i" :value=d.id>{{d.name}}</option>
+            </select>
+            <button class="login" @click="login">提交</button>
+        </div>
+        <div class="bottom">
+            <p>U企云服|电子行业企业管理云端解决方案</p>
+            <p>版权所有:深圳市优软科技有限公司 Copyright @ 2017 All Rights Reserved</p>
+        </div>
+    </div>
+</template>
+
+<script>
+import Session from '@/utils/session'
+import { setTimeout } from 'timers';
+    export default {
+        data(){
+            return {
+                isobtaincode:true,
+                time:60,
+                isphone:false,
+                isregphone:false,
+                isname:false,
+                isregname:false,
+                regname:new RegExp(/[\@\#\$\%\&\*!!\¥0-9a-zA-Z]/),//非法字符加数字加中文
+                isvalidCode:false,
+                isrole:false,
+                enterprise:[],
+                arr:[],
+                roleId:''
+            }
+        },
+        created(){
+            this.$store.state.isinvitation = false;
+            this.param();//获取页面参数
+        },
+        mounted(){
+            //获取角色
+            setTimeout(()=>{
+                this.role()
+            },800)
+        },
+        destroyed(){
+            this.$store.state.isinvitation = true
+        },
+        methods:{
+            //验证手机
+            phone(){
+                let phone = this.$refs.phone.value;//手机 
+                let reg = new RegExp('^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$');
+                if (phone == '') {
+                    this.$message.error('手机号码不能为空');
+                    this.isphone = false;
+                } else {
+                    this.isphone = true;
+                    if (!reg.test(phone)) {
+                        this.$message.error('请输入正确的手机号码');
+                        this.isregphone = false;
+                    } else {
+                        this.isregphone = true;
+                    }
+                }
+            },
+            //验证姓名
+            name(){
+                let name = this.$refs.name.value;
+                if (name == '') {
+                    this.$message.error('姓名不能为空')
+                    this.isname = false;
+                } else {
+                    this.isname = true;
+                    if (this.regname.test(name)) {
+                        this.$message.error('姓名不能包含符号、数字、英文等非法字符');
+                        this.isregname = false
+                    } else {
+                        this.isregname = true
+                    }
+                }
+            },
+            //验证码
+            validCode(){
+                let Verification = this.$refs.Verification.value;//验证码
+                if (Verification == '') {
+                    this.$message.error('请输入验证码')
+                    this.isvalidCode = false;
+                } else {
+                    this.isvalidCode = true;
+                }
+            },
+            // 验证角色
+            roles(){
+                let roleid = this.$refs.role.value;//角色
+                if (roleid == '') {
+                    this.$message.error('请选择岗位角色');
+                    this.isrole = false;
+                } else {
+                    this.isrole = true;
+                }
+            },
+            // 获取验证码
+            Obtaincode(){
+                if (!this.isphone) {
+                    this.$message.error('手机号码不能为空');
+                } else if (!this.isregphone){
+                    this.$message.error('请输入正确的手机号码');
+                } else {
+                    let phone = this.$refs.phone.value;//手机 
+                    this.$ajax({
+                        url:'http://192.168.253.31:8560/api/commons/share/getSmsCode',
+                        method:'POST',
+                        data:{
+                            mobile:phone
+                        },
+                        headers:{
+                            "Authorization":Session.getToken(),
+                        }
+                    })
+                    .then(res=>{
+                        console.log(res)
+                        if (res.data.success) {
+                            this.isobtaincode = false;
+                            this.settime()
+                        }
+                    })
+                }
+            },
+            // 提交
+            login(){
+                let phone = this.$refs.phone.value;//手机
+                let Verification = this.$refs.Verification.value;//验证码
+                let name = this.$refs.name.value;//姓名
+                let roleid = this.$refs.role.value;//角色
+                if (!this.isphone) {
+                    this.$message.error('手机号码不能为空');
+                } else if (!this.isregphone){
+                    this.$message.error('请输入正确的手机号码');
+                } else if (!this.isname) {
+                    this.$message.error('姓名不能为空')
+                } else if (!this.isregname) {
+                    this.$message.error("姓名不能包含符号、数字、英文等非法字符")
+                } else if(!this.isvalidCode){
+                    this.$message.error("请输入验证码")
+                } else if(!this.isrole){
+                    this.$message.error('请选择岗位角色');
+                } else {
+                    this.$ajax({
+                        url:'http://192.168.253.31:8560/api/commons/share/submit',
+                        method:'POST',
+                        data:{
+                            username:name,
+                            mobile:phone,
+                            companyId:this.enterprise.companyId,
+                            roleId:roleid,
+                            validCode:Verification,
+                        }
+                    })
+                }
+            },
+            //倒计时
+            settime(){
+                if (this.time == 0) {
+                    this.isobtaincode = true;
+                    clearTimeout(times)
+                } else {
+                    this.time--
+                }
+                let times = setTimeout(()=>{
+                    this.settime(this.time)
+                },1000)
+            },
+            //获取角色
+            role(){
+                let companyId = this.enterprise.companyId;
+                this.$ajax({
+                    url:'http://192.168.253.31:8560/api/account/role/list'+`?id=${companyId}`,
+                    headers:{
+                        "Authorization":Session.getToken(),
+                    }
+                })
+                .then(res=>{
+                    if (res.data.success) {
+                        this.arr = res.data.data
+                    }
+                })
+            },
+            //获取页面参数
+            param(){
+                let param = "dXNlcm5hbWU96ZmI54KcJmNvbXBhbnlJZD0yNjImdGltZXN0bWFwPTE1NDUyODAyODU1MjQmZGVsYXk9MSZjb21wYW55TmFtZT3pmYjngpw."
+                this.$ajax({
+                    url:"http://192.168.253.31:8560/api/commons/share/valid/param"+`?param=${param}`,
+                    method:'POST',
+                    headers:{
+                        "Authorization":Session.getToken(),
+                    }
+                })
+                .then(res=>{
+                    if (res.data.success) {
+                        this.enterprise = res.data.data;
+                    }
+                })
+            },
+        }
+    }
+</script>
+
+<style scoped>
+.invitation > img{
+    width: 100%;
+}
+.centent {
+    width: 352px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    text-align: center
+}
+.inv-logo {
+    font-family: PingFangSC-Medium;
+    font-size: 26px;
+    color: #FFFFFF;
+    letter-spacing: 3.25px;
+}
+
+.centent > input {
+    width: 100%;
+    margin-bottom: 16px;
+    opacity: 0.95;
+    background: #FFFFFF;
+    box-shadow: 0 2px 4px 0 #3C8EFF;
+    font-size: 15px;
+    padding: 3px 0px 3px 5px;
+    border: 0;
+}
+.inv-title {
+    text-align: left;
+    margin-top: 37px;
+    margin-bottom: 40px;
+}
+.inv-title > p{
+    font-family: PingFangSC-Medium;
+    font-size: 18px;
+    color: #FFFFFF;
+    letter-spacing: 2.25px;
+    text-shadow: 0 2px 4px #1B5099;
+}
+.inv-title >p:nth-child(1) {
+    margin-bottom: 16px;
+}
+.inv-text {
+    font-family: PingFangSC-Regular;
+}
+.login {
+    background: #004CE0;
+    width: 100%;
+    border: 0;
+    height: 36px;
+}
+.role {
+    width: 100%;
+    margin-bottom: 32px;
+    padding: 3px 0px;
+}
+.Verification {
+    border: 0;
+    opacity: 0.95;
+    background: #FFFFFF;
+    box-shadow: 0 2px 4px 0 #3C8EFF;
+    margin-bottom: 16px;
+}
+.Verification > input {
+    width: 68%;
+    border: 0;
+    font-size: 15px;
+    padding: 3px 0px 3px 5px;
+}
+.Verification > span {
+    width: 30%;
+    display: inline-block;
+    border-left: 1px solid #2F86FE;
+    font-family: PingFangSC-Regular;
+    font-size: 12px;
+    color: #2F86FE;
+    letter-spacing: 1.5px;
+}
+.bottom {
+    height: 100px;
+    background: #FAFCFF;
+    text-align: center;
+    padding: 27px 0px;
+}
+.bottom > p{
+    font-family: PingFangSC-Regular;
+    font-size: 16px;
+    color: #666666;
+    letter-spacing: 2px;
+}
+</style>

+ 4 - 1
frontend/saas-portal-web/src/pages/index/index.vue

@@ -4,7 +4,7 @@
       <div class="loadingtxt">加载中...</div>
       <div class="loadingtxt">加载中...</div>
     </div>
     </div>
     <router-view/>
     <router-view/>
-    <footers></footers>
+    <footers v-if="isinvitation"></footers>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -22,6 +22,9 @@ export default {
   computed:{
   computed:{
     isloading:function(){
     isloading:function(){
       return this.$store.state.isloading
       return this.$store.state.isloading
+    },
+    isinvitation:function(){
+      return this.$store.state.isinvitation
     }
     }
   }
   }
 }
 }

+ 6 - 0
frontend/saas-portal-web/src/router/index.js

@@ -5,6 +5,7 @@ import enterprise from '../components/conenter/enterprise.vue'//企业设置首
 import company from '../components/conenter/company.vue'//企业列表
 import company from '../components/conenter/company.vue'//企业列表
 import addenterprise from '../components/conenter/addenterprise.vue'//添加公司
 import addenterprise from '../components/conenter/addenterprise.vue'//添加公司
 import details from '../components/conenter/details.vue'//企业详细
 import details from '../components/conenter/details.vue'//企业详细
+import invitation from '../components/conenter/invitation.vue'//邀请页面
 
 
 Vue.use(Router)
 Vue.use(Router)
 
 
@@ -19,6 +20,11 @@ export default new Router({
       path: '*',
       path: '*',
       redirect:'/home'
       redirect:'/home'
     },
     },
+    {
+      path:'/invitation',
+      name:'invitation',
+      component:invitation
+    },
     {
     {
       path: '/enterprise',
       path: '/enterprise',
       name: 'enterprise',
       name: 'enterprise',

+ 1 - 0
frontend/saas-portal-web/src/store/index.js

@@ -8,6 +8,7 @@ export default new Vuex.Store({
         isproblem: '',//常见问题
         isproblem: '',//常见问题
         isloading:false,
         isloading:false,
         ishongdian:false,
         ishongdian:false,
+        isinvitation:true,
     },
     },
     mutations:{
     mutations:{
          Logintrue(state) {
          Logintrue(state) {

BIN
frontend/saas-portal-web/static/img/beijing.png