Ver código fonte

调试消息页面接口,加入企业接口

jinsy 7 anos atrás
pai
commit
c67bd75d8a

+ 29 - 21
frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -8,7 +8,7 @@
             <div class="gs-worp qy-worp tj-up">
                 <div class="qy-title" style="position: relative;">
                     <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>
+                        <li 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" :class= "{showqiye:nowindex == 0}" style="padding-top: 60px;">
@@ -16,7 +16,7 @@
                         <li style="margin: 0">
                             <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>
+                            <div class="qy-Tips Tips-buttom"><span ref="qyno" style="color:red"></span></div>
                         </li>
                         <li>
                             <span class="qy-biaoti">所属行业</span>
@@ -83,9 +83,9 @@
                             <div class="lookup">
                                 <ul>
                                     <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>
+                                        <span class="maxtxt">{{d.name}}</span>
+                                        <span class="maxtxt">{{d.admin}}</span>
+                                        <span>{{d.adminMobile}}</span>
                                     </li>
                                 </ul>
                             </div>
@@ -134,7 +134,7 @@ import { setTimeout } from 'timers';
                 // placeholde:{province:"", city:"", area:""},
                 tab:[
                     {name:'创建新企业'},
-                    // {name:'加入企业'},
+                    {name:'加入企业'},
                 ],
                 nowindex:0,
                 newindex:'',
@@ -190,9 +190,6 @@ import { setTimeout } from 'timers';
                                 this.qymingzi = false;
                             }
                         })
-                        .catch(err=>{
-                            // console.log("请求错误",err);
-                        })
                     }
                 }
             },
@@ -205,7 +202,7 @@ import { setTimeout } from 'timers';
                     this.islookup = false;
                 } else {
                     this.$ajax({
-                        url: "http://192.168.253.41:8560/api/account/accountCenter/company/isOpen",//http://192.168.253.41:8560
+                        url: this.$url.api+"/api/account/accountCenter/company/isOpen",//http://192.168.253.41:8560
                         method:'GET',
                         params: {
                             companyName: qyname
@@ -216,16 +213,16 @@ import { setTimeout } from 'timers';
                     })
                     .then(res=>{
                         if (res.data.success) {
-                            this.arr = res.data.data
+                            this.newindex = '';
+                            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){
+                        } else if (res.data.success == false && res.data.message == '公司不存在') {
                             this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 该企业不存在';
                         } else {
                             this.$message.error('请求失败,请重试');
                         }
                     })
-                    
                 }
             },
             //验证个人姓名1
@@ -268,7 +265,6 @@ import { setTimeout } from 'timers';
             //加入企业提交按钮
             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('企业或管理员不能为空');
@@ -278,7 +274,7 @@ import { setTimeout } from 'timers';
                     this.$message.error('姓名不能包含符号、数字等非法字符');
                 } else if (this.companyId){
                     this.$ajax({
-                        url:'http://192.168.253.41:8560/api/account/accountCenter/company/join',
+                        url: this.$url.api+'/api/account/accountCenter/company/join',
                         method:'POST',
                         data:{
                             username:username,
@@ -295,7 +291,10 @@ import { setTimeout } from 'timers';
                             this.$store.state.ishongdian = true;//显示红点
                             setTimeout(()=>{
                                 this.$router.push({name:'company'});
+                                document.documentElement.scrollTop = 0;
                             },3000)
+                        } else {
+                            this.$message.error(res.data.message);
                         }
                     })
                 } else {
@@ -343,10 +342,9 @@ import { setTimeout } from 'timers';
                 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'));
-                let token = String(mytoken.token);
-                let uu = mytoken.account.uu;
-                let mobile = mytoken.account.mobile;//手机号
+                let token = this.mytoken.token;
+                let uu = this.mytoken.account.uu;
+                let mobile = this.mytoken.account.mobile;//手机号
                 let company = {'name':qyname,'address':address,'type':qyindustry};
                 let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu};
                 // console.log('姓名',name)//个人姓名
