748 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			748 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			HTML
		
	
	
	
| <!DOCTYPE html>
 | |
| <html lang="zh-CN">
 | |
| <head>
 | |
|     <meta charset="UTF-8">
 | |
|     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | |
|     <title>专员管理</title>
 | |
|     <style>
 | |
|         * {
 | |
|             margin: 0;
 | |
|             padding: 0;
 | |
|             box-sizing: border-box;
 | |
|         }
 | |
| 
 | |
|         body {
 | |
|             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
 | |
|             background-color: #f5f5f5;
 | |
|             padding: 20px;
 | |
|         }
 | |
| 
 | |
|         .page-title {
 | |
|             font-size: 24px;
 | |
|             font-weight: 500;
 | |
|             color: #333;
 | |
|             margin-bottom: 20px;
 | |
|         }
 | |
| 
 | |
|         .config-section {
 | |
|             background-color: #fff;
 | |
|             padding: 20px;
 | |
|             margin-bottom: 20px;
 | |
|             border-radius: 4px;
 | |
|             box-shadow: 0 2px 8px rgba(0,0,0,0.1);
 | |
|         }
 | |
| 
 | |
|         .config-header {
 | |
|             display: flex;
 | |
|             justify-content: space-between;
 | |
|             align-items: center;
 | |
|             margin-bottom: 15px;
 | |
|         }
 | |
| 
 | |
|         .config-title {
 | |
|             font-size: 16px;
 | |
|             font-weight: 500;
 | |
|             color: #333;
 | |
|         }
 | |
| 
 | |
|         .config-help {
 | |
|             color: #1890ff;
 | |
|             font-size: 14px;
 | |
|             cursor: pointer;
 | |
|         }
 | |
| 
 | |
|         .config-item {
 | |
|             display: flex;
 | |
|             align-items: center;
 | |
|             padding: 12px 0;
 | |
|             gap: 16px;
 | |
|         }
 | |
| 
 | |
|         .config-label {
 | |
|             font-size: 14px;
 | |
|             color: #333;
 | |
|             min-width: 100px;
 | |
|         }
 | |
| 
 | |
|         .config-label::before {
 | |
|             content: '*';
 | |
|             color: #ff4d4f;
 | |
|             margin-right: 5px;
 | |
|         }
 | |
| 
 | |
|         .config-value {
 | |
|             color: #666;
 | |
|             font-size: 14px;
 | |
|             flex: 1;
 | |
|         }
 | |
| 
 | |
|         .config-value-display {
 | |
|             display: inline-block;
 | |
|             min-width: 120px;
 | |
|         }
 | |
| 
 | |
|         .modify-btn {
 | |
|             padding: 6px 16px;
 | |
|             border: 1px solid #1890ff;
 | |
|             border-radius: 4px;
 | |
|             background-color: #fff;
 | |
|             color: #1890ff;
 | |
|             font-size: 14px;
 | |
|             cursor: pointer;
 | |
|             transition: all 0.3s;
 | |
|         }
 | |
| 
 | |
|         .modify-btn:hover {
 | |
|             background-color: #e6f7ff;
 | |
|         }
 | |
| 
 | |
|         .select-wrapper {
 | |
|             position: relative;
 | |
|             display: inline-block;
 | |
|             min-width: 200px;
 | |
|         }
 | |
| 
 | |
|         .select-box {
 | |
|             width: 100%;
 | |
|             padding: 8px 30px 8px 12px;
 | |
|             border: 1px solid #d9d9d9;
 | |
|             border-radius: 2px;
 | |
|             font-size: 14px;
 | |
|             color: #333;
 | |
|             background-color: #fff;
 | |
|             cursor: pointer;
 | |
|             appearance: none;
 | |
|             -webkit-appearance: none;
 | |
|             -moz-appearance: none;
 | |
|             transition: all 0.3s;
 | |
|         }
 | |
| 
 | |
|         .select-box:hover {
 | |
|             border-color: #40a9ff;
 | |
|         }
 | |
