2019-07-23 13:05:27 +08:00
|
|
|
{% extends 'app_doc/manage_base.html' %}
|
2019-07-23 10:57:42 +08:00
|
|
|
{% load staticfiles %}
|
2019-07-23 13:05:27 +08:00
|
|
|
{% block title %}文档模板管理{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="layui-card-header" style="margin-bottom: 10px;">
|
|
|
|
<div class="layui-row">
|
|
|
|
<span style="font-size:18px;">文档模板管理
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-row">
|
2019-07-23 22:03:51 +08:00
|
|
|
<form action="{% url 'manage_doctemp' %}" method="get">
|
2019-07-23 13:05:27 +08:00
|
|
|
<div class="layui-form-item">
|
2019-07-23 10:57:42 +08:00
|
|
|
<div class="layui-input-inline">
|
2019-11-03 20:36:34 +08:00
|
|
|
<input type="text" name="kw" id="kw" placeholder="输入文档模板内容" autocomplete="off" class="layui-input">
|
2019-07-23 10:57:42 +08:00
|
|
|
</div>
|
2020-04-03 21:05:27 +08:00
|
|
|
<button class="layui-btn" type="submit">搜索</button>
|
|
|
|
<button class="layui-btn" type="button"><a href="{% url 'create_doctemp' %}" target="_blank">新建文档模板</a></button>
|
2019-07-23 10:57:42 +08:00
|
|
|
</div>
|
2019-07-23 22:03:51 +08:00
|
|
|
</form>
|
2019-07-23 10:57:42 +08:00
|
|
|
</div>
|
2019-07-23 13:05:27 +08:00
|
|
|
<div class="layui-row" lay-skin="line">
|
2019-12-15 20:54:16 +08:00
|
|
|
<table class="layui-table" id="doctemp-list" lay-skin="">
|
2019-07-23 13:05:27 +08:00
|
|
|
<colgroup>
|
|
|
|
<col width="200">
|
|
|
|
<col width="200">
|
|
|
|
<col>
|
|
|
|
</colgroup>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>模板名称</th>
|
|
|
|
<th>创建时间</th>
|
|
|
|
<th>操作</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2019-11-03 20:36:34 +08:00
|
|
|
{% for temp in doctemps %}
|
2019-07-23 13:05:27 +08:00
|
|
|
<tr>
|
|
|
|
<td>{{ temp.name }}</td>
|
|
|
|
<td>{{ temp.create_time }}</td>
|
|
|
|
<td>
|
|
|
|
{# <a href="javascript:void(0);" onclick="insertTemp('{{temp.id}}');">查看</a>#}
|
2020-04-03 21:05:27 +08:00
|
|
|
<a href="{% url 'modify_doctemp' doctemp_id=temp.id %}" target="_blank" class="layui-btn layui-btn-xs">修改</a>
|
|
|
|
<a href="javascript:void(0);" onclick="delTemp('{{temp.id}}');" class="layui-btn layui-btn-xs">删除</a>
|
2019-07-23 13:05:27 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2019-07-23 10:57:42 +08:00
|
|
|
</div>
|
2019-11-03 20:36:34 +08:00
|
|
|
<!-- 分页 -->
|
|
|
|
<div class="layui-row">
|
|
|
|
<div class="pagination">
|
|
|
|
<span class="step-links">
|
|
|
|
{% if doctemps.has_previous %}
|
2020-04-03 21:05:27 +08:00
|
|
|
<a href="?page={{ doctemps.previous_page_number }}&kw={{doctemps.kw}}" class="layui-btn layui-btn-xs">上一页</a>
|
2019-11-03 20:36:34 +08:00
|
|
|
{% endif %}
|
|
|
|
<span class="current">
|
|
|
|
当前页: {{ doctemps.number }} 共 {{ doctemps.paginator.num_pages }} 页
|
|
|
|
</span>
|
|
|
|
{% if doctemps.has_next %}
|
2020-04-03 21:05:27 +08:00
|
|
|
<a href="?page={{ doctemps.next_page_number }}&kw={{doctemps.kw}}" class="layui-btn layui-btn-xs">下一页</a>
|
2019-11-03 20:36:34 +08:00
|
|
|
{% endif %}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-23 22:03:51 +08:00
|
|
|
{% endblock %}
|
|
|
|
{% block custom_script %}
|
|
|
|
<script>
|
|
|
|
delTemp = function(doctemp_id){
|
|
|
|
layer.open({
|
|
|
|
type:1,
|
|
|
|
title:'删除文档',
|
|
|
|
area:'300px;',
|
|
|
|
id:'delPro',//配置ID
|
|
|
|
content:'<div style="margin-left:10px;">警告:此操作将删除此文档模板!</div>',
|
|
|
|
btn:['确定','取消'], //添加按钮
|
|
|
|
btnAlign:'c', //按钮居中
|
|
|
|
yes:function (index,layero) {
|
|
|
|
data = {
|
|
|
|
'doctemp_id':doctemp_id,
|
|
|
|
}
|
|
|
|
$.post("{% url 'del_doctemp' %}",data,function(r){
|
|
|
|
if(r.status){
|
|
|
|
//修改成功
|
|
|
|
window.location.reload();
|
|
|
|
//layer.close(index)
|
|
|
|
}else{
|
|
|
|
//修改失败,提示
|
|
|
|
console.log(r)
|
|
|
|
layer.msg(r.data)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
2019-07-23 13:05:27 +08:00
|
|
|
{% endblock %}
|