{% extends "base.html" %} {% block content %}

审批任务

发起审批
快捷筛选: 待审批 已通过 已驳回 已弃置 已审批 全部 {% if request.args.get('keyword') or request.args.get('status') or request.args.get('start_date') %} | 已筛选, 清除筛选 {% endif %}
{% for task in tasks %} {% else %} {% endfor %}
{% if current_user.role == '管理员' %} ID {% else %} 序号 {% endif %} 标题 申请人 状态 提交时间 附件 操作
{% if current_user.role == '管理员' %} #{{ task.id }} {% else %} {{ loop.index }} {% endif %} {{ task.title }} {{ task.applicant }} {% if task.status == 'pending' %} {% if task.current_user_approved %} ✅ 已审批 {% elif task.is_current_approver %} ⏳ 待我审批 {% else %} ⏳ 待审批 {% endif %} {% elif task.status == 'approved' %} ✅ 已通过 {% elif task.status == 'rejected' %} ❌ 已驳回 {% elif task.status == 'discarded' %} 🗑️ 已弃置 {% else %} {{ task.status }} {% endif %} {{ task.created_at }} {% if task.attachment_name %} {% else %} - {% endif %} 查看 {# 只有待审批且当前用户是当前审批人且尚未审批过才显示审批按钮 #} {% if task.status == 'pending' and task.is_current_approver and not task.current_user_approved %} 审批 {% endif %} {% if task.status == 'rejected' %} 重提 {% endif %} {# 弃置按钮(待审批或已驳回状态,发起人本人或管理员可见) #} {% if task.status in ['pending', 'rejected'] %} {% if task.applicant_id == current_user.id or current_user.is_admin() %} {% endif %} {% endif %}
{% if request.args.get('keyword') or request.args.get('status') or request.args.get('start_date') %} 没有找到匹配的审批任务 {% else %} 暂无审批任务,点击「发起审批」创建 {% endif %}
共 {{ tasks|length }} 条记录
{% endblock %}