| 
 | |
|         .select-box:focus {
 | |
|             outline: none;
 | |
|             border-color: #1890ff;
 | |
|             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
 | |
|         }
 | |
| 
 | |
|         .select-wrapper::after {
 | |
|             content: '▼';
 | |
|             position: absolute;
 | |
|             right: 12px;
 | |
|             top: 50%;
 | |
|             transform: translateY(-50%);
 | |
|             color: #999;
 | |
|             font-size: 10px;
 | |
|             pointer-events: none;
 | |
|         }
 | |
| 
 | |
|         .staff-section {
 | |
|             background-color: #fff;
 | |
|             padding: 20px;
 | |
|             border-radius: 4px;
 | |
|             box-shadow: 0 2px 8px rgba(0,0,0,0.1);
 | |
|         }
 | |
| 
 | |
|         .section-header {
 | |
|             display: flex;
 | |
|             justify-content: space-between;
 | |
|             align-items: center;
 | |
|             margin-bottom: 20px;
 | |
|         }
 | |
| 
 | |
|         .section-title {
 | |
|             font-size: 16px;
 | |
|             font-weight: 500;
 | |
|             color: #333;
 | |
|         }
 | |
| 
 | |
|         .add-btn {
 | |
|             padding: 8px 20px;
 | |
|             border: none;
 | |
|             border-radius: 4px;
 | |
|             background-color: #1890ff;
 | |
|             color: #fff;
 | |
|             font-size: 14px;
 | |
|             cursor: pointer;
 | |
|             transition: all 0.3s;
 | |
|         }
 | |
| 
 | |
|         .add-btn:hover {
 | |
|             background-color: #40a9ff;
 | |
|         }
 | |
| 
 | |
|         .staff-table {
 | |
|             width: 100%;
 | |
|             border-collapse: collapse;
 | |
|         }
 | |
| 
 | |
|         .staff-table thead {
 | |
|             background-color: #fafafa;
 | |
|         }
 | |
| 
 | |
|         .staff-table th {
 | |
|             padding: 12px 16px;
 | |
|             text-align: left;
 | |
|             font-weight: 500;
 | |
|             color: #333;
 | |
|             font-size: 14px;
 | |
|             border-bottom: 1px solid #e8e8e8;
 | |
|         }
 | |
| 
 | |
|         .staff-table td {
 | |
|             padding: 16px;
 | |
|             border-bottom: 1px solid #f0f0f0;
 | |
|             font-size: 14px;
 | |
|             color: #666;
 | |
|         }
 | |
| 
 | |
|         .staff-table tbody tr:hover {
 | |
|             background-color: #fafafa;
 | |
|         }
 | |
| 
 | |
|         .staff-name-cell {
 | |
|             display: flex;
 | |
|             align-items: center;
 | |
|             gap: 8px;
 | |
|         }
 | |
| 
 | |
|         .market-badge {
 | |
|             background-color: #e6f7ff;
 | |
|             color: #1890ff;
 | |
|             padding: 2px 8px;
 | |
|             border-radius: 2px;
 | |
|             font-size: 12px;
 | |
|         }
 | |
| 
 | |
|         .action-btns {
 | |
|             display: flex;
 | |
|             gap: 8px;
 | |
|         }
 | |
| 
 | |
|         .action-btn {
 | |
|             padding: 5px 12px;
 | |
|             border: 1px solid #d9d9d9;
 | |
|             border-radius: 2px;
 | |
|             background-color: #fff;
 | |
|             color: #666;
 | |
|             font-size: 13px;
 | |
|             cursor: pointer;
 | |
|             transition: all 0.3s;
 | |
|         }
 | |
| 
 | |
|         .action-btn:hover {
 | |
|             color: #1890ff;
 | |
|             border-color: #1890ff;
 | |
|         }
 | |
| 
 | |
