-
Notifications
You must be signed in to change notification settings - Fork 0
/
billing.tpl
207 lines (199 loc) · 7.55 KB
/
billing.tpl
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
{include file="includes/tablestyle"}
{include file="includes/deleteConfirm"}
<div class="card">
<div class="card-body">
<form action="combinebilling">
<div class="table-container">
<div class="table-header">
<div class="table-filter">
</div>
<div class="table-search d-flex justify-content-end">
<select class="form-control" id="statusSel" title="请选择状态" style="width: 150px">
<option value="">{$Lang.whole}</option>
<option value="Unpaid">{$Lang.unpaid}</option>
<option value="Paid">{$Lang.paid}</option>
<option value="Cancelled">{$Lang.cancelled}</option>
<option value="Refunded">{$Lang.refunded}</option>
</select>
</div>
</div>
<div class="table-responsive">
<table class="table tablelist">
<colgroup>
<col>
<col width="15%">
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead class="bg-light">
<tr>
<th class="checkbox">
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" name="headCheckbox" onchange="headCheckboxAll(this)" class="custom-control-input" id="customCheck" >
<label class="custom-control-label" for="customCheck"></label>
</div>
</th>
<th class="pointer" prop="id">
<span>{$Lang.bill_no}</span>
<span class="text-black-50 d-inline-flex flex-column justify-content-center ml-1 offset-3">
<i class="bx bx-caret-up"></i>
<i class="bx bx-caret-down"></i>
</span>
</th>
<th>
<span>{$Lang.type}</span>
</th>
<th class="pointer" prop="subtotal">
<span>{$Lang.amount_money}</span>
<span class="text-black-50 d-inline-flex flex-column justify-content-center ml-1 offset-3">
<i class="bx bx-caret-up"></i>
<i class="bx bx-caret-down"></i>
</span>
</th>
<th class="pointer" prop="paid_time">
<span>{$Lang.payment_time}</span>
<span class="text-black-50 d-inline-flex flex-column justify-content-center ml-1 offset-3">
<i class="bx bx-caret-up"></i>
<i class="bx bx-caret-down"></i>
</span>
</th>
<th class="pointer" prop="payment_zh">
<span>{$Lang.payment_zh}</span>
</th>
<th class="pointer" prop="due_time">
<span>{$Lang.overdue_time}</span>
<span class="text-black-50 d-inline-flex flex-column justify-content-center ml-1 offset-3">
<i class="bx bx-caret-up"></i>
<i class="bx bx-caret-down"></i>
</span>
</th>
<th class="pointer" prop="status">
<span>{$Lang.state}</span>
<span class="text-black-50 d-inline-flex flex-column justify-content-center ml-1 offset-3">
<i class="bx bx-caret-up"></i>
<i class="bx bx-caret-down"></i>
</span>
</th>
<th width="180px">{$Lang.operating}</th>
</tr>
</thead>
<tbody>
{if $Billing}
{foreach $Billing as $index => $bill}
<tr>
<td>
<div class="custom-control custom-checkbox mb-3">
<!-- xue 直接在复选框里写name value 改错了莫怪 -->
<input type="checkbox" class="custom-control-input row-checkbox" onclick="rowCheckbox(this)" id="customCheck{$bill.id}"
data-name="ids[{$index}]" name="ids[{$index}]" data-value="{$bill.id}" value="{$bill.id}">
<label class="custom-control-label" for="customCheck{$bill.id}"></label>
</div>
</td>
<td><a href="viewbilling?id={$bill.id}"><span class="badge badge-light"># {$bill.id}</span></a></td>
<td>{$bill.type_zh}</td>
<td>{$bill.subtotal}</td>
<td>{if $bill.paid_time}{$bill.paid_time|date="Y-m-d H:i"}{else}-{/if}</td>
<td>{if $bill.payment_zh}{$bill.payment_zh}{else}-{/if}</td>
<td>{if $bill.due_time}{$bill.due_time|date="Y-m-d H:i"}{else}-{/if}</td>
<td>
<span class="status badge status-{$bill.status|strtolower}">{$bill.status_zh.name}</span>
</td>
<td>
<a href="viewbilling?id={$bill.id}" class="text-success mr-2"><i class="fas fa-eye"></i> {$Lang.see}</a>
{if $bill.status == 'Unpaid'}
<a href="javascript: payamount({$bill.id});" class="text-primary mr-2"><i class="fas fa-check-circle"></i> {$Lang.payment}</a>
<a href="javascript: deleteConfirm('invoices', '{$Lang.delete_bill}', '{$Lang.want_delete_the_bill}', {id: {$bill.id}, token: '{$Token}'});"
class="text-danger"><i class="fas fa-times-circle"></i> {$Lang.delete}</a>
{/if}
</td>
</tr>
{/foreach}
{else}
<tr>
<td colspan="8">
<div class="no-data">{$Lang.nothing}</div>
</td>
</tr>
{/if}
</tbody>
</table>
</div>
<!-- 表单底部调用开始 -->
<div class="table-footer">
<div class="table-tools " >
<button class="btn btn-primary mr-1 " disabled id="readBtn" type="submit">{$Lang.consolidated_payment}</button>
<span id="pay-combine">{$Lang.you_have}{$Count}{$Lang.paid_total}{$Total_money}{$Lang.element}<span>
</div>
<div class="table-pagination">
<div class="table-pageinfo mr-2">
<span>{$Lang.common} {$Total} {$Lang.strips}</span>
<span class="mx-2">
{$Lang.each_page}
<select name="" id="limitSel">
<option value="10" {if $Limit==10}selected{/if}>10</option>
<option value="15" {if $Limit==15}selected{/if}>15</option>
<option value="20" {if $Limit==20}selected{/if}>20</option>
<option value="50" {if $Limit==50}selected{/if}>50</option>
<option value="100" {if $Limit==100}selected{/if}>100</option>
</select>
{$Lang.strips}
</span>
</div>
<ul class="pagination pagination-sm">
{$Pages}
</ul>
</div>
</div>
</div>
</form>
</div>
</div>
{include file="includes/paymodal"}
<script>
var _url = '';
var status = '{$Think.get.status}'
// 排序
$('.bg-light .pointer').on('click', function () {
var sort = '{$Think.get.sort}'
location.href = 'billing?status={$Think.get.status}&sort=' + (sort == 'desc' ? 'asc' : 'desc') + '&orderby=' + $(this).attr('prop') + '&page={$Think.get.page}&limit={$Think.get.limit}'
})
//排序样式
changeStyle()
function changeStyle() {
$('.bg-light th.pointer').children().children().css('color','rgba(0, 0, 0, 0.1)')
var sort = '{$Think.get.sort}'
let orderby = '{$Think.get.orderby}'
let index,
n
if(orderby === 'id') {
n = 0
} else if(orderby === 'subtotal') {
n = 1
} else if(orderby === 'paid_time'){
n = 2
} else if(orderby === 'due_time') {
n = 3
} else if(orderby === 'status') {
n = 4
}
if (sort === 'desc') {
index = 1 + 2 * n
} else if(sort === 'asc'){
index = 0 + 2 * n
}
$('.bg-light th.pointer').children().children().eq(index).css('color','rgba(0, 0, 0, 0.8)')
}
// 状态筛选
$('#statusSel').on('change', function () {
location.href = "billing?status=" + $('#statusSel').val() + "&sort={$Think.get.sort}&orderby={$Think.get.orderby}&page={$Think.get.page}&limit={$Think.get.limit}"
});
// 每页数量选择改变
$('#limitSel').on('change', function () {
location.href = '/billing?keywords={$Think.get.keywords}&sort={$Think.get.sort}&orderby={$Think.get.orderby}&page=1&limit=' + $('#limitSel').val()
})
</script>
<script src="/themes/clientarea/default/assets/js/billing.js?v={$Ver}"></script>