|
|
|
@ -14,19 +14,19 @@ |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<ul class="entry"> |
|
|
|
|
<li @click="$util.to('../clients/clients')"> |
|
|
|
|
<li v-if="auth('首页:客户')" @click="$util.to('../clients/clients')"> |
|
|
|
|
<image class="icon" src="@/static/image/index/index3.png" mode="widthFix"></image> |
|
|
|
|
<view class="text">客户</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="$util.to('../plans/plans')"> |
|
|
|
|
<li v-if="auth('首页:方案')" @click="$util.to('../plans/plans')"> |
|
|
|
|
<image class="icon" src="@/static/image/index/index4.png" mode="widthFix"></image> |
|
|
|
|
<view class="text">方案</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="$util.to('../orders/orders')"> |
|
|
|
|
<li v-if="auth('首页:订单')" @click="$util.to('../orders/orders')"> |
|
|
|
|
<image class="icon" src="@/static/image/index/index5.png" mode="widthFix"></image> |
|
|
|
|
<view class="text">订单</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="$util.to('../products/products')"> |
|
|
|
|
<li v-if="auth('首页:产品')" @click="$util.to('../products/products')"> |
|
|
|
|
<image class="icon" src="@/static/image/index/index6.png" mode="widthFix"></image> |
|
|
|
|
<view class="text">产品</view> |
|
|
|
|
</li> |
|
|
|
@ -98,6 +98,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view v-if="!per" class="per-mask">功能升级中,敬请期待...</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -107,6 +108,7 @@ |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
per: true, // 是否有权限 |
|
|
|
|
teamId: uni.getStorageSync('team').teamId || '', |
|
|
|
|
list: [], |
|
|
|
|
id: '', |
|
|
|
@ -114,50 +116,39 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.getInfo() |
|
|
|
|
this.initRole() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 初始化权限 |
|
|
|
|
initRole() { |
|
|
|
|
if (!uni.getStorageSync('auth').includes('首页')) { |
|
|
|
|
this.per = false |
|
|
|
|
} else { |
|
|
|
|
this.getInfo() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取团队 |
|
|
|
|
getInfo() { |
|
|
|
|
getTeamsByAccountId().then(({ data }) => { |
|
|
|
|
if (data.length) { |
|
|
|
|
// 全部分类 |
|
|
|
|
treeList().then(({ treeList }) => { |
|
|
|
|
this.teamList = treeList |
|
|
|
|
this.getId(treeList, '', data[0].teamId) |
|
|
|
|
// 依据团队id查询团队下的全部商务经理(集合) |
|
|
|
|
this.id && getTheBusinessManagerIdsUnderTheTeam(this.id).then(res => { |
|
|
|
|
data[0].businessManagerIds = res |
|
|
|
|
// 默认选择第一个团队 |
|
|
|
|
data.map(e => { |
|
|
|
|
const n = e.partnerClassificationList |
|
|
|
|
e.teamId = n.id |
|
|
|
|
e.partnerClassificationName = n.partnerClassificationName |
|
|
|
|
delete e.partnerClassificationList |
|
|
|
|
}) |
|
|
|
|
// 如果是第一次进,则默认选中第一个团队 |
|
|
|
|
if (data.length && !this.teamId) { |
|
|
|
|
this.teamId = data[0].teamId |
|
|
|
|
uni.setStorageSync('team', data[0]) |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
} |
|
|
|
|
this.list = data |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}, |
|
|
|
|
// 查询返回的teamId所属的团队id |
|
|
|
|
getId(list, parentId, id) { |
|
|
|
|
list.map(e => { |
|
|
|
|
if (e.id === id) { |
|
|
|
|
this.id = e.isTeam ? id : parentId |
|
|
|
|
} else { |
|
|
|
|
this.getId(e.children, e.id, id) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 团队选择回调 |
|
|
|
|
teamChange() { |
|
|
|
|
const { teamId } = this |
|
|
|
|
const e = this.list.find(e => e.teamId == teamId) |
|
|
|
|
if (e) { |
|
|
|
|
this.getId(this.teamList, '', e.teamId) |
|
|
|
|
this.id && getTheBusinessManagerIdsUnderTheTeam(this.id).then(res => { |
|
|
|
|
e.businessManagerIds = res |
|
|
|
|
uni.setStorageSync('team', e) |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 提示暂未开放 |
|
|
|
|
toPanel(i) { |
|
|
|
|