|         .action-btn.primary {
 | |
|             color: #1890ff;
 | |
|             border-color: #1890ff;
 | |
|         }
 | |
| 
 | |
|         .action-btn.primary:hover {
 | |
|             background-color: #e6f7ff;
 | |
|         }
 | |
| 
 | |
|         /* 弹窗遮罩层 */
 | |
|         .modal-overlay {
 | |
|             display: none;
 | |
|             position: fixed;
 | |
|             top: 0;
 | |
|             left: 0;
 | |
|             right: 0;
 | |
|             bottom: 0;
 | |
|             background-color: rgba(0, 0, 0, 0.5);
 | |
|             z-index: 1000;
 | |
|             justify-content: center;
 | |
|             align-items: center;
 | |
|         }
 | |
| 
 | |
|         .modal-overlay.active {
 | |
|             display: flex;
 | |
|         }
 | |
| 
 | |
|         /* 弹窗容器 */
 | |
|         .modal-container {
 | |
|             background-color: #fff;
 | |
|             border-radius: 8px;
 | |
|             width: 90%;
 | |
|             max-width: 500px;
 | |
|             max-height: 90vh;
 | |
|             overflow-y: auto;
 | |
|             box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
 | |
|         }
 | |
| 
 | |
|         /* 弹窗标题 */
 | |
|         .modal-header {
 | |
|             padding: 20px 24px;
 | |
|             border-bottom: 1px solid #f0f0f0;
 | |
|             text-align: center;
 | |
|         }
 | |
| 
 | |
|         .modal-title {
 | |
|             font-size: 18px;
 | |
|             font-weight: 500;
 | |
|             color: #333;
 | |
|         }
 | |
| 
 | |
|         /* 弹窗内容 */
 | |
|         .modal-body {
 | |
|             padding: 24px;
 | |
|         }
 | |
| 
 | |
|         .form-item {
 | |
|             margin-bottom: 24px;
 | |
|         }
 | |
| 
 | |
|         .form-label {
 | |
|             display: block;
 | |
|             font-size: 14px;
 | |
|             color: #333;
 | |
|             margin-bottom: 8px;
 | |
|         }
 | |
| 
 | |
|         .form-label.required::before {
 | |
|             content: '*';
 | |
|             color: #ff4d4f;
 | |
|             margin-right: 4px;
 | |
|         }
 | |
| 
 | |
|         .form-input {
 | |
|             width: 100%;
 | |
|             padding: 10px 12px;
 | |
|             border: 1px solid #d9d9d9;
 | |
|             border-radius: 4px;
 | |
|             font-size: 14px;
 | |
|             color: #333;
 | |
|             transition: all 0.3s;
 | |
|         }
 | |
| 
 | |
|         .form-input::placeholder {
 | |
|             color: #bfbfbf;
 | |
|         }
 | |
| 
 | |
|         .form-input:hover {
 | |
|             border-color: #40a9ff;
 | |
|         }
 | |
| 
 | |
|         .form-input:focus {
 | |
|             outline: none;
 | |
|             border-color: #1890ff;
 | |
|             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
 | |
|         }
 | |
| 
 | |
|         /* 复选框组 */
 | |
|         .checkbox-group {
 | |
|             display: flex;
 | |
|             flex-direction: column;
 | |
|             gap: 12px;
 | |
|         }
 | |
| 
 | |
|         .checkbox-item {
 | |
|             display: flex;
 | |
|             align-items: center;
 | |
|         }
 | |
| 
 | |
|         .checkbox-item input[type="checkbox"] {
 | |
|             width: 18px;
 | |
|             height: 18px;
 | |
|             margin-right: 8px;
 | |
|             cursor: pointer;
 | |
|             accent-color: #1890ff;
 | |
|         }
 | |
| 
 | |
|         .checkbox-item label {
 | |
|             font-size: 14px;
 | |
|             color: #333;
 | |
|             cursor: pointer;
 | |
|         }
 | |
| 
 | |
|         /* 弹窗底部按钮 */
 | |
