From 650f714f48b966181a628106490244bed6d0c69c Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Fri, 21 Nov 2025 16:46:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=A2=E9=98=9F=E6=94=B6=E5=85=A5?= =?UTF-8?q?=E9=A1=B5):=20=E6=80=BB=E6=94=B6=E5=85=A5=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=B9=B6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AgencyCenter/TeamBill.vue | 42 ++++++++++++++++------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/views/AgencyCenter/TeamBill.vue b/src/views/AgencyCenter/TeamBill.vue index f67a97b..cc9185c 100644 --- a/src/views/AgencyCenter/TeamBill.vue +++ b/src/views/AgencyCenter/TeamBill.vue @@ -24,7 +24,7 @@ >
{{ t('history_team_income') }}
-
$0
+
${{ totalIncome }}
@@ -180,8 +180,8 @@ const policyData = ref(null) const loadingPolicy = ref(false) // 数据 -const billList = ref([]) -const selectedBillMembers = ref([]) +const billList = ref([]) //账单列表 +const totalIncome = ref(0) //历史收益 // 格式化状态 const formatStatus = (status) => { @@ -201,19 +201,26 @@ const fetchTeamBill = async (teamId) => { const response = await getTeamBill(teamId) if (response.status && response.body) { - billList.value = response.body.map((bill) => ({ - ...bill, - // 将时间戳转换为可读格式 - date: `${bill.billBelong.toString().substring(0, 4)}.${bill.billBelong - .toString() - .substring(4, 6)}`, - status: formatStatus(bill.status), - hostSalary: formatSalaryValue(bill.settleResult?.memberSalary || 0) || '-', - agencySalary: formatSalaryValue(bill.settleResult?.ownSalary || 0) || '-', - totalSalary: formatSalaryValue(bill.settleResult?.totalSalary || 0) || '-', - createTimeFormatted: new Date(bill.createTime).toLocaleDateString(), - updateTimeFormatted: new Date(bill.updateTime).toLocaleDateString(), - })) + let historyTotalIncome = 0 // 历史收入累加 + billList.value = response.body.map((bill) => { + if (bill.status == 'SETTLED') { + historyTotalIncome += bill.settleResult?.totalSalary || 0 + } + return { + ...bill, + // 将时间戳转换为可读格式 + date: `${bill.billBelong.toString().substring(0, 4)}.${bill.billBelong + .toString() + .substring(4, 6)}`, + status: formatStatus(bill.status), + hostSalary: formatSalaryValue(bill.settleResult?.memberSalary || 0) || '-', + agencySalary: formatSalaryValue(bill.settleResult?.ownSalary || 0) || '-', + totalSalary: formatSalaryValue(bill.settleResult?.totalSalary || 0) || '-', + createTimeFormatted: new Date(bill.createTime).toLocaleDateString(), + updateTimeFormatted: new Date(bill.updateTime).toLocaleDateString(), + } + }) + totalIncome.value = historyTotalIncome.toFixed(2) } } catch (error) { console.error('Failed to fetch team bill:', error) @@ -323,7 +330,6 @@ const getStatusClass = (status) => { const showBillDetail = async (bill) => { // 获取该账单的成员工作信息 const membersData = await fetchBillWorkMembers(bill.id) - selectedBillMembers.value = membersData selectedBill.value = { ...bill, members: membersData,