diff --git a/src/views/AgentDashboard.vue b/src/views/AgentDashboard.vue
index 5a23330..659ad37 100644
--- a/src/views/AgentDashboard.vue
+++ b/src/views/AgentDashboard.vue
@@ -142,11 +142,31 @@
+
+
+
+ 总商户数:
+ {{ stats.total_merchants || 0 }}
+
+
+ 正常商户:
+ {{ stats.normal_merchants || 0 }}
+
+
+ 早期商户:
+ {{ stats.early_merchants || 0 }}
+
+
+
+
+
+
@@ -166,6 +186,30 @@
+
+
+
+ {{ row.merchant_status || '正常商户' }}
+
+
+
+
+
+
+
+
+
+ {{ row.commission_count || 0 }} 笔
+
+
+
@@ -228,10 +272,9 @@
-
- 第三次匹配
+
+ {{ getCommissionTypeText(row.commission_type) }}
- {{ row.commission_type }}
@@ -324,7 +367,10 @@ import {
Refresh,
CreditCard,
Management,
- ArrowRight
+ ArrowRight,
+ InfoFilled,
+ Warning,
+ Check
} from '@element-plus/icons-vue'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
@@ -428,6 +474,17 @@ const loadMerchants = async () => {
merchants.value = data.data.merchants
merchantsTotal.value = data.data.total
+
+ // 更新商户相关的统计信息(如果返回了统计数据)
+ if (data.data.stats) {
+ // 只更新商户相关的统计字段,保留其他统计数据
+ stats.value = {
+ ...stats.value,
+ total_merchants: data.data.stats.total_merchants,
+ early_merchants: data.data.stats.early_merchants,
+ normal_merchants: data.data.stats.normal_merchants
+ }
+ }
} catch (error) {
ElMessage.error('加载商户列表失败')
} finally {
@@ -489,22 +546,50 @@ const getAuditStatusText = (status) => {
return texts[status] || status
}
-const getCommissionStatusType = (status) => {
+/**
+ * 获取佣金类型标签类型
+ * @param {string} type - 佣金类型
+ * @returns {string} 标签类型
+ */
+const getCommissionTypeTagType = (type) => {
const types = {
- pending: 'warning',
- paid: 'success',
- cancelled: 'danger'
+ registration: 'primary',
+ matching: 'success'
}
- return types[status] || 'info'
+ return types[type] || 'info'
}
-const getCommissionStatusText = (status) => {
+/**
+ * 获取佣金类型文本
+ * @param {string} type - 佣金类型
+ * @returns {string} 显示文本
+ */
+const getCommissionTypeText = (type) => {
const texts = {
- pending: '待支付',
- paid: '已支付',
- cancelled: '已取消'
+ registration: '注册佣金',
+ matching: '匹配佣金'
}
- return texts[status] || status
+ return texts[type] || type
+}
+
+/**
+ * 获取佣金状态标签类型
+ * @param {string} status - 佣金状态
+ * @returns {string} 标签类型
+ */
+const getCommissionStatusType = (status) => {
+ // 由于agent_commission_records表没有status字段,所有佣金记录都是已生成状态
+ return 'success'
+}
+
+/**
+ * 获取佣金状态文本
+ * @param {string} status - 佣金状态
+ * @returns {string} 显示文本
+ */
+const getCommissionStatusText = (status) => {
+ // 由于agent_commission_records表没有status字段,所有佣金记录都是已生成状态
+ return '已生成'
}
const formatDateTime = (date) => {
@@ -745,13 +830,17 @@ const updateChartOptions = () => {
}
// 生命周期
-onMounted(() => {
+onMounted(async () => {
loadAgentInfo()
if (agentInfo.value) {
- loadStats()
- loadChartData()
- loadMerchants()
- loadCommissions()
+ // 先加载基础统计数据
+ await loadStats()
+ // 然后并行加载其他数据
+ await Promise.all([
+ loadChartData(),
+ loadMerchants(),
+ loadCommissions()
+ ])
}
})
@@ -1206,6 +1295,71 @@ onMounted(() => {
color: white;
}
+/* 商户统计信息样式 */
+.merchant-stats {
+ display: flex;
+ gap: 24px;
+ padding: 16px;
+ background: #f8f9fa;
+ border-radius: 8px;
+ margin-bottom: 16px;
+ border: 1px solid #e9ecef;
+}
+
+.merchant-stats .stat-item {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+}
+
+.merchant-stats .stat-label {
+ font-size: 14px;
+ color: #666;
+ font-weight: 500;
+}
+
+.merchant-stats .stat-value {
+ font-size: 16px;
+ font-weight: 600;
+ color: #333;
+}
+
+.merchant-stats .stat-value.normal {
+ color: #67C23A;
+}
+
+.merchant-stats .stat-value.early {
+ color: #E6A23C;
+}
+
+/* 商户类型相关样式 */
+.info-icon {
+ margin-left: 4px;
+ color: #E6A23C;
+ cursor: help;
+ font-size: 14px;
+}
+
+.text-muted {
+ color: #909399;
+ font-style: italic;
+}
+
+.merchant-status-tag {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+}
+
+/* 早期商户行样式 */
+.el-table .el-table__row.early-merchant {
+ background-color: #fdf6ec;
+}
+
+.el-table .el-table__row.early-merchant:hover {
+ background-color: #faecd8;
+}
+
/* 移动端响应式 */
@media (max-width: 768px) {
.dashboard-header {