chore(admin-platform-order): disable batch BMPA button when filters not pending+unpaid
This commit is contained in:
@@ -922,6 +922,17 @@
|
||||
|
||||
<div class="tool-group focus-box">
|
||||
<div class="tool-group-title">批量标记支付并生效(BMPA)</div>
|
||||
@php
|
||||
// 批量 BMPA:前端治理提示(后端仍有安全阀阻断,这里只做“减少误点/更可治理”)
|
||||
$batchBmpaBlockedReason = '';
|
||||
if ((string) ($filters['status'] ?? '') !== 'pending' || (string) ($filters['payment_status'] ?? '') !== 'unpaid') {
|
||||
$batchBmpaBlockedReason = '请先筛选「订单状态=待处理」且「支付状态=未支付」再执行批量 BMPA。';
|
||||
}
|
||||
if ($batchBmpaBlockedReason === '' && (((string) ($filters['reconcile_mismatch'] ?? '') === '1') || ((string) ($filters['refund_inconsistent'] ?? '') === '1'))) {
|
||||
$batchBmpaBlockedReason = '当前集合包含「对账不一致/退款不一致」治理集合:建议先完成回执/退款治理后再批量推进。';
|
||||
}
|
||||
$batchBmpaBlocked = $batchBmpaBlockedReason !== '';
|
||||
@endphp
|
||||
<form method="post" action="/admin/platform-orders/batch-mark-paid-and-activate" data-action="disable-on-submit" onsubmit="return confirm('确认批量将当前筛选范围内“待处理+未支付”的订单标记为已支付并生效,并同步订阅?(会补回执留痕;遇到退款/回执不一致会安全阀阻断并记录失败原因)');" class="mb-10">
|
||||
@csrf
|
||||
<input type="hidden" name="scope" value="filtered">
|
||||
@@ -956,7 +967,10 @@
|
||||
|
||||
<div class="muted mb-8">提示:建议先筛选「待处理 + 未支付」后再执行,避免误操作。</div>
|
||||
<div class="mt-6">
|
||||
<button class="btn btn-sm" type="submit">批量标记支付并生效(含订阅同步)(当前筛选范围)</button>
|
||||
<button class="btn btn-sm" type="submit" @disabled($batchBmpaBlocked) title="{{ $batchBmpaBlockedReason }}">批量标记支付并生效(含订阅同步)(当前筛选范围)</button>
|
||||
@if($batchBmpaBlocked)
|
||||
<div class="muted muted-xs text-danger mt-6" data-role="batch-bmpa-blocked-hint">提示:{{ $batchBmpaBlockedReason }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user