puzhibing
2023-11-28 7b726d5ff439e7b8bb66369ecc5881e370286bc8
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
/**
 * 角色管理的单例
 */
var VipChannelStatisticsInfo = {
    id: "VipChannelTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
VipChannelStatisticsInfo.initColumn = function () {
    var columns = [
        {field: 'select_item', radio: true},
        {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '用户手机号', field: 'phone', align: 'center', valign: 'middle', width: '200px'},
        {title: '用户类型', field: 'userType', align: 'center', valign: 'middle', width: '100px',
            formatter: function (value, row) {
                if(value == 1){
                    return "老用户";
                }
                if(value == 2){
                    return "初次登录老用户";
                }
                if(value == 3){
                    return "注册用户";
                }
            }
        },
        {title: '注册来源', field: 'vipChannelType', align: 'center', valign: 'middle', width: '200px',
            formatter: function (value, row) {
                if(value == 1){
                    return "主渠道码";
                }
                if(value == 2){
                    return "子渠道码";
                }
            }
        },
        {title: '渠道名称', field: 'name', align: 'center', valign: 'middle', width: '100px'},
        {title: '站内站外', field: 'membershipSource', align: 'center', valign: 'middle', width: '100px',
            formatter: function (value, row) {
                if(value == 0){
                    return "站内";
                }
                if(value == 1){
                    return "站外";
                }
            }
        },
        {title: '子渠道码名称', field: 'subName', align: 'center', valign: 'middle', width: '100px'}
    ]
    return columns;
};
 
 
/**
 * 检查是否选中
 */
VipChannelStatisticsInfo.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录!");
        return false;
    } else {
        VipChannelStatisticsInfo.seItem = selected[0];
        return true;
    }
};
 
 
 
 
 
 
 
VipChannelStatisticsInfo.exportVipChannelStatisticsInfoList = function(){
    window.location.href = Feng.ctxPath + "/vipChannel/exportVipChannelStatisticsInfoList?userType=" + $('#userType').val() + "&vipChannelType=" + $('#vipChannelType').val()
        + "&name=" + $('#name').val() + "&subName=" + $('#subName').val() + "&membershipSource=" + $('#membershipSource').val();
}
 
 
/**
 * 搜索
 */
VipChannelStatisticsInfo.search = function () {
    var queryData = {};
    queryData['id'] = $("#id").val();
    queryData['userType'] = $("#userType").val();
    queryData['vipChannelType'] = $('#vipChannelType').val();
    queryData['name'] = $('#name').val();
    queryData['subName'] = $('#subName').val();
    queryData['membershipSource'] = $('#membershipSource').val();
    VipChannelStatisticsInfo.table.setQueryParams({});
    VipChannelStatisticsInfo.table.refresh({query: queryData});
}
 
VipChannelStatisticsInfo.resetSearch = function () {
    $("#userType").val('');
    $('#vipChannelType').val('');
    $('#name').val('');
    $('#subName').val('');
    $('#membershipSource').val('');
    VipChannelStatisticsInfo.search();
}
 
 
$(function () {
    var defaultColunms = VipChannelStatisticsInfo.initColumn();
    var table = new BSTable(VipChannelStatisticsInfo.id, "/vipChannel/queryVipChannelStatisticsInfo", defaultColunms);
    table.setPaginationType("server");
    table.setQueryParams({
        id: $('#id').val()
    })
    VipChannelStatisticsInfo.table = table.init();
});