platform_orders index: compact table with optional columns toggle

This commit is contained in:
萝卜
2026-03-14 12:08:39 +00:00
parent 6051b1af3c
commit ff3c006670
2 changed files with 354 additions and 342 deletions

View File

@@ -81,3 +81,7 @@
white-space:nowrap; white-space:nowrap;
word-break:normal; word-break:normal;
} }
/* 平台订单列表:精简视图(默认隐藏部分列,避免列表过长) */
.platform-orders-table .col-optional{display:none;}
.platform-orders-table.is-full .col-optional{display:table-cell;}

View File

@@ -58,6 +58,9 @@
// 线索上下文(从开通线索跳转而来):用于提示“当前范围已锁定线索”,以及生成一键清除入口 // 线索上下文(从开通线索跳转而来):用于提示“当前范围已锁定线索”,以及生成一键清除入口
$incomingLeadId = (int) request()->query('lead_id', 0); $incomingLeadId = (int) request()->query('lead_id', 0);
// 列表视图默认精简避免列表过长view=full 展开全部列
$isFullView = ((string) request()->query('view', '') === 'full');
$clearLeadQuery = $currentQuery; $clearLeadQuery = $currentQuery;
unset($clearLeadQuery['lead_id'], $clearLeadQuery['page']); unset($clearLeadQuery['lead_id'], $clearLeadQuery['page']);
@@ -624,8 +627,6 @@
</div> </div>
@endif @endif
<div class="card section-dark mb-10">
<h4 class="mt-0">导出</h4>
<div class="grid-2 tool-grid"> <div class="grid-2 tool-grid">
<div class="tool-group focus-box"> <div class="tool-group focus-box">
<div class="tool-group-title">导出</div> <div class="tool-group-title">导出</div>
@@ -948,8 +949,6 @@
</div> </div>
</div> </div>
</div>
</div>
<div class="card"> <div class="card">
<div class="flex-between"> <div class="flex-between">
@@ -974,17 +973,26 @@
$createOrderUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($createQuery); $createOrderUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($createQuery);
@endphp @endphp
@php
$toggleViewUrl = $isFullView
? $safeFullUrlWithQuery(['view' => null, 'page' => null])
: $safeFullUrlWithQuery(['view' => 'full', 'page' => null]);
$toggleViewLabel = $isFullView ? '精简视图' : '展开全部列';
@endphp
<div class="actions gap-10">
<a class="btn btn-secondary btn-sm" href="{!! $toggleViewUrl !!}">{{ $toggleViewLabel }}</a>
<a href="{!! $createOrderUrl !!}" class="btn btn-sm">新建平台订单</a> <a href="{!! $createOrderUrl !!}" class="btn btn-sm">新建平台订单</a>
</div> </div>
</div>
<div class="table-wrap"> <div class="table-wrap">
<table class="table-nowrap"> <table class="table-nowrap platform-orders-table {{ $isFullView ? 'is-full' : '' }}">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>订单号</th> <th>订单号</th>
<th>站点</th> <th>站点</th>
<th>套餐</th> <th>套餐</th>
<th>订单类型</th> <th class="col-optional">订单类型</th>
<th>订单状态</th> <th>订单状态</th>
<th>支付状态</th> <th>支付状态</th>
<th>应付金额</th> <th>应付金额</th>
@@ -994,15 +1002,15 @@
<th>同步状态</th> <th>同步状态</th>
<th>订阅号</th> <th>订阅号</th>
<th>订阅到期</th> <th>订阅到期</th>
<th>同步时间</th> <th class="col-optional">同步时间</th>
<th>失败原因</th> <th class="col-optional">失败原因</th>
<th>最近批量同步</th> <th class="col-optional">最近批量同步</th>
<th>最近批量生效</th> <th class="col-optional">最近批量生效</th>
<th>回执总额</th> <th class="col-optional">回执总额</th>
<th>对账差额</th> <th class="col-optional">对账差额</th>
<th>回执数</th> <th class="col-optional">回执数</th>
<th>退款数</th> <th class="col-optional">退款数</th>
<th>退款总额</th> <th class="col-optional">退款总额</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
@@ -1044,7 +1052,7 @@
{{ $planName }} {{ $planName }}
@endif @endif
</td> </td>
<td>{{ $order->order_type }}</td> <td class="col-optional">{{ $order->order_type }}</td>
<td> <td>
{{ $statusLabels[$order->status] ?? $order->status }} {{ $statusLabels[$order->status] ?? $order->status }}
<div class="muted">{{ $order->status }}</div> <div class="muted">{{ $order->status }}</div>
@@ -1088,8 +1096,8 @@
@endif @endif
</td> </td>
<td>{{ optional($order->siteSubscription?->ends_at)->format('Y-m-d H:i:s') ?: '-' }}</td> <td>{{ optional($order->siteSubscription?->ends_at)->format('Y-m-d H:i:s') ?: '-' }}</td>
<td>{{ data_get($order->meta, 'subscription_activation.synced_at') ?: '-' }}</td> <td class="col-optional">{{ data_get($order->meta, 'subscription_activation.synced_at') ?: '-' }}</td>
<td> <td class="col-optional">
@php @php
$syncErrMsg = (string) (data_get($order->meta, 'subscription_activation_error.message') ?? ''); $syncErrMsg = (string) (data_get($order->meta, 'subscription_activation_error.message') ?? '');
$syncErrTooLong = $syncErrMsg !== '' && mb_strlen($syncErrMsg) > $SYNC_ERROR_KEYWORD_LINK_MAX_LEN; $syncErrTooLong = $syncErrMsg !== '' && mb_strlen($syncErrMsg) > $SYNC_ERROR_KEYWORD_LINK_MAX_LEN;
@@ -1130,7 +1138,7 @@
@endif @endif
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
// 优先使用扁平字段 meta.batch_activation便于筛选/统计,也避免遍历 audit // 优先使用扁平字段 meta.batch_activation便于筛选/统计,也避免遍历 audit
$batchActivation = (array) (data_get($order->meta, 'batch_activation', []) ?? []); $batchActivation = (array) (data_get($order->meta, 'batch_activation', []) ?? []);
@@ -1161,7 +1169,7 @@
<span class="muted">-</span> <span class="muted">-</span>
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
// 优先使用扁平字段 meta.batch_mark_activated便于筛选/统计,也避免遍历 audit // 优先使用扁平字段 meta.batch_mark_activated便于筛选/统计,也避免遍历 audit
$batchMarkActivated = (array) (data_get($order->meta, 'batch_mark_activated', []) ?? []); $batchMarkActivated = (array) (data_get($order->meta, 'batch_mark_activated', []) ?? []);
@@ -1192,7 +1200,7 @@
<span class="muted">-</span> <span class="muted">-</span>
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
$receiptTotal = (float) ($order->receipt_total ?? 0); $receiptTotal = (float) ($order->receipt_total ?? 0);
@endphp @endphp
@@ -1202,7 +1210,7 @@
<span class="muted">-</span> <span class="muted">-</span>
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
$rowDelta = (float) ($order->reconciliation_delta_row ?? 0); $rowDelta = (float) ($order->reconciliation_delta_row ?? 0);
// 统一口径:按分取整判断是否对账不一致,避免浮点误差导致 0.01 边界不稳定 // 统一口径:按分取整判断是否对账不一致,避免浮点误差导致 0.01 边界不稳定
@@ -1221,7 +1229,7 @@
<span class="muted">¥0.00</span> <span class="muted">¥0.00</span>
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
$receipts = (array) (data_get($order->meta, 'payment_receipts', []) ?? []); $receipts = (array) (data_get($order->meta, 'payment_receipts', []) ?? []);
$receiptSummaryCount = data_get($order->meta, 'payment_summary.count'); $receiptSummaryCount = data_get($order->meta, 'payment_summary.count');
@@ -1236,7 +1244,7 @@
<span class="muted">0</span> <span class="muted">0</span>
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
$refunds = (array) (data_get($order->meta, 'refund_receipts', []) ?? []); $refunds = (array) (data_get($order->meta, 'refund_receipts', []) ?? []);
$refundSummaryCount = data_get($order->meta, 'refund_summary.count'); $refundSummaryCount = data_get($order->meta, 'refund_summary.count');
@@ -1251,7 +1259,7 @@
<span class="muted">0</span> <span class="muted">0</span>
@endif @endif
</td> </td>
<td> <td class="col-optional">
@php @php
$refundTotal = (float) $order->refundTotal(); $refundTotal = (float) $order->refundTotal();
$isRefundInconsistent = (bool) $order->isRefundInconsistent(); $isRefundInconsistent = (bool) $order->isRefundInconsistent();