forked from jly8866/archer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueryapplydetail.html
155 lines (152 loc) · 5.13 KB
/
queryapplydetail.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{% extends "base.html" %}
{% load format_tags %}
{% block content %}
<h4 style="display: inline;">工单名称:<span>{{ workflowDetail.title }}</span></h4>
<hr>
<table data-toggle="table" class="table table-striped table-hover">
<thead>
<tr>
<th>
申请人
</th>
<th>
审核人列表
</th>
<th>
当前审核人
</th>
<th>
实例
</th>
<th>
权限级别
</th>
<th>
结果集
</th>
<th>
有效时间
</th>
<th>
申请时间
</th>
<th>
当前状态
</th>
</tr>
</thead>
<tbody>
<tr class="success">
<td>
{{ workflowDetail.user_name }}
</td>
<td>
{{ audit_info.audit_users }}
</td>
<td>
{% if audit_info.current_audit_user == '-1' %}
None
{% else %}
{{ audit_info.current_audit_user }}
{% endif %}
</td>
<td>
{{ workflowDetail.cluster_name }}
</td>
<td>
{% if workflowDetail.priv_type == 1 %}
DATABASE
{% elif workflowDetail.priv_type == 2 %}
TABLE
{% endif %}
</td>
<td>
{{ workflowDetail.limit_num }}
</td>
<td>
{{ workflowDetail.valid_date }}
</td>
<td>
{{ workflowDetail.create_time }}
</td>
<td>
{% if workflowDetail.status == 0 %}
<b style="color: red">待审核</b>
{% elif workflowDetail.status == 1 %}
<b style="color: green">审核通过</b>
{% elif workflowDetail.status == 2 %}
<b style="color: red">审核不通过</b>
{% elif workflowDetail.status == 3 %}
<b style="color: red">审核取消</b>
{% endif %}
</td>
</tr>
</tbody>
</table>
<br>
<div class="panel panel-default">
<div class="panel-heading">
{% if workflowDetail.priv_type == 1 %}
数据库清单
{% elif workflowDetail.priv_type == 2 %}
表清单
{% endif %}
</div>
<div class="panel-body">
{% if workflowDetail.priv_type == 1 %}
{% format_str workflowDetail.db_list %}
{% elif workflowDetail.priv_type == 2 %}
{% format_str workflowDetail.table_list %}
{% endif %}
</div>
</div>
<br>
{% if workflowDetail.status == 0 %}
{% if loginUser == audit_info.current_audit_user %}
<textarea id="remark" name="remark" class="form-control" data-name="审核备注"
placeholder="请填写驳回原因" rows=3></textarea>
<br>
<form action="/queryprivaudit/" method="post" style="display:inline-block;">
{% csrf_token %}
<input type="hidden" name="apply_id" value="{{ workflowDetail.apply_id }}">
<input type="hidden" id="audit_status" name="audit_status" value="1">
<input type="submit" id="btnPass" onclick="loading(this)" class="btn btn-success" value="审核通过"/>
</form>
<form id="form-cancel" action="/queryprivaudit/" method="post" style="display:inline-block;">
{% csrf_token %}
<input type="hidden" name="apply_id" value="{{ workflowDetail.apply_id }}">
<input type="hidden" id="audit_status" name="audit_status" value="2">
<input type="hidden" id="audit_remark" name="audit_remark" value="">
<input type="button" id="btnReject" class="btn btn-default" value="终止流程"/>
</form>
{% endif %}
{% endif %}
{% endblock content %}
{% block js %}
<script>
// 按钮禁用
function loading(obj) {
$(obj).button('loading').delay(2500).queue(function () {
$(obj).button('reset');
$(obj).dequeue();
});
}
// 校验备注
$("#btnReject").click(function () {
//获取form对象,判断输入,通过则提交
$("#audit_remark").val($("#remark").val());
var formCancel = $("#form-cancel");
if ($("#audit_remark").val()) {
$(this).button('loading').delay(2500).queue(function () {
$(this).button('reset');
$(this).dequeue();
});
formCancel.submit();
}
else {
alert('请填写驳回原因')
}
})
</script>
{% endblock %}