{% extends "base.html" %} {% block title %}{{ page_title }} - AgomTradePro{% endblock %} {% block content %} {% include "components/classic_tui_migration_banner.html" with screen_key="execution.accounts" action_key="broker-execution.overview" %}

{{ page_title }}

{{ page_subtitle }}
{% if permissions.kill_switch %}{% endif %}{% if permissions.resume and page_data.kill_switch.active %}{% endif %}
{% if page_error %}
{{ page_error }}
{% endif %} {% if page_key == 'overview' %}

今日能否交易

{{ page_data.today_readiness|default:"OFFLINE" }}
连接、停止开关与差异的综合结论

本地连接

{{ page_data.connections.online|default:0 }}/{{ page_data.connections.total|default:0 }}
Agent 与 QMT 同时在线

待我确认

{{ page_data.pending_approvals.count|default:0 }}
预计金额 {{ page_data.pending_approvals.estimated_amount|default:"0" }}
最早过期 {{ page_data.pending_approvals.earliest_expiry|default:"-" }}

执行异常

{{ page_data.execution_exceptions.count|default:0 }}
拒单、未知状态和待对账订单

对账差异

{{ page_data.reconciliation_differences.runs|default:0 }}
订单 {{ page_data.reconciliation_differences.order|default:0 }} / 成交 {{ page_data.reconciliation_differences.fill|default:0 }} / 资金 {{ page_data.reconciliation_differences.cash|default:0 }} / 持仓 {{ page_data.reconciliation_differences.position|default:0 }}

停止开关

{% if page_data.kill_switch.active %}已停止{% else %}未触发{% endif %}
停止后仍允许撤单、回报和对账

下一步

{% if page_data.connections.total == 0 %}

尚无本地 Agent。请由管理员完成 Windows Agent 与账户绑定。

{% elif page_data.pending_approvals.count %}复核待确认订单{% else %}

当前没有待确认订单。请持续关注连接与对账状态。

{% endif %}
{% if page_data.active_alerts %}

当前实盘告警

{% for alert in page_data.active_alerts %}
{{ alert.severity }} · {{ alert.title }}
账户 {{ alert.account_id }}{% if alert.auto_stop_applied %} · 已自动停止新单{% endif %}
{% endfor %}
{% endif %} {% endif %} {% if page_key == 'orders' %} {% if permissions.create_draft %}

从当前自动投顾建议生成草稿

服务端会重新生成当前建议并执行权威风控;不能在这里手工填写标的、方向、数量或价格。

{% endif %}

订单目录

{% for order in page_data.orders %}{% empty %}{% endfor %}
状态账户标的方向数量限价预计金额有效期操作
{{ order.status }}{{ order.account_id }}{{ order.asset_code }}{{ order.side }}{{ order.quantity }}{{ order.limit_price|default:"-" }}{{ order.estimated_amount }}{{ order.expires_at|default:"-" }}{% if permissions.approve and order.action_availability.approve %}{% endif %}{% if permissions.reject and order.action_availability.reject %}{% endif %}{% if permissions.cancel and order.action_availability.cancel %}{% endif %}
当前没有可见实盘订单。
{% endif %} {% if page_key == 'order_detail' %}

{{ page_data.asset_code }} · {{ page_data.side }}

{{ page_data.status }}

账户:{{ page_data.account_id }}

数量:{{ page_data.quantity }},限价:{{ page_data.limit_price|default:"-" }}

预计金额:{{ page_data.estimated_amount }}

券商委托号:{{ page_data.broker_order_id|default:"-" }}

已成交:{{ page_data.filled_quantity }},成交均价:{{ page_data.average_fill_price|default:"-" }}

{% if page_data.failure_code or page_data.failure_message %}
{{ page_data.failure_code|default:"执行异常" }}
{{ page_data.failure_message|default:"请进入对账核验" }}
{% endif %}

有效期:{{ page_data.expires_at|default:"-" }}

审批摘要:{{ page_data.approval_digest|default:"尚未批准" }}

{% if permissions.approve and page_data.action_availability.approve %}{% endif %}{% if permissions.reject and page_data.action_availability.reject %}{% endif %}{% if permissions.cancel and page_data.action_availability.cancel %}{% endif %}

风险快照

{{ page_data.risk_snapshot }}

券商事件与成交

{% for event in page_data.events %}{% empty %}{% endfor %}
时间事件状态编号
{{ event.occurred_at }}{{ event.event_type }}{{ event.status }}{{ event.event_id }}
尚无券商委托回报。

成交事实