|         .modal-footer {
 | |
|             padding: 16px 24px;
 | |
|             border-top: 1px solid #f0f0f0;
 | |
|             display: flex;
 | |
|             justify-content: center;
 | |
|             gap: 16px;
 | |
|         }
 | |
| 
 | |
|         .modal-btn {
 | |
|             flex: 1;
 | |
|             max-width: 200px;
 | |
|             padding: 10px 24px;
 | |
|             border: none;
 | |
|             border-radius: 24px;
 | |
|             font-size: 15px;
 | |
|             cursor: pointer;
 | |
|             transition: all 0.3s;
 | |
|         }
 | |
| 
 | |
|         .modal-btn.cancel {
 | |
|             background-color: #f0f0f0;
 | |
|             color: #666;
 | |
|         }
 | |
| 
 | |
|         .modal-btn.cancel:hover {
 | |
|             background-color: #e0e0e0;
 | |
|         }
 | |
| 
 | |
|         .modal-btn.confirm {
 | |
|             background-color: #2d6a4f;
 | |
|             color: #fff;
 | |
|         }
 | |
| 
 | |
|         .modal-btn.confirm:hover {
 | |
|             background-color: #1d4d38;
 | |
|         }
 | |
| 
 | |
|         /* 单选按钮组 */
 | |
|         .radio-group {
 | |
|             display: flex;
 | |
|             flex-direction: column;
 | |
|             gap: 16px;
 | |
|         }
 | |
| 
 | |
|         .radio-item {
 | |
|             display: flex;
 | |
|             align-items: center;
 | |
|         }
 | |
| 
 | |
|         .radio-item input[type="radio"] {
 | |
|             width: 18px;
 | |
|             height: 18px;
 | |
|             margin-right: 8px;
 | |
|             cursor: pointer;
 | |
|             accent-color: #1890ff;
 | |
|         }
 | |
| 
 | |
|         .radio-item label {
 | |
|             font-size: 14px;
 | |
|             color: #333;
 | |
|             cursor: pointer;
 | |
|             flex: 1;
 | |
|         }
 | |
|     </style>
 | |
| </head>
 | |
| <body>
 | |
|     <h1 class="page-title">专员管理</h1>
 | |
| 
 | |
|     <!-- 费用配置部分 -->
 | |
|     <div class="config-section">
 | |
|         <div class="config-header">
 | |
|             <div class="config-title">专员调度费配置</div>
 | |
|             <div class="config-help">字段说明</div>
 | |
|         </div>
 | |
|         <div class="config-item">
 | |
|             <div class="config-label">费用支付方</div>
 | |
|             <div class="config-value">
 | |
|                 <span class="config-value-display" id="paymentMethodDisplay">顾客支付</span>
 | |
|             </div>
 | |
|             <button class="modify-btn" onclick="openPaymentModal()">修改</button>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
|     <!-- 专员列表部分 -->
 | |
|     <div class="staff-section">
 | |
|         <div class="section-header">
 | |
|             <div class="section-title">专员列表</div>
 | |
|             <button class="add-btn" onclick="addStaff()">添加专员</button>
 | |
|         </div>
 | |
| 
 | |
|         <table class="staff-table">
 | |
|             <thead>
 | |
|                 <tr>
 | |
|                     <th>姓名</th>
 | |
|                     <th>账号</th>
 | |
|                     <th>专员类型</th>
 | |
|                     <th>操作</th>
 | |
|                 </tr>
 | |
|             </thead>
 | |
|             <tbody>
 | |
|                 <tr>
 | |
|                     <td>
 | |
|                         <div class="staff-name-cell">
 | |
|                             <span>春申菜场专员</span>
 | |
|                             <span class="market-badge">当前市场专员</span>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                     <td>13800000299</td>
 | |
|                     <td>调度专员;配送专员;客服专员</td>
 | |
|                     <td>
 | |
|                         <div class="action-btns">
 | |
