You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
13 KiB
Smarty
92 lines
13 KiB
Smarty
{assign var=admin_title value='账单系统'}
|
|
{assign var=admin_active value='billing'}
|
|
{include file='admin/static_header.tpl'}
|
|
{assign var=billing_view value=$billing_page.view|default:$billing_view|default:'invoices'}
|
|
{assign var=billing_filters value=$billing_page.filters|default:[]}
|
|
{assign var=billing_titles value=['invoices'=>'全部账单', 'orders'=>'开通任务', 'payments'=>'支付流水']}
|
|
{assign var=billing_financial value=[''=>'全部财务状态','open'=>'待支付','overdue'=>'已逾期','paid'=>'已支付','refunded'=>'已退款','expired'=>'已失效','void'=>'已作废']}
|
|
{assign var=billing_fulfillment value=[''=>'全部履约状态','awaiting_payment'=>'等待支付','queued'=>'已排队','pending'=>'待处理','running'=>'开通中','uncertain'=>'待人工核查','succeeded'=>'已开通','failed'=>'开通失败','expired'=>'已失效','refunded'=>'已退款','cancelled'=>'已取消']}
|
|
{assign var=billing_payment value=[''=>'全部支付状态','creating'=>'创建中','pending'=>'待支付','paid_invoice'=>'已入账单','credited_balance'=>'已入余额','failed'=>'支付失败']}
|
|
{assign var=billing_purpose value=[''=>'全部账单类型','provision'=>'实例开通','renewal'=>'实例续费','recharge'=>'余额充值']}
|
|
{assign var=billing_providers value=[''=>'全部支付渠道','balance'=>'账户余额','usdt'=>'USDT-TRC20','yipay_alipay'=>'易支付 · 支付宝','yipay_wxpay'=>'易支付 · 微信','paytaro'=>'Paytaro']}
|
|
{function name=billing_options options=[] selected=''}
|
|
{foreach $options as $value=>$label}<option value="{$value|escape}" {if $selected == $value}selected{/if}>{$label|escape}</option>{/foreach}
|
|
{/function}
|
|
<main data-admin-billing>
|
|
<div class="py-3 d-flex align-items-sm-center flex-sm-row flex-column gap-3">
|
|
<div class="flex-grow-1">
|
|
<h1 class="fs-20 fw-semibold mb-1">账单系统</h1>
|
|
<p class="text-muted mb-0">集中核对账单、开通任务与支付记录,财务状态与履约状态分别展示。</p>
|
|
</div>
|
|
<div class="admin-checkout-actions">
|
|
<span class="admin-config-status {if $billing_error|default:''}is-error{else}is-success{/if}" id="billing-notice" role="status" aria-live="polite">{if $billing_error|default:''}{$billing_error|escape}{else}已读取 {$billing_page.pagination.total|default:0|escape} 条{/if}</span>
|
|
<button class="btn btn-light" id="billing-refresh" type="button"><i class="mdi mdi-refresh me-1" aria-hidden="true"></i>刷新</button>
|
|
</div>
|
|
</div>
|
|
<nav class="admin-ticket-tabs mb-3" aria-label="账单视图">
|
|
{foreach $billing_titles as $view=>$label}<a href="/admin/billing{if $view != 'invoices'}?view={$view|escape}{/if}" data-billing-view="{$view|escape}" {if $billing_view == $view}aria-current="page"{/if}>{$label|escape}</a>{/foreach}
|
|
</nav>
|
|
<section class="row g-3 mb-3 admin-billing-summary" id="billing-summary" aria-label="当前筛选摘要" aria-busy="false">
|
|
{include file='admin/billing_summary.tpl'}
|
|
</section>
|
|
<section class="card mb-3 admin-billing-filter" aria-labelledby="billing-filter-title">
|
|
<div class="card-header d-flex flex-wrap justify-content-between align-items-center gap-2">
|
|
<div><h2 class="h5 card-title mb-1" id="billing-filter-title">筛选条件</h2><span class="text-muted fs-13">统计基于当前筛选,支付尝试金额不代表实际收入。</span></div>
|
|
<div class="d-flex gap-2 flex-wrap" aria-label="常用筛选"><button class="btn btn-light btn-sm" type="button" data-billing-preset="uncertain">待核对</button><button class="btn btn-light btn-sm" type="button" data-billing-preset="failed">开通失败</button><button class="btn btn-light btn-sm" type="button" data-billing-preset="refunded">已退款</button></div>
|
|
</div>
|
|
<div class="card-body">
|
|
<form id="billing-filter-form" class="row g-2 align-items-end" method="get" action="/admin/billing" novalidate>
|
|
<input type="hidden" name="view" id="billing-view-input" value="{$billing_view|escape}">
|
|
<label class="col-xl-4 col-lg-6" for="billing-query"><span class="form-label d-block">关键词</span><input class="form-control" id="billing-query" name="q" type="search" maxlength="80" value="{$billing_filters.q|default:''|escape}" placeholder="账单 / 订单 / 套餐 / 用户 ID"></label>
|
|
<label class="col-xl-2 col-lg-3 col-6" for="billing-user-id"><span class="form-label d-block">用户 ID</span><input class="form-control" id="billing-user-id" name="user_id" type="text" inputmode="numeric" pattern="[1-9][0-9]*" maxlength="20" value="{$billing_filters.user_id|default:''|escape}" placeholder="全部用户"></label>
|
|
<label class="col-xl-3 col-lg-3 col-6" for="billing-status-primary" id="billing-status-primary-field"><span class="form-label d-block" id="billing-status-primary-label">{if $billing_view == 'invoices'}财务状态{elseif $billing_view == 'orders'}履约状态{else}支付状态{/if}</span>
|
|
<select class="form-select" id="billing-status-primary" name="{if $billing_view == 'invoices'}financial_status{else}status{/if}">{if $billing_view == 'invoices'}{billing_options options=$billing_financial selected=$billing_filters.financial_status|default:''}{elseif $billing_view == 'orders'}{billing_options options=$billing_fulfillment selected=$billing_filters.status|default:''}{else}{billing_options options=$billing_payment selected=$billing_filters.status|default:''}{/if}</select>
|
|
</label>
|
|
<label class="col-xl-3 col-lg-4 col-6" for="billing-status-secondary" id="billing-status-secondary-field" {if $billing_view == 'payments'}hidden{/if}><span class="form-label d-block" id="billing-status-secondary-label">{if $billing_view == 'orders'}财务状态{else}履约状态{/if}</span>
|
|
<select class="form-select" id="billing-status-secondary" name="{if $billing_view == 'orders'}financial_status{else}fulfillment_status{/if}" {if $billing_view == 'payments'}disabled{/if}>{if $billing_view == 'orders'}{billing_options options=$billing_financial selected=$billing_filters.financial_status|default:''}{else}{billing_options options=$billing_fulfillment selected=$billing_filters.fulfillment_status|default:''}{/if}</select>
|
|
</label>
|
|
<details class="col-12 admin-billing-advanced" id="billing-advanced">
|
|
<summary class="text-primary py-2">更多筛选:类型、渠道、日期和每页条数</summary>
|
|
<div class="row g-2 align-items-end pt-2">
|
|
<label class="col-lg-3 col-6" for="billing-category" id="billing-category-field" {if $billing_view == 'orders'}hidden{/if}><span class="form-label d-block" id="billing-category-label">{if $billing_view == 'payments'}支付渠道{else}账单类型{/if}</span><select class="form-select" id="billing-category" name="{if $billing_view == 'payments'}provider{else}purpose{/if}" {if $billing_view == 'orders'}disabled{/if}>{if $billing_view == 'payments'}{billing_options options=$billing_providers selected=$billing_filters.provider|default:''}{else}{billing_options options=$billing_purpose selected=$billing_filters.purpose|default:''}{/if}</select></label>
|
|
<label class="col-lg-3 col-6" for="{if $billing_view == 'payments'}billing-reference-input{else}billing-reference-select{/if}" id="billing-reference-field" {if $billing_view == 'orders'}hidden{/if}><span class="form-label d-block" id="billing-reference-label">{if $billing_view == 'payments'}账单 ID{else}支付渠道{/if}</span><select class="form-select" id="billing-reference-select" name="payment_method" {if $billing_view != 'invoices'}hidden disabled{/if}>{billing_options options=$billing_providers selected=$billing_filters.payment_method|default:''}</select><input class="form-control" id="billing-reference-input" name="invoice_id" type="text" inputmode="numeric" pattern="[1-9][0-9]*" maxlength="20" value="{$billing_filters.invoice_id|default:''|escape}" placeholder="全部账单" {if $billing_view != 'payments'}hidden disabled{/if}></label>
|
|
<label class="col-lg-2 col-6" for="billing-created-from"><span class="form-label d-block">开始日期</span><input class="form-control" id="billing-created-from" type="date" value="{if $billing_filters.created_from|default:0}{$billing_filters.created_from|date_format:'%Y-%m-%d'|escape}{/if}"></label>
|
|
<label class="col-lg-2 col-6" for="billing-created-to"><span class="form-label d-block">结束日期</span><input class="form-control" id="billing-created-to" type="date" value="{if $billing_filters.created_to|default:0}{$billing_filters.created_to|date_format:'%Y-%m-%d'|escape}{/if}"></label>
|
|
<label class="col-lg-2 col-6" for="billing-per-page"><span class="form-label d-block">每页条数</span><select class="form-select" id="billing-per-page" name="per_page">{foreach [30,50,100] as $size}<option value="{$size}" {if $billing_page.pagination.per_page|default:30 == $size}selected{/if}>{$size} 条</option>{/foreach}</select></label>
|
|
</div>
|
|
</details>
|
|
<div class="col-12 admin-form-actions admin-billing-filter-actions mt-2"><button class="btn btn-primary" id="billing-apply" type="submit">应用筛选</button><button class="btn btn-light" id="billing-reset" type="button">清空条件</button></div>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
<section class="card" id="billing-panel" aria-labelledby="billing-view-heading">
|
|
<div class="card-header d-flex align-items-center justify-content-between flex-wrap gap-2">
|
|
<div><h2 class="h5 card-title mb-1" id="billing-view-heading">{$billing_titles[$billing_view]|escape}</h2><span class="text-muted fs-13" id="billing-view-description">财务状态、履约状态与支付尝试分别核对。</span></div>
|
|
<span class="badge text-bg-light" id="billing-result-count" aria-live="polite">{if $billing_page}本页 {$billing_page.items|count} 条 · 共 {$billing_page.pagination.total|escape} 条{else}数据未获取{/if}</span>
|
|
<p class="text-muted fs-12 mb-0 w-100" id="billing-shown-filters">下列记录对应当前筛选条件。</p>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="table-responsive admin-checkout-table-wrap"><table class="table table-hover align-middle mb-0 admin-checkout-table admin-billing-table" id="billing-table"><caption class="visually-hidden" id="billing-table-caption">管理员账单列表</caption>
|
|
{include file='admin/billing_rows.tpl'}
|
|
</table></div>
|
|
<nav class="admin-user-pagination" id="billing-pagination" aria-label="账单列表分页" {if !$billing_page || !$billing_page.pagination.total}hidden{/if}>
|
|
<button class="btn btn-light" id="billing-previous" type="button" {if !$billing_page || !$billing_page.pagination.has_previous}disabled{/if}>上一页</button>
|
|
<span id="billing-page-label">第 {$billing_page.pagination.page|default:1|escape} / {$billing_page.pagination.total_pages|default:1|escape} 页 · 共 {$billing_page.pagination.total|default:0|escape} 条</span>
|
|
<button class="btn btn-light" id="billing-next" type="button" {if !$billing_page || !$billing_page.pagination.has_next}disabled{/if}>下一页</button>
|
|
</nav>
|
|
</div>
|
|
</section>
|
|
<noscript><p class="alert alert-info mt-3">已显示数据库账单快照。启用 JavaScript 后可查看详情、分页及日期筛选。</p></noscript>
|
|
</main>
|
|
<dialog data-admin-instance-drawer data-admin-billing-drawer id="billing-detail-dialog" aria-labelledby="billing-detail-title">
|
|
<header class="admin-instance-drawer-header"><div><p class="text-muted fs-13 mb-1">账单详情</p><h2 class="h4 fw-semibold mb-0" id="billing-detail-title">账单</h2></div><button class="admin-modal-close position-static flex-shrink-0" id="billing-detail-close" type="button" aria-label="关闭账单详情" autofocus><i class="mdi mdi-close" aria-hidden="true"></i></button></header>
|
|
<div class="admin-instance-drawer-body"><p class="alert alert-info" id="billing-detail-state" role="status" aria-live="polite">正在读取账单详情…</p>
|
|
<div class="admin-instance-tabs" role="tablist" aria-label="账单详情分类">{foreach ['overview'=>'账单概览','funds'=>'资金记录','fulfillment'=>'履约信息','payments'=>'支付记录'] as $tab=>$label}<button class="btn btn-light" type="button" id="billing-tab-{$tab}" data-billing-tab="{$tab}" role="tab" aria-controls="billing-panel-{$tab}" aria-selected="{if $tab == 'overview'}true{else}false{/if}" tabindex="{if $tab == 'overview'}0{else}-1{/if}">{$label}</button>{/foreach}</div>
|
|
<div id="billing-detail-body">{foreach ['overview','funds','fulfillment','payments'] as $tab}<section id="billing-panel-{$tab}" role="tabpanel" aria-labelledby="billing-tab-{$tab}" tabindex="0" {if $tab != 'overview'}hidden{/if}></section>{/foreach}</div>
|
|
</div>
|
|
<footer class="admin-instance-drawer-footer"><span class="text-muted fs-12">只读核对,不会触发退款或重复执行开通。</span><div class="d-flex gap-2 flex-wrap" id="billing-detail-links"></div></footer>
|
|
</dialog>
|
|
<script id="admin-billing-bootstrap" type="application/json">{$billing_bootstrap_json|default:'null' nofilter}</script>
|
|
<script type="module" src="/cloud/admin-billing.js?v={$venix_asset_version}"></script>
|
|
{include file='admin/static_footer.tpl'}
|