|
|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
+ <iframe hidden :src="setTokenPage"></iframe>
|
|
|
<!-- 遮罩 -->
|
|
|
<div class="zhezhao"></div>
|
|
|
<!-- 设置默认弹窗 -->
|
|
|
@@ -8,7 +9,7 @@
|
|
|
<div v-if="moren">
|
|
|
<div class="tc-text tc-queren"><span>是否确认设为默认企业?</span></div>
|
|
|
<div class="tc-anniu">
|
|
|
- <button @click="addmoren">确认</button>
|
|
|
+ <button @click="setDefault">确认</button>
|
|
|
<button @click="guanbitc">取消</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -23,13 +24,13 @@
|
|
|
<div v-if="ktsass">
|
|
|
<div class="tc-text tc-queren"><span>是否确认开通saas服务?</span></div>
|
|
|
<div class="tc-anniu">
|
|
|
- <button @click="addsass">确认</button>
|
|
|
+ <button @click="confirmSaas">确认</button>
|
|
|
<button @click="guanbitc">取消</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<div class="tc-text tc-conent"><span>开通成功</span></div>
|
|
|
- <div style="margin-top: 40px;"><span @click="offfuwu" class="gs-btn1 dianji">进入服务</span></div>
|
|
|
+ <div style="margin-top: 40px;"><span @click="showServeWin" class="gs-btn1 dianji">进入服务</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 该企业已开通服务弹窗 -->
|
|
|
@@ -59,7 +60,7 @@
|
|
|
<div class="gs-qiyebox">
|
|
|
<!-- 点击查看企业详情 -->
|
|
|
<div v-for="(d , i) in arr " :key="i" class="gs-xiangqing xs">
|
|
|
- <div class="left gs-xqleft" @click= "chakanxq">
|
|
|
+ <div class="left gs-xqleft" @click= "getEnterpriseInfo(d)">
|
|
|
<div class="gs-lefttext">
|
|
|
<p class="gs-qynema"><span>企业名称:</span>{{d.address}}</p>
|
|
|
<p><span>管理员:</span>{{d.name}}</p>
|
|
|
@@ -68,37 +69,30 @@
|
|
|
</div>
|
|
|
<div class="right gs-xqright">
|
|
|
<div class="gs-border">
|
|
|
- <span v-if= "d.saas_" class="gs-btn1 dianji" @click="jinru(d.id)">进入服务</span>
|
|
|
- <span v-else @click= "kaitong" class="gs-btn1 kaitong xs">开通服务</span>
|
|
|
+ <span v-if= "d.saas_" class="gs-btn1 dianji" @click="selectServe(d.id)">进入服务</span>
|
|
|
+ <span v-else @click= "showOpenServeWin" class="gs-btn1 kaitong xs">开通服务</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span v-if = "d.default_" class="gs-btn2 gs-btn3">默认企业</span>
|
|
|
- <span v-else @click="szmoren(i)" class="gs-btn2 xs">设为默认</span>
|
|
|
+ <span v-else @click="showDefaultWin(i)" class="gs-btn2 xs">设为默认</span>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="gs-xiangqing dotted">
|
|
|
<p class="gs-tianja">
|
|
|
- <span @click= "tianjia"><router-link to="/addenterprise">+添加企业</router-link></span>
|
|
|
+ <span @click= "addEnterprise"><router-link to="/addenterprise">+添加企业</router-link></span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <div class="gs-xiangqing dotted">
|
|
|
- <p class="gs-tianja">
|
|
|
- <span @click="tianjia"><router-link to="/addenterprise">+添加企业</router-link></span>
|
|
|
- </p>
|
|
|
- </div> -->
|
|
|
- <!-- </div>
|
|
|
- </div> -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import Session from '@/utils/session'
|
|
|
export default {
|
|
|
data(){
|
|
|
return {
|
|
|
- biaoqian: [],//标签数组
|
|
|
index:0,
|
|
|
ktsass: true,//开通sass
|
|
|
moren: true,//开通默认
|
|
|
@@ -107,15 +101,20 @@
|
|
|
arr: []//企业列表信息
|
|
|
}
|
|
|
},
|
|
|
+ computed :{
|
|
|
+ setTokenPage() {
|
|
|
+ return this.$url.web + '/set-token.html'
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted(){
|
|
|
this.boxheight();
|
|
|
// console.log("我是子路由的"+this.comdata)
|
|
|
- this.addqy();
|
|
|
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:"http://192.168.253.31:8560/api/account/accountCenter/company/list",
|
|
|
+ url: "/api/account/accountCenter/company/list",
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
mobile: mytoken.account.mobile
|
|
|
@@ -135,17 +134,17 @@
|
|
|
},
|
|
|
methods: {
|
|
|
//设置默认弹窗
|
|
|
- szmoren(i){
|
|
|
+ showDefaultWin(i){
|
|
|
this.index = i;
|
|
|
$(".szmoren").css("display","block");
|
|
|
$(".zhezhao").css("display","block");
|
|
|
},
|
|
|
//确认默认
|
|
|
- addmoren(){
|
|
|
+ setDefault(){
|
|
|
let i = this.index;
|
|
|
let token = this.mytoken.token;
|
|
|
this.$ajax({
|
|
|
- url:'http://192.168.253.31:8560/api/account/accountCenter/bind/defaultCompany',
|
|
|
+ url: '/api/account/accountCenter/bind/defaultCompany',
|
|
|
method: 'post',
|
|
|
data:{
|
|
|
companyId: this.arr[i].id,
|
|
|
@@ -166,14 +165,14 @@
|
|
|
|
|
|
},
|
|
|
//进入服务
|
|
|
- jinru(id){
|
|
|
+ selectServe(id){
|
|
|
let token = this.mytoken.token;
|
|
|
const frame = window.frames[window.frames.length - 1];
|
|
|
this.$ajax({
|
|
|
- url: 'http://192.168.253.31:8560/api/auth/switch/company?companyId='+id,
|
|
|
+ url: '/api/auth/switch/company?companyId='+id,//http://192.168.253.31:8560
|
|
|
method :'get',
|
|
|
headers: {
|
|
|
- "Authorization":token,
|
|
|
+ "Authorization":token
|
|
|
}
|
|
|
})
|
|
|
.then(res=>{
|
|
|
@@ -182,11 +181,8 @@
|
|
|
session.account.companyId=id;
|
|
|
session.span = session.timestamp - new Date().getTime();
|
|
|
session.token=mytoken;
|
|
|
- debugger
|
|
|
- localStorage.setItem('app-state-session',JSON.stringify(session));
|
|
|
frame.postMessage(JSON.stringify(session), '*');
|
|
|
- // window.location.href = 'http://192.168.0.181';
|
|
|
- // console.log('请求成功',res)
|
|
|
+ window.location.href = me.$url.web
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.log('请求失败',err)
|
|
|
@@ -194,36 +190,28 @@
|
|
|
|
|
|
},
|
|
|
//开通sass
|
|
|
- kaitong(){
|
|
|
+ showOpenServeWin(){
|
|
|
$(".ktsass").css('display','block');
|
|
|
$(".zhezhao").css("display","block");
|
|
|
this.ktsass = true;
|
|
|
},
|
|
|
- addsass(){//确认sass
|
|
|
+ confirmSaas(){//确认sass
|
|
|
this.ktsass = false;
|
|
|
},
|
|
|
//进入服务
|
|
|
- offfuwu(){
|
|
|
+ showServeWin(){
|
|
|
$(".ktsass").css('display','none');
|
|
|
$(".zhezhao").css("display","none");
|
|
|
},
|
|
|
//查看企业详情
|
|
|
- chakanxq(){
|
|
|
+ getEnterpriseInfo(d){
|
|
|
document.documentElement.scrollTop = 0;
|
|
|
- this.$router.push({name:'details',});
|
|
|
+ this.$router.push({path:'/details',query:{content:d}});
|
|
|
},
|
|
|
//添加企业
|
|
|
- tianjia(){
|
|
|
+ addEnterprise(){
|
|
|
document.documentElement.scrollTop = 0;
|
|
|
},
|
|
|
- addqy(){
|
|
|
-
|
|
|
- },
|
|
|
- //添加企业标签
|
|
|
- addbiaoqian(){
|
|
|
- this.biaoqian.push(this.$refs.biaoqian.value)
|
|
|
- this.tjbiaoqian = false;
|
|
|
- },
|
|
|
//关闭弹窗
|
|
|
guanbitc(){
|
|
|
$(".tanchuang").css("display","none");
|