{% extends "base.html" %} {% block title %}逐鹿人才-证件合同管理系统-合同版本历史{% endblock %} {% block content %}

合同版本历史 - {{ contract.name }}

{% set contracts_grouped = {} %} {# 先按合同分组 parsed_versions #} {% for v in parsed_versions %} {% if v.belongs_to.id not in contracts_grouped %} {% set _ = contracts_grouped.update({v.belongs_to.id: []}) %} {% endif %} {% set _ = contracts_grouped[v.belongs_to.id].append(v) %} {% endfor %} {% for contract_id, versions in contracts_grouped.items() %} {% set latest_version_num = versions | map(attribute='version_obj.version') | max %}

合同编号: {{ versions[0].belongs_to.contract_number }} | 合同名称: {{ versions[0].belongs_to.name }}

{% for v in versions %}

合同名称 {{ v.data.name }}
合同编号 {{ v.data.contract_number }}
合同类型 {{ contract_types.get(v.data.type_id, '未知类型') }}
公司实体 {{ company_entities.get(v.data.company_entity_id, '未知实体') }}
开始日期 {{ v.data.start_date }}
结束日期 {{ v.data.end_date }}
提醒天数 {{ v.data.remind_before }}
合同方 {% for cp in v.data.counterparties %} {{ cp }}{% if not loop.last %}, {% endif %} {% endfor %}
备注 {{ v.data.notes }}
{% endfor %} {% endfor %}
返回合同详情 {% endblock %}