综述: 新增分销商管理和分销订单佣金管理演示页面
- 新增分销商审核和管理演示页面,包含申请审核、分销商列表管理功能 - 新增分销订单和佣金管理演示页面,包含订单明细、佣金统计功能 - 实现分销商申请审核流程,支持通过、拒绝、批量审核操作 - 实现分销商列表管理,支持启用、禁用、等级管理功能 - 实现分销订单管理,支持订单状态跟踪、佣金计算逻辑展示 - 实现佣金统计功能,支持按分销商等级筛选、数据汇总和导出
This commit is contained in:
		
							parent
							
								
									90ca3480f6
								
							
						
					
					
						commit
						8f31b9a105
					
				|  | @ -0,0 +1,638 @@ | ||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="zh-CN"> | ||||||
|  | <head> | ||||||
|  |     <meta charset="UTF-8"> | ||||||
|  |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||||
|  |     <title>分销商审核和管理系统</title> | ||||||
|  |     <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> | ||||||
|  |     <style> | ||||||
|  |         * { | ||||||
|  |             margin: 0; | ||||||
|  |             padding: 0; | ||||||
|  |             box-sizing: border-box; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         body { | ||||||
|  |             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', | ||||||
|  |                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||||||
|  |             background: #f0f2f5; | ||||||
|  |             padding: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .container { | ||||||
|  |             max-width: 1400px; | ||||||
|  |             margin: 0 auto; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .header-card { | ||||||
|  |             background: white; | ||||||
|  |             padding: 30px; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             margin-bottom: 20px; | ||||||
|  |             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .page-title { | ||||||
|  |             font-size: 28px; | ||||||
|  |             font-weight: bold; | ||||||
|  |             color: #303133; | ||||||
|  |             margin-bottom: 10px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .page-desc { | ||||||
|  |             font-size: 14px; | ||||||
|  |             color: #909399; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .main-card { | ||||||
|  |             background: white; | ||||||
|  |             padding: 20px; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-cards { | ||||||
|  |             display: grid; | ||||||
|  |             grid-template-columns: repeat(4, 1fr); | ||||||
|  |             gap: 20px; | ||||||
|  |             margin-bottom: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-card { | ||||||
|  |             background: white; | ||||||
|  |             padding: 24px; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||||
|  |             cursor: pointer; | ||||||
|  |             transition: all 0.3s; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-card:hover { | ||||||
|  |             transform: translateY(-5px); | ||||||
|  |             box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-content { | ||||||
|  |             display: flex; | ||||||
|  |             align-items: center; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-icon { | ||||||
|  |             font-size: 48px; | ||||||
|  |             margin-right: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-icon.primary { color: #409EFF; } | ||||||
|  |         .stat-icon.success { color: #67C23A; } | ||||||
|  |         .stat-icon.danger { color: #F56C6C; } | ||||||
|  |         .stat-icon.warning { color: #E6A23C; } | ||||||
|  | 
 | ||||||
|  |         .stat-info { | ||||||
|  |             flex: 1; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-label { | ||||||
|  |             font-size: 14px; | ||||||
|  |             color: #909399; | ||||||
|  |             margin-bottom: 8px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-value { | ||||||
|  |             font-size: 32px; | ||||||
|  |             font-weight: bold; | ||||||
|  |             color: #303133; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .search-form { | ||||||
|  |             margin: 20px 0; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         @media screen and (max-width: 1200px) { | ||||||
|  |             .stat-cards { | ||||||
|  |                 grid-template-columns: repeat(2, 1fr); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         @media screen and (max-width: 768px) { | ||||||
|  |             .stat-cards { | ||||||
|  |                 grid-template-columns: 1fr; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     </style> | ||||||
|  | </head> | ||||||
|  | <body> | ||||||
|  |     <div id="app" class="container"> | ||||||
|  |         <!-- 页面标题 --> | ||||||
|  |         <div class="header-card"> | ||||||
|  |             <h1 class="page-title">分销商审核与管理系统</h1> | ||||||
|  |             <p class="page-desc">管理分销商申请审核、查看分销商列表及相关统计数据</p> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <!-- 主内容 --> | ||||||
|  |         <div class="main-card"> | ||||||
|  |             <el-tabs v-model="activeTab" @tab-click="handleTabChange"> | ||||||
|  |                 <!-- 申请审核Tab --> | ||||||
|  |                 <el-tab-pane label="申请审核" name="apply"> | ||||||
|  |                     <!-- 搜索表单 --> | ||||||
|  |                     <el-form :inline="true" :model="applyQuery" size="small" class="search-form"> | ||||||
|  |                         <el-form-item label="审核状态"> | ||||||
|  |                             <el-select v-model="applyQuery.status" placeholder="请选择审核状态" clearable style="width: 150px"> | ||||||
|  |                                 <el-option label="待审核" :value="0"></el-option> | ||||||
|  |                                 <el-option label="已通过" :value="1"></el-option> | ||||||
|  |                                 <el-option label="已拒绝" :value="-1"></el-option> | ||||||
|  |                             </el-select> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="申请人"> | ||||||
|  |                             <el-input v-model="applyQuery.userName" placeholder="请输入申请人姓名" clearable style="width: 200px"></el-input> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item> | ||||||
|  |                             <el-button type="primary" @click="handleSearch">查询</el-button> | ||||||
|  |                             <el-button @click="handleReset">重置</el-button> | ||||||
|  |                             <el-button v-if="hasWaitingApproval" type="success" @click="handlePassAll">一键通过</el-button> | ||||||
|  |                         </el-form-item> | ||||||
|  |                     </el-form> | ||||||
|  | 
 | ||||||
|  |                     <!-- 申请列表表格 --> | ||||||
|  |                     <el-table | ||||||
|  |                         :data="filteredApplyList" | ||||||
|  |                         border | ||||||
|  |                         style="width: 100%" | ||||||
|  |                         :header-cell-style="{ background: '#F5F7FA', color: '#606266' }"> | ||||||
|  |                         <el-table-column prop="userName" label="申请人" align="center" width="120"></el-table-column> | ||||||
|  |                         <el-table-column prop="mobile" label="手机号" align="center" width="130"></el-table-column> | ||||||
|  |                         <el-table-column prop="createTime" label="申请时间" align="center" width="180"></el-table-column> | ||||||
|  |                         <el-table-column prop="auditTime" label="审核时间" align="center" width="180"></el-table-column> | ||||||
|  |                         <el-table-column prop="status" label="审核状态" align="center" width="100"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-tag :type="getStatusType(scope.row.status)"> | ||||||
|  |                                     {{ getStatusText(scope.row.status) }} | ||||||
|  |                                 </el-tag> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="refuseReason" label="拒绝理由" align="center" min-width="200"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span v-if="scope.row.status === -1">{{ scope.row.refuseReason }}</span> | ||||||
|  |                                 <span v-else>-</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column label="操作" align="center" width="180" fixed="right"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-button v-if="scope.row.status === 0" size="mini" type="success" @click="handleApprove(scope.row)">通过</el-button> | ||||||
|  |                                 <el-button v-if="scope.row.status === 0" size="mini" type="danger" @click="handleReject(scope.row)">拒绝</el-button> | ||||||
|  |                                 <el-button v-else size="mini" type="primary" @click="handleDetail(scope.row)">详情</el-button> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                     </el-table> | ||||||
|  | 
 | ||||||
|  |                     <!-- 分页 --> | ||||||
|  |                     <div style="text-align: right; margin-top: 20px;"> | ||||||
|  |                         <el-pagination | ||||||
|  |                             background | ||||||
|  |                             @current-change="handleApplyPageChange" | ||||||
|  |                             :current-page.sync="applyPage.current" | ||||||
|  |                             :page-size="applyPage.size" | ||||||
|  |                             layout="total, prev, pager, next" | ||||||
|  |                             :total="filteredApplyList.length"> | ||||||
|  |                         </el-pagination> | ||||||
|  |                     </div> | ||||||
|  |                 </el-tab-pane> | ||||||
|  | 
 | ||||||
|  |                 <!-- 分销商列表Tab --> | ||||||
|  |                 <el-tab-pane label="分销商列表" name="distributor"> | ||||||
|  |                     <!-- 统计卡片 --> | ||||||
|  |                     <div class="stat-cards"> | ||||||
|  |                         <div class="stat-card"> | ||||||
|  |                             <div class="stat-content"> | ||||||
|  |                                 <i class="el-icon-user stat-icon primary"></i> | ||||||
|  |                                 <div class="stat-info"> | ||||||
|  |                                     <div class="stat-label">总分销商数</div> | ||||||
|  |                                     <div class="stat-value">{{ distributorStats.total }}</div> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="stat-card"> | ||||||
|  |                             <div class="stat-content"> | ||||||
|  |                                 <i class="el-icon-check stat-icon success"></i> | ||||||
|  |                                 <div class="stat-info"> | ||||||
|  |                                     <div class="stat-label">启用中</div> | ||||||
|  |                                     <div class="stat-value">{{ distributorStats.active }}</div> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="stat-card"> | ||||||
|  |                             <div class="stat-content"> | ||||||
|  |                                 <i class="el-icon-close stat-icon danger"></i> | ||||||
|  |                                 <div class="stat-info"> | ||||||
|  |                                     <div class="stat-label">已禁用</div> | ||||||
|  |                                     <div class="stat-value">{{ distributorStats.disabled }}</div> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="stat-card"> | ||||||
|  |                             <div class="stat-content"> | ||||||
|  |                                 <i class="el-icon-star-on stat-icon warning"></i> | ||||||
|  |                                 <div class="stat-info"> | ||||||
|  |                                     <div class="stat-label">高级分销商</div> | ||||||
|  |                                     <div class="stat-value">{{ distributorStats.advanced }}</div> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|  | 
 | ||||||
|  |                     <!-- 搜索表单 --> | ||||||
|  |                     <el-form :inline="true" :model="distributorQuery" size="small" class="search-form"> | ||||||
|  |                         <el-form-item label="姓名"> | ||||||
|  |                             <el-input v-model="distributorQuery.userName" placeholder="请输入姓名" clearable style="width: 150px"></el-input> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="手机号"> | ||||||
|  |                             <el-input v-model="distributorQuery.mobile" placeholder="请输入手机号" clearable style="width: 150px"></el-input> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="状态"> | ||||||
|  |                             <el-select v-model="distributorQuery.status" placeholder="请选择状态" clearable style="width: 120px"> | ||||||
|  |                                 <el-option label="启用" :value="1"></el-option> | ||||||
|  |                                 <el-option label="禁用" :value="0"></el-option> | ||||||
|  |                             </el-select> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="等级"> | ||||||
|  |                             <el-select v-model="distributorQuery.level" placeholder="请选择等级" clearable style="width: 150px"> | ||||||
|  |                                 <el-option label="普通分销商" :value="1"></el-option> | ||||||
|  |                                 <el-option label="高级分销商" :value="2"></el-option> | ||||||
|  |                                 <el-option label="精英分销商" :value="3"></el-option> | ||||||
|  |                             </el-select> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item> | ||||||
|  |                             <el-button type="primary" @click="handleDistributorSearch">查询</el-button> | ||||||
|  |                             <el-button @click="handleDistributorReset">重置</el-button> | ||||||
|  |                         </el-form-item> | ||||||
|  |                     </el-form> | ||||||
|  | 
 | ||||||
|  |                     <!-- 分销商列表表格 --> | ||||||
|  |                     <el-table | ||||||
|  |                         :data="filteredDistributorList" | ||||||
|  |                         border | ||||||
|  |                         style="width: 100%" | ||||||
|  |                         :header-cell-style="{ background: '#F5F7FA', color: '#606266' }"> | ||||||
|  |                         <el-table-column prop="userName" label="姓名" align="center" width="120"></el-table-column> | ||||||
|  |                         <el-table-column prop="mobile" label="手机号" align="center" width="130"></el-table-column> | ||||||
|  |                         <el-table-column prop="level" label="等级" align="center" width="120"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-tag :type="getLevelType(scope.row.level)"> | ||||||
|  |                                     {{ getLevelText(scope.row.level) }} | ||||||
|  |                                 </el-tag> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="visitTimes" label="进店量" align="center" width="100"></el-table-column> | ||||||
|  |                         <el-table-column prop="createTime" label="成为分销商时间" align="center" width="180"></el-table-column> | ||||||
|  |                         <el-table-column prop="status" label="状态" align="center" width="100"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-tag :type="scope.row.status === 1 ? 'success' : 'danger'"> | ||||||
|  |                                     {{ scope.row.status === 1 ? '启用' : '禁用' }} | ||||||
|  |                                 </el-tag> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="disableReason" label="禁用原因" align="center" min-width="200"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span v-if="scope.row.status === 0">{{ scope.row.disableReason }}</span> | ||||||
|  |                                 <span v-else>-</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column label="操作" align="center" width="200" fixed="right"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-button size="mini" type="primary" @click="viewDistributorDetail(scope.row)">详情</el-button> | ||||||
|  |                                 <el-button | ||||||
|  |                                     v-if="scope.row.status === 1" | ||||||
|  |                                     size="mini" | ||||||
|  |                                     type="warning" | ||||||
|  |                                     @click="handleDisable(scope.row)">禁用</el-button> | ||||||
|  |                                 <el-button | ||||||
|  |                                     v-else | ||||||
|  |                                     size="mini" | ||||||
|  |                                     type="success" | ||||||
|  |                                     @click="handleEnable(scope.row)">启用</el-button> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                     </el-table> | ||||||
|  | 
 | ||||||
|  |                     <!-- 分页 --> | ||||||
|  |                     <div style="text-align: right; margin-top: 20px;"> | ||||||
|  |                         <el-pagination | ||||||
|  |                             background | ||||||
|  |                             @current-change="handleDistributorPageChange" | ||||||
|  |                             :current-page.sync="distributorPage.current" | ||||||
|  |                             :page-size="distributorPage.size" | ||||||
|  |                             layout="total, prev, pager, next" | ||||||
|  |                             :total="filteredDistributorList.length"> | ||||||
|  |                         </el-pagination> | ||||||
|  |                     </div> | ||||||
|  |                 </el-tab-pane> | ||||||
|  |             </el-tabs> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <!-- 拒绝原因对话框 --> | ||||||
|  |         <el-dialog title="拒绝申请" :visible.sync="rejectDialogVisible" width="30%"> | ||||||
|  |             <el-form :model="rejectForm" ref="rejectForm" label-width="100px"> | ||||||
|  |                 <el-form-item label="拒绝理由" required> | ||||||
|  |                     <el-input type="textarea" :rows="4" placeholder="请输入拒绝理由" v-model="rejectForm.reason"></el-input> | ||||||
|  |                 </el-form-item> | ||||||
|  |             </el-form> | ||||||
|  |             <span slot="footer" class="dialog-footer"> | ||||||
|  |                 <el-button @click="rejectDialogVisible = false">取 消</el-button> | ||||||
|  |                 <el-button type="primary" @click="confirmReject">确 定</el-button> | ||||||
|  |             </span> | ||||||
|  |         </el-dialog> | ||||||
|  | 
 | ||||||
|  |         <!-- 禁用原因对话框 --> | ||||||
|  |         <el-dialog title="禁用分销商" :visible.sync="disableDialogVisible" width="30%"> | ||||||
|  |             <el-form :model="disableForm" ref="disableForm" label-width="100px"> | ||||||
|  |                 <el-form-item label="禁用理由" required> | ||||||
|  |                     <el-input type="textarea" :rows="4" placeholder="请输入禁用理由" v-model="disableForm.reason"></el-input> | ||||||
|  |                 </el-form-item> | ||||||
|  |             </el-form> | ||||||
|  |             <span slot="footer" class="dialog-footer"> | ||||||
|  |                 <el-button @click="disableDialogVisible = false">取 消</el-button> | ||||||
|  |                 <el-button type="primary" @click="confirmDisable">确 定</el-button> | ||||||
|  |             </span> | ||||||
|  |         </el-dialog> | ||||||
|  | 
 | ||||||
|  |         <!-- 申请详情对话框 --> | ||||||
|  |         <el-dialog title="申请详情" :visible.sync="detailDialogVisible" width="50%"> | ||||||
|  |             <el-descriptions :column="2" border v-if="detailData"> | ||||||
|  |                 <el-descriptions-item label="申请人">{{ detailData.userName }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="手机号">{{ detailData.mobile }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="申请时间">{{ detailData.createTime }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="审核时间">{{ detailData.auditTime }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="审核状态"> | ||||||
|  |                     <el-tag :type="getStatusType(detailData.status)"> | ||||||
|  |                         {{ getStatusText(detailData.status) }} | ||||||
|  |                     </el-tag> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="拒绝理由" v-if="detailData.status === -1" :span="2"> | ||||||
|  |                     {{ detailData.refuseReason }} | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |             </el-descriptions> | ||||||
|  |             <span slot="footer" class="dialog-footer"> | ||||||
|  |                 <el-button @click="detailDialogVisible = false">关 闭</el-button> | ||||||
|  |             </span> | ||||||
|  |         </el-dialog> | ||||||
|  | 
 | ||||||
|  |         <!-- 分销商详情对话框 --> | ||||||
|  |         <el-dialog title="分销商详情" :visible.sync="distributorDetailVisible" width="60%"> | ||||||
|  |             <el-descriptions :column="2" border v-if="distributorDetail"> | ||||||
|  |                 <el-descriptions-item label="姓名">{{ distributorDetail.userName }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="手机号">{{ distributorDetail.mobile }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="等级"> | ||||||
|  |                     <el-tag :type="getLevelType(distributorDetail.level)"> | ||||||
|  |                         {{ getLevelText(distributorDetail.level) }} | ||||||
|  |                     </el-tag> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="状态"> | ||||||
|  |                     <el-tag :type="distributorDetail.status === 1 ? 'success' : 'danger'"> | ||||||
|  |                         {{ distributorDetail.status === 1 ? '启用' : '禁用' }} | ||||||
|  |                     </el-tag> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="进店量">{{ distributorDetail.visitTimes || 0 }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="成为分销商时间">{{ distributorDetail.createTime }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="禁用原因" v-if="distributorDetail.status === 0" :span="2"> | ||||||
|  |                     {{ distributorDetail.disableReason }} | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |             </el-descriptions> | ||||||
|  |             <span slot="footer" class="dialog-footer"> | ||||||
|  |                 <el-button @click="distributorDetailVisible = false">关 闭</el-button> | ||||||
|  |             </span> | ||||||
|  |         </el-dialog> | ||||||
|  |     </div> | ||||||
|  | 
 | ||||||
|  |     <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script> | ||||||
|  |     <script src="https://unpkg.com/element-ui/lib/index.js"></script> | ||||||
|  |     <script> | ||||||
|  |         new Vue({ | ||||||
|  |             el: '#app', | ||||||
|  |             data() { | ||||||
|  |                 return { | ||||||
|  |                     activeTab: 'apply', | ||||||
|  | 
 | ||||||
|  |                     // 申请审核数据 | ||||||
|  |                     applyQuery: { | ||||||
|  |                         status: null, | ||||||
|  |                         userName: '' | ||||||
|  |                     }, | ||||||
|  |                     applyList: [ | ||||||
|  |                         { id: 1, userName: '张三', mobile: '13800138001', createTime: '2024-01-15 10:30:00', auditTime: '', status: 0, refuseReason: '' }, | ||||||
|  |                         { id: 2, userName: '李四', mobile: '13800138002', createTime: '2024-01-16 14:20:00', auditTime: '', status: 0, refuseReason: '' }, | ||||||
|  |                         { id: 3, userName: '王五', mobile: '13800138003', createTime: '2024-01-17 09:15:00', auditTime: '2024-01-17 16:20:00', status: 1, refuseReason: '' }, | ||||||
|  |                         { id: 4, userName: '赵六', mobile: '13800138004', createTime: '2024-01-18 11:45:00', auditTime: '2024-01-18 15:30:00', status: -1, refuseReason: '资料不完整' }, | ||||||
|  |                         { id: 5, userName: '钱七', mobile: '13800138005', createTime: '2024-01-19 08:00:00', auditTime: '', status: 0, refuseReason: '' }, | ||||||
|  |                         { id: 6, userName: '孙八', mobile: '13800138006', createTime: '2024-01-20 13:25:00', auditTime: '2024-01-20 17:10:00', status: 1, refuseReason: '' }, | ||||||
|  |                     ], | ||||||
|  |                     applyPage: { current: 1, size: 10 }, | ||||||
|  | 
 | ||||||
|  |                     // 分销商列表数据 | ||||||
|  |                     distributorQuery: { | ||||||
|  |                         userName: '', | ||||||
|  |                         mobile: '', | ||||||
|  |                         status: null, | ||||||
|  |                         level: null | ||||||
|  |                     }, | ||||||
|  |                     distributorList: [ | ||||||
|  |                         { id: 1, userName: '张三', mobile: '13800138001', level: 1, visitTimes: 120, status: 1, createTime: '2024-01-15 10:30:00', disableReason: '' }, | ||||||
|  |                         { id: 2, userName: '李四', mobile: '13800138002', level: 2, visitTimes: 350, status: 1, createTime: '2024-01-16 14:20:00', disableReason: '' }, | ||||||
|  |                         { id: 3, userName: '王五', mobile: '13800138003', level: 3, visitTimes: 680, status: 1, createTime: '2024-01-17 09:15:00', disableReason: '' }, | ||||||
|  |                         { id: 4, userName: '赵六', mobile: '13800138004', level: 1, visitTimes: 45, status: 0, createTime: '2024-01-18 11:45:00', disableReason: '违规推广' }, | ||||||
|  |                         { id: 5, userName: '孙八', mobile: '13800138006', level: 2, visitTimes: 280, status: 1, createTime: '2024-01-20 13:25:00', disableReason: '' }, | ||||||
|  |                         { id: 6, userName: '周九', mobile: '13800138007', level: 1, visitTimes: 95, status: 1, createTime: '2024-01-21 16:00:00', disableReason: '' }, | ||||||
|  |                         { id: 7, userName: '吴十', mobile: '13800138008', level: 3, visitTimes: 520, status: 1, createTime: '2024-01-22 10:15:00', disableReason: '' }, | ||||||
|  |                         { id: 8, userName: '郑十一', mobile: '13800138009', level: 2, visitTimes: 310, status: 0, createTime: '2024-01-23 14:30:00', disableReason: '不符合资质要求' }, | ||||||
|  |                     ], | ||||||
|  |                     distributorPage: { current: 1, size: 10 }, | ||||||
|  |                     distributorStats: { | ||||||
|  |                         total: 8, | ||||||
|  |                         active: 6, | ||||||
|  |                         disabled: 2, | ||||||
|  |                         advanced: 4 | ||||||
|  |                     }, | ||||||
|  | 
 | ||||||
|  |                     // 对话框 | ||||||
|  |                     rejectDialogVisible: false, | ||||||
|  |                     disableDialogVisible: false, | ||||||
|  |                     detailDialogVisible: false, | ||||||
|  |                     distributorDetailVisible: false, | ||||||
|  | 
 | ||||||
|  |                     // 表单数据 | ||||||
|  |                     rejectForm: { reason: '' }, | ||||||
|  |                     disableForm: { reason: '' }, | ||||||
|  |                     currentRow: null, | ||||||
|  |                     detailData: null, | ||||||
|  |                     distributorDetail: null | ||||||
|  |                 }; | ||||||
|  |             }, | ||||||
|  |             computed: { | ||||||
|  |                 filteredApplyList() { | ||||||
|  |                     let list = this.applyList; | ||||||
|  |                     if (this.applyQuery.status !== null && this.applyQuery.status !== '') { | ||||||
|  |                         list = list.filter(item => item.status === this.applyQuery.status); | ||||||
|  |                     } | ||||||
|  |                     if (this.applyQuery.userName) { | ||||||
|  |                         list = list.filter(item => item.userName.includes(this.applyQuery.userName)); | ||||||
|  |                     } | ||||||
|  |                     return list; | ||||||
|  |                 }, | ||||||
|  |                 filteredDistributorList() { | ||||||
|  |                     let list = this.distributorList; | ||||||
|  |                     if (this.distributorQuery.userName) { | ||||||
|  |                         list = list.filter(item => item.userName.includes(this.distributorQuery.userName)); | ||||||
|  |                     } | ||||||
|  |                     if (this.distributorQuery.mobile) { | ||||||
|  |                         list = list.filter(item => item.mobile.includes(this.distributorQuery.mobile)); | ||||||
|  |                     } | ||||||
|  |                     if (this.distributorQuery.status !== null && this.distributorQuery.status !== '') { | ||||||
|  |                         list = list.filter(item => item.status === this.distributorQuery.status); | ||||||
|  |                     } | ||||||
|  |                     if (this.distributorQuery.level !== null && this.distributorQuery.level !== '') { | ||||||
|  |                         list = list.filter(item => item.level === this.distributorQuery.level); | ||||||
|  |                     } | ||||||
|  |                     return list; | ||||||
|  |                 }, | ||||||
|  |                 hasWaitingApproval() { | ||||||
|  |                     return this.filteredApplyList.some(item => item.status === 0); | ||||||
|  |                 } | ||||||
|  |             }, | ||||||
|  |             methods: { | ||||||
|  |                 handleTabChange(tab) { | ||||||
|  |                     console.log('切换到Tab:', tab.name); | ||||||
|  |                 }, | ||||||
|  | 
 | ||||||
|  |                 // 申请审核相关方法 | ||||||
|  |                 handleSearch() { | ||||||
|  |                     this.$message.success('查询成功'); | ||||||
|  |                 }, | ||||||
|  |                 handleReset() { | ||||||
|  |                     this.applyQuery = { status: null, userName: '' }; | ||||||
|  |                     this.$message.info('已重置查询条件'); | ||||||
|  |                 }, | ||||||
|  |                 handleApprove(row) { | ||||||
|  |                     this.$confirm('确定通过该分销商申请?', '提示', { | ||||||
|  |                         confirmButtonText: '确定', | ||||||
|  |                         cancelButtonText: '取消', | ||||||
|  |                         type: 'warning' | ||||||
|  |                     }).then(() => { | ||||||
|  |                         row.status = 1; | ||||||
|  |                         row.auditTime = new Date().toLocaleString(); | ||||||
|  |                         this.$message.success('审核通过成功!'); | ||||||
|  |                     }).catch(() => { | ||||||
|  |                         this.$message.info('已取消操作'); | ||||||
|  |                     }); | ||||||
|  |                 }, | ||||||
|  |                 handleReject(row) { | ||||||
|  |                     this.currentRow = row; | ||||||
|  |                     this.rejectForm.reason = ''; | ||||||
|  |                     this.rejectDialogVisible = true; | ||||||
|  |                 }, | ||||||
|  |                 confirmReject() { | ||||||
|  |                     if (!this.rejectForm.reason) { | ||||||
|  |                         this.$message.warning('请输入拒绝理由'); | ||||||
|  |                         return; | ||||||
|  |                     } | ||||||
|  |                     this.currentRow.status = -1; | ||||||
|  |                     this.currentRow.auditTime = new Date().toLocaleString(); | ||||||
|  |                     this.currentRow.refuseReason = this.rejectForm.reason; | ||||||
|  |                     this.rejectDialogVisible = false; | ||||||
|  |                     this.$message.success('已拒绝该申请'); | ||||||
|  |                 }, | ||||||
|  |                 handlePassAll() { | ||||||
|  |                     const waitingList = this.applyList.filter(item => item.status === 0); | ||||||
|  |                     this.$confirm(`确定要一键通过所有 ${waitingList.length} 条待审核的申请?`, '提示', { | ||||||
|  |                         confirmButtonText: '确定', | ||||||
|  |                         cancelButtonText: '取消', | ||||||
|  |                         type: 'warning' | ||||||
|  |                     }).then(() => { | ||||||
|  |                         waitingList.forEach(item => { | ||||||
|  |                             item.status = 1; | ||||||
|  |                             item.auditTime = new Date().toLocaleString(); | ||||||
|  |                         }); | ||||||
|  |                         this.$message.success(`成功通过 ${waitingList.length} 条申请记录!`); | ||||||
|  |                     }).catch(() => { | ||||||
|  |                         this.$message.info('已取消操作'); | ||||||
|  |                     }); | ||||||
|  |                 }, | ||||||
|  |                 handleDetail(row) { | ||||||
|  |                     this.detailData = row; | ||||||
|  |                     this.detailDialogVisible = true; | ||||||
|  |                 }, | ||||||
|  |                 handleApplyPageChange(page) { | ||||||
|  |                     console.log('申请审核页码变化:', page); | ||||||
|  |                 }, | ||||||
|  | 
 | ||||||
|  |                 // 分销商列表相关方法 | ||||||
|  |                 handleDistributorSearch() { | ||||||
|  |                     this.$message.success('查询成功'); | ||||||
|  |                 }, | ||||||
|  |                 handleDistributorReset() { | ||||||
|  |                     this.distributorQuery = { userName: '', mobile: '', status: null, level: null }; | ||||||
|  |                     this.$message.info('已重置查询条件'); | ||||||
|  |                 }, | ||||||
|  |                 viewDistributorDetail(row) { | ||||||
|  |                     this.distributorDetail = row; | ||||||
|  |                     this.distributorDetailVisible = true; | ||||||
|  |                 }, | ||||||
|  |                 handleDisable(row) { | ||||||
|  |                     this.currentRow = row; | ||||||
|  |                     this.disableForm.reason = ''; | ||||||
|  |                     this.disableDialogVisible = true; | ||||||
|  |                 }, | ||||||
|  |                 confirmDisable() { | ||||||
|  |                     if (!this.disableForm.reason) { | ||||||
|  |                         this.$message.warning('请输入禁用理由'); | ||||||
|  |                         return; | ||||||
|  |                     } | ||||||
|  |                     this.currentRow.status = 0; | ||||||
|  |                     this.currentRow.disableReason = this.disableForm.reason; | ||||||
|  |                     this.disableDialogVisible = false; | ||||||
|  |                     this.updateStats(); | ||||||
|  |                     this.$message.success('已禁用该分销商'); | ||||||
|  |                 }, | ||||||
|  |                 handleEnable(row) { | ||||||
|  |                     this.$confirm('确定要启用该分销商?', '提示', { | ||||||
|  |                         confirmButtonText: '确定', | ||||||
|  |                         cancelButtonText: '取消', | ||||||
|  |                         type: 'warning' | ||||||
|  |                     }).then(() => { | ||||||
|  |                         row.status = 1; | ||||||
|  |                         row.disableReason = ''; | ||||||
|  |                         this.updateStats(); | ||||||
|  |                         this.$message.success('已启用该分销商'); | ||||||
|  |                     }).catch(() => { | ||||||
|  |                         this.$message.info('已取消操作'); | ||||||
|  |                     }); | ||||||
|  |                 }, | ||||||
|  |                 handleDistributorPageChange(page) { | ||||||
|  |                     console.log('分销商列表页码变化:', page); | ||||||
|  |                 }, | ||||||
|  |                 updateStats() { | ||||||
|  |                     this.distributorStats.total = this.distributorList.length; | ||||||
|  |                     this.distributorStats.active = this.distributorList.filter(item => item.status === 1).length; | ||||||
|  |                     this.distributorStats.disabled = this.distributorList.filter(item => item.status === 0).length; | ||||||
|  |                     this.distributorStats.advanced = this.distributorList.filter(item => item.level >= 2 && item.status === 1).length; | ||||||
|  |                 }, | ||||||
|  | 
 | ||||||
|  |                 // 工具方法 | ||||||
|  |                 getStatusType(status) { | ||||||
|  |                     const map = { 0: 'warning', 1: 'success', '-1': 'danger' }; | ||||||
|  |                     return map[status] || 'info'; | ||||||
|  |                 }, | ||||||
|  |                 getStatusText(status) { | ||||||
|  |                     const map = { 0: '待审核', 1: '已通过', '-1': '已拒绝' }; | ||||||
|  |                     return map[status] || '未知'; | ||||||
|  |                 }, | ||||||
|  |                 getLevelType(level) { | ||||||
|  |                     const map = { 1: 'info', 2: 'success', 3: 'warning' }; | ||||||
|  |                     return map[level] || 'info'; | ||||||
|  |                 }, | ||||||
|  |                 getLevelText(level) { | ||||||
|  |                     const map = { 1: '普通分销商', 2: '高级分销商', 3: '精英分销商' }; | ||||||
|  |                     return map[level] || '未知'; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     </script> | ||||||
|  | </body> | ||||||
|  | </html> | ||||||
|  | @ -0,0 +1,651 @@ | ||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="zh-CN"> | ||||||
|  | <head> | ||||||
|  |     <meta charset="UTF-8"> | ||||||
|  |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||||
|  |     <title>分销订单与佣金管理系统</title> | ||||||
|  |     <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> | ||||||
|  |     <style> | ||||||
|  |         * { | ||||||
|  |             margin: 0; | ||||||
|  |             padding: 0; | ||||||
|  |             box-sizing: border-box; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         body { | ||||||
|  |             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', | ||||||
|  |                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||||||
|  |             background: #f0f2f5; | ||||||
|  |             padding: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .container { | ||||||
|  |             max-width: 1600px; | ||||||
|  |             margin: 0 auto; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .header-card { | ||||||
|  |             background: white; | ||||||
|  |             padding: 30px; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             margin-bottom: 20px; | ||||||
|  |             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .page-title { | ||||||
|  |             font-size: 28px; | ||||||
|  |             font-weight: bold; | ||||||
|  |             color: #303133; | ||||||
|  |             margin-bottom: 10px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .page-desc { | ||||||
|  |             font-size: 14px; | ||||||
|  |             color: #909399; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-cards { | ||||||
|  |             display: grid; | ||||||
|  |             grid-template-columns: repeat(4, 1fr); | ||||||
|  |             gap: 20px; | ||||||
|  |             margin-bottom: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-card { | ||||||
|  |             background: white; | ||||||
|  |             padding: 24px; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||||
|  |             cursor: pointer; | ||||||
|  |             transition: all 0.3s; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-card:hover { | ||||||
|  |             transform: translateY(-5px); | ||||||
|  |             box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-content { | ||||||
|  |             display: flex; | ||||||
|  |             align-items: center; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-icon { | ||||||
|  |             font-size: 48px; | ||||||
|  |             margin-right: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-icon.primary { color: #409EFF; } | ||||||
|  |         .stat-icon.success { color: #67C23A; } | ||||||
|  |         .stat-icon.warning { color: #E6A23C; } | ||||||
|  |         .stat-icon.info { color: #909399; } | ||||||
|  | 
 | ||||||
|  |         .stat-info { | ||||||
|  |             flex: 1; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-label { | ||||||
|  |             font-size: 14px; | ||||||
|  |             color: #909399; | ||||||
|  |             margin-bottom: 8px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-value { | ||||||
|  |             font-size: 32px; | ||||||
|  |             font-weight: bold; | ||||||
|  |             color: #303133; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .main-card { | ||||||
|  |             background: white; | ||||||
|  |             padding: 20px; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .search-form { | ||||||
|  |             margin: 20px 0; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .money-text { | ||||||
|  |             color: #E6A23C; | ||||||
|  |             font-weight: bold; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .commission-text { | ||||||
|  |             color: #67C23A; | ||||||
|  |             font-weight: bold; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .detail-section { | ||||||
|  |             margin-top: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .detail-section h4 { | ||||||
|  |             margin-bottom: 10px; | ||||||
|  |             color: #303133; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         @media screen and (max-width: 1200px) { | ||||||
|  |             .stat-cards { | ||||||
|  |                 grid-template-columns: repeat(2, 1fr); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         @media screen and (max-width: 768px) { | ||||||
|  |             .stat-cards { | ||||||
|  |                 grid-template-columns: 1fr; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     </style> | ||||||
|  | </head> | ||||||
|  | <body> | ||||||
|  |     <div id="app" class="container"> | ||||||
|  |         <!-- 页面标题 --> | ||||||
|  |         <div class="header-card"> | ||||||
|  |             <h1 class="page-title">分销订单与佣金管理系统</h1> | ||||||
|  |             <p class="page-desc">查看分销订单明细、佣金统计及分销业绩数据</p> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <!-- 统计卡片 --> | ||||||
|  |         <div class="stat-cards"> | ||||||
|  |             <div class="stat-card"> | ||||||
|  |                 <div class="stat-content"> | ||||||
|  |                     <i class="el-icon-s-order stat-icon primary"></i> | ||||||
|  |                     <div class="stat-info"> | ||||||
|  |                         <div class="stat-label">分销订单总数</div> | ||||||
|  |                         <div class="stat-value">{{ orderStats.totalCount }}</div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="stat-card"> | ||||||
|  |                 <div class="stat-content"> | ||||||
|  |                     <i class="el-icon-s-goods stat-icon success"></i> | ||||||
|  |                     <div class="stat-info"> | ||||||
|  |                         <div class="stat-label">订单总金额(元)</div> | ||||||
|  |                         <div class="stat-value">{{ orderStats.totalMoney }}</div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="stat-card"> | ||||||
|  |                 <div class="stat-content"> | ||||||
|  |                     <i class="el-icon-wallet stat-icon warning"></i> | ||||||
|  |                     <div class="stat-info"> | ||||||
|  |                         <div class="stat-label">佣金总额(元)</div> | ||||||
|  |                         <div class="stat-value">{{ orderStats.totalCommission }}</div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="stat-card"> | ||||||
|  |                 <div class="stat-content"> | ||||||
|  |                     <i class="el-icon-pie-chart stat-icon info"></i> | ||||||
|  |                     <div class="stat-info"> | ||||||
|  |                         <div class="stat-label">佣金比例</div> | ||||||
|  |                         <div class="stat-value">{{ orderStats.commissionRate }}%</div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <!-- 主内容 --> | ||||||
|  |         <div class="main-card"> | ||||||
|  |             <el-tabs v-model="activeTab"> | ||||||
|  |                 <!-- 订单明细Tab --> | ||||||
|  |                 <el-tab-pane label="订单明细" name="order"> | ||||||
|  |                     <!-- 搜索表单 --> | ||||||
|  |                     <el-form :inline="true" :model="orderQuery" size="small" class="search-form"> | ||||||
|  |                         <el-form-item label="订单编号"> | ||||||
|  |                             <el-input v-model="orderQuery.orderNo" placeholder="请输入订单编号" clearable style="width: 200px"></el-input> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="分销商"> | ||||||
|  |                             <el-input v-model="orderQuery.distributorName" placeholder="请输入分销商姓名" clearable style="width: 150px"></el-input> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="订单状态"> | ||||||
|  |                             <el-select v-model="orderQuery.status" placeholder="请选择订单状态" clearable style="width: 120px"> | ||||||
|  |                                 <el-option label="未完成" :value="0"></el-option> | ||||||
|  |                                 <el-option label="已完成" :value="1"></el-option> | ||||||
|  |                             </el-select> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item> | ||||||
|  |                             <el-button type="primary" @click="handleOrderSearch">查询</el-button> | ||||||
|  |                             <el-button @click="handleOrderReset">重置</el-button> | ||||||
|  |                             <el-button type="success" @click="exportOrders">导出订单</el-button> | ||||||
|  |                         </el-form-item> | ||||||
|  |                     </el-form> | ||||||
|  | 
 | ||||||
|  |                     <!-- 订单列表表格 --> | ||||||
|  |                     <el-table | ||||||
|  |                         :data="filteredOrderList" | ||||||
|  |                         border | ||||||
|  |                         style="width: 100%" | ||||||
|  |                         :header-cell-style="{ background: '#F5F7FA', color: '#606266' }"> | ||||||
|  |                         <el-table-column prop="orderNo" label="订单编号" align="center" width="180"></el-table-column> | ||||||
|  |                         <el-table-column prop="unitOrderNo" label="市场订单号" align="center" width="180"></el-table-column> | ||||||
|  |                         <el-table-column prop="distributorName" label="分销商" align="center" width="120"></el-table-column> | ||||||
|  |                         <el-table-column prop="totalMoney" label="订单金额(元)" align="center" width="120"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="money-text">{{ scope.row.totalMoney }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="orderSharingRatio" label="分佣比例" align="center" width="100"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span>{{ scope.row.orderSharingRatio }}%</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="totalCommission" label="总佣金(元)" align="center" width="120"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="commission-text">{{ scope.row.totalCommission }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="myCommission" label="分销商佣金(元)" align="center" width="140"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="commission-text">{{ scope.row.myCommission }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="superiorCommission" label="上级佣金(元)" align="center" width="130"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="commission-text">{{ scope.row.superiorCommission }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="status" label="订单状态" align="center" width="100"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-tag :type="scope.row.status === 1 ? 'success' : 'warning'"> | ||||||
|  |                                     {{ scope.row.status === 1 ? '已完成' : '未完成' }} | ||||||
|  |                                 </el-tag> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="createTime" label="下单时间" align="center" width="180"></el-table-column> | ||||||
|  |                         <el-table-column label="操作" align="center" width="120" fixed="right"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-button size="mini" type="primary" @click="viewOrderDetail(scope.row)">详情</el-button> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                     </el-table> | ||||||
|  | 
 | ||||||
|  |                     <!-- 分页 --> | ||||||
|  |                     <div style="text-align: right; margin-top: 20px;"> | ||||||
|  |                         <el-pagination | ||||||
|  |                             background | ||||||
|  |                             @current-change="handleOrderPageChange" | ||||||
|  |                             :current-page.sync="orderPage.current" | ||||||
|  |                             :page-size="orderPage.size" | ||||||
|  |                             layout="total, prev, pager, next" | ||||||
|  |                             :total="filteredOrderList.length"> | ||||||
|  |                         </el-pagination> | ||||||
|  |                     </div> | ||||||
|  |                 </el-tab-pane> | ||||||
|  | 
 | ||||||
|  |                 <!-- 佣金统计Tab --> | ||||||
|  |                 <el-tab-pane label="佣金统计" name="commission"> | ||||||
|  |                     <!-- 搜索表单 --> | ||||||
|  |                     <el-form :inline="true" :model="commissionQuery" size="small" class="search-form"> | ||||||
|  |                         <el-form-item label="分销商"> | ||||||
|  |                             <el-input v-model="commissionQuery.distributorName" placeholder="请输入分销商姓名" clearable style="width: 200px"></el-input> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item label="等级"> | ||||||
|  |                             <el-select v-model="commissionQuery.level" placeholder="请选择等级" clearable style="width: 150px"> | ||||||
|  |                                 <el-option label="普通分销商" :value="1"></el-option> | ||||||
|  |                                 <el-option label="高级分销商" :value="2"></el-option> | ||||||
|  |                                 <el-option label="精英分销商" :value="3"></el-option> | ||||||
|  |                             </el-select> | ||||||
|  |                         </el-form-item> | ||||||
|  |                         <el-form-item> | ||||||
|  |                             <el-button type="primary" @click="handleCommissionSearch">查询</el-button> | ||||||
|  |                             <el-button @click="handleCommissionReset">重置</el-button> | ||||||
|  |                             <el-button type="success" @click="exportCommission">导出佣金</el-button> | ||||||
|  |                         </el-form-item> | ||||||
|  |                     </el-form> | ||||||
|  | 
 | ||||||
|  |                     <!-- 佣金统计列表 --> | ||||||
|  |                     <el-table | ||||||
|  |                         :data="filteredCommissionList" | ||||||
|  |                         border | ||||||
|  |                         show-summary | ||||||
|  |                         :summary-method="getSummaries" | ||||||
|  |                         style="width: 100%" | ||||||
|  |                         :header-cell-style="{ background: '#F5F7FA', color: '#606266' }"> | ||||||
|  |                         <el-table-column prop="distributorName" label="分销商" align="center" width="120"></el-table-column> | ||||||
|  |                         <el-table-column prop="mobile" label="手机号" align="center" width="130"></el-table-column> | ||||||
|  |                         <el-table-column prop="level" label="等级" align="center" width="120"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-tag :type="getLevelType(scope.row.level)"> | ||||||
|  |                                     {{ getLevelText(scope.row.level) }} | ||||||
|  |                                 </el-tag> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="orderCount" label="订单数量" align="center" width="100"></el-table-column> | ||||||
|  |                         <el-table-column prop="orderTotalMoney" label="订单总额(元)" align="center" width="140"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="money-text">{{ scope.row.orderTotalMoney }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="totalCommission" label="总佣金(元)" align="center" width="140"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="commission-text">{{ scope.row.totalCommission }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="myCommission" label="本人佣金(元)" align="center" width="140"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="commission-text">{{ scope.row.myCommission }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="superiorCommission" label="上级佣金(元)" align="center" width="140"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span class="commission-text">{{ scope.row.superiorCommission }}</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column prop="commissionRate" label="佣金率" align="center" width="100"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <span>{{ scope.row.commissionRate }}%</span> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                         <el-table-column label="操作" align="center" width="120" fixed="right"> | ||||||
|  |                             <template slot-scope="scope"> | ||||||
|  |                                 <el-button size="mini" type="primary" @click="viewCommissionDetail(scope.row)">详情</el-button> | ||||||
|  |                             </template> | ||||||
|  |                         </el-table-column> | ||||||
|  |                     </el-table> | ||||||
|  | 
 | ||||||
|  |                     <!-- 分页 --> | ||||||
|  |                     <div style="text-align: right; margin-top: 20px;"> | ||||||
|  |                         <el-pagination | ||||||
|  |                             background | ||||||
|  |                             @current-change="handleCommissionPageChange" | ||||||
|  |                             :current-page.sync="commissionPage.current" | ||||||
|  |                             :page-size="commissionPage.size" | ||||||
|  |                             layout="total, prev, pager, next" | ||||||
|  |                             :total="filteredCommissionList.length"> | ||||||
|  |                         </el-pagination> | ||||||
|  |                     </div> | ||||||
|  |                 </el-tab-pane> | ||||||
|  |             </el-tabs> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <!-- 订单详情对话框 --> | ||||||
|  |         <el-dialog title="订单详情" :visible.sync="orderDetailVisible" width="60%"> | ||||||
|  |             <el-descriptions :column="2" border v-if="orderDetail"> | ||||||
|  |                 <el-descriptions-item label="订单编号">{{ orderDetail.orderNo }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="市场订单号">{{ orderDetail.unitOrderNo }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="分销商">{{ orderDetail.distributorName }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="用户ID">{{ orderDetail.userId }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="订单金额"> | ||||||
|  |                     <span class="money-text">{{ orderDetail.totalMoney }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="分佣比例">{{ orderDetail.orderSharingRatio }}%</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="总佣金"> | ||||||
|  |                     <span class="commission-text">{{ orderDetail.totalCommission }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="分销商佣金"> | ||||||
|  |                     <span class="commission-text">{{ orderDetail.myCommission }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="上级佣金"> | ||||||
|  |                     <span class="commission-text">{{ orderDetail.superiorCommission }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="分销商佣金比例">{{ orderDetail.mySharingPercent }}%</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="订单状态"> | ||||||
|  |                     <el-tag :type="orderDetail.status === 1 ? 'success' : 'warning'"> | ||||||
|  |                         {{ orderDetail.status === 1 ? '已完成' : '未完成' }} | ||||||
|  |                     </el-tag> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="下单时间">{{ orderDetail.createTime }}</el-descriptions-item> | ||||||
|  |             </el-descriptions> | ||||||
|  | 
 | ||||||
|  |             <!-- 佣金计算说明 --> | ||||||
|  |             <div class="detail-section"> | ||||||
|  |                 <h4>💡 佣金计算逻辑</h4> | ||||||
|  |                 <el-alert type="info" :closable="false"> | ||||||
|  |                     <div style="line-height: 1.8;"> | ||||||
|  |                         <p><strong>总佣金</strong> = 订单金额 × 分佣比例 = {{ orderDetail.totalMoney }} × {{ orderDetail.orderSharingRatio }}% = <span class="commission-text">{{ orderDetail.totalCommission }} 元</span></p> | ||||||
|  |                         <p><strong>分销商佣金</strong> = 总佣金 × 分销商佣金比例 = {{ orderDetail.totalCommission }} × {{ orderDetail.mySharingPercent }}% = <span class="commission-text">{{ orderDetail.myCommission }} 元</span></p> | ||||||
|  |                         <p><strong>上级佣金</strong> = 总佣金 - 分销商佣金 = {{ orderDetail.totalCommission }} - {{ orderDetail.myCommission }} = <span class="commission-text">{{ orderDetail.superiorCommission }} 元</span></p> | ||||||
|  |                     </div> | ||||||
|  |                 </el-alert> | ||||||
|  |             </div> | ||||||
|  | 
 | ||||||
|  |             <span slot="footer" class="dialog-footer"> | ||||||
|  |                 <el-button @click="orderDetailVisible = false">关 闭</el-button> | ||||||
|  |             </span> | ||||||
|  |         </el-dialog> | ||||||
|  | 
 | ||||||
|  |         <!-- 佣金详情对话框 --> | ||||||
|  |         <el-dialog title="佣金详情" :visible.sync="commissionDetailVisible" width="70%"> | ||||||
|  |             <el-descriptions :column="2" border v-if="commissionDetail"> | ||||||
|  |                 <el-descriptions-item label="分销商">{{ commissionDetail.distributorName }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="手机号">{{ commissionDetail.mobile }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="等级"> | ||||||
|  |                     <el-tag :type="getLevelType(commissionDetail.level)"> | ||||||
|  |                         {{ getLevelText(commissionDetail.level) }} | ||||||
|  |                     </el-tag> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="订单数量">{{ commissionDetail.orderCount }}</el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="订单总额"> | ||||||
|  |                     <span class="money-text">{{ commissionDetail.orderTotalMoney }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="总佣金"> | ||||||
|  |                     <span class="commission-text">{{ commissionDetail.totalCommission }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="本人佣金"> | ||||||
|  |                     <span class="commission-text">{{ commissionDetail.myCommission }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="上级佣金"> | ||||||
|  |                     <span class="commission-text">{{ commissionDetail.superiorCommission }} 元</span> | ||||||
|  |                 </el-descriptions-item> | ||||||
|  |                 <el-descriptions-item label="佣金率">{{ commissionDetail.commissionRate }}%</el-descriptions-item> | ||||||
|  |             </el-descriptions> | ||||||
|  | 
 | ||||||
|  |             <!-- 订单明细表格 --> | ||||||
|  |             <div class="detail-section"> | ||||||
|  |                 <h4>订单明细</h4> | ||||||
|  |                 <el-table :data="commissionDetailOrders" border style="width: 100%"> | ||||||
|  |                     <el-table-column type="index" label="序号" align="center" width="60"></el-table-column> | ||||||
|  |                     <el-table-column prop="orderNo" label="订单编号" align="center" width="180"></el-table-column> | ||||||
|  |                     <el-table-column prop="totalMoney" label="订单金额" align="center" width="120"> | ||||||
|  |                         <template slot-scope="scope"> | ||||||
|  |                             <span class="money-text">{{ scope.row.totalMoney }} 元</span> | ||||||
|  |                         </template> | ||||||
|  |                     </el-table-column> | ||||||
|  |                     <el-table-column prop="totalCommission" label="总佣金" align="center" width="120"> | ||||||
|  |                         <template slot-scope="scope"> | ||||||
|  |                             <span class="commission-text">{{ scope.row.totalCommission }} 元</span> | ||||||
|  |                         </template> | ||||||
|  |                     </el-table-column> | ||||||
|  |                     <el-table-column prop="myCommission" label="本人佣金" align="center" width="120"> | ||||||
|  |                         <template slot-scope="scope"> | ||||||
|  |                             <span class="commission-text">{{ scope.row.myCommission }} 元</span> | ||||||
|  |                         </template> | ||||||
|  |                     </el-table-column> | ||||||
|  |                     <el-table-column prop="status" label="状态" align="center" width="100"> | ||||||
|  |                         <template slot-scope="scope"> | ||||||
|  |                             <el-tag :type="scope.row.status === 1 ? 'success' : 'warning'"> | ||||||
|  |                                 {{ scope.row.status === 1 ? '已完成' : '未完成' }} | ||||||
|  |                             </el-tag> | ||||||
|  |                         </template> | ||||||
|  |                     </el-table-column> | ||||||
|  |                     <el-table-column prop="createTime" label="下单时间" align="center"></el-table-column> | ||||||
|  |                 </el-table> | ||||||
|  |             </div> | ||||||
|  | 
 | ||||||
|  |             <span slot="footer" class="dialog-footer"> | ||||||
|  |                 <el-button @click="commissionDetailVisible = false">关 闭</el-button> | ||||||
|  |             </span> | ||||||
|  |         </el-dialog> | ||||||
|  |     </div> | ||||||
|  | 
 | ||||||
|  |     <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script> | ||||||
|  |     <script src="https://unpkg.com/element-ui/lib/index.js"></script> | ||||||
|  |     <script> | ||||||
|  |         new Vue({ | ||||||
|  |             el: '#app', | ||||||
|  |             data() { | ||||||
|  |                 return { | ||||||
|  |                     activeTab: 'order', | ||||||
|  | 
 | ||||||
|  |                     // 统计数据 | ||||||
|  |                     orderStats: { | ||||||
|  |                         totalCount: 1250, | ||||||
|  |                         totalMoney: 125680.50, | ||||||
|  |                         totalCommission: 12568.05, | ||||||
|  |                         commissionRate: 10 | ||||||
|  |                     }, | ||||||
|  | 
 | ||||||
|  |                     // 订单数据 | ||||||
|  |                     orderQuery: { | ||||||
|  |                         orderNo: '', | ||||||
|  |                         distributorName: '', | ||||||
|  |                         status: null | ||||||
|  |                     }, | ||||||
|  |                     orderList: [ | ||||||
|  |                         { id: 1, orderNo: 'ORD20240101001', unitOrderNo: 'UNIT20240101001', distributorName: '张三', userId: 1001, totalMoney: 299.00, orderSharingRatio: 10, totalCommission: 29.90, myCommission: 20.93, superiorCommission: 8.97, mySharingPercent: 70, status: 1, createTime: '2024-01-01 10:30:00' }, | ||||||
|  |                         { id: 2, orderNo: 'ORD20240102002', unitOrderNo: 'UNIT20240102002', distributorName: '李四', userId: 1002, totalMoney: 499.00, orderSharingRatio: 10, totalCommission: 49.90, myCommission: 49.90, superiorCommission: 0, mySharingPercent: 100, status: 0, createTime: '2024-01-02 14:20:00' }, | ||||||
|  |                         { id: 3, orderNo: 'ORD20240103003', unitOrderNo: 'UNIT20240103003', distributorName: '王五', userId: 1003, totalMoney: 688.00, orderSharingRatio: 10, totalCommission: 68.80, myCommission: 48.16, superiorCommission: 20.64, mySharingPercent: 70, status: 1, createTime: '2024-01-03 09:15:00' }, | ||||||
|  |                         { id: 4, orderNo: 'ORD20240104004', unitOrderNo: 'UNIT20240104004', distributorName: '张三', userId: 1004, totalMoney: 358.00, orderSharingRatio: 10, totalCommission: 35.80, myCommission: 25.06, superiorCommission: 10.74, mySharingPercent: 70, status: 1, createTime: '2024-01-04 16:45:00' }, | ||||||
|  |                         { id: 5, orderNo: 'ORD20240105005', unitOrderNo: 'UNIT20240105005', distributorName: '王五', userId: 1005, totalMoney: 799.00, orderSharingRatio: 10, totalCommission: 79.90, myCommission: 55.93, superiorCommission: 23.97, mySharingPercent: 70, status: 1, createTime: '2024-01-05 11:20:00' }, | ||||||
|  |                         { id: 6, orderNo: 'ORD20240106006', unitOrderNo: 'UNIT20240106006', distributorName: '李四', userId: 1006, totalMoney: 428.00, orderSharingRatio: 10, totalCommission: 42.80, myCommission: 42.80, superiorCommission: 0, mySharingPercent: 100, status: 0, createTime: '2024-01-06 13:50:00' }, | ||||||
|  |                         { id: 7, orderNo: 'ORD20240107007', unitOrderNo: 'UNIT20240107007', distributorName: '赵六', userId: 1007, totalMoney: 568.00, orderSharingRatio: 10, totalCommission: 56.80, myCommission: 56.80, superiorCommission: 0, mySharingPercent: 100, status: 1, createTime: '2024-01-07 15:30:00' }, | ||||||
|  |                         { id: 8, orderNo: 'ORD20240108008', unitOrderNo: 'UNIT20240108008', distributorName: '张三', userId: 1008, totalMoney: 268.00, orderSharingRatio: 10, totalCommission: 26.80, myCommission: 18.76, superiorCommission: 8.04, mySharingPercent: 70, status: 1, createTime: '2024-01-08 08:15:00' }, | ||||||
|  |                     ], | ||||||
|  |                     orderPage: { current: 1, size: 10 }, | ||||||
|  | 
 | ||||||
|  |                     // 佣金统计数据 | ||||||
|  |                     commissionQuery: { | ||||||
|  |                         distributorName: '', | ||||||
|  |                         level: null | ||||||
|  |                     }, | ||||||
|  |                     commissionList: [ | ||||||
|  |                         { distributorId: 1, distributorName: '张三', mobile: '13800138001', level: 2, orderCount: 25, orderTotalMoney: 7475.00, totalCommission: 747.50, myCommission: 523.25, superiorCommission: 224.25, commissionRate: 10 }, | ||||||
|  |                         { distributorId: 2, distributorName: '李四', mobile: '13800138002', level: 1, orderCount: 15, orderTotalMoney: 4485.00, totalCommission: 448.50, myCommission: 448.50, superiorCommission: 0, commissionRate: 10 }, | ||||||
|  |                         { distributorId: 3, distributorName: '王五', mobile: '13800138003', level: 3, orderCount: 38, orderTotalMoney: 11378.00, totalCommission: 1137.80, myCommission: 796.46, superiorCommission: 341.34, commissionRate: 10 }, | ||||||
|  |                         { distributorId: 4, distributorName: '赵六', mobile: '13800138004', level: 1, orderCount: 12, orderTotalMoney: 3592.00, totalCommission: 359.20, myCommission: 359.20, superiorCommission: 0, commissionRate: 10 }, | ||||||
|  |                         { distributorId: 5, distributorName: '孙八', mobile: '13800138006', level: 2, orderCount: 28, orderTotalMoney: 8384.00, totalCommission: 838.40, myCommission: 586.88, superiorCommission: 251.52, commissionRate: 10 }, | ||||||
|  |                     ], | ||||||
|  |                     commissionPage: { current: 1, size: 10 }, | ||||||
|  |                     commissionDetailOrders: [], | ||||||
|  | 
 | ||||||
|  |                     // 对话框 | ||||||
|  |                     orderDetailVisible: false, | ||||||
|  |                     commissionDetailVisible: false, | ||||||
|  |                     orderDetail: null, | ||||||
|  |                     commissionDetail: null | ||||||
|  |                 }; | ||||||
|  |             }, | ||||||
|  |             computed: { | ||||||
|  |                 filteredOrderList() { | ||||||
|  |                     let list = this.orderList; | ||||||
|  |                     if (this.orderQuery.orderNo) { | ||||||
|  |                         list = list.filter(item => item.orderNo.includes(this.orderQuery.orderNo)); | ||||||
|  |                     } | ||||||
|  |                     if (this.orderQuery.distributorName) { | ||||||
|  |                         list = list.filter(item => item.distributorName.includes(this.orderQuery.distributorName)); | ||||||
|  |                     } | ||||||
|  |                     if (this.orderQuery.status !== null && this.orderQuery.status !== '') { | ||||||
|  |                         list = list.filter(item => item.status === this.orderQuery.status); | ||||||
|  |                     } | ||||||
|  |                     return list; | ||||||
|  |                 }, | ||||||
|  |                 filteredCommissionList() { | ||||||
|  |                     let list = this.commissionList; | ||||||
|  |                     if (this.commissionQuery.distributorName) { | ||||||
|  |                         list = list.filter(item => item.distributorName.includes(this.commissionQuery.distributorName)); | ||||||
|  |                     } | ||||||
|  |                     if (this.commissionQuery.level !== null && this.commissionQuery.level !== '') { | ||||||
|  |                         list = list.filter(item => item.level === this.commissionQuery.level); | ||||||
|  |                     } | ||||||
|  |                     return list; | ||||||
|  |                 } | ||||||
|  |             }, | ||||||
|  |             methods: { | ||||||
|  |                 // 订单相关方法 | ||||||
|  |                 handleOrderSearch() { | ||||||
|  |                     this.$message.success('查询成功'); | ||||||
|  |                 }, | ||||||
|  |                 handleOrderReset() { | ||||||
|  |                     this.orderQuery = { orderNo: '', distributorName: '', status: null }; | ||||||
|  |                     this.$message.info('已重置查询条件'); | ||||||
|  |                 }, | ||||||
|  |                 viewOrderDetail(row) { | ||||||
|  |                     this.orderDetail = row; | ||||||
|  |                     this.orderDetailVisible = true; | ||||||
|  |                 }, | ||||||
|  |                 exportOrders() { | ||||||
|  |                     this.$message.success('订单数据导出成功!'); | ||||||
|  |                 }, | ||||||
|  |                 handleOrderPageChange(page) { | ||||||
|  |                     console.log('订单页码变化:', page); | ||||||
|  |                 }, | ||||||
|  | 
 | ||||||
|  |                 // 佣金相关方法 | ||||||
|  |                 handleCommissionSearch() { | ||||||
|  |                     this.$message.success('查询成功'); | ||||||
|  |                 }, | ||||||
|  |                 handleCommissionReset() { | ||||||
|  |                     this.commissionQuery = { distributorName: '', level: null }; | ||||||
|  |                     this.$message.info('已重置查询条件'); | ||||||
|  |                 }, | ||||||
|  |                 viewCommissionDetail(row) { | ||||||
|  |                     this.commissionDetail = row; | ||||||
|  |                     // 获取该分销商的订单明细 | ||||||
|  |                     this.commissionDetailOrders = this.orderList.filter( | ||||||
|  |                         order => order.distributorName === row.distributorName | ||||||
|  |                     ); | ||||||
|  |                     this.commissionDetailVisible = true; | ||||||
|  |                 }, | ||||||
|  |                 exportCommission() { | ||||||
|  |                     this.$message.success('佣金数据导出成功!'); | ||||||
|  |                 }, | ||||||
|  |                 handleCommissionPageChange(page) { | ||||||
|  |                     console.log('佣金页码变化:', page); | ||||||
|  |                 }, | ||||||
|  | 
 | ||||||
|  |                 // 合计计算 | ||||||
|  |                 getSummaries(param) { | ||||||
|  |                     const { columns, data } = param; | ||||||
|  |                     const sums = []; | ||||||
|  |                     columns.forEach((column, index) => { | ||||||
|  |                         if (index === 0) { | ||||||
|  |                             sums[index] = '合计'; | ||||||
|  |                             return; | ||||||
|  |                         } | ||||||
|  |                         const values = data.map(item => Number(item[column.property])); | ||||||
|  |                         if (!values.every(value => isNaN(value))) { | ||||||
|  |                             if (['orderCount', 'orderTotalMoney', 'totalCommission', 'myCommission', 'superiorCommission'].includes(column.property)) { | ||||||
|  |                                 sums[index] = values.reduce((prev, curr) => { | ||||||
|  |                                     const value = Number(curr); | ||||||
|  |                                     if (!isNaN(value)) { | ||||||
|  |                                         return prev + curr; | ||||||
|  |                                     } else { | ||||||
|  |                                         return prev; | ||||||
|  |                                     } | ||||||
|  |                                 }, 0); | ||||||
|  |                                 if (column.property !== 'orderCount') { | ||||||
|  |                                     sums[index] = sums[index].toFixed(2); | ||||||
|  |                                 } | ||||||
|  |                             } else { | ||||||
|  |                                 sums[index] = ''; | ||||||
|  |                             } | ||||||
|  |                         } else { | ||||||
|  |                             sums[index] = ''; | ||||||
|  |                         } | ||||||
|  |                     }); | ||||||
|  |                     return sums; | ||||||
|  |                 }, | ||||||
|  | 
 | ||||||
|  |                 // 工具方法 | ||||||
|  |                 getLevelType(level) { | ||||||
|  |                     const map = { 1: 'info', 2: 'success', 3: 'warning' }; | ||||||
|  |                     return map[level] || 'info'; | ||||||
|  |                 }, | ||||||
|  |                 getLevelText(level) { | ||||||
|  |                     const map = { 1: '普通分销商', 2: '高级分销商', 3: '精英分销商' }; | ||||||
|  |                     return map[level] || '未知'; | ||||||
|  |                 } | ||||||
|  |             }, | ||||||
|  |             mounted() { | ||||||
|  |                 this.$message({ | ||||||
|  |                     message: '欢迎使用分销订单与佣金管理系统!', | ||||||
|  |                     type: 'success' | ||||||
|  |                 }); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     </script> | ||||||
|  | </body> | ||||||
|  | </html> | ||||||
		Loading…
	
		Reference in New Issue