|
@@ -34,7 +34,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card">
|
|
<div class="card">
|
|
|
<h3>佣金率</h3>
|
|
<h3>佣金率</h3>
|
|
|
- <p class="stat-value">{{ formatRate(teamStats?.commissionRate) }}%</p>
|
|
|
|
|
|
|
+ <p class="stat-value">{{ formatRate(teamStats?.averageCommissionRate) }}%</p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -84,7 +84,7 @@
|
|
|
import { ref, onMounted, computed, inject, watch } from 'vue'
|
|
import { ref, onMounted, computed, inject, watch } from 'vue'
|
|
|
import { useUserStore } from '@/stores/user'
|
|
import { useUserStore } from '@/stores/user'
|
|
|
import { useTeamStore } from '@/stores/team'
|
|
import { useTeamStore } from '@/stores/team'
|
|
|
-import { getAllTeamStatistics, getTeamStatistics, getIncomeStatistics } from '@/services/api'
|
|
|
|
|
|
|
+import { getAllTeamStatistics, getIncomeStatistics } from '@/services/api'
|
|
|
import Chart from 'chart.js/auto'
|
|
import Chart from 'chart.js/auto'
|
|
|
import Select from 'primevue/select'
|
|
import Select from 'primevue/select'
|
|
|
import DataTable from 'primevue/datatable'
|
|
import DataTable from 'primevue/datatable'
|
|
@@ -171,8 +171,12 @@ const loadTeamStats = async () => {
|
|
|
}
|
|
}
|
|
|
} else if (isTeam.value) {
|
|
} else if (isTeam.value) {
|
|
|
console.log('加载队长团队统计数据')
|
|
console.log('加载队长团队统计数据')
|
|
|
- const data = await getTeamStatistics()
|
|
|
|
|
|
|
+ const data = await getAllTeamStatistics()
|
|
|
console.log('队长团队统计数据:', data)
|
|
console.log('队长团队统计数据:', data)
|
|
|
|
|
+ // 为 team 角色添加团队名称
|
|
|
|
|
+ if (data.allTeams && data.allTeams.length > 0) {
|
|
|
|
|
+ data.name = data.allTeams[0].name
|
|
|
|
|
+ }
|
|
|
teamStats.value = data
|
|
teamStats.value = data
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|