xuhy
2025-01-09 712f70b2936079a131ecb1e63c6d337171618cad
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
/**
 * 提现列表管理初始化
 */
var ComplaintDeductmoney = {
    id: "ComplaintDeductmoneyTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
ComplaintDeductmoney.initColumn = function () {
    return [
        {field: 'selectItem',visible: true, radio: true},
        {title: '扣款时间', field: 'createTime', visible: true, align: 'center', valign: 'middle',width:'10%',
            formatter: function (value, row) {
                var btn = "";
                if(row.createTime != '' && row.createTime != null) {
                    var time = row.createTime.replace(" ",'<br>');
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.createTime + '" onfocus="TUser.tooltip()">' + time + '</p>']
                }
                return btn;
            }
        },
        {title: '流水id', field: 'id', visible: true, align: 'center', valign: 'middle'},
        {title: '司机名称', field: 'userName', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                var btn = "";
                if(row.name != '' && row.name != null) {
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.name + '" onfocus="TUser.tooltip()">' + row.name + '</p>']
                }
                return btn;
            }
        },
 
 
        {title: '司机电话', field: 'phone', visible: true, align: 'center', valign: 'middle'},
        {title: '投诉id', field: 'complaintIds', visible: true, align: 'center', valign: 'middle'},
        {title: '扣款金额', field: 'money', visible: true, align: 'center', valign: 'middle',
            formatter: function (value,row) {
                return row.money;
            }
        }
    ];
};
 
/**
 * 检查是否选中
 */
ComplaintDeductmoney.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        ComplaintDeductmoney.seItem = selected[0];
        return true;
    }
};
ComplaintDeductmoney.delete = function(){
    if (this.check()) {
        swal({
            title: "您是否确认删除?",
            text: "请谨慎操作,删除后数据无法恢复!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            closeOnConfirm: false
        }, function () {
            var ajax = new $ax(Feng.ctxPath + "/incomeDetail/deleteComplaintDeductmoney", function (data) {
                swal("删除成功", "您已经删除了。", "success");
                YesDriver.table.refresh();
            }, function (data) {
                swal("删除失败", data.responseJSON.message + "!", "warning");
            });
            ajax.set("id", ComplaintDeductmoney.seItem.id);
            ajax.start();
        });
    }
}
/**
 * 查询提现列表列表
 */
ComplaintDeductmoney.search = function () {
    var queryData = {};
    queryData['insertTime'] = $("#insertTime").val();
    queryData['id'] = $("#id").val();
    queryData['userName'] = $("#userName").val();
    queryData['userPhone'] = $("#userPhone").val();
    ComplaintDeductmoney.table.refresh({query: queryData});
};
 
ComplaintDeductmoney.resetSearch = function () {
    $("#insertTime").val("");
    $("#userName").val("");
    $("#userPhone").val("");
    $("#id").val("");
    ComplaintDeductmoney.search();
};
///  导出
ComplaintDeductmoney.excel = function(){
    var arr = $("#insertTime").val();
    window.location.href = Feng.ctxPath + "/incomeDetail/exportComplaintDeductmoney?id=" + $("#id").val() + "&insertTime=" + arr
        + "&userName=" + $("#userName").val()
        + "&userPhone=" + $("#userPhone").val();
};
$(function () {
    var defaultColunms = ComplaintDeductmoney.initColumn();
    var table = new BSTable(ComplaintDeductmoney.id, "/incomeDetail/complaintDeductmoneyList", defaultColunms);
    table.setPaginationType("server");
    ComplaintDeductmoney.table = table.init();
});