lisy
2023-08-02 d69f9a06fb73f9d5efea882a684d217f12e34a4f
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
/**
 * 管理初始化
 */
var TStoreProvince = {
    id: "TStoreProvinceTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 初始化表格的列
 */
TStoreProvince.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'},
        {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '所属账号', field: 'name', visible: true, align: 'center', valign: 'middle'},
        {title: '所在省市', field: 'useScope', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                return {1: "全国", 2: "指定城市", 3: "指定门店"}[value]
            }
        },
        {title: '门店名称', field: 'type', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                return {1: "满减券", 2: "代金券", 3: "体验券"}[value]
            }},
    ];
};
 
/**
 * 检查是否选中
 */
TStoreProvince.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TStoreProvince.seItem = selected[0];
        return true;
    }
};
 
 
function storeOfClosePage(){
 
}
 
function saveSelectStores(){
 
}
 
 
 
/**
 * 查询列表
 */
TStoreProvince.search = function () {
    var queryData = {};
    queryData['name'] = $("#name").val();
    queryData['type'] = $("#type").val();
    queryData['distributionMethod'] = $("#distributionMethod").val();
    queryData['userPopulation'] = $("#userPopulation").val();
    queryData['status'] = $("#status").val();
    queryData['state'] = $("#state").val();
    TStoreProvince.table.refresh({query: queryData});
};
 
 
/**
 * 重置搜索
 */
TStoreProvince.resetSearch = function () {
    $("#name").val('');
    $("#type").val('');
    $("#distributionMethod").val('');
    $("#userPopulation").val('');
    $("#status").val('');
    $("#state").val('');
    TStoreProvince.search();
};
 
$(function () {
    var defaultColunms = TStoreProvince.initColumn();
    var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeList", defaultColunms);
    table.setPaginationType("client");
    TStoreProvince.table = table.init();
 
 
});