2025-08-06 04:03:35 +00:00
|
|
|
<!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', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.page-header {
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.page-title {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #333;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-form {
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-label {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #666;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
min-width: 60px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-input {
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
border: 1px solid #dcdfe6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
width: 180px;
|
|
|
|
|
transition: border-color 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-input:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #409eff;
|
|
|
|
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-select {
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
border: 1px solid #dcdfe6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
width: 180px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: border-color 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-select:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #409eff;
|
|
|
|
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-group {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
padding: 10px 20px;
|
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-primary {
|
|
|
|
|
background-color: #409eff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-primary:hover {
|
|
|
|
|
background-color: #66b1ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-success {
|
|
|
|
|
background-color: #67c23a;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-success:hover {
|
|
|
|
|
background-color: #85ce61;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-default {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
color: #606266;
|
|
|
|
|
border: 1px solid #dcdfe6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-default:hover {
|
|
|
|
|
color: #409eff;
|
|
|
|
|
border-color: #c6e2ff;
|
|
|
|
|
background-color: #ecf5ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-container {
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-wrapper {
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.data-table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.data-table th {
|
|
|
|
|
background-color: #fafafa;
|
|
|
|
|
color: #606266;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
padding: 12px 6px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
border-bottom: 1px solid #ebeef5;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
min-width: 80px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.data-table td {
|
|
|
|
|
padding: 12px 6px;
|
|
|
|
|
border-bottom: 1px solid #ebeef5;
|
|
|
|
|
color: #606266;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.data-table tr:hover {
|
|
|
|
|
background-color: #f5f7fa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-tag {
|
|
|
|
|
padding: 2px 8px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-pending {
|
|
|
|
|
background-color: #fff7e6;
|
|
|
|
|
color: #fa8c16;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-processing {
|
|
|
|
|
background-color: #e6f7ff;
|
|
|
|
|
color: #1890ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-completed {
|
|
|
|
|
background-color: #f6ffed;
|
|
|
|
|
color: #52c41a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.no-data {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 60px 20px;
|
|
|
|
|
color: #999;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.operation-btn {
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
margin: 0 2px;
|
|
|
|
|
border: 1px solid #409eff;
|
|
|
|
|
background: transparent;
|
|
|
|
|
color: #409eff;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.operation-btn:hover {
|
|
|
|
|
background-color: #409eff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-14 12:42:15 +00:00
|
|
|
.expand-btn {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
user-select: none;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #409eff;
|
|
|
|
|
transition: transform 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expand-btn:hover {
|
|
|
|
|
transform: scale(1.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.child-table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin: 10px 0;
|
|
|
|
|
background-color: #fafafa;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.child-table th {
|
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.child-table td {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
background-color: #fafafa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.parent-row:hover {
|
|
|
|
|
background-color: #f5f7fa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.child-row td {
|
|
|
|
|
padding: 0;
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:03:35 +00:00
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.container {
|
|
|
|
|
padding: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-row {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-item {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
gap: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-input,
|
|
|
|
|
.form-select {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-group {
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.data-table th,
|
|
|
|
|
.data-table td {
|
|
|
|
|
min-width: 80px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
padding: 8px 6px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="page-header">
|
|
|
|
|
<h1 class="page-title">积分订单管理</h1>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="search-form">
|
|
|
|
|
<div class="form-row">
|
|
|
|
|
<div class="form-item">
|
|
|
|
|
<label class="form-label">摊铺:</label>
|
|
|
|
|
<select class="form-select" id="storeSelect">
|
|
|
|
|
<option value="">全部</option>
|
|
|
|
|
<option value="store1">牛牛蔬菜店</option>
|
|
|
|
|
<option value="store2">小明水果店</option>
|
|
|
|
|
<option value="store3">王记杂货铺</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-item">
|
|
|
|
|
<label class="form-label">商品名称:</label>
|
|
|
|
|
<input type="text" class="form-input" placeholder="商品名称" id="productName">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-item">
|
|
|
|
|
<label class="form-label">订单状态:</label>
|
|
|
|
|
<select class="form-select" id="orderStatus">
|
|
|
|
|
<option value="">全部订单</option>
|
|
|
|
|
<option value="pending">待备货</option>
|
|
|
|
|
<option value="preparing">待取货</option>
|
|
|
|
|
<option value="shipping">待收货</option>
|
|
|
|
|
<option value="completed">已完成</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-08-14 12:42:15 +00:00
|
|
|
<div class="btn-group">
|
|
|
|
|
<button class="btn btn-primary" onclick="searchOrders()">查询</button>
|
|
|
|
|
<button class="btn btn-default" onclick="resetForm()">重置</button>
|
|
|
|
|
</div>
|
2025-08-06 04:03:35 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="table-container">
|
|
|
|
|
<div class="table-wrapper">
|
|
|
|
|
<table class="data-table" id="ordersTable">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
2025-08-14 12:42:15 +00:00
|
|
|
<th style="width: 40px;"></th>
|
|
|
|
|
<th>结算订单号</th>
|
|
|
|
|
<th>摊位</th>
|
2025-08-06 04:03:35 +00:00
|
|
|
<th>订单状态</th>
|
|
|
|
|
<th>配送费</th>
|
2025-08-12 19:13:29 +00:00
|
|
|
<th>打包费</th>
|
2025-08-14 12:42:15 +00:00
|
|
|
<th>调度费</th>
|
2025-08-06 04:03:35 +00:00
|
|
|
<th>支付时间</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
2025-08-14 12:42:15 +00:00
|
|
|
<tbody id="ordersTableBody">
|
|
|
|
|
<!-- 数据将通过JavaScript动态生成 -->
|
2025-08-06 04:03:35 +00:00
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="no-data" id="noDataMsg" style="display: none;">
|
|
|
|
|
暂无数据
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-08-14 12:42:15 +00:00
|
|
|
// 模拟结算订单数据(一级表格数据)
|
|
|
|
|
const settlementOrders = [
|
2025-08-06 04:03:35 +00:00
|
|
|
{
|
2025-08-14 12:42:15 +00:00
|
|
|
settlementOrderNo: 'SO2024010001',
|
|
|
|
|
booth: '牛牛蔬菜店',
|
2025-08-06 04:03:35 +00:00
|
|
|
status: '已完成',
|
|
|
|
|
deliveryFee: 8.00,
|
2025-08-12 19:13:29 +00:00
|
|
|
packageFee: 2.00,
|
2025-08-14 12:42:15 +00:00
|
|
|
dispatchFee: 3.00,
|
|
|
|
|
paymentTime: '2024-01-15 14:30:22',
|
|
|
|
|
// 商品明细(二级表格数据)
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
productOrderNo: 'PO2024010001',
|
|
|
|
|
productName: '有机蔬菜礼盒',
|
|
|
|
|
originalPrice: 158.00,
|
|
|
|
|
productQuantity: 2,
|
|
|
|
|
pointsUsed: 200,
|
|
|
|
|
customerPayment: 0.00,
|
|
|
|
|
pointsType: '积分换购',
|
|
|
|
|
status: '已完成'
|
|
|
|
|
}
|
|
|
|
|
]
|
2025-08-06 04:03:35 +00:00
|
|
|
},
|
|
|
|
|
{
|
2025-08-14 12:42:15 +00:00
|
|
|
settlementOrderNo: 'SO2024010002',
|
|
|
|
|
booth: '小明水果店',
|
2025-08-06 04:03:35 +00:00
|
|
|
status: '待备货',
|
|
|
|
|
deliveryFee: 6.00,
|
2025-08-12 19:13:29 +00:00
|
|
|
packageFee: 1.50,
|
2025-08-14 12:42:15 +00:00
|
|
|
dispatchFee: 2.00,
|
|
|
|
|
paymentTime: '2024-01-15 15:45:10',
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
productOrderNo: 'PO2024010002',
|
|
|
|
|
productName: '进口苹果',
|
|
|
|
|
originalPrice: 105.00,
|
|
|
|
|
productQuantity: 1,
|
|
|
|
|
pointsUsed: 150,
|
|
|
|
|
customerPayment: 52.50,
|
|
|
|
|
pointsType: '积分优惠购',
|
|
|
|
|
status: '待备货'
|
|
|
|
|
}
|
|
|
|
|
]
|
2025-08-06 04:03:35 +00:00
|
|
|
},
|
|
|
|
|
{
|
2025-08-14 12:42:15 +00:00
|
|
|
settlementOrderNo: 'SO2024010003',
|
|
|
|
|
booth: '王记杂货铺',
|
2025-08-06 04:03:35 +00:00
|
|
|
status: '待取货',
|
|
|
|
|
deliveryFee: 10.00,
|
2025-08-12 19:13:29 +00:00
|
|
|
packageFee: 3.00,
|
2025-08-14 12:42:15 +00:00
|
|
|
dispatchFee: 4.00,
|
|
|
|
|
paymentTime: '2024-01-15 16:20:35',
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
productOrderNo: 'PO2024010003',
|
|
|
|
|
productName: '新鲜牛奶',
|
|
|
|
|
originalPrice: 268.00,
|
|
|
|
|
productQuantity: 4,
|
|
|
|
|
pointsUsed: 380,
|
|
|
|
|
customerPayment: 0.00,
|
|
|
|
|
pointsType: '积分换购',
|
|
|
|
|
status: '待取货'
|
|
|
|
|
}
|
|
|
|
|
]
|
2025-08-06 04:03:35 +00:00
|
|
|
},
|
|
|
|
|
{
|
2025-08-14 12:42:15 +00:00
|
|
|
settlementOrderNo: 'SO2024010004',
|
|
|
|
|
booth: '牛牛蔬菜店',
|
2025-08-06 04:03:35 +00:00
|
|
|
status: '待收货',
|
|
|
|
|
deliveryFee: 15.00,
|
2025-08-12 19:13:29 +00:00
|
|
|
packageFee: 4.50,
|
2025-08-14 12:42:15 +00:00
|
|
|
dispatchFee: 5.00,
|
|
|
|
|
paymentTime: '2024-01-15 17:35:28',
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
productOrderNo: 'PO2024010004',
|
|
|
|
|
productName: '精品牛肉',
|
|
|
|
|
originalPrice: 456.00,
|
|
|
|
|
productQuantity: 6,
|
|
|
|
|
pointsUsed: 580,
|
|
|
|
|
customerPayment: 228.00,
|
|
|
|
|
pointsType: '积分优惠购',
|
|
|
|
|
status: '待收货'
|
|
|
|
|
}
|
|
|
|
|
]
|
2025-08-06 04:03:35 +00:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
2025-08-14 12:42:15 +00:00
|
|
|
// 渲染一级表格数据
|
2025-08-06 04:03:35 +00:00
|
|
|
function renderTable(data = []) {
|
2025-08-14 12:42:15 +00:00
|
|
|
const tbody = document.getElementById('ordersTableBody');
|
2025-08-06 04:03:35 +00:00
|
|
|
const noDataMsg = document.getElementById('noDataMsg');
|
|
|
|
|
|
|
|
|
|
if (data.length === 0) {
|
|
|
|
|
tbody.innerHTML = '';
|
|
|
|
|
noDataMsg.style.display = 'block';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
noDataMsg.style.display = 'none';
|
|
|
|
|
|
2025-08-14 12:42:15 +00:00
|
|
|
tbody.innerHTML = data.map((order, index) => `
|
|
|
|
|
<tr class="parent-row" data-index="${index}">
|
|
|
|
|
<td><span class="expand-btn">▶</span></td>
|
|
|
|
|
<td>${order.settlementOrderNo}</td>
|
|
|
|
|
<td>${order.booth}</td>
|
2025-08-06 04:03:35 +00:00
|
|
|
<td><span class="status-tag ${getStatusClass(order.status)}">${order.status}</span></td>
|
|
|
|
|
<td>¥${order.deliveryFee.toFixed(2)}</td>
|
2025-08-12 19:13:29 +00:00
|
|
|
<td>¥${order.packageFee.toFixed(2)}</td>
|
2025-08-14 12:42:15 +00:00
|
|
|
<td>¥${order.dispatchFee.toFixed(2)}</td>
|
2025-08-06 04:03:35 +00:00
|
|
|
<td>${order.paymentTime}</td>
|
|
|
|
|
</tr>
|
2025-08-14 12:42:15 +00:00
|
|
|
<tr class="child-row" data-parent-index="${index}" style="display: none;">
|
|
|
|
|
<td colspan="8">
|
|
|
|
|
<table class="data-table child-table">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>商品订单号</th>
|
|
|
|
|
<th>商品名称</th>
|
|
|
|
|
<th>商品原价</th>
|
|
|
|
|
<th>商品数量</th>
|
|
|
|
|
<th>消耗积分</th>
|
|
|
|
|
<th>顾客支付</th>
|
|
|
|
|
<th>积分类型</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
${order.items.map(item => `
|
|
|
|
|
<tr>
|
|
|
|
|
<td>${item.productOrderNo}</td>
|
|
|
|
|
<td>${item.productName}</td>
|
|
|
|
|
<td>¥${item.originalPrice.toFixed(2)}</td>
|
|
|
|
|
<td>${item.productQuantity}</td>
|
|
|
|
|
<td>${item.pointsUsed}</td>
|
|
|
|
|
<td>¥${item.customerPayment.toFixed(2)}</td>
|
|
|
|
|
<td>${item.pointsType}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
`).join('')}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2025-08-06 04:03:35 +00:00
|
|
|
`).join('');
|
2025-08-14 12:42:15 +00:00
|
|
|
|
|
|
|
|
// 添加展开/折叠事件监听器
|
|
|
|
|
document.querySelectorAll('.expand-btn').forEach((btn, index) => {
|
|
|
|
|
btn.addEventListener('click', function() {
|
|
|
|
|
toggleRow(index);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 展开/折叠行
|
|
|
|
|
function toggleRow(index) {
|
|
|
|
|
const parentRow = document.querySelector(`.parent-row[data-index="${index}"]`);
|
|
|
|
|
const childRow = document.querySelector(`.child-row[data-parent-index="${index}"]`);
|
|
|
|
|
const expandBtn = parentRow.querySelector('.expand-btn');
|
|
|
|
|
|
|
|
|
|
if (childRow.style.display === 'none' || childRow.style.display === '') {
|
|
|
|
|
childRow.style.display = 'table-row';
|
|
|
|
|
expandBtn.textContent = '▼';
|
|
|
|
|
} else {
|
|
|
|
|
childRow.style.display = 'none';
|
|
|
|
|
expandBtn.textContent = '▶';
|
|
|
|
|
}
|
2025-08-06 04:03:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取状态样式类
|
|
|
|
|
function getStatusClass(status) {
|
|
|
|
|
const statusMap = {
|
|
|
|
|
'待备货': 'status-pending',
|
|
|
|
|
'待取货': 'status-processing',
|
|
|
|
|
'待收货': 'status-processing',
|
|
|
|
|
'已完成': 'status-completed'
|
|
|
|
|
};
|
|
|
|
|
return statusMap[status] || 'status-pending';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 搜索订单
|
|
|
|
|
function searchOrders() {
|
|
|
|
|
const storeSelect = document.getElementById('storeSelect').value;
|
|
|
|
|
const productName = document.getElementById('productName').value;
|
|
|
|
|
const orderStatus = document.getElementById('orderStatus').value;
|
|
|
|
|
|
|
|
|
|
// 这里应该调用后端API进行搜索
|
|
|
|
|
console.log('搜索参数:', { storeSelect, productName, orderStatus });
|
|
|
|
|
|
|
|
|
|
// 模拟搜索结果
|
2025-08-14 12:42:15 +00:00
|
|
|
let filteredOrders = [...settlementOrders];
|
2025-08-06 04:03:35 +00:00
|
|
|
|
|
|
|
|
if (orderStatus) {
|
|
|
|
|
const statusMap = {
|
|
|
|
|
'pending': '待备货',
|
|
|
|
|
'preparing': '待取货',
|
|
|
|
|
'shipping': '待收货',
|
|
|
|
|
'completed': '已完成'
|
|
|
|
|
};
|
|
|
|
|
filteredOrders = filteredOrders.filter(order =>
|
|
|
|
|
order.status === statusMap[orderStatus]
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderTable(filteredOrders);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 重置表单
|
|
|
|
|
function resetForm() {
|
|
|
|
|
document.getElementById('storeSelect').value = '';
|
|
|
|
|
document.getElementById('productName').value = '';
|
|
|
|
|
document.getElementById('orderStatus').value = '';
|
2025-08-14 12:42:15 +00:00
|
|
|
renderTable(settlementOrders);
|
2025-08-06 04:03:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出订单
|
|
|
|
|
function exportOrders() {
|
|
|
|
|
alert('导出功能开发中...');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查看订单
|
|
|
|
|
function viewOrder(orderNo) {
|
|
|
|
|
alert(`查看订单: ${orderNo}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 编辑订单
|
|
|
|
|
function editOrder(orderNo) {
|
|
|
|
|
alert(`编辑订单: ${orderNo}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 页面加载完成后初始化
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
2025-08-14 12:42:15 +00:00
|
|
|
renderTable(settlementOrders);
|
2025-08-06 04:03:35 +00:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|