Browse Source

邀请加入页面接口调试

jinsy 7 years ago
parent
commit
727ae10c69

+ 56 - 46
frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -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 {

+ 55 - 45
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -38,7 +38,7 @@
             <div class="gs-tab">
                 <ul>
                     <li class="xs" v-for="(btn , index) in tab" :key='index' :class= "{gsactive:nowindex == index}" @click= "tabswitch(index)">{{btn.name}}</li>
-                    <span v-if="ishongdian" class="reddian"></span>
+                    <!-- <span v-if="ishongdian" class="reddian"></span> -->
                 </ul>
             </div>
             <div class="gs-none">
@@ -128,7 +128,11 @@
                             <li>
                                 <span>消息类型</span>
                                 <span>时间</span>
-                                <span class="newscentent">消息内容</span>
+                                <span class="newscentent" style="position: relative;top: 7px;">
+                                    <span>消息内容</span>
+                                    <span>管理员</span>
+                                    <span>联系方式</span>
+                                </span>
                                 <span>状态</span>
                                 <span>操作</span>
                             </li>
@@ -177,7 +181,7 @@ import { setTimeout } from 'timers';
                 mobile: null,
                 ismodifyname:true,
                 isname:true,//姓名验证
-                reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
+                reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
                 isheigh:false,//默认高度
                 isnews: false,
                 tab: [
@@ -208,6 +212,7 @@ import { setTimeout } from 'timers';
             setTokenPage() {
                 return this.$url.web + '/set-token.html'
             },
+            //红点
             ishongdian(){
                 return this.$store.state.ishongdian;
             },
@@ -219,39 +224,42 @@ import { setTimeout } from 'timers';
                 if (index == 3) {
                     this.nowindex = 3;
                     let id = this.mytoken.id;
-                    let param = {
+                    let param = [{
                         type:'condition',
-                        value:'creatorId='+id+''
-                    }
+                        value:"creatorId="+id
+                    }];
                     // tab切换到消息的时候获取申请列表
-                    this.$ajax({
+                    this.$store.state.isloading = true;
+                    let _this = this
+                    $.ajax({
                         url: this.$url.api+'/api/commons/remind/apply/list',
-                        method:'GET',
-                        async:false,
-                        params: {
+                        type: "GET",
+                        data:{
                             condition:JSON.stringify(param),
                             number:1,
                             size:this.size
                         },
                         headers:{
                             'Access-Control-Allow-Origin':'*',
-                            "Authorization":Session.getToken(),
-                            'Content-Type':'application/json;charset=UTF-8'
-                        }
-                    })
-                    .then(res=>{
-                        if (res.data.success) {
-                            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]
+                            'Content-Type':'application/json;charset=UTF-8',
+                            "Authorization":Session.getToken()
+                        },
+                        success:function(res){
+                            _this.$store.state.isloading = false;
+                            if (res.success) {
+                                _this.arr = [];
+                                let list = res.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.arr.push(list[i])
+                                _this.listtotal = res.data.total;
+                                // _this.$store.state.ishongdian = false;//红点
                             }
-                            this.listtotal = res.data.data.total;
-                            this.$store.state.ishongdian = false;
                         }
                     })
                 } else {
@@ -284,40 +292,42 @@ import { setTimeout } from 'timers';
             },
             // 分页
              handleCurrentChange(val) {
+                this.$store.state.isloading = true;
+                document.documentElement.scrollTop = 0;
                 let id = this.mytoken.id;
-                let param = {
+                let param = [{
                     type:'condition',
                     value:'creatorId='+id+''
-                }
-                this.$ajax({
+                }];
+                let _this = this
+                $.ajax({
                     url: this.$url.api+'/api/commons/remind/apply/list',
-                    method:'GET',
-                    async:false,
-                    params: {
+                    type: "GET",
+                    data:{
                         condition:JSON.stringify(param),
                         number:val,
                         size:this.size
                     },
                     headers:{
                         'Access-Control-Allow-Origin':'*',
-                        "Authorization":Session.getToken(),
-                        'Content-Type':'application/json;charset=UTF-8'
-                    }
-                })
-                .then(res=>{
-                    if (res.data.success) {
-                        // 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]
+                        'Content-Type':'application/json;charset=UTF-8',
+                        "Authorization":Session.getToken()
+                    },
+                    success:function(res){
+                        _this.$store.state.isloading = false;
+                        if (res.success) {
+                            let arr2 = [];
+                            let list = res.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])
                             }
-                            arr2.push(list[i])
+                            _this.arr = arr2
                         }
-                        this.arr = arr2
                     }
                 })
             },

+ 38 - 22
frontend/saas-portal-web/src/components/conenter/invitation.vue

@@ -44,12 +44,13 @@ import { setTimeout } from 'timers';
                 isregphone:false,
                 isname:false,
                 isregname:false,
-                regname:new RegExp(/[\@\#\$\%\&\*!!\¥0-9a-zA-Z]/),//非法字符加数字加
+                regname:new RegExp(/[\@\#\$\%\&\*!!\¥0-9a-zA-Z]/),//非法字符加数字加
                 isvalidCode:false,
                 isrole:false,
                 enterprise:[],
                 arr:[],
-                roleId:''
+                roleId:'',
+                times:''
             }
         },
         created(){
@@ -121,6 +122,7 @@ import { setTimeout } from 'timers';
             },
             // 获取验证码
             Obtaincode(){
+                this.$refs.Verification.value = '';
                 if (!this.isphone) {
                     this.$message.error('手机号码不能为空');
                 } else if (!this.isregphone){
@@ -128,20 +130,18 @@ import { setTimeout } from 'timers';
                 } else {
                     let phone = this.$refs.phone.value;//手机 
                     this.$ajax({
-                        url:'http://192.168.253.31:8560/api/commons/share/getSmsCode',
+                        url: this.$url.api+'/api/commons/share/getSmsCode'+`?mobile=${phone}`,//http://192.168.253.31:8560
                         method:'POST',
-                        data:{
-                            mobile:phone
-                        },
                         headers:{
                             "Authorization":Session.getToken(),
                         }
                     })
                     .then(res=>{
-                        console.log(res)
                         if (res.data.success) {
                             this.isobtaincode = false;
-                            this.settime()
+                            this.settime();
+                        } else {
+                            this.$message.error(res.data.message)
                         }
                     })
                 }
@@ -157,16 +157,16 @@ import { setTimeout } from 'timers';
                 } else if (!this.isregphone){
                     this.$message.error('请输入正确的手机号码');
                 } else if (!this.isname) {
-                    this.$message.error('姓名不能为空')
+                    this.$message.error('姓名不能为空');
                 } else if (!this.isregname) {
-                    this.$message.error("姓名不能包含符号、数字、英文等非法字符")
+                    this.$message.error("姓名不能包含符号、数字、英文等非法字符");
                 } else if(!this.isvalidCode){
-                    this.$message.error("请输入验证码")
+                    this.$message.error("请输入验证码");
                 } else if(!this.isrole){
                     this.$message.error('请选择岗位角色');
                 } else {
                     this.$ajax({
-                        url:'http://192.168.253.31:8560/api/commons/share/submit',
+                        url: this.$url.api+'/api/commons/share/submit',
                         method:'POST',
                         data:{
                             username:name,
@@ -174,27 +174,41 @@ import { setTimeout } from 'timers';
                             companyId:this.enterprise.companyId,
                             roleId:roleid,
                             validCode:Verification,
+                        },
+                        headers:{
+                            "Authorization":Session.getToken(),
+                        }
+                    })
+                    .then(res=>{
+                        if (res.data.success) {
+                            this.$message.success('提交成功,3秒后自动跳转...');
+                            setTimeout(()=>{
+                                this.$router.push({path: '/home'});
+                            },3000)
+                        } else {
+                            this.$message.error(res.data.message);
                         }
                     })
                 }
             },
             //倒计时
             settime(){
-                if (this.time == 0) {
-                    this.isobtaincode = true;
-                    clearTimeout(times)
-                } else {
-                    this.time--
-                }
-                let times = setTimeout(()=>{
-                    this.settime(this.time)
+                this.times = setTimeout(()=>{
+                    if (this.time == 0) {
+                        this.isobtaincode = true;
+                        this.time = 60;
+                        clearTimeout(this.times);
+                    } else {
+                        this.time--;
+                        this.settime();
+                    }
                 },1000)
             },
             //获取角色
             role(){
                 let companyId = this.enterprise.companyId;
                 this.$ajax({
-                    url:'http://192.168.253.31:8560/api/account/role/list'+`?id=${companyId}`,
+                    url: this.$url.api+'/api/account/role/list'+`?id=${companyId}`,
                     headers:{
                         "Authorization":Session.getToken(),
                     }
@@ -209,7 +223,7 @@ import { setTimeout } from 'timers';
             param(){
                 let param = "dXNlcm5hbWU96ZmI54KcJmNvbXBhbnlJZD0yNjImdGltZXN0bWFwPTE1NDUyODAyODU1MjQmZGVsYXk9MSZjb21wYW55TmFtZT3pmYjngpw."
                 this.$ajax({
-                    url:"http://192.168.253.31:8560/api/commons/share/valid/param"+`?param=${param}`,
+                    url: this.$url.api+"/api/commons/share/valid/param"+`?param=${param}`,
                     method:'POST',
                     headers:{
                         "Authorization":Session.getToken(),
@@ -218,6 +232,8 @@ import { setTimeout } from 'timers';
                 .then(res=>{
                     if (res.data.success) {
                         this.enterprise = res.data.data;
+                    } else {
+                        this.$message.error(res.data.message);
                     }
                 })
             },

+ 17 - 10
frontend/saas-portal-web/static/css/gongsi.css

@@ -223,9 +223,10 @@
     color: red;
 }
 .qy-anniu {
-    margin-left: 56%;
+    /* margin-left: 56%; */
     margin-top: 30px;
     margin-bottom: 45px;
+    text-align: center;
 }
 .qy-conent input {
     border: 1px solid #1E88F5;
@@ -388,21 +389,23 @@
     text-align: center;
 }
 .jr-conent input {
-    width: 30%;
+    width: 31%;
     padding-left: 10px;
-    border: 0;
-    border-bottom: 1px solid #BDBEBE;
 }
 .hied {
     display: none;
 }
 .lookup {
-    width: 90%;
-    margin-left: 5%;
+    width: 80%;
     background: #FFFFFF;
     border: 1px solid #1E88F5;
     border-radius: 2px;
     text-align: left;
+    position: absolute;
+    z-index: 1;
+    top: 40px;
+    left: 50%;
+    transform: translate(-50%, 0%);
 }
 .showlookup {
     display: block !important;
@@ -411,24 +414,28 @@
     padding: 0;
 }
 .lookup > ul > li {
-    padding: 20px 20px 10px 20px;
+    padding: 5px 20px;
     margin-bottom: 0 !important;
+    overflow: hidden;
 } 
 .lookup > ul > li span{
     display: inline-block;
     overflow: hidden;
     text-overflow:ellipsis;
     white-space: nowrap;
+    float: right;
 } 
 .lookup > ul > li span:nth-child(1) {
-    width: 47%
+    width: 20%;
+    text-align: right;
 }
 .lookup > ul > li span:nth-child(2) {
     width: 30%;
-    padding: 0px 20px;
+    text-align: center;
 } 
 .lookup > ul > li span:nth-child(3) {
-    width: 20%;
+    width: 48%;
+    text-align: left;
 } 
 .saasguanli {
     width: 18% !important;