yanghb
2023-04-14 cd8e73d4dad311de76fc9a7db3b74e8c88afe78e
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
/**
 * 提现列表管理初始化
 */
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;
                    switch (orderType) {
                        case 1:
                            orderType = '快车';
                            break
                        case 2:
                            orderType = '出租车';
                            break
                        case 3:
                            orderType = '跨城出行';
                            break
                        case 4:
                            orderType = '同城小件物流';
                            break
                        case 5:
                            orderType = '跨城小件物流';
                            break
                        case 6:
                            orderType = '包车';
                            break
                        case 7:
                            orderType = '95128';
                            break
                    }
                    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].name == "undefined" ? "-" : list[i].name;
                    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].phone == "undefined" ? "-" : list[i].phone;
                    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: '', 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 activityAward = typeof list[i].activityAward == "undefined" ? "-" : list[i].activityAward;
                    if(parseInt(i) == 0){
                        str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + activityAward + '</div>'
                    }else{
                        str += '<div style="width: 100%;height: 35px;line-height: 35px;border-top: 1px solid #ddd">' + activityAward + '</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 = typeof list[i].all == "undefined" ? "-" : list[i].all;
                    all = parseFloat(all).toFixed(2);
                    if(parseInt(i) == 0){
                        str += '<div style="width: 100%;height: 35px;line-height: 35px;">' + all + '</div>'
                    }else{
                        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/exportSummaryOfSpendingDetails?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/summaryOfSpendingDetailsList", defaultColunms);
    table.setPaginationType("server");
    TPubWithdrawal.table = table.init();
});