@@ -380,7 +378,7 @@ import { setTimeout } from 'timers';
                                 this.isadd = true;//添加成功弹窗
                                 setTimeout(()=>{
                                     document.documentElement.scrollTop = 0;
-                                    let session = JSON.parse(window.localStorage.getItem('app-state-session'));
+                                    let session = Session.get();
                                     session.account.realname = name;
                                     Session.set(session);
                                     // this.$router.push({name:'company'})
@@ -496,6 +494,16 @@ import { setTimeout } from 'timers';
     margin-right: 5px;
 }
 .hui {
-    background: #c5c5c5;
+    background: #c5c5c5 !important;
+}
+.lookup > ul > li:hover {
+    background: #f5f4f4
+}
+.lookup > ul {
+    height: 300px;
+    overflow-y: scroll;
+}
+.maxtxt {
+    font-size: 16px !important;
 }
 </style>

+ 12 - 12
frontend/saas-portal-web/src/components/conenter/company.vue

@@ -142,7 +142,7 @@
             let token = String(mytoken.token);
             //企业列表
             this.$ajax({
-                    url: this.$url.api+"/api/account/accountCenter/company/list",//http://192.168.253.29:8560
+                    url: this.$url.api+"/api/account/accountCenter/company/list",//http://192.168.253.41:8560
                     method: 'get',
                     params: {
                         mobile: mytoken.account.mobile
@@ -315,21 +315,21 @@
                 .then(res=>{
                     // console.log('请求成功',res)
                     if (res.data.success) {
-                        this.saasid = res.data.data
+                        this.saasid = res.data.data;
                         this.ktsass = false;
-                        let id = res.data.data
-                        let name = qyname
-                        let logoUrl = null
-                        let addenterprise = {'id':id, 'logoUrl': logoUrl, 'name': name}
-                        let session = JSON.parse(window.localStorage.getItem('app-state-session'))
-                        session.account.companies.push(addenterprise)
+                        let id = res.data.data;
+                        let name = qyname;
+                        let logoUrl = null;
+                        let addenterprise = {'id':id, 'logoUrl': logoUrl, 'name': name};
+                        let session = Session.get();
+                        session.account.companies.push(addenterprise);
                         Session.set(session);
                         this.$router.go(0);
                     } else {
-                        let msg = res.data.message
-                        let name = msg.split(" ")[1]
-                        this.admin = name.split('(')[0]
-                        this.adminMobile = name.split('(')[1].split(')')[0]
+                        let msg = res.data.message;
+                        let name = msg.split(" ")[1];
+                        this.admin = name.split('(')[0];
+                        this.adminMobile = name.split('(')[1].split(')')[0];
                         this.isokopensaas = true;
                     }
                 })

+ 1 - 2
frontend/saas-portal-web/src/components/conenter/details.vue

@@ -173,7 +173,7 @@
                     let company = {'name':qyname,'address':address, 'id':companyId, 'type':qyindustry};
                     let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu};
                     this.$ajax({
-                        url: this.$url.api+"/api/account/accountCenter/companyAccount/update",//http://192.168.253.31:8560
+                        url: this.$url.api+"/api/account/accountCenter/companyAccount/update",//http://192.168.253.41:8560
                         method: 'post',
                         data: {
                             companyRegDTO:company,
@@ -184,7 +184,6 @@
                         }
                     })
                     .then(res=>{
-                        // console.log("请求成功",res)
                         if (res.data.success) {
                             document.documentElement.scrollTop = 0;
                             this.modify = true;

+ 102 - 38
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -130,18 +130,31 @@
                                 <span>状态</span>
                                 <span>操作</span>
                             </li>
-                            <li class="newslist" v-for="(d, i) in arr" :key="i">
-                                <span>{{d.leixing}}</span>
-                                <span>{{d.time}}</span>
-                                <span class="newscentent">
-                                    <span>{{d.neirong.qyname}}</span>
-                                    <span>{{d.neirong.saas}}</span>
-                                    <span>{{d.neirong.phone}}</span>
+                            <li v-if="isnews" class="newslist" v-for="(d, i) in arr" :key="i">
+                                <span>加入申请</span>
+                                <span>{{d.createTime}}</span>
+                                <span class="newscentent" style="position:relative;top:9px">
+                                    <span>{{d.companyName}}</span>
+                                    <span>{{d.admin}}</span>
+                                    <span>{{d.adminMobile}}</span>
                                 </span>
-                                <span>{{d.zhuangtai}}</span>
-                                <span><button v-if="d.caozuo" @click="Rejoin(i)" class="news-btn">重新加入</button></span>
+                                <span v-if='d.status == 0'>未通过</span>
+                                <span v-else-if='d.status == 1'>已批准</span>
+                                <span v-else-if='d.status == 2'>待批准</span>
+                                <span><button v-if="d.status == 0" @click="Rejoin(i)" class="news-btn">重新加入</button></span>
+                            </li>
+                            <li v-if="!isnews">
+                                <img style="width:100%" src="/static/img/nodata.png" alt="">
                             </li>
                         </ul>
+                        <div v-if="isnews" class="my-pagination">
+                            <el-pagination
+                                background
+                                @current-change="handleCurrentChange"
+                                layout="prev, pager, next"
+                                :total= list>
+                            </el-pagination>
+                        </div>
                     </div>
                 </div>
             </div>
@@ -163,27 +176,27 @@ import { setTimeout } from 'timers';
                 isname:true,//姓名验证
                 reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
                 isheigh:false,//默认高度
+                isnews: false,
                 tab: [
                     {name: '企业信息'},
                     {name: '个人信息'},
                     {name: '安全设置'},
-                    // {name: '消息'},
+                    {name: '消息'},
                 ],
-                arr: [
-                    {leixing:'加入申请',time:'2018/12/01  12:45:21',neirong:{qyname:'X防守对方的发士大夫XX公司',saas:'管理员名称范德萨发达',phone:'1345678923'},zhuangtai:'待批准',caozuo:false},
-                    {leixing:'加入申请',time:'2018/12/01  12:45:21',neirong:{qyname:'XXX公司',saas:'管理员名称',phone:'1345678923'},zhuangtai:'未通过',caozuo:true},
-                ]
+                arr: [],
+                list:1
             }
         },
         mounted(){
-            let mob = this.mytoken.mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
-            this.mobile = mob;
+            let phone = this.mytoken.mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+            this.mobile = phone;
             this.boxheight();
         },
         watch:{
             arr:function(){
                 this.$nextTick(function(){
                     this.boxheight();
+                    this.isnews = true;
                 })
             }
         },
@@ -193,26 +206,28 @@ import { setTimeout } from 'timers';
             },
             ishongdian(){
                 return this.$store.state.ishongdian;
-            }
+            },
         },
         methods: {
             // tab切换
             tabswitch(index){
                 if (index == 3) {
                     this.nowindex = 3;
-                    let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
+                    let mytoken = Session.get();
                     let id = mytoken.account.id;
-                    // tab切换到消息的时候执行
                     let param = {
                         type:'condition',
                         value:'creatorId='+id+''
                     }
+                    // tab切换到消息的时候执行
                     this.$ajax({
-                        url:'http://192.168.253.41:8560/api/commons/remind/apply/list',
+                        url: this.$url.api+'/api/commons/remind/apply/list',
                         method:'GET',
                         async:false,
                         params: {
-                            condition:JSON.stringify(param)
+                            condition:JSON.stringify(param),
+                            number:1,
+                            size:10
                         },
                         headers:{
                             'Access-Control-Allow-Origin':'*',
@@ -221,8 +236,11 @@ import { setTimeout } from 'timers';
                         }
                     })
                     .then(res=>{
-                        console.log(res)
-                        this.$store.state.ishongdian = false
+                        if (res.data.success) {
+                            this.arr = res.data.data.list;
+                            this.list = res.data.data.total;
+                            this.$store.state.ishongdian = false;
+                        }
                     })
                 } else {
                     this.nowindex = index;
@@ -230,9 +248,58 @@ import { setTimeout } from 'timers';
                 
             },
             setTurnHome(){
-                // debugger
                 this.$parent.turnHome = true
             },
+            //重新加入
+            Rejoin(i){
+                this.$ajax({
+                    url: this.$url.api+'/api/account/accountCenter/company/join',
+                    method:'POST',
+                    data:{
+                        username:this.arr[i].creatorName,
+                        accountId:this.mytoken.id,
+                        companyId:this.arr[i].companyId,
+                    },
+                    headers:{
+                        "Authorization":Session.getToken(),
+                    }
+                })
+                .then(res=>{
+                    if (res.data.success) {
+                        this.$message.success('提交成功,待管理员批准');
+                        this.tabswitch(3);//本页面刷新
+                    }
+                })
+            },
+            // 分页
+             handleCurrentChange(val) {
+                let mytoken = Session.get();
+                let id = mytoken.account.id;
+                let param = {
+                    type:'condition',
+                    value:'creatorId='+id+''
+                }
+                this.$ajax({
+                    url: this.$url.api+'/api/commons/remind/apply/list',
+                    method:'GET',
+                    async:false,
+                    params: {
+                        condition:JSON.stringify(param),
+                        number:val,
+                        size:10
+                    },
+                    headers:{
+                        'Access-Control-Allow-Origin':'*',
+                        "Authorization":mytoken.token,
+                        'Content-Type':'application/json;charset=UTF-8'
+                    }
+                })
+                .then(res=>{
+                    if (res.data.success) {
+                        this.arr = res.data.data.list;
+                    }
+                })
+            },
             //退出
             loginout(){
                 const frame = window.frames[window.frames.length - 1]
@@ -278,7 +345,6 @@ import { setTimeout } from 'timers';
                 if (this.isname) {
                     let name = this.$refs.realname.value.replace(/\s+/g, "");
                     let id = this.mytoken.id;
-                    let token = JSON.parse(localStorage.getItem('app-state-session')).token;
                     this.$ajax({
                         url: this.$url.api+"/api/account/account/update",
                         method :'post',
@@ -287,12 +353,12 @@ import { setTimeout } from 'timers';
                             realname:name
                         },
                         headers: {
-                            "Authorization":token
+                            "Authorization":Session.getToken()
                         }
                     })
                     .then(res=>{
                         if (res.data.success) {
-                            let session = JSON.parse(window.localStorage.getItem('app-state-session'));
+                            let session = Session.get();
                             session.account.realname = name;
                             Session.set(session);
                             this.$router.go(0);
@@ -303,20 +369,10 @@ import { setTimeout } from 'timers';
                     })
                 }
             },
-            //重新加入
-            Rejoin(i){
-                //成功后提示
-                this.$message({
-                    message: '提交成功,待管理员批准',
-                    type: 'success'
-                });
-                this.arr[i].zhuangtai = '待批准';
-                this.arr[i].caozuo = false;
-            },
             //没有内容也要有一定的高度
             boxheight(){
                 let H = this.$refs.qiyebox.offsetHeight;
-                if (H < 500) {
+                if (H <= 500) {
                     this.isheigh = true
                 } else {
                     this.isheigh = false
@@ -385,6 +441,9 @@ import { setTimeout } from 'timers';
     width: 130%;
     margin-left: -15%;
 }
+.gs-news > img {
+    width: 100%
+}
 .gs-news > ul {
     padding: 0;
     font-family: PingFangSC-Regular;
@@ -457,4 +516,9 @@ import { setTimeout } from 'timers';
     top: -5px;
     left: -25px;
 }
+.my-pagination {
+    margin: 0;
+    text-align: center !important;
+    margin-top: 50px;
+}
 </style>

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

@@ -379,16 +379,9 @@
     color: #243A52;
     text-align: right;
     font-weight: 600;
-    margin-right: 40px;
-    width: 100px;
     display: inline-block;
-}
-.qy-biaoqian {
-    padding: 6px 20px;
-    color: #FFFFFF;
-    background: #1E88F5;
-    border-radius: 2px;
-    margin-right: 8px;
+    width: 15%;
+    margin-right: 6%;
 }
 .jr-conent {
     padding: 60px 30px 30px 30px;
@@ -422,12 +415,21 @@
     margin-bottom: 0 !important;
 } 
 .lookup > ul > li span{
-    width: 16%;
     display: inline-block;
     overflow: hidden;
     text-overflow:ellipsis;
     white-space: nowrap;
 } 
+.lookup > ul > li span:nth-child(1) {
+    width: 47%
+}
+.lookup > ul > li span:nth-child(2) {
+    width: 30%;
+    padding: 0px 20px;
+} 
+.lookup > ul > li span:nth-child(3) {
+    width: 20%;
+} 
 .saasguanli {
     width: 18% !important;
 }

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