重构分销商审核和订单管理页面
- 移除Element UI和Vue.js依赖,改用原生HTML/CSS/JS实现 - 为分销商审核和订单管理页面添加Tab选项卡功能 - 实现自定义表单、表格、按钮等UI组件的样式 - 将动态数据绑定替换为静态数据展示 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
		
							parent
							
								
									8f31b9a105
								
							
						
					
					
						commit
						e405208130
					
				
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -4,7 +4,6 @@ | |||
|     <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; | ||||
|  | @ -56,13 +55,6 @@ | |||
|             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 { | ||||
|  | @ -103,8 +95,129 @@ | |||
|             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||||
|         } | ||||
| 
 | ||||
|         .tabs { | ||||
|             border-bottom: 2px solid #E4E7ED; | ||||
|             margin-bottom: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .tab-item { | ||||
|             display: inline-block; | ||||
|             padding: 12px 20px; | ||||
|             cursor: pointer; | ||||
|             border-bottom: 2px solid transparent; | ||||
|             margin-bottom: -2px; | ||||
|             color: #303133; | ||||
|         } | ||||
| 
 | ||||
|         .tab-item.active { | ||||
|             color: #409EFF; | ||||
|             border-bottom-color: #409EFF; | ||||
|         } | ||||
| 
 | ||||
|         .tab-content { | ||||
|             display: none; | ||||
|         } | ||||
| 
 | ||||
|         .tab-content.active { | ||||
|             display: block; | ||||
|         } | ||||
| 
 | ||||
|         .search-form { | ||||
|             margin: 20px 0; | ||||
|             padding: 20px; | ||||
|             background: #f5f7fa; | ||||
|             border-radius: 4px; | ||||
|         } | ||||
| 
 | ||||
|         .form-item { | ||||
|             display: inline-block; | ||||
|             margin-right: 20px; | ||||
|             margin-bottom: 10px; | ||||
|         } | ||||
| 
 | ||||
|         .form-item label { | ||||
|             margin-right: 8px; | ||||
|             color: #606266; | ||||
|         } | ||||
| 
 | ||||
|         .form-item input, .form-item select { | ||||
|             padding: 8px 12px; | ||||
|             border: 1px solid #DCDFE6; | ||||
|             border-radius: 4px; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         .btn { | ||||
|             padding: 9px 15px; | ||||
|             border: none; | ||||
|             border-radius: 4px; | ||||
|             cursor: pointer; | ||||
|             font-size: 14px; | ||||
|             margin-right: 10px; | ||||
|         } | ||||
| 
 | ||||
|         .btn-primary { | ||||
|             background: #409EFF; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         .btn-default { | ||||
|             background: white; | ||||
|             color: #606266; | ||||
|             border: 1px solid #DCDFE6; | ||||
|         } | ||||
| 
 | ||||
|         .btn-success { | ||||
|             background: #67C23A; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         table { | ||||
|             width: 100%; | ||||
|             border-collapse: collapse; | ||||
|             margin-top: 20px; | ||||
|         } | ||||
| 
 | ||||
|         table th, table td { | ||||
|             border: 1px solid #EBEEF5; | ||||
|             padding: 12px 8px; | ||||
|             text-align: center; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         table th { | ||||
|             background: #F5F7FA; | ||||
|             color: #606266; | ||||
|             font-weight: bold; | ||||
|         } | ||||
| 
 | ||||
|         table tr:hover { | ||||
|             background: #F5F7FA; | ||||
|         } | ||||
| 
 | ||||
|         .tag { | ||||
|             display: inline-block; | ||||
|             padding: 4px 12px; | ||||
|             border-radius: 4px; | ||||
|             font-size: 12px; | ||||
|         } | ||||
| 
 | ||||
|         .tag-success { | ||||
|             background: #f0f9ff; | ||||
|             color: #67C23A; | ||||
|             border: 1px solid #c6f6d5; | ||||
|         } | ||||
| 
 | ||||
|         .tag-warning { | ||||
|             background: #fffbeb; | ||||
|             color: #E6A23C; | ||||
|             border: 1px solid #fef3c7; | ||||
|         } | ||||
| 
 | ||||
|         .tag-info { | ||||
|             background: #f4f4f5; | ||||
|             color: #909399; | ||||
|             border: 1px solid #e4e4e7; | ||||
|         } | ||||
| 
 | ||||
|         .money-text { | ||||
|  | @ -117,13 +230,10 @@ | |||
|             font-weight: bold; | ||||
|         } | ||||
| 
 | ||||
|         .detail-section { | ||||
|         .pagination { | ||||
|             text-align: right; | ||||
|             margin-top: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .detail-section h4 { | ||||
|             margin-bottom: 10px; | ||||
|             color: #303133; | ||||
|             color: #606266; | ||||
|         } | ||||
| 
 | ||||
|         @media screen and (max-width: 1200px) { | ||||
|  | @ -140,7 +250,7 @@ | |||
|     </style> | ||||
| </head> | ||||
| <body> | ||||
|     <div id="app" class="container"> | ||||
|     <div class="container"> | ||||
|         <!-- 页面标题 --> | ||||
|         <div class="header-card"> | ||||
|             <h1 class="page-title">分销订单与佣金管理系统</h1> | ||||
|  | @ -151,37 +261,37 @@ | |||
|         <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-icon primary">📊</div> | ||||
|                     <div class="stat-info"> | ||||
|                         <div class="stat-label">分销订单总数</div> | ||||
|                         <div class="stat-value">{{ orderStats.totalCount }}</div> | ||||
|                         <div class="stat-value">1250</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-icon success">💰</div> | ||||
|                     <div class="stat-info"> | ||||
|                         <div class="stat-label">订单总金额(元)</div> | ||||
|                         <div class="stat-value">{{ orderStats.totalMoney }}</div> | ||||
|                         <div class="stat-value">125680.50</div> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="stat-card"> | ||||
|                 <div class="stat-content"> | ||||
|                     <i class="el-icon-wallet stat-icon warning"></i> | ||||
|                     <div class="stat-icon warning">💳</div> | ||||
|                     <div class="stat-info"> | ||||
|                         <div class="stat-label">佣金总额(元)</div> | ||||
|                         <div class="stat-value">{{ orderStats.totalCommission }}</div> | ||||
|                         <div class="stat-value">12568.05</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-icon info">📈</div> | ||||
|                     <div class="stat-info"> | ||||
|                         <div class="stat-label">佣金比例</div> | ||||
|                         <div class="stat-value">{{ orderStats.commissionRate }}%</div> | ||||
|                         <div class="stat-value">10%</div> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|  | @ -189,463 +299,310 @@ | |||
| 
 | ||||
|         <!-- 主内容 --> | ||||
|         <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> | ||||
|             <!-- Tab选项卡 --> | ||||
|             <div class="tabs"> | ||||
|                 <div class="tab-item active" onclick="switchTab('order')">订单明细</div> | ||||
|                 <div class="tab-item" onclick="switchTab('commission')">佣金统计</div> | ||||
|             </div> | ||||
| 
 | ||||
|                     <!-- 订单列表表格 --> | ||||
|                     <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> | ||||
|             <!-- 订单明细Tab --> | ||||
|             <div id="tab-order" class="tab-content active"> | ||||
|                 <!-- 搜索表单 --> | ||||
|                 <div class="search-form"> | ||||
|                     <div class="form-item"> | ||||
|                         <label>订单编号</label> | ||||
|                         <input type="text" placeholder="请输入订单编号" style="width: 200px"> | ||||
|                     </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 class="form-item"> | ||||
|                         <label>分销商</label> | ||||
|                         <input type="text" placeholder="请输入分销商姓名" style="width: 150px"> | ||||
|                     </div> | ||||
|                 </el-tab-pane> | ||||
|             </el-tabs> | ||||
|                     <div class="form-item"> | ||||
|                         <label>订单状态</label> | ||||
|                         <select style="width: 120px"> | ||||
|                             <option value="">全部</option> | ||||
|                             <option value="0">未完成</option> | ||||
|                             <option value="1">已完成</option> | ||||
|                         </select> | ||||
|                     </div> | ||||
|                     <div class="form-item"> | ||||
|                         <button class="btn btn-primary">查询</button> | ||||
|                         <button class="btn btn-default">重置</button> | ||||
|                         <button class="btn btn-success">导出订单</button> | ||||
|                     </div> | ||||
|                 </div> | ||||
| 
 | ||||
|                 <!-- 订单列表表格 --> | ||||
|                 <table> | ||||
|                     <thead> | ||||
|                         <tr> | ||||
|                             <th>订单编号</th> | ||||
|                             <th>市场订单号</th> | ||||
|                             <th>分销商</th> | ||||
|                             <th>订单金额(元)</th> | ||||
|                             <th>分佣比例</th> | ||||
|                             <th>总佣金(元)</th> | ||||
|                             <th>分销商佣金(元)</th> | ||||
|                             <th>上级佣金(元)</th> | ||||
|                             <th>订单状态</th> | ||||
|                             <th>下单时间</th> | ||||
|                             <th>操作</th> | ||||
|                         </tr> | ||||
|                     </thead> | ||||
|                     <tbody> | ||||
|                         <tr> | ||||
|                             <td>ORD20240101001</td> | ||||
|                             <td>UNIT20240101001</td> | ||||
|                             <td>张三</td> | ||||
|                             <td><span class="money-text">299.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">29.90</span></td> | ||||
|                             <td><span class="commission-text">20.93</span></td> | ||||
|                             <td><span class="commission-text">8.97</span></td> | ||||
|                             <td><span class="tag tag-success">已完成</span></td> | ||||
|                             <td>2024-01-01 10:30:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240102002</td> | ||||
|                             <td>UNIT20240102002</td> | ||||
|                             <td>李四</td> | ||||
|                             <td><span class="money-text">499.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">49.90</span></td> | ||||
|                             <td><span class="commission-text">49.90</span></td> | ||||
|                             <td><span class="commission-text">0.00</span></td> | ||||
|                             <td><span class="tag tag-warning">未完成</span></td> | ||||
|                             <td>2024-01-02 14:20:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240103003</td> | ||||
|                             <td>UNIT20240103003</td> | ||||
|                             <td>王五</td> | ||||
|                             <td><span class="money-text">688.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">68.80</span></td> | ||||
|                             <td><span class="commission-text">48.16</span></td> | ||||
|                             <td><span class="commission-text">20.64</span></td> | ||||
|                             <td><span class="tag tag-success">已完成</span></td> | ||||
|                             <td>2024-01-03 09:15:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240104004</td> | ||||
|                             <td>UNIT20240104004</td> | ||||
|                             <td>张三</td> | ||||
|                             <td><span class="money-text">358.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">35.80</span></td> | ||||
|                             <td><span class="commission-text">25.06</span></td> | ||||
|                             <td><span class="commission-text">10.74</span></td> | ||||
|                             <td><span class="tag tag-success">已完成</span></td> | ||||
|                             <td>2024-01-04 16:45:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240105005</td> | ||||
|                             <td>UNIT20240105005</td> | ||||
|                             <td>王五</td> | ||||
|                             <td><span class="money-text">799.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">79.90</span></td> | ||||
|                             <td><span class="commission-text">55.93</span></td> | ||||
|                             <td><span class="commission-text">23.97</span></td> | ||||
|                             <td><span class="tag tag-success">已完成</span></td> | ||||
|                             <td>2024-01-05 11:20:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240106006</td> | ||||
|                             <td>UNIT20240106006</td> | ||||
|                             <td>李四</td> | ||||
|                             <td><span class="money-text">428.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">42.80</span></td> | ||||
|                             <td><span class="commission-text">42.80</span></td> | ||||
|                             <td><span class="commission-text">0.00</span></td> | ||||
|                             <td><span class="tag tag-warning">未完成</span></td> | ||||
|                             <td>2024-01-06 13:50:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240107007</td> | ||||
|                             <td>UNIT20240107007</td> | ||||
|                             <td>赵六</td> | ||||
|                             <td><span class="money-text">568.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">56.80</span></td> | ||||
|                             <td><span class="commission-text">56.80</span></td> | ||||
|                             <td><span class="commission-text">0.00</span></td> | ||||
|                             <td><span class="tag tag-success">已完成</span></td> | ||||
|                             <td>2024-01-07 15:30:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>ORD20240108008</td> | ||||
|                             <td>UNIT20240108008</td> | ||||
|                             <td>张三</td> | ||||
|                             <td><span class="money-text">268.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><span class="commission-text">26.80</span></td> | ||||
|                             <td><span class="commission-text">18.76</span></td> | ||||
|                             <td><span class="commission-text">8.04</span></td> | ||||
|                             <td><span class="tag tag-success">已完成</span></td> | ||||
|                             <td>2024-01-08 08:15:00</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                     </tbody> | ||||
|                 </table> | ||||
| 
 | ||||
|                 <!-- 分页 --> | ||||
|                 <div class="pagination"> | ||||
|                     共 8 条 | ||||
|                 </div> | ||||
|             </div> | ||||
| 
 | ||||
|             <!-- 佣金统计Tab --> | ||||
|             <div id="tab-commission" class="tab-content"> | ||||
|                 <!-- 搜索表单 --> | ||||
|                 <div class="search-form"> | ||||
|                     <div class="form-item"> | ||||
|                         <label>分销商</label> | ||||
|                         <input type="text" placeholder="请输入分销商姓名" style="width: 200px"> | ||||
|                     </div> | ||||
|                     <div class="form-item"> | ||||
|                         <label>等级</label> | ||||
|                         <select style="width: 150px"> | ||||
|                             <option value="">全部</option> | ||||
|                             <option value="1">普通分销商</option> | ||||
|                             <option value="2">高级分销商</option> | ||||
|                             <option value="3">精英分销商</option> | ||||
|                         </select> | ||||
|                     </div> | ||||
|                     <div class="form-item"> | ||||
|                         <button class="btn btn-primary">查询</button> | ||||
|                         <button class="btn btn-default">重置</button> | ||||
|                         <button class="btn btn-success">导出佣金</button> | ||||
|                     </div> | ||||
|                 </div> | ||||
| 
 | ||||
|                 <!-- 佣金统计列表 --> | ||||
|                 <table> | ||||
|                     <thead> | ||||
|                         <tr> | ||||
|                             <th>分销商</th> | ||||
|                             <th>手机号</th> | ||||
|                             <th>等级</th> | ||||
|                             <th>订单数量</th> | ||||
|                             <th>订单总额(元)</th> | ||||
|                             <th>总佣金(元)</th> | ||||
|                             <th>本人佣金(元)</th> | ||||
|                             <th>上级佣金(元)</th> | ||||
|                             <th>佣金率</th> | ||||
|                             <th>操作</th> | ||||
|                         </tr> | ||||
|                     </thead> | ||||
|                     <tbody> | ||||
|                         <tr> | ||||
|                             <td>张三</td> | ||||
|                             <td>13800138001</td> | ||||
|                             <td><span class="tag tag-success">高级分销商</span></td> | ||||
|                             <td>25</td> | ||||
|                             <td><span class="money-text">7475.00</span></td> | ||||
|                             <td><span class="commission-text">747.50</span></td> | ||||
|                             <td><span class="commission-text">523.25</span></td> | ||||
|                             <td><span class="commission-text">224.25</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>李四</td> | ||||
|                             <td>13800138002</td> | ||||
|                             <td><span class="tag tag-info">普通分销商</span></td> | ||||
|                             <td>15</td> | ||||
|                             <td><span class="money-text">4485.00</span></td> | ||||
|                             <td><span class="commission-text">448.50</span></td> | ||||
|                             <td><span class="commission-text">448.50</span></td> | ||||
|                             <td><span class="commission-text">0.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>王五</td> | ||||
|                             <td>13800138003</td> | ||||
|                             <td><span class="tag tag-warning">精英分销商</span></td> | ||||
|                             <td>38</td> | ||||
|                             <td><span class="money-text">11378.00</span></td> | ||||
|                             <td><span class="commission-text">1137.80</span></td> | ||||
|                             <td><span class="commission-text">796.46</span></td> | ||||
|                             <td><span class="commission-text">341.34</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>赵六</td> | ||||
|                             <td>13800138004</td> | ||||
|                             <td><span class="tag tag-info">普通分销商</span></td> | ||||
|                             <td>12</td> | ||||
|                             <td><span class="money-text">3592.00</span></td> | ||||
|                             <td><span class="commission-text">359.20</span></td> | ||||
|                             <td><span class="commission-text">359.20</span></td> | ||||
|                             <td><span class="commission-text">0.00</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                         <tr> | ||||
|                             <td>孙八</td> | ||||
|                             <td>13800138006</td> | ||||
|                             <td><span class="tag tag-success">高级分销商</span></td> | ||||
|                             <td>28</td> | ||||
|                             <td><span class="money-text">8384.00</span></td> | ||||
|                             <td><span class="commission-text">838.40</span></td> | ||||
|                             <td><span class="commission-text">586.88</span></td> | ||||
|                             <td><span class="commission-text">251.52</span></td> | ||||
|                             <td>10%</td> | ||||
|                             <td><button class="btn btn-primary" style="margin: 0; padding: 5px 15px;">详情</button></td> | ||||
|                         </tr> | ||||
|                     </tbody> | ||||
|                     <tfoot> | ||||
|                         <tr style="font-weight: bold; background: #F5F7FA;"> | ||||
|                             <td>合计</td> | ||||
|                             <td></td> | ||||
|                             <td></td> | ||||
|                             <td>118</td> | ||||
|                             <td><span class="money-text">35314.00</span></td> | ||||
|                             <td><span class="commission-text">3531.40</span></td> | ||||
|                             <td><span class="commission-text">2714.29</span></td> | ||||
|                             <td><span class="commission-text">817.11</span></td> | ||||
|                             <td></td> | ||||
|                             <td></td> | ||||
|                         </tr> | ||||
|                     </tfoot> | ||||
|                 </table> | ||||
| 
 | ||||
|                 <!-- 分页 --> | ||||
|                 <div class="pagination"> | ||||
|                     共 5 条 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </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', | ||||
|         function switchTab(tabName) { | ||||
|             // 移除所有active类 | ||||
|             document.querySelectorAll('.tab-item').forEach(item => { | ||||
|                 item.classList.remove('active'); | ||||
|             }); | ||||
|             document.querySelectorAll('.tab-content').forEach(content => { | ||||
|                 content.classList.remove('active'); | ||||
|             }); | ||||
| 
 | ||||
|                     // 统计数据 | ||||
|                     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' | ||||
|                 }); | ||||
|             } | ||||
|         }); | ||||
|             // 添加active类到当前tab | ||||
|             event.target.classList.add('active'); | ||||
|             document.getElementById('tab-' + tabName).classList.add('active'); | ||||
|         } | ||||
|     </script> | ||||
| </body> | ||||
| </html> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue