-
Notifications
You must be signed in to change notification settings - Fork 52
/
agency_shares.html
139 lines (128 loc) · 5.11 KB
/
agency_shares.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
<div class="box box-default">
<div class="box-header">
<i class="fa fa-rmb"></i>
<h3 class="box-title">代理分成统计</h3>
<div class="bar pull-right">
<a href="javascript:window.location.reload();"><i class="fa fa-refresh"></i> 刷新</a>
</div>
</div>
<div class="box-body">
<div class="container">
<form id="query_form" class="form-horizontal form-well" role="form" action="/agency/share" method="post">
<div class="form-group">
<label for="node_id" class="col-md-2 control-label">区域</label>
<div class="col-md-3">
<select id="node_id" name="node_id" class="form-control input-sm" >
<option value=""></option>
{{ range .NodeList }}
<option value="{{.Id}}" {{if eq (Str .Id) (call $.Post "node_id") }} selected {{end}}>{{.Desc}}</option>
{{end}}
</select>
</div>
<label for="product_id" class="col-md-2 control-label">资费</label>
<div class="col-md-3">
<select id="product_id" name="product_id" class="form-control input-sm" >
<option value=""></option>
{{ range .Products }}
<option value="{{.Id}}" {{if eq (Str .Id) (call $.Post "product_id")}} selected {{end}}>{{.Name}}</option>
{{end}}
</select>
</div>
</div>
<div class="form-group">
<label for="query_begin_time" class="col-md-2 control-label">开始时间</label>
<div class="col-md-3">
<input type="text" id="query_begin_time" name="query_begin_time" value="{{call $.Post "query_begin_time"}}" class="form-control input-sm form_datetime" >
</div>
<label for="query_end_time" class="col-md-2 control-label">结束时间</label>
<div class="col-md-3">
<input type="text" id="query_end_time" name="query_end_time" value="{{call $.Post "query_end_time"}}" class="form-control input-sm form_datetime">
</div>
</div>
<div class="form-group">
<label for="agency_id" class="col-md-2 control-label">代理商</label>
<div class="col-md-3">
<select id="agency_id" name="agency_id" class="form-control input-sm" >
<option value=""></option>
{{ range .AgencyList }}
<option value="{{.Id}}" {{if eq (Str .Id) (call $.Post "agency_id")}} selected {{end}}>{{.Name}}</option>
{{end}}
</select>
</div>
<div class="col-md-7">
<button type="button" onclick="do_submit();" class="btn btn-sm bg-navy">查询</button>
<button type="button" onclick="$('input').val('');" class="btn btn-sm bg-navy">重置</button>
{{ if (call $.Match "/agency/share/export") }}
<a href="javascript:do_export();" class="btn btn-sm bg-navy">
<i class="fa fa-sign-out"></i> 导出数据</a>
{{end}}
</div>
</div>
</form>
<table class="table" id="maintable">
<thead>
<tr>
<th>日期</th>
<th>区域</th>
<th>代理商</th>
<th>资费</th>
<th>总金额</th>
<th>分成总额</th>
</tr>
</thead>
<tbody>
{{ range .AgencyShares }}
<tr>
<td>{{.CreateTime}}</td>
<td>{{map_get $.NodeDescMap .NodeId }}</td>
<td>{{map_get $.AgencyMap .AgencyId }}</td>
<td>{{map_get $.ProductMap .ProductId }}</td>
<td>{{Fen2yuan .FeeValue }}</td>
<td>{{Fen2yuan .ShareFee }}</td>
</tr>
{{end}}
</tbody>
<tfoot>
<tr>
<th colspan="4">合计</th>
<th>{{Fen2yuan .fee_value_total }}</th>
<th>{{Fen2yuan .fee_share_total }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#query_begin_time").datepicker({format: 'yyyy-mm-dd',endDate:"+1d"});
$("#query_end_time").datepicker({format: 'yyyy-mm-dd',endDate:"+1d"});
$('#maintable').dataTable({
"bPaginate": true,
"bLengthChange": false,
"bFilter": false,
"bSort": true,
"bInfo": false,
"bAutoWidth": false,
"pagingType": "full_numbers",
"oLanguage": {
"sZeroRecords": "没有找到符合条件的数据",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "前一页",
"sNext": "后一页",
"sLast": "尾页"
}
}
});
});
function do_submit(){
$("#query_form").attr("action", "/agency/share");
$("#query_form").submit();
}
function do_export(){
$("#query_form").attr("action", "/guuagency/agencyshare_export");
$("#query_form").submit();
setTimeout(function(){$("#query_form").attr("action", "/guuagency/agencyshare");}, 0);
}
</script>