无关风月
2025-04-11 1d9f7b0cf4251f3058badb07dd7a2bc06b6bc09a
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 Store = {
    id: "StoreTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
/**
 * 初始化表格的列
 */
Store.initColumn = function () {
    return [
        {field: 'selectItem', checkbox: true},
        {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '所在省市', field: 'province', visible: true, align: 'center', valign: 'middle',width:'20%',},
        {title: '所属运营商', field: 'operator', visible: true, align: 'center', valign: 'middle',},
        {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'},
        {title: '闸机ID', field: 'gate', visible: true, align: 'center', valign: 'middle'},
    ];
};
 
/**
 * 检查是否选中
 */
Store.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        Store.seItem = selected[0];
        return true;
    }
};
 
 
 
 
Store.region = function (node, e){
    let pcode = null;
    if(null != e){
        pcode = $(e).val();
    }
    var ajax = new $ax(Feng.ctxPath + "/region/getRegion", function (res) {
        let html = '<option value="">请选择</option>';
        for (let i = 0; i < res.length; i++) {
            html += '<option value="' + res[i].code + '">' + res[i].name + '</option>';
        }
        $('#' + node).html(html)
    }, function (data) {
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.setData({
        'pcode': pcode
    });
    ajax.start();
}
 
 
 
 
/**
 * 关闭此对话框
 */
Store.close = function() {
    parent.layer.close(window.parent.WorldCupInfo.layerIndex);
};
 
Store.addSubmit = function (){
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        window.parent.WorldCupInfo.stores = selected;
        window.parent.WorldCupInfo.initStore();
        Store.close();
    }
}
 
 
 
Store.search = function () {
    var queryData = {};
    queryData['userName']  = $("#name").val();
    queryData['operator'] =$("#operator").val();
    queryData['provinceCode'] =$("#provinceCode").val();
    queryData['cityCode'] =$("#cityCode").val();
    Store.table.refresh({query: queryData});
};
 
Store.resetSearch = function () {
    $("#name").val("");
    $("#operator").val("");
    $("#provinceCode").val("");
    $("#cityCode").val("");
    Store.search();
};
 
$(function () {
    var defaultColunms = Store.initColumn();
    var table = new BSTable(Store.id, "/store/listAll", defaultColunms);
    table.setPaginationType("server");
    Store.table = table.init();
 
    Store.region('provinceCode', null);
 
    var ajax = new $ax(Feng.ctxPath + "/operator/getOperatorListAll", function (res) {
        let html = '<option value="">请选择</option>';
        for (let i = 0; i < res.length; i++) {
            html += '<option value="' + res[i].id + '">' + res[i].name + '</option>';
        }
        $('#operator').html(html)
    }, function (data) {
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.start();
});