|                             <button class="action-btn">取消市场专员</button>
 | |
|                             <button class="action-btn primary" onclick="editStaff('春申菜场专员', '13800000299', ['scheduler', 'delivery', 'service'])">编辑</button>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                 </tr>
 | |
|                 <tr>
 | |
|                     <td>
 | |
|                         <div class="staff-name-cell">
 | |
|                             <span>春申菜场调度专员</span>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                     <td>13800000298</td>
 | |
|                     <td>调度专员</td>
 | |
|                     <td>
 | |
|                         <div class="action-btns">
 | |
|                             <button class="action-btn">设为市场专员</button>
 | |
|                             <button class="action-btn primary" onclick="editStaff('春申菜场调度专员', '13800000298', ['scheduler'])">编辑</button>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                 </tr>
 | |
|                 <tr>
 | |
|                     <td>
 | |
|                         <div class="staff-name-cell">
 | |
|                             <span>春申菜场客服专员</span>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                     <td>13800000296</td>
 | |
|                     <td>客服专员</td>
 | |
|                     <td>
 | |
|                         <div class="action-btns">
 | |
|                             <button class="action-btn">设为市场专员</button>
 | |
|                             <button class="action-btn primary" onclick="editStaff('春申菜场客服专员', '13800000296', ['service'])">编辑</button>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                 </tr>
 | |
|                 <tr>
 | |
|                     <td>
 | |
|                         <div class="staff-name-cell">
 | |
|                             <span>春申菜市场配送专员</span>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                     <td>13800000297</td>
 | |
|                     <td>配送专员</td>
 | |
|                     <td>
 | |
|                         <div class="action-btns">
 | |
|                             <button class="action-btn">设为市场专员</button>
 | |
|                             <button class="action-btn primary" onclick="editStaff('春申菜市场配送专员', '13800000297', ['delivery'])">编辑</button>
 | |
|                         </div>
 | |
|                     </td>
 | |
|                 </tr>
 | |
|             </tbody>
 | |
|         </table>
 | |
|     </div>
 | |
| 
 | |
|     <!-- 添加/编辑专员弹窗 -->
 | |
|     <div class="modal-overlay" id="staffModal">
 | |
|         <div class="modal-container">
 | |
|             <div class="modal-header">
 | |
|                 <h2 class="modal-title" id="modalTitle">添加专员</h2>
 | |
|             </div>
 | |
|             <div class="modal-body">
 | |
|                 <form id="staffForm">
 | |
|                     <div class="form-item">
 | |
|                         <label class="form-label required">专员姓名</label>
 | |
|                         <input type="text" class="form-input" id="staffName" placeholder="请输入专员姓名">
 | |
|                     </div>
 | |
|                     <div class="form-item">
 | |
|                         <label class="form-label required">专员账号</label>
 | |
|                         <input type="text" class="form-input" id="staffPhone" placeholder="请输入手机号">
 | |
|                     </div>
 | |
|                     <div class="form-item">
 | |
|                         <label class="form-label required">专员类型</label>
 | |
|                         <div class="checkbox-group">
 | |
|                             <div class="checkbox-item">
 | |
|                                 <input type="checkbox" id="typeScheduler" value="scheduler">
 | |
|                                 <label for="typeScheduler">调度专员</label>
 | |
|                             </div>
 | |
|                             <div class="checkbox-item">
 | |
|                                 <input type="checkbox" id="typeDelivery" value="delivery">
 | |
|                                 <label for="typeDelivery">配送专员</label>
 | |
|                             </div>
 | |
|                             <div class="checkbox-item">
 | |
|                                 <input type="checkbox" id="typeService" value="service">
 | |
|                                 <label for="typeService">客服专员</label>
 | |
|                             </div>
 | |
|                         </div>
 | |
|                     </div>
 | |
|                 </form>
 | |
|             </div>
 | |
|             <div class="modal-footer">
 | |
|                 <button class="modal-btn cancel" onclick="closeModal()">取消</button>
 | |
