44323
2024-05-17 788e0aaa0896bb59ca4379e50bf72b4bd07211a6
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
/**
 * 用户管理管理初始化
 */
var TUser = {
    id: "TUserTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 鼠标悬停提示框 class .toolTip 为无效样式,作用于个别选择器使用
 */
TUser.tooltip = function(){
    $(".toolTip").tooltip();
};
 
/**
 * 初始化表格的列
 */
TUser.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '下单时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
        {title: '订单号', field: 'code', visible: true, align: 'center', valign: 'middle'},
 
        {title: '司机姓名', field: 'driverName', visible: false, align: 'center', valign: 'middle'},
        {title: '司机手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle',
        },
        {title: '佣金金额', field: 'money', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                var money = row.money;
                var btn = "";
                btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: orange;" title="待审核" onfocus="TUser.tooltip()">'+money+'</p>']
                return btn;
            }
        },
        {title: '支付方式', field: 'payType', visible: true, align: 'center', valign: 'middle',
        },
        {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle',},
        {title: '状态', field: 'paymentStatus', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                var state = row.state;
                if (state == 1){
                    var btn = "";
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #68e02c;" title="待审核" onfocus="TUser.tooltip()">已结算</p>']
                }else{
                    var btn = "";
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #e31452;" title="待审核" onfocus="TUser.tooltip()">未结算</p>']
                }
                return btn;
 
            }
        },
        {title: '结算时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',},
    ];
};
 
/**
 * 检查是否选中
 */
TUser.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TUser.seItem = selected[0];
        return true;
    }
};
 
/**
 * 修改余额
 */
TUser.updateBalance = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '修改余额',
            area: ['800px', '420px'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tUser/tUser_updateBalance/'+ TUser.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 修改密码
 */
TUser.updatePassword = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '修改密码',
            area: ['800px', '420px'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tUser/tUser_updatePassword/'+ TUser.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 查看分享信息
 */
TUser.inviteInfo=function(){
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '邀请信息',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tUser/inviteInfo/'+ TUser.seItem.id
        });
        this.layerIndex = index;
 
    }
};
 
/**
 * 打开查看用户管理详情
 */
TUser.userDetail = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '用户详情',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tUser/tUser_userDetail/' + TUser.seItem.id
        });
        this.layerIndex = index;
    }
};
 
/**
 * 冻结用户
 */
TUser.freezeUser = function () {
    if (this.check()) {
        var nickname = TUser.seItem.nickName;
        if (nickname == "" || nickname == null || nickname == undefined) {
            nickname = "该用户";
        } else {
            nickname = "【" + nickname + "】";
        }
        if (TUser.seItem.state != 1) {
            swal("冻结失败", "【正常】状态下才能执行此操作", "warning");
            return;
        } else {
            var index = layer.open({
                type: 2,
                title: '冻结用户',
                area: ['800px', '420px'], //宽高
                fix: false, //不固定
                maxmin: true,
                content: Feng.ctxPath + '/tUser/tUser_optUser/' + TUser.seItem.id +"/"+1
            });
            this.layerIndex = index;
        }
    }
};
/**
 * 解冻用户
 */
TUser.trawUser = function () {
    if (this.check()) {
        var nickname = TUser.seItem.nickName;
        if (nickname == "" || nickname == null || nickname == undefined) {
            nickname = "该用户";
        } else {
            nickname = "【" + nickname + "】";
        }
        if (TUser.seItem.state != 2) {
            swal("启用失败", "【冻结】状态下才能执行此操作", "warning");
            return;
        } else {
            var index = layer.open({
                type: 2,
                title: '解冻用户',
                area: ['800px', '420px'], //宽高
                fix: false, //不固定
                maxmin: true,
                content: Feng.ctxPath + '/tUser/tUser_optUser/' + TUser.seItem.id +"/"+2
            });
            this.layerIndex = index;
        }
    }
};
// 首次
TUser.getCount1 = function() {
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/platform/commission/getCount", function(data){
 
        document.getElementById("num1").innerHTML = data.total;
        document.getElementById("num2").innerHTML = data.balance;
        document.getElementById("num3").innerHTML = data.unBalance;
    },function(data){
        Feng.error("修改失败!" + data.responseJSON.message + "!");
    });
    ajax.set("time",1);
    ajax.set("insertTime",null);
    ajax.set("state",null);
    ajax.start();
}
// 点击搜索
TUser.getCount = function() {
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/platform/commission/getCount", function(data){
        console.log(data);
        console.log(data);
        console.log(data);
        document.getElementById("num1").innerHTML = data.total;
        document.getElementById("num2").innerHTML = data.balance;
        document.getElementById("num3").innerHTML = data.unBalance;
    },function(data){
        Feng.error("修改失败!" + data.responseJSON.message + "!");
    });
    ajax.set("time",$("#time").val());
    ajax.set("insertTime",$("#insertTime").val());
    ajax.set("state",$("#state").val());
    ajax.start();
}
/**
 * 查询用户管理列表
 */
TUser.search = function () {
    var queryData = {};
    queryData['time'] = $("#time").val();
    queryData['insertTime'] = $("#insertTime").val();
    queryData['state'] = $("#state").val();
    TUser.table.refresh({query: queryData});
    TUser.getCount();
};
TUser.resetSearch = function () {
    $("#time").val("");
    $("#insertTime").val("");
    $("#state").val("");
    TUser.search();
};
 
$(function () {
    TUser.getCount1();
    var defaultColunms = TUser.initColumn();
    var table = new BSTable(TUser.id, "/platform/commission/list", defaultColunms);
    // 设置物理分页server(逻辑分页client)
    table.setPaginationType("client");
    TUser.table = table.init();
});
 
TUser.sendAjaxRequest = function(url,type,data){
    $.ajax({
        url : url,
        type : type,
        data : data,
        success : function(result) {
            if(result.code==500) {
                Feng.info(result.message);
            }else {
                Feng.success("导入成功!");
            }
            TUser.table.refresh();
        },
        error : function() {
            Feng.error("excel上传失败!");
        },
        cache : false,
        contentType : false,
        processData : false
    });
};
 
var agreement;
$(function(){
    agreement = new agreement();
    agreement.init();
});