细节优化

This commit is contained in:
18631081161 2026-03-04 01:14:52 +08:00
parent 461bc64a6f
commit 962920b2b0
2 changed files with 42 additions and 10 deletions

View File

@ -79,7 +79,13 @@
<small class="text-muted">UID: {{ row.user?.uid || '-' }}</small>
</template>
</el-table-column>
<el-table-column label="金额" width="180">
<el-table-column prop="serviceContent" label="服务内容" min-width="180" show-overflow-tooltip />
<el-table-column prop="paymentTime" label="支付时间" width="160">
<template #default="{ row }">
{{ formatDate(row.paymentTime) }}
</template>
</el-table-column>
<el-table-column label="支付金额" width="140">
<template #default="{ row }">
<div class="amount-info">
<span v-if="row.amountPeso" class="amount peso">{{ row.amountPeso }}</span>
@ -88,13 +94,25 @@
</div>
</template>
</el-table-column>
<el-table-column prop="serviceContent" label="服务内容" min-width="200" show-overflow-tooltip />
<el-table-column prop="paymentTime" label="支付时间" width="160">
<el-table-column label="成本金额" width="140">
<template #default="{ row }">
{{ formatDate(row.paymentTime) }}
<div class="amount-info">
<span v-if="row.costPeso" class="amount cost">{{ row.costPeso }}</span>
<span v-if="row.costRmb" class="amount cost">¥{{ row.costRmb }}</span>
<span v-if="!row.costPeso && !row.costRmb" class="no-data">-</span>
</div>
</template>
</el-table-column>
<el-table-column label="佣金" width="150">
<el-table-column label="营利金额" width="140">
<template #default="{ row }">
<div class="amount-info">
<span v-if="row.amountPeso" class="amount profit">{{ (parseFloat(row.amountPeso || 0) - parseFloat(row.costPeso || 0)).toFixed(2) }}</span>
<span v-if="row.amountRmb" class="amount profit">¥{{ (parseFloat(row.amountRmb || 0) - parseFloat(row.costRmb || 0)).toFixed(2) }}</span>
<span v-if="!row.amountPeso && !row.amountRmb && row.amount" class="amount profit">¥{{ (parseFloat(row.amount || 0)).toFixed(2) }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="佣金" width="120">
<template #default="{ row }">
<div v-if="row.commissions && row.commissions.length > 0" class="commissions-info">
<span
@ -109,14 +127,14 @@
<span v-else class="no-commission"></span>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100">
<el-table-column prop="status" label="状态" width="80">
<template #default="{ row }">
<el-tag :type="row.status === 'active' ? 'success' : 'danger'">
<el-tag :type="row.status === 'active' ? 'success' : 'danger'" size="small">
{{ row.status === 'active' ? '有效' : '已取消' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="showDetails(row)">详情</el-button>
<el-button
@ -680,6 +698,18 @@ onMounted(() => {
&.rmb {
color: #e6a23c;
}
&.cost {
color: #f56c6c;
}
&.profit {
color: #67c23a;
}
}
.no-data {
color: #909399;
}
.commission {

View File

@ -235,9 +235,9 @@ const getPaymentOrders = async (options = {}) => {
limit: parseInt(limit),
offset: parseInt(offset),
}),
// Query for amount statistics (sum of all matching orders, not just current page)
// Query for amount statistics (only active orders, not just current page)
PaymentOrder.findOne({
where,
where: { ...where, status: 'active' },
attributes: [
[sequelize.fn('COALESCE', sequelize.fn('SUM', sequelize.col('amount_rmb')), 0), 'totalRmb'],
[sequelize.fn('COALESCE', sequelize.fn('SUM', sequelize.col('amount_peso')), 0), 'totalPeso'],
@ -297,6 +297,8 @@ const getPaymentOrders = async (options = {}) => {
amount: order.amount ? parseFloat(order.amount).toFixed(2) : null,
amountPeso: order.amountPeso ? parseFloat(order.amountPeso).toFixed(2) : null,
amountRmb: order.amountRmb ? parseFloat(order.amountRmb).toFixed(2) : null,
costPeso: order.costPeso ? parseFloat(order.costPeso).toFixed(2) : null,
costRmb: order.costRmb ? parseFloat(order.costRmb).toFixed(2) : null,
serviceContent: order.serviceContent,
paymentTime: order.paymentTime,
paymentProof: order.paymentProof,