519 lines
14 KiB
Vue
519 lines
14 KiB
Vue
<template>
|
||
<div class="fullPage gradient-background-circles">
|
||
<!-- 顶部导航 -->
|
||
<GeneralHeader
|
||
:showLanguageList="true"
|
||
title="My BD Leader Teams"
|
||
color="black"
|
||
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
||
/>
|
||
|
||
<!-- 主要内容 -->
|
||
<div
|
||
style="
|
||
padding: 16px;
|
||
position: relative;
|
||
z-index: 2;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 12px;
|
||
"
|
||
>
|
||
<!-- 总收入信息 -->
|
||
<div
|
||
style="
|
||
background-color: white;
|
||
border-radius: 12px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
|
||
padding: 16px;
|
||
border: 1px solid #e5e7eb;
|
||
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
"
|
||
>
|
||
<div style="display: flex; align-items: flex-end">
|
||
<div style="font-weight: 600; font-size: 0.9em">Total income:</div>
|
||
<div style="font-weight: 700">${{ TeamOverview?.totalIncome || 0 }}</div>
|
||
</div>
|
||
<div style="display: flex; align-items: flex-end">
|
||
<div style="font-weight: 600; font-size: 0.9em">Previous period income:</div>
|
||
<div style="font-weight: 700">${{ TeamOverview?.previousPeriodIncome || 0 }}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- BDLeader团队收入信息 -->
|
||
<div
|
||
style="
|
||
background-color: white;
|
||
border-radius: 12px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
|
||
padding: 16px;
|
||
border: 1px solid #e5e7eb;
|
||
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
"
|
||
>
|
||
<!-- 团队信息 -->
|
||
<div style="font-weight: 700">BD Leaders: {{ TeamOverview?.memberCount || 0 }}</div>
|
||
<div style="font-size: 0.9em; font-weight: 600">
|
||
Team Total Income: ${{ TeamOverview?.teamTotalIncome || 0 }}
|
||
</div>
|
||
|
||
<!-- BDLeader成员列表 -->
|
||
<div
|
||
v-for="BDLeaderInfo in TeamOverview?.members"
|
||
style="
|
||
position: relative;
|
||
|
||
background-color: white;
|
||
padding: 14px 10px;
|
||
border-radius: 12px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
gap: 4px;
|
||
"
|
||
>
|
||
<!-- 头像 -->
|
||
<div
|
||
style="
|
||
width: 15%;
|
||
align-self: stretch;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
"
|
||
>
|
||
<img
|
||
:src="BDLeaderInfo.avatar || ''"
|
||
alt=""
|
||
style="
|
||
display: block;
|
||
width: 100%;
|
||
aspect-ratio: 1/1;
|
||
border-radius: 50%;
|
||
object-fit: cover;
|
||
"
|
||
@error="handleAvatarImageError"
|
||
/>
|
||
</div>
|
||
|
||
<!-- 基本信息 -->
|
||
<div
|
||
style="
|
||
flex: 1;
|
||
min-width: 0;
|
||
align-self: stretch;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-around;
|
||
gap: 4px;
|
||
"
|
||
>
|
||
<div
|
||
style="
|
||
font-weight: 700;
|
||
width: 100%;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
"
|
||
>
|
||
{{ BDLeaderInfo.userName || '-' }}
|
||
</div>
|
||
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||
ID:{{ BDLeaderInfo.account || '-' }}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 收入信息 -->
|
||
<div
|
||
style="
|
||
width: auto;
|
||
min-width: 0;
|
||
align-self: stretch;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
"
|
||
>
|
||
<div style="font-size: 0.8em; font-weight: 500; text-align: end">
|
||
Number Of Agencies Personnel: {{ BDLeaderInfo?.subMemberCount || 0 }}
|
||
</div>
|
||
<div style="font-size: 0.8em; font-weight: 500; text-align: end">
|
||
Total Income: ${{ BDLeaderInfo?.totalIncome || 0 }}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 更多按钮 -->
|
||
<div
|
||
style="
|
||
font-size: 0.8em;
|
||
|
||
position: absolute;
|
||
bottom: 4%;
|
||
right: 4%;
|
||
color: #bb92ff;
|
||
font-weight: 500;
|
||
"
|
||
@click="incomeShow(BDLeaderInfo)"
|
||
>
|
||
{{ t('more') }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 遮罩层 -->
|
||
<maskLayer :maskLayerShow="maskLayerShow" @click="closedPopup">
|
||
<div style="position: fixed; bottom: 0; width: 100%">
|
||
<!-- 某个BDLeader的收益 -->
|
||
<div
|
||
v-if="showIncome"
|
||
style="
|
||
background: white;
|
||
border-radius: 16px 16px 0 0;
|
||
max-height: 80vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
padding: 10px 12px 30px;
|
||
"
|
||
class="overflow-y-auto"
|
||
@click.stop
|
||
>
|
||
<div style="display: flex; justify-content: center; align-items: center">
|
||
<div style="margin: 0; font-weight: 600; color: #333">
|
||
BD Leader's lD: {{ moreUserAccount }}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 总体信息 -->
|
||
<div
|
||
style="
|
||
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
|
||
border-radius: 8px;
|
||
padding: 12px;
|
||
margin: 0 4px;
|
||
"
|
||
>
|
||
<div>
|
||
<div style="display: grid; gap: 4px">
|
||
<div style="font-size: 0.9em; font-weight: 600">
|
||
{{ t('total_income') }}: ${{ moreDetail?.totalIncome || 0 }}
|
||
</div>
|
||
<div style="font-size: 0.9em; font-weight: 600">
|
||
{{ t('previous_period_income') }}: ${{ moreDetail?.previousPeriodIncome || 0 }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="font-weight: 600">Income Details:</div>
|
||
|
||
<!-- 历史薪资列表 -->
|
||
<div style="overflow-y: auto" class="salaryList">
|
||
<div
|
||
style="display: flex; flex-direction: column; gap: 8px"
|
||
v-for="incomeInfo in moreDetail?.incomeDetails"
|
||
>
|
||
<!-- 进行中 -->
|
||
<historySalary
|
||
v-if="incomeInfo.status === 'In Progress'"
|
||
type="In Progress"
|
||
@showMore="historyShow(incomeInfo)"
|
||
>
|
||
<template v-slot:content>
|
||
<div>{{ incomeInfo.settlementPeriod }}</div>
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px">
|
||
<div>Agency: {{ incomeInfo.memberCount }}</div>
|
||
<!-- 团队收入 -->
|
||
<div>Team total Income: ${{ incomeInfo.teamTotalIncome }}</div>
|
||
</div>
|
||
</template>
|
||
</historySalary>
|
||
|
||
<!-- 已完成 -->
|
||
<historySalary
|
||
v-if="incomeInfo.status === 'Completed'"
|
||
type="Completed"
|
||
@showMore="historyShow(incomeInfo)"
|
||
>
|
||
<template v-slot:content>
|
||
<div>{{ incomeInfo.settlementPeriod }}</div>
|
||
<div>Agency: {{ incomeInfo.memberCount }}</div>
|
||
<!-- 团队收入 -->
|
||
<div>Team total income:${{ incomeInfo.teamTotalIncome }}</div>
|
||
</template>
|
||
</historySalary>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 某个时期的BD收益详情 -->
|
||
<div
|
||
v-if="showHistory"
|
||
style="
|
||
background: white;
|
||
border-radius: 16px 16px 0 0;
|
||
max-height: 60vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
padding: 10px 12px 30px;
|
||
"
|
||
class="overflow-y-auto"
|
||
@click.stop
|
||
>
|
||
<div style="font-weight: 600">{{ incomeDetailsItem.settlementPeriod }}</div>
|
||
<div style="display: flex; justify-content: space-between">
|
||
<div style="font-size: 0.8em; font-weight: 600">
|
||
Agency: {{ incomeDetailsItem.memberCount }}
|
||
</div>
|
||
<div style="font-size: 0.8em; font-weight: 600">
|
||
Team Total income: ${{ incomeDetailsItem.teamTotalIncome }}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- BD列表 -->
|
||
<div
|
||
v-for="member in incomeDetailsItem.members"
|
||
style="
|
||
background-color: white;
|
||
padding: 14px 10px;
|
||
border-radius: 12px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 4px;
|
||
"
|
||
>
|
||
<!-- 头像 -->
|
||
<div
|
||
style="
|
||
width: 15%;
|
||
align-self: stretch;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
"
|
||
>
|
||
<img
|
||
:src="member.avatar || ''"
|
||
alt=""
|
||
style="
|
||
display: block;
|
||
width: 100%;
|
||
aspect-ratio: 1/1;
|
||
border-radius: 50%;
|
||
object-fit: cover;
|
||
"
|
||
@error="handleAvatarImageError"
|
||
/>
|
||
</div>
|
||
|
||
<!-- 基本信息 -->
|
||
<div
|
||
style="
|
||
flex: 1;
|
||
min-width: 0;
|
||
align-self: stretch;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-around;
|
||
gap: 4px;
|
||
"
|
||
>
|
||
<div
|
||
style="
|
||
font-weight: 700;
|
||
width: 100%;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
"
|
||
>
|
||
{{ member.userName }}
|
||
</div>
|
||
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||
ID:{{ member.account }}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 收入信息 -->
|
||
<div
|
||
style="
|
||
width: auto;
|
||
min-width: 0;
|
||
align-self: stretch;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-around;
|
||
"
|
||
>
|
||
<div style="font-size: 0.8em; font-weight: 500">BD Income:</div>
|
||
<div style="font-size: 0.8em; font-weight: 500">${{ member.income }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</maskLayer>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { computed, onMounted, ref } from 'vue'
|
||
import { useI18n } from 'vue-i18n'
|
||
import { setDocumentDirection } from '@/locales/i18n'
|
||
import { handleAvatarImageError } from '@/utils/imageHandler.js'
|
||
|
||
import {
|
||
apiGetTeamOverview, //查询BD团队概览
|
||
apiGetTeamMemberDetail, // 查询BD团队成员详情(More弹框)
|
||
} from '@/api/admin.js'
|
||
|
||
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||
import maskLayer from '@/components/MaskLayer.vue'
|
||
import historySalary from './components/historySalary.vue'
|
||
|
||
const { t, locale } = useI18n()
|
||
|
||
// 监听语言变化并设置文档方向
|
||
locale.value && setDocumentDirection(locale.value)
|
||
|
||
const TeamOverview = ref(null) //团队概览
|
||
const moreUserAccount = ref('') //选中的成员id
|
||
const moreDetail = ref(null) //某个成员的详情
|
||
const incomeDetailsItem = ref(null) //某个时期的收益详情
|
||
|
||
const showIncome = ref(false)
|
||
const showHistory = ref(false)
|
||
// 遮罩层显示状态
|
||
const maskLayerShow = computed(() => showIncome.value || showHistory.value)
|
||
|
||
const incomeShow = (BDLeaderInfo) => {
|
||
console.log('点击了收入按钮')
|
||
console.log('BDLeaderInfo.userId:', BDLeaderInfo.userId)
|
||
moreUserAccount.value = BDLeaderInfo.account
|
||
getTeamMemberDetail(BDLeaderInfo.userId)
|
||
|
||
showIncome.value = true
|
||
}
|
||
|
||
const historyShow = (incomeInfo) => {
|
||
console.log('点击了历史薪资按钮')
|
||
console.log('incomeInfo:', incomeInfo)
|
||
incomeDetailsItem.value = incomeInfo
|
||
|
||
showIncome.value = false
|
||
showHistory.value = true
|
||
}
|
||
|
||
// 关闭弹窗
|
||
const closedPopup = () => {
|
||
showIncome.value = false
|
||
showHistory.value = false
|
||
moreUserAccount.value = ''
|
||
moreDetail.value = null
|
||
incomeDetailsItem.value = null
|
||
}
|
||
|
||
// 获取任务列表
|
||
const getTeamOverview = async () => {
|
||
let data = {
|
||
type: 'BD_LEADER',
|
||
}
|
||
const resInvitedList = await apiGetTeamOverview(data)
|
||
console.log('任务列表:', resInvitedList)
|
||
if (resInvitedList.status && resInvitedList.body) {
|
||
TeamOverview.value = resInvitedList.body
|
||
}
|
||
}
|
||
|
||
// 查询BD团队成员详情(More弹框)
|
||
const getTeamMemberDetail = async (userId) => {
|
||
let data = {
|
||
targetId: userId,
|
||
type: 'BD',
|
||
}
|
||
const resInvitedList = await apiGetTeamMemberDetail(data)
|
||
console.log('任务列表:', resInvitedList)
|
||
if (resInvitedList.status && resInvitedList.body) {
|
||
moreDetail.value = resInvitedList.body
|
||
}
|
||
}
|
||
|
||
// 初始化数据
|
||
const init = () => {
|
||
getTeamOverview()
|
||
}
|
||
|
||
onMounted(() => {
|
||
init()
|
||
})
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
* {
|
||
color: rgba(0, 0, 0, 0.8);
|
||
font-family: 'SF Pro Text';
|
||
}
|
||
|
||
.fullPage {
|
||
max-height: 100vh;
|
||
overflow-y: auto;
|
||
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
||
background-color: #ffffff;
|
||
background-image: url(../../assets/images/secondBg.png);
|
||
}
|
||
|
||
.fullPage::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
|
||
.overflow-y-auto {
|
||
overflow-y: auto;
|
||
}
|
||
|
||
.overflow-y-auto::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
|
||
.salaryList::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
|
||
@media screen and (max-width: 360px) {
|
||
* {
|
||
font-size: 10px;
|
||
}
|
||
}
|
||
|
||
@media screen and (min-width: 360px) {
|
||
* {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
@media screen and (min-width: 768px) {
|
||
* {
|
||
font-size: 24px;
|
||
}
|
||
}
|
||
|
||
@media screen and (min-width: 1024px) {
|
||
* {
|
||
font-size: 32px;
|
||
}
|
||
}
|
||
</style>
|