2026-01-28 12:30:14 +08:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
{% load custom_filters %}
|
|
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
<!-- 页面标题 -->
|
|
|
|
|
<div class="w-full max-w-6xl mx-auto p-6">
|
|
|
|
|
<div class="relative flex items-center justify-center py-8">
|
|
|
|
|
<div class="absolute left-0 right-0 h-1 bg-gradient-to-r from-transparent via-rose-500 to-transparent"></div>
|
|
|
|
|
<div class="relative z-10 bg-gradient-to-r from-rose-600 to-pink-700 text-white px-8 py-3 rounded-full shadow-lg">
|
|
|
|
|
<h1 class="text-xl font-bold flex items-center gap-3">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
|
|
|
|
|
</svg>
|
|
|
|
|
活动统计
|
|
|
|
|
</h1>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="w-full max-w-6xl mx-auto p-6">
|
|
|
|
|
<!-- 筛选表单 -->
|
|
|
|
|
<div class="bg-white rounded-2xl shadow-lg overflow-hidden border border-rose-100 mb-6">
|
|
|
|
|
<div class="px-6 py-4 bg-gradient-to-r from-rose-600 via-rose-700 to-pink-700">
|
|
|
|
|
<h2 class="text-lg font-bold text-white flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
|
|
|
|
|
</svg>
|
|
|
|
|
筛选条件
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="p-6">
|
|
|
|
|
<form method="GET" class="flex flex-wrap gap-4 items-end">
|
|
|
|
|
<!-- 年份选择 -->
|
|
|
|
|
<div class="flex flex-col">
|
|
|
|
|
<label class="text-sm font-medium text-gray-700 mb-2 flex items-center gap-1">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
|
|
|
|
</svg>
|
|
|
|
|
选择年份
|
|
|
|
|
</label>
|
|
|
|
|
<select name="year" class="mt-1 p-2.5 border border-gray-200 rounded-lg focus:ring-2 focus:ring-rose-300 focus:border-rose-500 outline-none text-sm bg-gray-50 hover:bg-white transition-colors">
|
|
|
|
|
<option value="all">全部年份</option>
|
|
|
|
|
<option value="2023" {% if selected_year == '2023' %}selected{% endif %}>2023年</option>
|
|
|
|
|
<option value="2024" {% if selected_year == '2024' %}selected{% endif %}>2024年</option>
|
|
|
|
|
<option value="2025" {% if selected_year == '2025' %}selected{% endif %}>2025年</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 分支机构选择 -->
|
|
|
|
|
<div class="flex flex-col">
|
|
|
|
|
<label class="text-sm font-medium text-gray-700 mb-2 flex items-center gap-1">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
|
|
|
</svg>
|
|
|
|
|
分支机构
|
|
|
|
|
</label>
|
|
|
|
|
<select name="branch" class="mt-1 p-2.5 border border-gray-200 rounded-lg focus:ring-2 focus:ring-rose-300 focus:border-rose-500 outline-none text-sm bg-gray-50 hover:bg-white transition-colors">
|
|
|
|
|
<option value="all" {% if selected_branch == 'all' %}selected{% endif %}>全部分支机构</option>
|
|
|
|
|
{% for branch in branches %}
|
|
|
|
|
<option value="{{ branch.id }}" {% if selected_branch == branch.id|stringformat:"s" %}selected{% endif %}>
|
|
|
|
|
{{ branch.name }}
|
|
|
|
|
</option>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 状态选择 -->
|
|
|
|
|
<div class="flex flex-col">
|
|
|
|
|
<label class="text-sm font-medium text-gray-700 mb-2 flex items-center gap-1">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
|
|
|
</svg>
|
|
|
|
|
活动状态
|
|
|
|
|
</label>
|
|
|
|
|
<select name="status" class="mt-1 p-2.5 border border-gray-200 rounded-lg focus:ring-2 focus:ring-rose-300 focus:border-rose-500 outline-none text-sm bg-gray-50 hover:bg-white transition-colors">
|
|
|
|
|
<option value="completed" {% if selected_status == 'completed' %}selected{% endif %}>已完成</option>
|
|
|
|
|
<option value="ongoing" {% if selected_status == 'ongoing' %}selected{% endif %}>未完成</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button type="submit" class="px-5 py-2.5 bg-gradient-to-r from-rose-600 to-rose-700 hover:from-rose-700 hover:to-rose-800 text-white rounded-lg shadow-md hover:shadow-lg transition-all duration-200 font-medium flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
|
|
|
|
|
</svg>
|
|
|
|
|
筛选
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 统计结果展示 -->
|
|
|
|
|
<div class="bg-white rounded-2xl shadow-lg overflow-hidden border border-rose-100">
|
|
|
|
|
<div class="px-6 py-4 bg-gradient-to-r from-rose-50 to-pink-50 border-b-2 border-rose-200">
|
|
|
|
|
<h2 class="text-lg font-bold text-gray-800 flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-rose-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
|
|
|
|
|
</svg>
|
|
|
|
|
活动统计结果
|
|
|
|
|
<span class="ml-2 px-3 py-1 bg-rose-100 text-rose-700 rounded-full text-sm font-medium">共 {{ activities.count }} 条</span>
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="overflow-x-auto">
|
|
|
|
|
<table class="w-full border-collapse">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr class="bg-gradient-to-r from-rose-50 to-pink-50 border-b-2 border-rose-200">
|
|
|
|
|
<th class="px-6 py-4 text-left text-sm font-bold text-gray-700 uppercase tracking-wider">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
|
|
|
</svg>
|
|
|
|
|
活动名称
|
|
|
|
|
</div>
|
|
|
|
|
</th>
|
|
|
|
|
<th class="px-6 py-4 text-left text-sm font-bold text-gray-700 uppercase tracking-wider">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
|
|
|
</svg>
|
|
|
|
|
分支机构
|
|
|
|
|
</div>
|
|
|
|
|
</th>
|
|
|
|
|
<th class="px-6 py-4 text-left text-sm font-bold text-gray-700 uppercase tracking-wider">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z" />
|
|
|
|
|
</svg>
|
|
|
|
|
活动分类
|
|
|
|
|
</div>
|
|
|
|
|
</th>
|
|
|
|
|
<th class="px-6 py-4 text-left text-sm font-bold text-gray-700 uppercase tracking-wider">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
|
|
|
|
</svg>
|
|
|
|
|
开始时间
|
|
|
|
|
</div>
|
|
|
|
|
</th>
|
|
|
|
|
<th class="px-6 py-4 text-left text-sm font-bold text-gray-700 uppercase tracking-wider">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-rose-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
|
|
|
</svg>
|
|
|
|
|
结束时间
|
|
|
|
|
</div>
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody class="divide-y divide-gray-100">
|
|
|
|
|
{% for activity in activities %}
|
|
|
|
|
<tr class="{% cycle 'bg-white' 'bg-rose-50/30' %} hover:bg-rose-50/50 transition-colors duration-200">
|
|
|
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 font-medium">{{ activity.name }}</td>
|
|
|
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ activity.branch.name }}</td>
|
|
|
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
|
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium bg-rose-100 text-rose-700">
|
|
|
|
|
{{ activity.scope }}
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ activity.start_time|format_chinese_full_date }}</td>
|
|
|
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
|
|
|
|
{% if activity.end_time %}
|
|
|
|
|
{{ activity.end_time|format_chinese_full_date }}
|
|
|
|
|
{% else %}
|
|
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium bg-amber-100 text-amber-700">
|
|
|
|
|
未结束
|
|
|
|
|
</span>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% empty %}
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5" class="px-6 py-8 text-center text-gray-500">
|
|
|
|
|
<div class="flex flex-col items-center gap-2">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-300" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
|
|
|
</svg>
|
|
|
|
|
<span>无符合条件的活动记录</span>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 分隔线 -->
|
|
|
|
|
<div class="h-1 my-8 rounded-full bg-gradient-to-r from-transparent via-rose-400 to-transparent"></div>
|
2025-11-11 11:09:01 +08:00
|
|
|
{% endblock %}
|