liujie
10 天以前 4c8c5c3051944e26f2d6f9352879a4a5891e8f1d
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
/**
 * 车辆管理管理初始化
 */
var AuditSellingCar = {
    id: "AuditSellingCarTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
AuditSellingCar.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle',width:'150px'},
        {title: '发布来源', field: 'userType', visible: true, align: 'center', valign: 'middle',width:'100px',
            formatter: function (value, row) {
                switch (value) {
                    case 1:
                        return '个人用户';
                    case 2:
                        return '司机用户';
                    case 3:
                        return '企业用户';
                }
            }
        },
        {title: '发布者名称', field: 'pushUser', visible: true, align: 'center', valign: 'middle',width:'150px'},
        {title: '电话', field: 'pushUserPhone', visible: true, align: 'center', valign: 'middle',width:'150px'},
        {title: '标题', field: 'title', visible: true, align: 'center', valign: 'middle',width:'200px',
            formatter: function (value, row) {
                value = (typeof value == "undefined" ? '-':value);
                return '<span title="' + value + '">' + value + '</span>';
            }
        },
        {title: '车牌号', field: 'carLicensePlate', visible: true, align: 'center', valign: 'middle',width:'200px'},
        {title: '品牌', field: 'brandName', visible: true, align: 'center', valign: 'middle',width:'100px'},
        {title: '车辆颜色', field: 'carColor', visible: true, align: 'center', valign: 'middle',width:'100px'},
        {title: '联系人', field: 'contactsName', visible: true, align: 'center', valign: 'middle',width:'200px'},
        {title: '联系人电话', field: 'contactsPhone', visible: true, align: 'center', valign: 'middle',width:'150px'},
        {title: '取车地址', field: 'address', visible: true, align: 'center', valign: 'middle',width:'300px'},
        {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle',width:'100px',
            formatter: function (value, row) {
                switch (value) {
                    case 1:
                        return '待审核';
                    case 2:
                        return '上架中';
                    case 3:
                        return '已下架';
                    case 4:
                        return '待上架';
                    case 5:
                        return '已拒绝';
                }
            }
        }
    ];
};
 
/**
 * 检查是否选中
 */
AuditSellingCar.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        AuditSellingCar.seItem = selected[0];
        return true;
    }
};
 
/**
 * 点击添加车辆管理
 */
AuditSellingCar.openAuditSellingCar = function () {
    if (this.check()) {
        if(AuditSellingCar.seItem.status != 1){
            Feng.error("不允许重复审核");
            return
        }
        var index = layer.open({
            type: 2,
            title: '售卖车辆审核',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/sellingCar/showAuditSellingCar_info?id=' + AuditSellingCar.seItem.id
        });
        this.layerIndex = index;
    }
};
 
AuditSellingCar.showAuditSellingCarInfo = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '售卖车辆详情',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/sellingCar/showSellingCarInfo?id=' + AuditSellingCar.seItem.id
        });
        this.layerIndex = index;
    }
};
 
 
 
/**
 * 查询车辆管理列表
 */
AuditSellingCar.search = function () {
    var queryData = {};
    queryData['createTime'] = $("#createTime").val();
    queryData['carLicensePlate'] = $("#carLicensePlate").val();
    queryData['brandId'] = $("#brandId").val();
    queryData['insertUser'] = $("#insertUser").val();
    queryData['status'] = $("#status").val();
    queryData['userType'] = $("#userType").val();
    AuditSellingCar.table.setQueryParams(queryData);
    AuditSellingCar.table.refresh({query: queryData});
};
 
AuditSellingCar.resetSearch = function () {
    $("#createTime").val("");
    $("#carLicensePlate").val("");
    $("#brandId").val("");
    $("#insertUser").val("");
    $("#status").val("");
    $("#userType").val("");
    AuditSellingCar.search();
};
 
$(function () {
    var defaultColunms = AuditSellingCar.initColumn();
    var table = new BSTable(AuditSellingCar.id, "/sellingCar/listAuditSellingCar", defaultColunms);
    table.setPaginationType("server");
    AuditSellingCar.table = table.init();
});