Pu Zhibing
3 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/**
 * 提现列表管理初始化
 */
var TPubWithdrawal = {
    id: "TPubWithdrawalTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
TPubWithdrawal.initColumn = function () {
    // return [
    //     {field: 'selectItem', radio: true},
    //     {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
    //     {title: '时间', field: 'insertTime', align: 'center', valign: 'middle'},
    //     {title: '订单类型', field: '', visible: true, align: 'center', valign: 'middle',width:'10%',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let orderType = typeof list[i].orderType == "undefined" ? "-" : list[i].orderType;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + orderType + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + orderType + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '收益类型', field: 'name', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let type = typeof list[i].type == "undefined" ? "-" : list[i].type;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + type + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + type + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '用户名称', field: 'withdrawalType', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let userName = typeof list[i].userName == "undefined" ? "-" : list[i].userName;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + userName + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + userName + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '用户手机号', field: 'balance', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let userPhone = typeof list[i].userPhone == "undefined" ? "-" : list[i].userPhone;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + userPhone + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + userPhone + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '乘客实际支付金额', field: 'money', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let orderPayMoney = typeof list[i].orderPayMoney == "undefined" ? "-" : list[i].orderPayMoney;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + orderPayMoney + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + orderPayMoney + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '平台抽佣金额', field: '', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let orderRevenue = typeof list[i].orderRevenue == "undefined" ? "-" : list[i].orderRevenue;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + orderRevenue + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + orderRevenue + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '购买打车卡收益', field: 'realGetMoney', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let taxiCardRevenue = typeof list[i].taxiCardRevenue == "undefined" ? "-" : list[i].taxiCardRevenue;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + taxiCardRevenue + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + taxiCardRevenue + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '超时扣款收益', field: 'userName', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let overtimeDeduction = typeof list[i].overtimeDeduction == "undefined" ? "-" : list[i].overtimeDeduction;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + overtimeDeduction + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + overtimeDeduction + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '司机投诉扣款平台收益', field: 'userPhone', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let complaintDeductionProceeds = typeof list[i].complaintDeductionProceeds == "undefined" ? "-" : list[i].complaintDeductionProceeds;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + complaintDeductionProceeds + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + complaintDeductionProceeds + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '其他收入', field: 'remark', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let other = typeof list[i].other == "undefined" ? "-" : list[i].other;
    //                 if(parseInt(i) == 0){
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + other + '</div>'
    //                 }else{
    //                     str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + other + '</div>'
    //                 }
    //             }
    //             return str;
    //         }
    //     },
    //     {title: '收入合计', field: 'state', visible: true, align: 'center', valign: 'middle',
    //         formatter: function (value, row) {
    //             let list = row.list;
    //             let str = '';
    //             for(let i in list){
    //                 let all = list[i].orderRevenue + list[i].taxiCardRevenue + list[i].overtimeDeduction + list[i].complaintDeductionProceeds + list[i].other;
    //                 all = parseFloat(all).toFixed(2);
    //                 str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + all + '</div>'
    //             }
    //             return str;
    //         }
    //     }
    // ];
 
    return [
        {field: 'selectItem', radio: true},
        {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '时间', field: 'insertTime', align: 'center', valign: 'middle'},
        {title: '订单类型', field: '', visible: true, align: 'center', valign: 'middle',width:'10%',
            formatter: function (value, row) {
                let orderType = typeof row.orderType == "undefined" ? "-" : row.orderType;
                return orderType;
            }
        },
        {title: '收益类型', field: 'name', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let type = typeof row.type == "undefined" ? "-" : row.type;
                return type;
            }
        },
        {title: '用户名称', field: 'withdrawalType', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let userName = typeof row.userName == "undefined" ? "-" : row.userName;
                return userName;
            }
        },
        {title: '用户手机号', field: 'balance', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let userPhone = typeof row.userPhone == "undefined" ? "-" : row.userPhone;
                return userPhone;
            }
        },
        {title: '乘客实际支付金额', field: 'money', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let orderPayMoney = typeof row.orderPayMoney == "undefined" ? "-" : row.orderPayMoney;
                return orderPayMoney;
            }
        },
        {title: '平台抽佣金额', field: '', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let orderRevenue = typeof row.orderRevenue == "undefined" ? "-" : row.orderRevenue;
                return orderRevenue;
            }
        },
        {
            title: '购买打车卡收益', field: 'realGetMoney', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let taxiCardRevenue = typeof row.taxiCardRevenue == "undefined" ? "-" : row.taxiCardRevenue;
                return taxiCardRevenue;
            }
        },
        // {title: '超时扣款收益', field: 'userName', visible: true, align: 'center', valign: 'middle',
        //     formatter: function (value, row) {
        //         let overtimeDeduction = typeof row.overtimeDeduction == "undefined" ? "-" : row.overtimeDeduction;
        //         return overtimeDeduction;
        //     }
        // },
        {
            title: '司机投诉扣款平台收益', field: 'userPhone', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let complaintDeductionProceeds = typeof row.complaintDeductionProceeds == "undefined" ? "-" : row.complaintDeductionProceeds;
                return complaintDeductionProceeds;
            }
        },
        {
            title: '其他收入', field: 'remark', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let other = typeof row.other == "undefined" ? "-" : row.other;
                return other;
            }
        },
        {title: '收入合计', field: 'state', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                let all = row.orderRevenue + row.taxiCardRevenue + row.overtimeDeduction + row.complaintDeductionProceeds + row.other;
                all = parseFloat(all).toFixed(2);
                return all;
            }
        }
    ];
};
 
 
 
/**
 * 检查是否选中
 */
TPubWithdrawal.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TPubWithdrawal.seItem = selected[0];
        return true;
    }
};
 
 
 
TPubWithdrawal.excel = function(){
    window.location.href = Feng.ctxPath + "/incomeDetail/exportSummaryOfIncomeDetails?insertTime=" + $("#insertTime").val() +
    "&orderType=" + $("#type").val() + "&incomeType=" + $("#income").val() + "&name=" + $("#name").val() + "&phone=" + $("#phone").val();
}
 
 
/**
 * 查询提现列表列表
 */
TPubWithdrawal.search = function () {
    var queryData = {};
    queryData['insertTime'] = $("#insertTime").val();
    queryData['orderType'] = $("#type").val();
    queryData['incomeType'] = $("#income").val();
    queryData['name'] = $("#name").val();
    queryData['phone'] = $("#phone").val();
    TPubWithdrawal.table.refresh({query: queryData});
};
 
TPubWithdrawal.resetSearch = function () {
    $("#insertTime").val("");
    $("#type").val("");
    $("#income").val("");
    $("#name").val("");
    $("#phone").val("");
    TPubWithdrawal.search();
};
 
$(function () {
    var defaultColunms = TPubWithdrawal.initColumn();
    var table = new BSTable(TPubWithdrawal.id, "/incomeDetail/summaryOfIncomeDetailsList", defaultColunms);
    table.setPaginationType("server");
    TPubWithdrawal.table = table.init();
});