history salary total 修复
This commit is contained in:
parent
5200af892d
commit
ac669510ed
@ -216,12 +216,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {onMounted, ref} from 'vue'
|
import {onMounted, ref} from 'vue'
|
||||||
import {useRouter} from 'vue-router'
|
|
||||||
import MobileHeader from '../components/MobileHeader.vue'
|
import MobileHeader from '../components/MobileHeader.vue'
|
||||||
import {getTeamMemberWork, getTeamReleasePolicy} from '../api/teamBill.js'
|
import {getTeamMemberWork, getTeamReleasePolicy} from '../api/teamBill.js'
|
||||||
import {getTeamId, getUserId} from "@/utils/userStore.js";
|
import {getTeamId, getUserId} from "@/utils/userStore.js";
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const totalSalary = ref('0.00')
|
const totalSalary = ref('0.00')
|
||||||
const showSalaryModal = ref(false)
|
const showSalaryModal = ref(false)
|
||||||
const showHelpModal = ref(false)
|
const showHelpModal = ref(false)
|
||||||
@ -308,10 +306,10 @@ const fetchWorkReports = async (userId) => {
|
|||||||
originalData: target // 保存原始数据用于详情显示
|
originalData: target // 保存原始数据用于详情显示
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 计算总薪资
|
// 计算总薪资 - 汇总所有 targets 中 target.settlementResult.ownSalary
|
||||||
const totalAmount = targets.reduce((sum, target) => {
|
const totalAmount = targets.reduce((sum, target) => {
|
||||||
const salary = parseFloat(target.target?.ownSalary || 0)
|
const ownSalary = parseFloat(target.target?.settlementResult?.ownSalary || 0)
|
||||||
return sum + salary
|
return sum + ownSalary
|
||||||
}, 0)
|
}, 0)
|
||||||
totalSalary.value = totalAmount.toFixed(2)
|
totalSalary.value = totalAmount.toFixed(2)
|
||||||
}
|
}
|
||||||
@ -351,26 +349,6 @@ const getStatusText = (status) => {
|
|||||||
return statusMap[status] || status
|
return statusMap[status] || status
|
||||||
}
|
}
|
||||||
|
|
||||||
// 格式化礼物数值
|
|
||||||
const formatGiftValue = (value) => {
|
|
||||||
if (!value || value === '0') return '0'
|
|
||||||
|
|
||||||
// 如果已经是格式化的字符串,直接返回
|
|
||||||
if (typeof value === 'string' && (value.includes('K') || value.includes('M'))) {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
|
|
||||||
const numValue = parseFloat(value)
|
|
||||||
if (isNaN(numValue)) return '0'
|
|
||||||
|
|
||||||
if (numValue >= 1000000) {
|
|
||||||
return `${(numValue / 1000000).toFixed(1)}M`
|
|
||||||
} else if (numValue >= 1000) {
|
|
||||||
return `${(numValue / 1000).toFixed(1)}K`
|
|
||||||
}
|
|
||||||
return numValue.toFixed(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 显示报告详情
|
// 显示报告详情
|
||||||
const showReportDetail = (report) => {
|
const showReportDetail = (report) => {
|
||||||
selectedReport.value = report
|
selectedReport.value = report
|
||||||
@ -392,21 +370,6 @@ const closeDetailModal = () => {
|
|||||||
dailyTargets.value = []
|
dailyTargets.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据礼物数值获取等级
|
|
||||||
const getLevelFromGiftValue = (giftValue) => {
|
|
||||||
const value = parseFloat(giftValue) || 0
|
|
||||||
if (value >= 214000) return 4
|
|
||||||
if (value >= 108000) return 3
|
|
||||||
if (value >= 65000) return 2
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将分钟转换为小时
|
|
||||||
const formatMinutesToHours = (minutes) => {
|
|
||||||
const mins = parseInt(minutes) || 0
|
|
||||||
return Math.round(mins / 60)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 格式化在线时间(为 Daily Salary 显示分钟数)
|
// 格式化在线时间(为 Daily Salary 显示分钟数)
|
||||||
const formatOnlineTime = (minutes) => {
|
const formatOnlineTime = (minutes) => {
|
||||||
const mins = parseInt(minutes) || 0
|
const mins = parseInt(minutes) || 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user