chore(admin-platform-order): disable batch sync button when governance blocks

This commit is contained in:
萝卜
2026-03-16 12:54:07 +08:00
parent 4dc5b2f728
commit 80a6576a07
2 changed files with 142 additions and 1 deletions

View File

@@ -826,6 +826,20 @@
<div class="tool-group focus-box">
<div class="tool-group-title">批量同步订阅</div>
@php
// 批量同步订阅:前端治理提示(后端仍有安全阀阻断,这里只做“减少误点/更可治理”)
$batchActivateBlockedReason = '';
if ((string) ($filters['syncable_only'] ?? '') !== '1') {
$batchActivateBlockedReason = '请先勾选「只看可同步」再执行批量同步。';
}
if ($batchActivateBlockedReason === '' && ((string) ($filters['receipt_status'] ?? '') === 'none')) {
$batchActivateBlockedReason = '当前集合为「无回执」:建议先补齐支付回执留痕后再批量同步。';
}
if ($batchActivateBlockedReason === '' && (((string) ($filters['reconcile_mismatch'] ?? '') === '1') || ((string) ($filters['refund_inconsistent'] ?? '') === '1'))) {
$batchActivateBlockedReason = '当前集合包含「对账不一致/退款不一致」:建议先完成金额/状态治理后再批量同步。';
}
$batchActivateBlocked = $batchActivateBlockedReason !== '';
@endphp
<form method="post" action="/admin/platform-orders/batch-activate-subscriptions" data-action="disable-on-submit" onsubmit="return confirm('确认批量同步当前筛选范围内“可同步”的订单?(仅处理:已支付+已生效+未同步)');" class="mb-10">
@csrf
<input type="hidden" name="scope" value="filtered">
@@ -860,7 +874,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($batchActivateBlocked) title="{{ $batchActivateBlockedReason }}">批量同步订阅(当前筛选范围)</button>
@if($batchActivateBlocked)
<div class="muted muted-xs text-danger mt-6" data-role="batch-activate-subscriptions-blocked-hint">提示:{{ $batchActivateBlockedReason }}</div>
@endif
</div>
</form>