yanghb
2023-04-10 b2f678ad387ca24e05a11100ea4583f0f2f730f0
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
/**
 * 提现列表管理初始化
 */
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;
            }
        }
    ];
};
 
 
 
/**
 * 检查是否选中
 */
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();
}
 
 
/**
 * 查询提现列表列表
 */
TPubWithdrawal.search = function () {
    var queryData = {};
    queryData['insertTime'] = $("#insertTime").val();
    TPubWithdrawal.table.refresh({query: queryData});
};
 
TPubWithdrawal.resetSearch = function () {
    $("#insertTime").val("");
    TPubWithdrawal.search();
};
 
$(function () {
    var defaultColunms = TPubWithdrawal.initColumn();
    var table = new BSTable(TPubWithdrawal.id, "/incomeDetail/summaryOfIncomeDetailsList", defaultColunms);
    table.setPaginationType("server");
    TPubWithdrawal.table = table.init();
});