|
|
@@ -2,11 +2,11 @@
|
|
|
<div>
|
|
|
<iframe hidden :src="setTokenPage"></iframe>
|
|
|
<!-- 遮罩 -->
|
|
|
- <div class="zhezhao"></div>
|
|
|
+ <div class="zhezhao" v-if="issetDefault || isOpensaas"></div>
|
|
|
<!-- 设置默认弹窗 -->
|
|
|
- <div class="tanchuang szmoren">
|
|
|
+ <div class="tanchuang szmoren" v-if="issetDefault">
|
|
|
<div class="over"><img @click="guanbitc" class="right xs" src="/static/img/qiye/chahao.png" alt=""></div>
|
|
|
- <div v-if="moren">
|
|
|
+ <div v-if="isDefault">
|
|
|
<div class="tc-text tc-queren"><span>是否确认设为默认企业?</span></div>
|
|
|
<div class="tc-anniu">
|
|
|
<button @click="setDefault">确认</button>
|
|
|
@@ -19,7 +19,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 开通sass服务弹窗 -->
|
|
|
- <div class="tanchuang ktsass">
|
|
|
+ <div class="tanchuang ktsass" v-if="isOpensaas">
|
|
|
<div class="over"><img @click="guanbitc" class="right xs" src="/static/img/qiye/chahao.png" alt=""></div>
|
|
|
<div v-if="ktsass">
|
|
|
<div class="tc-text tc-queren"><span>是否确认开通saas服务?</span></div>
|
|
|
@@ -46,7 +46,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 开通10个不能继续开通 -->
|
|
|
- <div class="tanchuang nokaitong" style="display:none">
|
|
|
+ <div class="tanchuang nokaitong" style="display:none" v-if="isNoopen">
|
|
|
<div class="over"><img @click="guanbitc" class="right xs" src="/static/img/qiye/chahao.png" alt=""></div>
|
|
|
<div>
|
|
|
<div class="tc-conent"><img src="/static/img/qiye/buneng kaitong@1x.png" alt=""></div>
|
|
|
@@ -57,7 +57,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="gs-qiyebox">
|
|
|
+ <div class="gs-qiyebox" ref="qiyebox">
|
|
|
<!-- 点击查看企业详情 -->
|
|
|
<div v-for="(d , i) in arr " :key="i" class="gs-xiangqing xs">
|
|
|
<div class="left gs-xqleft" @click= "getEnterpriseInfo(d)">
|
|
|
@@ -93,10 +93,14 @@
|
|
|
export default {
|
|
|
data(){
|
|
|
return {
|
|
|
+ issetDefault: false,//设置默认
|
|
|
+ isOpensaas: false,//开通saas弹窗
|
|
|
+ isNoopen: false,//开通10个不能继续开通
|
|
|
index:0,
|
|
|
- ktsass: true,//开通sass
|
|
|
- moren: true,//开通默认
|
|
|
+ ktsass: true,//确认开通saas
|
|
|
+ isDefault: true,//开通默认
|
|
|
comdata: this.$store.state.data,//登录成功后的本地数据
|
|
|
+ isAutoLogin: this.$store.state.isAutoLogin,
|
|
|
mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
|
|
|
arr: []//企业列表信息
|
|
|
}
|
|
|
@@ -106,15 +110,19 @@
|
|
|
return this.$url.web + '/set-token.html'
|
|
|
}
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ arr:function(){
|
|
|
+ this.$nextTick(function(){
|
|
|
+ this.boxheight();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted(){
|
|
|
- this.boxheight();
|
|
|
- // console.log("我是子路由的"+this.comdata)
|
|
|
let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
|
|
|
let token = String(mytoken.token);
|
|
|
// console.log(mytoken.account)
|
|
|
- console.log(this.$url.api)
|
|
|
this.$ajax({
|
|
|
- url: "/api/account/accountCenter/company/list",
|
|
|
+ url: this.$url.api+"/api/account/accountCenter/company/list",
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
mobile: mytoken.account.mobile
|
|
|
@@ -125,26 +133,36 @@
|
|
|
}
|
|
|
})
|
|
|
.then(res=>{
|
|
|
- this.arr = res.data.data
|
|
|
+ this.arr = res.data.data.spaces;
|
|
|
+ let hasCompany = res.data.data.hasDefaultCompany;
|
|
|
+ let companyId = res.data.data.defaultCompanyId;
|
|
|
+ if (this.isAutoLogin) {
|
|
|
+ if (hasCompany) {
|
|
|
+ this.selectServe(companyId)
|
|
|
+ }
|
|
|
+ this.isAutoLogin = false
|
|
|
+ }
|
|
|
// console.log(res.data.data)
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.log("请求失败",err)
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
//设置默认弹窗
|
|
|
showDefaultWin(i){
|
|
|
this.index = i;
|
|
|
- $(".szmoren").css("display","block");
|
|
|
- $(".zhezhao").css("display","block");
|
|
|
+ this.issetDefault = true;
|
|
|
+ // $(".szmoren").css("display","block");
|
|
|
+ // $(".zhezhao").css("display","block");
|
|
|
},
|
|
|
//确认默认
|
|
|
setDefault(){
|
|
|
let i = this.index;
|
|
|
let token = this.mytoken.token;
|
|
|
this.$ajax({
|
|
|
- url: '/api/account/accountCenter/bind/defaultCompany',
|
|
|
+ url: this.$url.api+'/api/account/accountCenter/bind/defaultCompany',
|
|
|
method: 'post',
|
|
|
data:{
|
|
|
companyId: this.arr[i].id,
|
|
|
@@ -157,7 +175,7 @@
|
|
|
})
|
|
|
.then(res=>{
|
|
|
// console.log('请求成功',res);
|
|
|
- this.moren = false;
|
|
|
+ this.isDefault = false;
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.log('请求失败',err);
|
|
|
@@ -169,7 +187,7 @@
|
|
|
let token = this.mytoken.token;
|
|
|
const frame = window.frames[window.frames.length - 1];
|
|
|
this.$ajax({
|
|
|
- url: '/api/auth/switch/company?companyId='+id,//http://192.168.253.31:8560
|
|
|
+ url: this.$url.api+'/api/auth/switch/company?companyId='+id,//http://192.168.253.31:8560
|
|
|
method :'get',
|
|
|
headers: {
|
|
|
"Authorization":token
|
|
|
@@ -182,7 +200,7 @@
|
|
|
session.span = session.timestamp - new Date().getTime();
|
|
|
session.token=mytoken;
|
|
|
frame.postMessage(JSON.stringify(session), '*');
|
|
|
- window.location.href = me.$url.web
|
|
|
+ window.location.href = this.$url.web
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.log('请求失败',err)
|
|
|
@@ -191,8 +209,9 @@
|
|
|
},
|
|
|
//开通sass
|
|
|
showOpenServeWin(){
|
|
|
- $(".ktsass").css('display','block');
|
|
|
- $(".zhezhao").css("display","block");
|
|
|
+ this.isOpensaas = true;
|
|
|
+ // $(".ktsass").css('display','block');
|
|
|
+ // $(".zhezhao").css("display","block");
|
|
|
this.ktsass = true;
|
|
|
},
|
|
|
confirmSaas(){//确认sass
|
|
|
@@ -200,8 +219,9 @@
|
|
|
},
|
|
|
//进入服务
|
|
|
showServeWin(){
|
|
|
- $(".ktsass").css('display','none');
|
|
|
- $(".zhezhao").css("display","none");
|
|
|
+ this.isOpensaas = false
|
|
|
+ // $(".ktsass").css('display','none');
|
|
|
+ // $(".zhezhao").css("display","none");
|
|
|
},
|
|
|
//查看企业详情
|
|
|
getEnterpriseInfo(d){
|
|
|
@@ -214,13 +234,17 @@
|
|
|
},
|
|
|
//关闭弹窗
|
|
|
guanbitc(){
|
|
|
- $(".tanchuang").css("display","none");
|
|
|
- $(".zhezhao").css("display","none");
|
|
|
+ this.issetDefault = false;
|
|
|
+ this.isOpensaas = false
|
|
|
+ // $(".tanchuang").css("display","none");
|
|
|
+ // $(".zhezhao").css("display","none");
|
|
|
},
|
|
|
//没有内容也要有一定的高度
|
|
|
boxheight(){
|
|
|
- let H = $(".gs-qiyebox").height();
|
|
|
- if (H <= 500) {
|
|
|
+ let H = this.$refs.qiyebox.offsetHeight;
|
|
|
+ // let H = $(".gs-qiyebox").height();
|
|
|
+ console.log(H)
|
|
|
+ if (H < 300) {
|
|
|
$(".gs-qiyebox").css("height",'500px')
|
|
|
} else {
|
|
|
$(".gs-qiyebox").css("height",'')
|
|
|
@@ -232,6 +256,9 @@
|
|
|
|
|
|
<style scoped>
|
|
|
.zhezhao {
|
|
|
- display: none;
|
|
|
+ /* display: none */
|
|
|
+}
|
|
|
+.tanchuang {
|
|
|
+ /* display: none */
|
|
|
}
|
|
|
</style>
|