Browse Source

修改加入企业,选择的企业已存在但不是管理员,不提示已存在改企业的bug

jinsy 7 years ago
parent
commit
fd21b1acf7

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

@@ -154,6 +154,7 @@ import { setTimeout, clearTimeout } from 'timers';
                 isqyaddress:false,//地址
                 isyzusername:false,
                 isheidemail:false,
+                iscompanyname:false,
             }
         },
         components:{
@@ -324,12 +325,21 @@ import { setTimeout, clearTimeout } from 'timers';
             },
             // 选择要加入的企业
             qylist(i){
-                this.companyId = this.arr[i].id,
-                this.admin = this.arr[i].admin,
-                this.newindex = i,
-                this.$refs.lookupqyname.value = this.arr[i].name,
+                let companyName = JSON.parse(window.sessionStorage.getItem("companyname"));
+                this.companyId = this.arr[i].id;
+                this.admin = this.arr[i].admin;
+                this.newindex = i;
+                this.$refs.lookupqyname.value = this.arr[i].name;
                 this.islookup = false;
-                if (this.admin == this.mytoken.account.realname) {
+                for (let j = 0; j < companyName.length; j++) {
+                    if (this.arr[i].name == companyName[j]) {
+                        this.iscompanyname = true
+                        break
+                    } else {
+                        this.iscompanyname = false
+                    }
+                }
+                if (this.iscompanyname || this.admin == this.mytoken.account.realname) {
                     this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 账号已在企业服务中,不能重复加入';
                 } else {
                     this.$refs.warningqyname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">';
@@ -342,7 +352,6 @@ import { setTimeout, clearTimeout } from 'timers';
             },
             //加入企业提交按钮
             Submission(){
-                this.$store.state.isloading = true;
                 let token = this.mytoken.token;
                 let qyname = this.$refs.lookupqyname.value.replace(/\s+/g, "");//企业名字
                 let username = this.$refs.lookupname.value.replace(/\s+/g, "");//姓名过滤空格
@@ -352,13 +361,14 @@ import { setTimeout, clearTimeout } from 'timers';
                     this.$message.error('企业或管理员不存在');
                 } else if (!this.companyId) {
                     this.$message.error('请选择要加入的企业');
-                } else if (this.admin == this.mytoken.account.realname) {
+                } else if (this.admin == this.mytoken.account.realname || this.iscompanyname) {
                     this.$message.error('账号已在企业服务中,不能重复加入');
                 } else if (!this.isTestingname) {
                     this.$message.error('姓名不能为空');
                 } else if (!this.isregname) {
                     this.$message.error('姓名不能包含符号、数字等非法字符');
                 } else {
+                    this.$store.state.isloading = true;
                     this.$ajax({
                         url: this.$url.api+'/api/account/accountCenter/company/join',
                         method:'POST',

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

@@ -173,7 +173,10 @@
                         this.list = res.data.data.spaces;
                         this.pagingtion(1,this.size);
                         let enterprise = [];
+                        let qyname = [];
                         for (let i = 0; i < this.list.length; i++) {
+                            qyname.push(this.list[i].name);
+                            window.sessionStorage.setItem('companyname',JSON.stringify(qyname))
                             if (this.list[i].saas_) {
                                 let addenterprise = {'id':'', 'logoUrl': '', 'name': '','dcName':''};
                                 addenterprise.id = this.list[i].id;

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

@@ -4,8 +4,8 @@
         <div class="Popup" v-if="istanchaung">
         <!-- <div class="Popup"> -->
             <div class="shang">
-                <img src="/static/img/caidian2x.png" alt="">
-                <img src="/static/img/tijiao2x.png" alt="">
+                <!-- <img src="/static/img/caidian2x.png" alt=""> -->
+                <img src="/static/img/tijiao.png" alt="">
                 <img class="xs" @click="hidden" src="/static/img/assets/chahao.png" alt="">
             </div>
             <div class="zhong">
@@ -431,20 +431,12 @@ import { setTimeout } from 'timers';
     height: 30%;
     position: relative;
 }
-.shang > img {
-    position: absolute;
-}
 .shang > img:nth-child(1){
-    top: 15px;
-    left: 34%;
     width: 124px;
+    margin-top: 15px;
 }
 .shang > img:nth-child(2){
-    top: 18px;
-    left: 38%;
-    width: 101px;
-}
-.shang > img:nth-child(3){
+    position: absolute;
     top: 0px;
     right: 0px;
 }

+ 1 - 1
frontend/saas-portal-web/static/css/main.css

@@ -101,7 +101,7 @@ main > section {
     height: 100%;
     width: 100%;
     background: #000;
-    opacity: 0.3;
+    opacity: 0.35;
     z-index: 10000;
 }
 /* 登录弹窗 */

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


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


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