{% for fill in page_data.fills %}{% empty %}{% endfor %}
成交时间券商成交号数量价格金额
{{ fill.occurred_at }}{{ fill.broker_trade_id }}{{ fill.quantity }}{{ fill.price }}{{ fill.amount }}
尚无成交。
{% endif %} {% if page_key == 'reconciliation' %}

对账批次

Agent 不可用时导入券商成交文件

{% for run in page_data.runs %}{% empty %}{% endfor %}
时间账户状态订单成交资金持仓差异证据操作
{{ run.started_at }}{{ run.account_id }}{{ run.status }}{{ run.order_difference_count }}{{ run.fill_difference_count }}{{ run.cash_difference_count }}{{ run.position_difference_count }}
{{ run.differences|length }} 项{% for difference in run.differences %}
{{ difference.severity }} · {{ difference.dimension }} {{ difference.difference_key }}
{{ difference.reason }}
{% empty %}无差异{% endfor %}
{% if permissions.resolve_reconciliation and run.status != 'resolved' and run.status != 'completed' %}{% endif %}
暂无对账批次。Agent 首次同步后会形成持久化证据。
{% endif %} {% if page_key == 'connection' or page_key == 'settings' %}

{% if page_key == 'connection' %}Agent / QMT 连接{% else %}账户执行设置{% endif %}

{% if permissions.manage_binding and page_key == 'connection' %}{% endif %}{% for agent in page_data.connections %}{% if permissions.manage_binding and page_key == 'connection' %}{% endif %}{% empty %}{% endfor %}
Agent状态QMT版本最后心跳绑定账户连接操作
{{ agent.display_name }}{{ agent.status }}{% if agent.qmt_connected %}已连接{% else %}未连接{% endif %}{{ agent.agent_version|default:"-" }}{{ agent.last_heartbeat_at|default:"从未" }}{% for binding in agent.bindings %}
{{ binding.account_id }} · {{ binding.broker_account_mask }} · {% if binding.is_active %}{% if binding.auto_execution_enabled %}可执行{% else %}仅观察{% endif %}{% else %}已解绑{% endif %}{% if permissions.manage_binding and binding.is_active and page_key == 'connection' %} {% endif %}
{% empty %}-{% endfor %}
本地 Agent 尚未连接。请先在 Windows 安装 QMT、xtquant 与 Agom QMT Agent。
{% if page_key == 'connection' %}

主动测试通过现有出站长轮询向 Agent 下发全量同步命令,不需要在本机开放入站端口。

{% endif %}
{% if permissions.manage_binding and page_key == 'connection' %}

管理员:绑定执行端

首版仅支持普通股票账户;信用账户必须在专门适配融资融券委托语义后另行验收。

{% endif %} {% if permissions.manage_agent_credentials and page_key == 'connection' %}

管理员:Agent 凭证

{% for agent in page_data.connections %}{% for credential in agent.credentials %}{% empty %}{% endfor %}{% empty %}{% endfor %}
Agent凭证 ID允许账户有效期状态操作
{{ agent.agent_id }}{{ credential.credential_id }}{{ credential.allowed_account_ids|join:", " }}{{ credential.expires_at }}{% if credential.revoked_at %}已撤销{% else %}有效{% endif %}{% if not credential.revoked_at %}{% endif %}
{% endif %} {% if permissions.manage_limits and page_key == 'settings' %}

管理员:更新账户门禁

{% endif %} {% if permissions.manage_access and page_key == 'settings' %}

管理员:账户授权

角色只决定可执行的动作类型;非账户所有者还必须拥有这里配置的显式账户授权。

{% for grant in page_data.access_grants %}{% empty %}{% endfor %}
用户账户审批交易状态授权人
{{ grant.username }} ({{ grant.user_id }}){{ grant.account_id }}{% if grant.can_approve %}允许{% else %}禁止{% endif %}{% if grant.can_trade %}允许{% else %}禁止{% endif %}{% if grant.is_active %}有效{% else %}已撤销{% endif %}{{ grant.granted_by|default:"-" }}
暂无显式账户授权。
{% endif %} {% endif %} {% if page_key == 'audit' %}

只追加审计时间线

{% for event in page_data.events %}{% empty %}{% endfor %}
时间操作者动作账户资源原因请求 ID
{{ event.created_at }}{{ event.actor_username|default:event.actor_type }}{{ event.action }}{{ event.account_id }}{{ event.resource_type }} / {{ event.resource_id }}{{ event.reason|default:"-" }}{{ event.request_id|default:"-" }}
暂无可见审计事件。

导出范围与当前用户权限及当前筛选结果一致;不会包含其他用户的审计数据。

{% endif %}
{{ page_data|json_script:"broker-execution-page-data" }} {{ page_view_model|json_script:"broker-execution-page-view-model" }} {% endblock %}