You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

350 lines
8.3 KiB

<template>
2 years ago
<view :class="['page', {oh: !per}]">
3 years ago
<image class="bg" src="@/static/image/index/index2.png" mode="widthFix"></image>
<view class="team">
2 years ago
<uni-data-picker class="picker-input" placeholder="切换团队" popup-title="切换团队" preload :clear-icon="false" :localdata="list" :map="{text: 'partnerClassificationName', value: 'teamId'}" v-model="teamId" @change="teamChange"></uni-data-picker>
</view>
<view class="banner">
<image class="img" src="@/static/image/index/index1.png" mode="widthFix"></image>
<view class="info">
<view class="title">城市合伙人招募中</view>
2 years ago
<view class="text">携手共创教育信息化新未来合伙共享产业互联领域新红利</view>
</view>
</view>
<ul class="entry">
2 years ago
<li v-if="auth('首页:客户')" @click="$util.to('../clients/clients')">
3 years ago
<image class="icon" src="@/static/image/index/index3.png" mode="widthFix"></image>
<view class="text">客户</view>
</li>
2 years ago
<li v-if="auth('首页:方案')" @click="$util.to('../plans/plans')">
3 years ago
<image class="icon" src="@/static/image/index/index4.png" mode="widthFix"></image>
<view class="text">方案</view>
</li>
2 years ago
<li v-if="auth('首页:订单')" @click="$util.to('/order/orders/orders')">
3 years ago
<image class="icon" src="@/static/image/index/index5.png" mode="widthFix"></image>
<view class="text">订单</view>
</li>
2 years ago
<li v-if="auth('首页:产品')" @click="$util.to('../products/products')">
3 years ago
<image class="icon" src="@/static/image/index/index6.png" mode="widthFix"></image>
<view class="text">产品</view>
</li>
</ul>
3 years ago
<view class="panel">
3 years ago
<view class="title" @click="toPanel(1)">
3 years ago
<view class="left">
3 years ago
<image class="icon" src="@/static/image/index/index8.png" mode="widthFix"></image>
3 years ago
销售进展
</view>
<view class="right">
3 years ago
<image class="date" src="@/static/image/index/index7.png" mode="widthFix"></image>
3 years ago
<text>本月</text>
3 years ago
<image class="arrow" src="@/static/image/index/index10.png" mode="widthFix"></image>
3 years ago
</view>
</view>
<view class="data first">
<view class="line">
<view class="item">
<view class="name">本月新增客户</view>
<view class="val">0</view>
3 years ago
</view>
<view class="item">
<view class="name">我的客户</view>
<view class="val">0</view>
3 years ago
</view>
</view>
<view class="line">
<view class="item">
<view class="name">本月新增产品试用</view>
<view class="val">0</view>
3 years ago
</view>
<view class="item">
<view class="name">试用客户</view>
<view class="val">0</view>
3 years ago
</view>
</view>
</view>
</view>
<view class="panel">
3 years ago
<view class="title y-title" @click="toPanel(1)">
3 years ago
<view class="left">
3 years ago
<image class="icon" src="@/static/image/index/index9.png" mode="widthFix"></image>
3 years ago
年度业绩看板
</view>
3 years ago
<image class="arrow" src="@/static/image/index/index10.png" mode="widthFix"></image>
3 years ago
</view>
<view class="data second">
<view class="line">
<view class="item">
<view class="val">0</view>
3 years ago
<view class="name">成交总额</view>
</view>
<view class="item">
<view class="val">0</view>
3 years ago
<view class="name">收益金额</view>
</view>
<view class="item">
<view class="val">0</view>
3 years ago
<view class="name">已到账</view>
</view>
<view class="item">
<view class="val">0</view>
3 years ago
<view class="name">未到账</view>
</view>
</view>
</view>
</view>
2 years ago
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
</view>
</template>
<script>
2 years ago
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js'
import { getTeamsByAccountId, getTheBusinessManagerIdsUnderTheTeam } from '@/apis/modules/client.js'
import { treeList } from '@/apis/modules/parner.js'
export default {
data() {
return {
2 years ago
per: true, // 是否有权限
2 years ago
// teamId: uni.getStorageSync('team').teamId || '',
teamId: '',
list: [],
id: '',
teamList: []
}
},
onShow() {
2 years ago
this.per = true
this.getInfo()
},
methods: {
2 years ago
// 初始化权限
initRole() {
if (!uni.getStorageSync('auth').includes('首页')) {
this.per = false
}
},
2 years ago
// 查询当前角色权限
getAuth() {
uni.getStorageSync('token') && getUserRolesPermissionMenu({
2 years ago
teamId: this.list.find(e => e.teamId === this.teamId).partnerClassificationId,
2 years ago
platformId: 4
}).then(({ permissionMenu }) => {
2 years ago
uni.hideLoading()
2 years ago
const auth = []
2 years ago
// 生成权限数组
2 years ago
const generateAuth = (list, parent) => {
list.map(e => {
const name = `${parent ? parent + ':' : ''}${e.name}`
auth.push(name)
generateAuth(e.children, name)
})
}
generateAuth(permissionMenu[0].children, '')
uni.setStorageSync('auth', auth)
2 years ago
this.$forceUpdate()
2 years ago
this.initRole()
2 years ago
}).catch(e => {
2 years ago
uni.hideLoading()
2 years ago
uni.setStorageSync('auth', [])
this.initRole()
})
2 years ago
},
// 获取团队
getInfo() {
2 years ago
uni.showLoading({
title: '加载中'
})
getTeamsByAccountId().then(({ data }) => {
2 years ago
data.map(e => {
const n = e.partnerClassificationList
2 years ago
e.id = n.id
2 years ago
e.teamId = e.isTeam == 1 ? e.partnerClassificationId : n.id
2 years ago
e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList
})
2 years ago
if (data.length) {
2 years ago
/**
* @description 如果是第一次进则默认选中第一个团队并把该团队的信息存入缓存
* 或者团队列表里没有该id则说明超管已经被转让也需要重新选中团队
*/
if (!this.teamId || !data.find(e => e.teamId == this.teamId)) {
2 years ago
this.teamId = data[0].teamId
uni.setStorageSync('team', data[0])
}
} else {
// 如果没有团队,则退出登录
2 years ago
uni.hideLoading()
2 years ago
uni.clearStorageSync()
uni.navigateTo({
url: '../login/login'
})
}
2 years ago
3 years ago
this.list = data
2 years ago
this.getAuth()
2 years ago
}).catch(e => {
uni.hideLoading()
})
},
// 团队选择回调
teamChange() {
2 years ago
const { teamId } = this
const e = this.list.find(e => e.teamId == teamId)
2 years ago
uni.setStorageSync('team', e)
this.getAuth()
3 years ago
},
// 提示暂未开放
toPanel(i) {
this.$util.errMsg('功能暂未开放!')
}
}
}
</script>
<style scoped lang="scss">
.page {
3 years ago
position: relative;
min-height: 100%;
padding: 30rpx 22rpx;
2 years ago
box-sizing: border-box;
3 years ago
}
.bg {
z-index: -1;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.team {
width: 300rpx;
margin-bottom: 30rpx;
}
.banner {
position: relative;
.img {
width: 100%;
}
.info {
position: absolute;
top: 80rpx;
left: 46rpx;
}
.title {
margin-bottom: 15rpx;
font-size: 36rpx;
font-weight: 600;
color: #001D67;
}
.text {
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
color: #001D67;
}
}
.entry {
display: flex;
justify-content: space-around;
align-items: center;
3 years ago
margin: 10rpx 0 30rpx;
text-align: center;
.icon {
width: 78rpx;
}
.text {
font-size: 28rpx;
color: #333;
}
}
3 years ago
.panel {
margin: 20rpx 10rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 17rpx 20rpx;
background: linear-gradient(90deg, #E5EFFF 0%, #FFFFFF 100%);
}
3 years ago
.y-title {
background: linear-gradient(90deg, #FFF5E5 0%, #FFFFFF 100%);
}
3 years ago
.left {
display: flex;
align-items: center;
font-size: 30rpx;
color: #333;
}
.right {
display: flex;
align-items: center;
font-size: 28rpx;
color: #333;
text {
margin: 0 15rpx 0 8rpx;
}
}
.icon {
width: 36rpx;
margin-right: 10rpx;
}
.date {
width: 26rpx;
}
.arrow {
width: 16rpx;
}
.data {
padding: 33rpx 36rpx;
}
.line {
display: flex;
}
.first {
.item:first-child {
width: 65%;
}
.name {
margin-bottom: 14rpx;
font-size: 24rpx;
color: #999;
}
.val {
font-size: 30rpx;
color: #333;
}
.line:first-child {
margin-bottom: 32rpx;
}
}
.second {
padding: 38rpx 36rpx;
.line {
justify-content: space-between;
}
.item {
text-align: center;
}
.val {
margin-bottom: 10rpx;
font-size: 30rpx;
color: #333;
}
.name {
font-size: 24rpx;
color: #999;
}
}
}
2 years ago
.oh {
overflow: hidden;
}
</style>