zhibing.pu
2024-07-25 01d8de48c76467ff3b99b204e66d3ef86506fa52
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
/**
 * 司机单单返活动管理初始化
 */
var SettlementAllocation = {
    id: "SettlementAllocationTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
SettlementAllocation.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '结算日期', field: 'day', visible: true, align: 'center', valign: 'middle'},
        {title: '结算金额', field: 'payMoney', visible: true, align: 'center', valign: 'middle'},
        {title: '结算方式', field: 'payType', visible: true, align: 'center', valign: 'middle',
            formatter:function (value, row) {
                if(1 == value){
                    return "手机支付";
                }
                if(2 == value){
                    return "银行卡支付";
                }
                if(3 == value){
                    return "余额支付";
                }
            }
        },
        {title: '结算状态', field: 'paymentStatus', visible: true, align: 'center', valign: 'middle',
            formatter:function (value, row) {
                if(1 == value){
                    return "未支付";
                }
                if(2 == value){
                    return "支付成功";
                }
            }
        },
        {title: '结算人', field: 'driverName', visible: true, align: 'center', valign: 'middle'}
    ];
};
 
/**
 * 检查是否选中
 */
SettlementAllocation.check = function (type) {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }
};
 
 
 
/**
 * 删除司机单单返活动
 */
SettlementAllocation.setSettlementAllocation = function () {
    let type = $('input[name="type"]:checked')[0];
    if(typeof type == "undefined"){
        Feng.error("请选择结算周期");
        return
    }
    let day = $($(type).siblings('.date')[0]).val();
    if('' == day || null == day){
        Feng.error("请输入有效的结算日期")
        return
    }
    let maxPrice = $('#maxPrice').val();
    // if('' == maxPrice || null == maxPrice){
    //     Feng.error("请输入每日结算金额")
    //     return
    // }
    let json = {
        type: $(type).val(),
        day: day,
        maxPrice: maxPrice
    }
 
    var ajax = new $ax(Feng.ctxPath + "/settlementAllocation/setSettlementAllocation", function (data) {
        if(data.code == 200){
            Feng.success("配置成功!");
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("配置失败!" + data.responseJSON.message + "!");
    });
    ajax.set("json", JSON.stringify(json));
    ajax.start();
};
 
/**
 * 查询司机单单返活动列表
 */
SettlementAllocation.search = function () {
    var queryData = {};
    queryData['time'] = $('#time').val();
    queryData['money'] = $('#money').val();
    queryData['status'] = $('#payStatus').val();
    queryData['driverName'] = $("#userName").val();
    SettlementAllocation.table.refresh({query: queryData});
};
 
SettlementAllocation.resetSearch = function () {
    $("#time").val("");
    $("#money").val("");
    $("#payStatus").val("");
    $("#userName").val("");
    SettlementAllocation.search();
};
 
 
 
$(function () {
    var defaultColunms = SettlementAllocation.initColumn();
    var table = new BSTable(SettlementAllocation.id, "/settlementAllocation/querySettlementRecordList", defaultColunms);
    table.setPaginationType("server");
    SettlementAllocation.table = table.init();
});