checkTheAccount.php
5.88 KB
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
<?php $this->load->view('common/header'); ?>
<body>
<div class="page-container">
<form class="" onreset="resetHandler()">
<?php $this->load->view('work/search2'); ?>
<div>
<button class="btn btn-primary radius" type="button" onclick="$('#table').DataTable().draw()">搜索</button>
<input class="btn btn-warning radius" type="reset" value="重置">
</div>
</form>
<div class="body mt-20">
<table class="table table-border table-bordered table-bg" id="table">
<thead class="text-c">
<tr>
<th width="68px">操作</th>
<th>订单编号</th>
<th>申请人</th>
<th>身份证</th>
<th>手机号</th>
<th>进件时间</th>
<th>网点</th>
<th>产品名称</th>
<th>申请金额</th>
<th>审批金额</th>
<th>客户经理</th>
<th>期数</th>
<th>当月应还(元)</th>
</tr>
</thead>
<tbody class="text-c">
</tbody>
</table>
</div>
</div>
<?php $this->load->view('common/footer'); ?>
<script>
var table = $('#table').dataTable({
aaSorting: [[1, "desc"]],
serverSide: true,
processing: true,
bSort: false,
searching: false,//是否显示搜索
iDisplayLength: 6,
bLengthChange: false,
ajax: {
url: apiBaseUrl + 'manage/financial/repayments/nonePay',
dataFilter: function (json) {
var ret = {}, json = jQuery.parseJSON(json);
ret.data = json.data;
var draw = getUrlParam('draw');
if (draw) {
ret.draw = draw;
}
ret.recordsTotal = 0;
ret.recordsFiltered = 0;
if (json.page) {
ret.recordsTotal = parseInt(json.page.totalNumber);
ret.recordsFiltered = parseInt(json.page.totalNumber);
}
return JSON.stringify(ret);
},
data: function (data) {
data.pageSize = data.length;
data.currentPage = parseFloat(data.start / data.length) + 1;
return data;
}
},
columns: [
{
data: "id", render: function (data, type, full) {
return '<span class="dropDown dropDown_hover">\
<button class="btn radius size-M">请选择 <i class="Hui-iconfont"></i></button>\
<ul class="dropDown-menu menu radius box-shadow">\
<li><a href="javascript:;pass(' + data + ')">确认到款</a></li>\
</ul></span>';
}
},
{data: "orderNumber"},//订单编号
{data: "proposerName"},//申请人
{data: "idNumber"},//身份证
{data: "phoneNumber"},//手机号
{data: "enterDate"},//进件时间
{data: "branchName"},//网点
{data: "productName"},//产品名称
{data: "applyAmount"},//申请金额
{data: "ratifyAmount"},//审批金额
{data: "clientManager"},//客户经理
{data: "totalPeriods"},//期数
{data: "currentBalance"}//当月应还
]
});
$.fn.dataTableExt.afnFiltering.push(
function (oSettings, aData, iDataIndex) {
var min = document.getElementById('min').value;
var max = document.getElementById('max').value;
var iDateCol = 5; //进件时间
var dateMin = new Date(aData[iDateCol]);
var dateMax = new Date(aData[iDateCol]);
if (min === '' && max === '')
return true;
else if (new Date(min).getTime() <= dateMin.getTime() && max === '')
return true;
else if (new Date(min).getTime() <= dateMin.getTime() && new Date(max).getTime() >= dateMax.getTime())
return true;
return false;
}
);
$('.table_search').on('change', function () {
search = $(this).val();
column = $(this).attr('column');
$('#table').DataTable().column(column).search(search).draw();
});
$('.table_search').on('keyup', function () {
search = $(this).val();
column = $(this).attr('column');
$('#table').DataTable().column(column).search(search).draw();
});
$('#min, #max').on('keyup', function () {
$('#table').DataTable().draw();
});
function resetHandler() {
$('#table').DataTable().columns().search("").draw();
}
function pass(id) {
layer.confirm('通过之后, 账单同步更新到收款明细列表', {
btn: ['通过', '取消'],
title: '确认到账',
icon: 3
}, function () {
var data = {
realRepaymentDate: getNowFormatDate()
};
$.ajax({
type: 'patch',
url: apiBaseUrl + 'manage/financial/confirm/' + id + '?realRepaymentDate=' + Date.now(),
cache: false,
dataType: 'json',
data: JSON.stringify(data),
contentType: "application/json; charset=UTF-8",
success: function (data) {
if (data.msg) {
layer.alert(data.msg);
} else if (data.code != 0) {
layer.alert('操作失败');
} else {
layer.msg('通过');
}
},
error: function () {
layer.alert("操作失败")
}
})
});
}
</script>
</body>
<html>