|                 <button class="modal-btn confirm" onclick="submitStaff()">确定</button>
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
|     <!-- 费用支付方修改弹窗 -->
 | |
|     <div class="modal-overlay" id="paymentModal">
 | |
|         <div class="modal-container">
 | |
|             <div class="modal-header">
 | |
|                 <h2 class="modal-title">专员调度费配置</h2>
 | |
|             </div>
 | |
|             <div class="modal-body">
 | |
|                 <form id="paymentForm">
 | |
|                     <div class="form-item">
 | |
|                         <div class="radio-group">
 | |
|                             <div class="radio-item">
 | |
|                                 <input type="radio" id="paymentCustomer" name="paymentMethod" value="customer" checked>
 | |
|                                 <label for="paymentCustomer">
 | |
|                                     <div style="font-weight: 500; margin-bottom: 4px;">顾客支付</div>
 | |
|                                     <div style="color: #999; font-size: 13px;">顾客在下单时,将根据配置内容额外收取专员调度费用;</div>
 | |
|                                 </label>
 | |
|                             </div>
 | |
|                             <div class="radio-item">
 | |
|                                 <input type="radio" id="paymentOperator" name="paymentMethod" value="operator">
 | |
|                                 <label for="paymentOperator">
 | |
|                                     <div style="font-weight: 500; margin-bottom: 4px;">经营者支付</div>
 | |
|                                     <div style="color: #999; font-size: 13px;">根据配置,从经营者收益中扣除相应费用作为专员调度费;</div>
 | |
|                                 </label>
 | |
|                             </div>
 | |
|                         </div>
 | |
|                     </div>
 | |
|                 </form>
 | |
|             </div>
 | |
|             <div class="modal-footer">
 | |
|                 <button class="modal-btn cancel" onclick="closePaymentModal()">取消</button>
 | |
|                 <button class="modal-btn confirm" onclick="submitPaymentMethod()">确定</button>
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
|     <script>
 | |
|         let isEditMode = false;
 | |
|         let currentEditStaff = null;
 | |
|         let currentPaymentMethod = 'customer'; // 默认顾客支付
 | |
| 
 | |
|         // 添加专员
 | |
|         function addStaff() {
 | |
|             isEditMode = false;
 | |
|             document.getElementById('modalTitle').textContent = '添加专员';
 | |
|             document.getElementById('staffForm').reset();
 | |
|             document.getElementById('staffModal').classList.add('active');
 | |
|         }
 | |
| 
 | |
|         // 编辑专员
 | |
|         function editStaff(name, phone, types) {
 | |
|             isEditMode = true;
 | |
|             currentEditStaff = { name, phone, types };
 | |
| 
 | |
|             document.getElementById('modalTitle').textContent = '编辑专员';
 | |
|             document.getElementById('staffName').value = name;
 | |
|             document.getElementById('staffPhone').value = phone;
 | |
| 
 | |
|             // 重置所有复选框
 | |
|             document.getElementById('typeScheduler').checked = false;
 | |
|             document.getElementById('typeDelivery').checked = false;
 | |
|             document.getElementById('typeService').checked = false;
 | |
| 
 | |
|             // 设置已选择的专员类型
 | |
|             types.forEach(type => {
 | |
|                 if (type === 'scheduler') {
 | |
|                     document.getElementById('typeScheduler').checked = true;
 | |
|                 } else if (type === 'delivery') {
 | |
|                     document.getElementById('typeDelivery').checked = true;
 | |
|                 } else if (type === 'service') {
 | |
|                     document.getElementById('typeService').checked = true;
 | |
|                 }
 | |
|             });
 | |
| 
 | |
|             document.getElementById('staffModal').classList.add('active');
 | |
|         }
 | |
| 
 | |
|         // 关闭专员弹窗
 | |
|         function closeModal() {
 | |
|             document.getElementById('staffModal').classList.remove('active');
 | |
|             document.getElementById('staffForm').reset();
 | |
|         }
 | |
