9b79c14267
- 新增 SoftwareCategory/SoftwareAsset/SoftwareChangeLog 模型与迁移0010 - 软资产CRUD:编号/名称/分类/供应商/版本/许可类型/授权数量/许可密钥/账号/费用/起止日期/负责人/部门/状态 - 许可类型:永久授权/订阅/开源免费/按需付费;状态:在用/闲置/已过期/已注销 - 到期提醒:已过期/即将到期(30天)自动标识 - Excel导入导出:模板下载、ID存在时更新、分类自动创建、空白行跳过、缺编号/名称报错 - 软件分类独立管理,分类下有资产时禁止删除 - 独立软件变更记录页;仪表盘增加软件统计卡片、软件分类统计、许可类型分布 - 导航栏改造:资产管理/分类管理/变更记录/导入导出下拉菜单 - 全流程15项功能验证通过(CRUD/导入导出/权限/仪表盘)
113 lines
5.2 KiB
HTML
113 lines
5.2 KiB
HTML
{% extends "assetapp/base.html" %}
|
|
|
|
{% block title %}软件资产变更记录{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h4 class="mb-0"><i class="bi bi-clock-history me-2"></i>软件资产变更记录</h4>
|
|
</div>
|
|
|
|
<div class="card card-dark mb-3">
|
|
<div class="card-body py-3">
|
|
<form method="get" class="row g-2 align-items-center">
|
|
<div class="col-md-4">
|
|
<div class="input-group input-group-sm">
|
|
<span class="input-group-text"><i class="bi bi-search"></i></span>
|
|
<input type="text" name="asset_number" value="{{ asset_number }}" class="form-control"
|
|
placeholder="按资产编号搜索">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<select name="action" class="form-select form-select-sm">
|
|
<option value="">全部操作</option>
|
|
<option value="create" {% if current_action == 'create' %}selected{% endif %}>创建</option>
|
|
<option value="update" {% if current_action == 'update' %}selected{% endif %}>更新</option>
|
|
<option value="delete" {% if current_action == 'delete' %}selected{% endif %}>删除</option>
|
|
<option value="import" {% if current_action == 'import' %}selected{% endif %}>导入</option>
|
|
<option value="export" {% if current_action == 'export' %}selected{% endif %}>导出</option>
|
|
<option value="status_change" {% if current_action == 'status_change' %}selected{% endif %}>状态变更</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="submit" class="btn btn-primary btn-sm w-100">
|
|
<i class="bi bi-funnel me-1"></i>筛选
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-dark">
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-dark table-hover mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>时间</th>
|
|
<th>资产编号</th>
|
|
<th>操作</th>
|
|
<th>变更字段</th>
|
|
<th>旧值</th>
|
|
<th>新值</th>
|
|
<th>描述</th>
|
|
<th>操作人</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for log in page_obj %}
|
|
<tr>
|
|
<td>{{ log.created_at|date:"m-d H:i" }}</td>
|
|
<td>
|
|
{% if log.software_asset %}
|
|
<a href="{% url 'software_detail' log.software_asset.pk %}" class="text-info">{{ log.asset_number }}</a>
|
|
{% else %}
|
|
{{ log.asset_number }}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<span class="badge
|
|
{% if log.action == 'create' %}bg-success
|
|
{% elif log.action == 'update' %}bg-primary
|
|
{% elif log.action == 'delete' %}bg-danger
|
|
{% elif log.action == 'import' %}bg-info
|
|
{% elif log.action == 'export' %}bg-secondary
|
|
{% else %}bg-warning{% endif %}">
|
|
{{ log.get_action_display }}
|
|
</span>
|
|
</td>
|
|
<td>{{ log.field_name|default:"-" }}</td>
|
|
<td class="text-wrap" style="max-width:150px;">{{ log.old_value|default:"-"|truncatechars:30 }}</td>
|
|
<td class="text-wrap" style="max-width:150px;">{{ log.new_value|default:"-"|truncatechars:30 }}</td>
|
|
<td>{{ log.description|default:"-" }}</td>
|
|
<td>{{ log.operator|default:"-" }}</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="8" class="text-center text-muted py-4">暂无变更记录</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if page_obj.paginator.num_pages > 1 %}
|
|
<nav class="mt-3">
|
|
<ul class="pagination pagination-sm justify-content-center">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.previous_page_number }}&asset_number={{ asset_number }}&action={{ current_action }}">上一页</a>
|
|
</li>
|
|
{% endif %}
|
|
<li class="page-item active">
|
|
<span class="page-link">{{ page_obj.number }} / {{ page_obj.paginator.num_pages }}</span>
|
|
</li>
|
|
{% if page_obj.has_next %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.next_page_number }}&asset_number={{ asset_number }}&action={{ current_action }}">下一页</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
{% endblock %}
|