platform_orders index: row-warn prefix span for faster scan

This commit is contained in:
萝卜
2026-03-14 13:22:21 +00:00
parent ea3bafdb96
commit 646f1b972d
3 changed files with 83 additions and 5 deletions

View File

@@ -93,6 +93,7 @@
.platform-orders-table .row-warn{margin-top:4px;padding:4px 6px;border-left:3px solid #d9534f;background:#fff6f6;border-radius:4px;} .platform-orders-table .row-warn{margin-top:4px;padding:4px 6px;border-left:3px solid #d9534f;background:#fff6f6;border-radius:4px;}
.platform-orders-table .row-warn a.link{color:#b52b27;text-decoration:underline;} .platform-orders-table .row-warn a.link{color:#b52b27;text-decoration:underline;}
.platform-orders-table .row-warn a.link:hover{text-decoration:none;} .platform-orders-table .row-warn a.link:hover{text-decoration:none;}
.platform-orders-table .row-warn-prefix{font-weight:600;}
/* 平台订单列表:精简视图也要可达的治理提示(对账/退款不一致) */ /* 平台订单列表:精简视图也要可达的治理提示(对账/退款不一致) */
.platform-orders-table .governance-hints{margin-bottom:6px;} .platform-orders-table .governance-hints{margin-bottom:6px;}

View File

@@ -1082,7 +1082,7 @@
@endphp @endphp
@if($order->payment_status === 'paid' && ! $hasReceiptEvidenceRow) @if($order->payment_status === 'paid' && ! $hasReceiptEvidenceRow)
<div class="muted text-danger muted-xs row-warn"> <div class="muted text-danger muted-xs row-warn">
无回执 <span class="row-warn-prefix">无回执</span>
<span class="muted"></span> <span class="muted"></span>
<a class="link" href="{!! $noReceiptFixUrlRow !!}">去补回执</a> <a class="link" href="{!! $noReceiptFixUrlRow !!}">去补回执</a>
</div> </div>
@@ -1132,10 +1132,10 @@
@if(! $isFullView) @if(! $isFullView)
@if($syncErr !== '') @if($syncErr !== '')
<div class="muted muted-xs text-danger row-warn">原因{{ mb_substr($syncErr, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</div> <div class="muted muted-xs text-danger row-warn"><span class="row-warn-prefix">原因</span>{{ mb_substr($syncErr, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</div>
@endif @endif
@if($bmpaErrCompact !== '') @if($bmpaErrCompact !== '')
<div class="muted muted-xs text-danger row-warn">BMPA{{ mb_substr($bmpaErrCompact, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</div> <div class="muted muted-xs text-danger row-warn"><span class="row-warn-prefix">BMPA</span>{{ mb_substr($bmpaErrCompact, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</div>
@endif @endif
@endif @endif
</td> </td>
@@ -1376,14 +1376,14 @@
<div class="governance-hints row-warn"> <div class="governance-hints row-warn">
@if($needReconcileFix) @if($needReconcileFix)
<div class="muted text-danger muted-xs governance-hint"> <div class="muted text-danger muted-xs governance-hint">
对账不一致 <span class="row-warn-prefix">对账</span>
<span class="muted"></span> <span class="muted"></span>
<a class="link" href="{!! $reconcileFixUrlCompact !!}">去补回执</a> <a class="link" href="{!! $reconcileFixUrlCompact !!}">去补回执</a>
</div> </div>
@endif @endif
@if($needRefundFix) @if($needRefundFix)
<div class="muted text-danger muted-xs governance-hint"> <div class="muted text-danger muted-xs governance-hint">
退款不一致 <span class="row-warn-prefix">退款</span>
<span class="muted"></span> <span class="muted"></span>
<a class="link" href="{!! $refundFixUrlCompact !!}">去核对退款</a> <a class="link" href="{!! $refundFixUrlCompact !!}">去核对退款</a>
</div> </div>

View File

@@ -0,0 +1,77 @@
<?php
namespace Tests\Feature;
use App\Models\Merchant;
use App\Models\Plan;
use App\Models\PlatformOrder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexRowWarnPrefixRenderTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_row_warn_prefix_span_is_rendered_for_no_receipt_and_sync_bmpa_reason(): void
{
$this->loginAsPlatformAdmin();
$merchant = Merchant::query()->firstOrFail();
$plan = Plan::query()->create([
'code' => 'po_index_row_warn_prefix_plan',
'name' => '平台订单列表 row-warn prefix 测试套餐',
'billing_cycle' => 'monthly',
'price' => 10,
'list_price' => 10,
'status' => 'active',
'sort' => 10,
'published_at' => now(),
]);
PlatformOrder::query()->create([
'merchant_id' => $merchant->id,
'plan_id' => $plan->id,
'order_no' => 'PO_INDEX_ROW_WARN_PREFIX_0001',
'order_type' => 'new_purchase',
'status' => 'activated',
'payment_status' => 'paid',
'plan_name' => $plan->name,
'billing_cycle' => $plan->billing_cycle,
'period_months' => 1,
'quantity' => 1,
'payable_amount' => 10,
'paid_amount' => 10,
'placed_at' => now(),
'paid_at' => now(),
'activated_at' => now(),
'meta' => [
'subscription_activation_error' => [
'message' => 'SIM_SYNC_ERR_2',
'at' => now()->toDateTimeString(),
],
'batch_mark_paid_and_activate_error' => [
'message' => 'SIM_BMPA_ERR_2',
'at' => now()->toDateTimeString(),
],
],
]);
$res = $this->get('/admin/platform-orders?keyword=PO_INDEX_ROW_WARN_PREFIX_0001');
$res->assertOk();
$res->assertSee('<span class="row-warn-prefix">无回执</span>', false);
$res->assertSee('<span class="row-warn-prefix">原因</span>', false);
$res->assertSee('<span class="row-warn-prefix">BMPA</span>', false);
}
}