| 
 | |
|         // 提交专员表单
 | |
|         function submitStaff() {
 | |
|             const name = document.getElementById('staffName').value.trim();
 | |
|             const phone = document.getElementById('staffPhone').value.trim();
 | |
|             const types = [];
 | |
| 
 | |
|             if (document.getElementById('typeScheduler').checked) {
 | |
|                 types.push('调度专员');
 | |
|             }
 | |
|             if (document.getElementById('typeDelivery').checked) {
 | |
|                 types.push('配送专员');
 | |
|             }
 | |
|             if (document.getElementById('typeService').checked) {
 | |
|                 types.push('客服专员');
 | |
|             }
 | |
| 
 | |
|             // 表单验证
 | |
|             if (!name) {
 | |
|                 alert('请输入专员姓名');
 | |
|                 return;
 | |
|             }
 | |
| 
 | |
|             if (!phone) {
 | |
|                 alert('请输入手机号');
 | |
|                 return;
 | |
|             }
 | |
| 
 | |
|             // 验证手机号格式
 | |
|             if (!/^1[3-9]\d{9}$/.test(phone)) {
 | |
|                 alert('请输入正确的手机号');
 | |
|                 return;
 | |
|             }
 | |
| 
 | |
|             if (types.length === 0) {
 | |
|                 alert('请至少选择一个专员类型');
 | |
|                 return;
 | |
|             }
 | |
| 
 | |
|             // 这里应该调用后端API保存数据
 | |
|             if (isEditMode) {
 | |
|                 console.log('编辑专员:', { name, phone, types });
 | |
|                 alert('专员信息已更新');
 | |
|             } else {
 | |
|                 console.log('添加专员:', { name, phone, types });
 | |
|                 alert('专员已添加');
 | |
|             }
 | |
| 
 | |
|             closeModal();
 | |
|             // 实际项目中应该在这里刷新列表数据
 | |
|         }
 | |
| 
 | |
|         // 打开费用支付方弹窗
 | |
|         function openPaymentModal() {
 | |
|             // 设置当前选中的支付方式
 | |
|             if (currentPaymentMethod === 'customer') {
 | |
|                 document.getElementById('paymentCustomer').checked = true;
 | |
|             } else {
 | |
|                 document.getElementById('paymentOperator').checked = true;
 | |
|             }
 | |
|             document.getElementById('paymentModal').classList.add('active');
 | |
|         }
 | |
| 
 | |
|         // 关闭费用支付方弹窗
 | |
|         function closePaymentModal() {
 | |
|             document.getElementById('paymentModal').classList.remove('active');
 | |
|         }
 | |
| 
 | |
|         // 提交费用支付方
 | |
|         function submitPaymentMethod() {
 | |
|             const selectedRadio = document.querySelector('input[name="paymentMethod"]:checked');
 | |
|             if (selectedRadio) {
 | |
|                 currentPaymentMethod = selectedRadio.value;
 | |
|                 const displayText = selectedRadio.value === 'customer' ? '顾客支付' : '经营者支付';
 | |
|                 document.getElementById('paymentMethodDisplay').textContent = displayText;
 | |
|                 console.log('费用支付方已更改为:', displayText);
 | |
|                 // 这里应该调用后端API保存配置
 | |
|             }
 | |
|             closePaymentModal();
 | |
|         }
 | |
| 
 | |
|         // 点击遮罩层关闭弹窗
 | |
|         document.getElementById('staffModal').addEventListener('click', function(e) {
 | |
|             if (e.target === this) {
 | |
|                 closeModal();
 | |
|             }
 | |
|         });
 | |
| 
 | |
|         document.getElementById('paymentModal').addEventListener('click', function(e) {
 | |
|             if (e.target === this) {
 | |
|                 closePaymentModal();
 | |
|             }
 | |
|         });
 | |
|     </script>
 | |
| </body>
 | |
| </html>
 |