合约管理改为Tab切换品种展示

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-26 14:54:52 +08:00
parent 06f7fc930a
commit 5ca5df72b6
+9 -3
View File
@@ -157,10 +157,16 @@
</form> </form>
</div> </div>
{# ── Contract tables per product ── #} {# ── Product tabs for contract list ── #}
{% set ctab = request.query_params.get('ctab', products[0].code if products else '') %}
<div class="tabs" style="margin-top:24px;">
{% for p in products %} {% for p in products %}
{% if p.contracts %} <a href="/admin/?tab=contract&ctab={{ p.code }}" class="tab-btn{% if ctab == p.code %} active{% endif %}">{{ p.code }} · {{ p.name }}</a>
<div class="section-title" style="margin-top:{% if not loop.first %}24px{% else %}0{% endif %};">{{ p.code }} · {{ p.name }}</div> {% endfor %}
</div>
{% for p in products %}
{% if p.code == ctab and p.contracts %}
<div class="table-wrap" style="margin-bottom:20px;"> <div class="table-wrap" style="margin-bottom:20px;">
<table> <table>
<tr><th>合约代码</th><th>月份</th><th>状态</th><th>操作</th></tr> <tr><th>合约代码</th><th>月份</th><th>状态</th><th>操作</th></tr>