history salary total 修复

This commit is contained in:
tianfeng 2025-08-26 11:36:27 +00:00
parent 5200af892d
commit ac669510ed

View File

@ -216,12 +216,10 @@
<script setup>
import {onMounted, ref} from 'vue'
import {useRouter} from 'vue-router'
import MobileHeader from '../components/MobileHeader.vue'
import {getTeamMemberWork, getTeamReleasePolicy} from '../api/teamBill.js'
import {getTeamId, getUserId} from "@/utils/userStore.js";
const router = useRouter()
const totalSalary = ref('0.00')
const showSalaryModal = ref(false)
const showHelpModal = ref(false)
@ -308,10 +306,10 @@ const fetchWorkReports = async (userId) => {
originalData: target //
}))
//
// - targets target.settlementResult.ownSalary
const totalAmount = targets.reduce((sum, target) => {
const salary = parseFloat(target.target?.ownSalary || 0)
return sum + salary
const ownSalary = parseFloat(target.target?.settlementResult?.ownSalary || 0)
return sum + ownSalary
}, 0)
totalSalary.value = totalAmount.toFixed(2)
}
@ -351,26 +349,6 @@ const getStatusText = (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) => {
selectedReport.value = report
@ -392,21 +370,6 @@ const closeDetailModal = () => {
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
const formatOnlineTime = (minutes) => {
const mins = parseInt(minutes) || 0