ui(governance): add go-processable shortcut in batch bmpa blocked hint

This commit is contained in:
萝卜
2026-03-17 05:46:57 +08:00
parent 7548343394
commit 3e2e0ad046
2 changed files with 50 additions and 1 deletions

View File

@@ -1015,7 +1015,19 @@
<div class="mt-6"> <div class="mt-6">
<button class="btn btn-sm" type="submit" @disabled($batchBmpaBlocked) title="{{ $batchBmpaBlockedReason }}">批量标记支付并生效(含订阅同步)(当前筛选范围)</button> <button class="btn btn-sm" type="submit" @disabled($batchBmpaBlocked) title="{{ $batchBmpaBlockedReason }}">批量标记支付并生效(含订阅同步)(当前筛选范围)</button>
@if($batchBmpaBlocked) @if($batchBmpaBlocked)
<div class="adm-tool-blocked-hint" data-role="batch-bmpa-blocked-hint">提示:{{ $batchBmpaBlockedReason }}</div> <div class="adm-tool-blocked-hint" data-role="batch-bmpa-blocked-hint">
<div>提示:{{ $batchBmpaBlockedReason }}</div>
@php
// 提效被阻断时给一键跳转到「可BMPA处理集合」口径pending + unpaid
$goBmpaProcessableUrl = $buildQuickFilterUrl([
'status' => 'pending',
'payment_status' => 'unpaid',
]);
@endphp
<div class="mt-6 actions gap-10">
<a class="btn btn-secondary btn-sm" href="{!! $goBmpaProcessableUrl !!}">切到可BMPA处理集合</a>
</div>
</div>
@endif @endif
</div> </div>
</form> </form>

View File

@@ -0,0 +1,37 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkTest 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_blocked_hint_should_include_link_to_pending_unpaid_set(): void
{
$this->loginAsPlatformAdmin();
// 构造一个会触发 batch_bmpa 被阻断的筛选:不给 pending+unpaid。
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="batch-bmpa-blocked-hint"', $html);
$this->assertStringContainsString('切到可BMPA处理集合', $html);
$this->assertStringContainsString('status=pending', $html);
$this->assertStringContainsString('payment_status=unpaid', $html);
}
}