Pu Zhibing
2025-04-28 361114b8d93fdfed72881e5446abde578df26ee2
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
/**
 * 管理初始化
 */
var OfflineOrderStatistics = {
    id: "OfflineOrderStatisticsTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
OfflineOrderStatistics.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '订单号', field: 'orderNum', visible: true, align: 'center', valign: 'middle'},
        {title: '用户手机号', field: 'userPhone', visible: true, align: 'center', valign: 'middle'},
        {title: '打车方式', field: 'orderSource', visible: true, align: 'center', valign: 'middle'},
        {title: '接单司机手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle'},
        {title: '司机所属机构', field: 'company', visible: true, align: 'center', valign: 'middle'},
        {title: '扣除司机抽成', field: 'income', visible: true, align: 'center', valign: 'middle'},
        {title: '下单时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                return '<a onclick="OfflineOrderStatistics.openOfflineOrderStatisticsDetail(' + value + ')" style="color: blue;">订单详情</a>';
            }
        }
    ];
};
 
/**
 * 检查是否选中
 */
OfflineOrderStatistics.check = function (type) {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        //验证类型null删除,1=审核,2=编辑,3=启动/暂停
        if(type==null){
            OfflineOrderStatistics.seItem = selected[0];
            return true;
        }else if(type==3 && selected[0].status!=3 && selected[0].status!=4){
            Feng.info("当前状态不能暂停/启动!");
            return false;
        }else if(type==3 && selected[0].status==3 && (selected[0].startTime>new Date() || new Date()>selected[0].endTime)){
            Feng.info("当前状态不能暂停/启动!");
            return false;
        }else if(type==1 && selected[0].status!=1){
            Feng.info("当前状态不能审核!");
            return false;
        }else if(type==2 && selected[0].status!=2){
            Feng.info("当前状态不能编辑!");
            return false;
        }
        OfflineOrderStatistics.seItem = selected[0];
        return true;
    }
};
/**
 * 打开查看详情
 */
OfflineOrderStatistics.openOfflineOrderStatisticsDetail = function (id) {
    var index = layer.open({
        type: 2,
        title: '出租车订单详情',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tOrderTaxi/tOrderTaxi_update/' + id
    });
    this.layerIndex = index;
};
 
 
OfflineOrderStatistics.export = function (){
    let orderCode = $("#orderCode").val();
    let userPhone = $("#userPhone").val();
    let driverPhone = $("#driverPhone").val();
    let createTime = $("#createTime").val();
    let orderSource = $("#orderSource").val();
    window.location.href = Feng.ctxPath + '/financialStatement/offlineOrderStatisticsList_export?orderCode=' + orderCode +
            "&userPhone=" + userPhone + "&driverPhone=" + driverPhone + "&createTime=" + createTime + "&orderSource=" + orderSource
}
 
 
 
/**
 * 查询列表
 */
OfflineOrderStatistics.search = function () {
    var queryData = {};
    queryData['orderCode'] = $("#orderCode").val();
    queryData['userPhone'] = $("#userPhone").val();
    queryData['driverPhone'] = $("#driverPhone").val();
    queryData['createTime'] = $("#createTime").val();
    queryData['orderSource'] = $("#orderSource").val();
    OfflineOrderStatistics.table.refresh({query: queryData});
};
 
 
OfflineOrderStatistics.resetSearch = function () {
    $("#orderCode").val("");
    $("#userPhone").val("");
    $("#driverPhone").val("");
    $("#createTime").val("");
    $("#orderSource").val("");
    OfflineOrderStatistics.search();
};
 
 
$(function () {
    var defaultColunms = OfflineOrderStatistics.initColumn();
    var table = new BSTable(OfflineOrderStatistics.id, "/financialStatement/offlineOrderStatisticsList", defaultColunms);
    table.setPaginationType("server");
    OfflineOrderStatistics.table = table.init();
});