puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
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
/**
 * 管理初始化
 */
var TStoreProvince = {
    id: "TStoreProvinceTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1,
    storeList: []
};
 
/**
 * 初始化表格的列
 */
TStoreProvince.initColumn = function () {
    return [
        {field: 'selectItem', checkbox: true},
        {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'},
        {title: '所属账号', field: 'accountName', visible: true, align: 'center', valign: 'middle'},
        {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'},
        {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'},
    ];
};
 
/**
 * 检查是否选中
 */
TStoreProvince.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TStoreProvince.seItem = selected[0];
        return true;
    }
};
 
 
TStoreProvince.storeOfClosePage = function (){
    parent.layer.close(parent.layer.getFrameIndex(window.frameElement.id));
}
 
TStoreProvince.saveSelectStores = function (){
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }
    var arr = [];
    console.log('selected--->',selected)
    for(var i in selected){
        if(typeof selected[i].id != "undefined"){
            arr.push({
                id: selected[i].id,
                provinceCity: typeof selected[i].provinceCity != "undefined" ? selected[i].provinceCity : "",
                accountName: typeof selected[i].accountName != "undefined" ? selected[i].accountName : "",
                name: typeof selected[i].name != "undefined" ? selected[i].name : ""
            })
        }
    }
    window.parent.couponInfoDlg.selecUserOpt(arr);
    TStoreProvince.storeOfClosePage();
 
}
/**
 * 查询列表
 */
TStoreProvince.search = function () {
    var queryData = {};
    queryData['provinceId'] = $("#pCode").val();
    queryData['cityId'] = $("#cCode").val();
    queryData['operatorId'] = $("#account").val();
    queryData['storeName'] = $("#storeName").val();
    TStoreProvince.table.refresh({query: queryData});
};
 
/**
 * 重置搜索
 */
TStoreProvince.resetSearch = function () {
    var provinceSelect = document.getElementById("province");
    provinceSelect.innerHTML = '<option value="">全部</option>';
 
    var citySelect = document.getElementById("city");
    citySelect.innerHTML = '<option value="">全部</option>';
 
    queryProvince();
 
    $("#userPopulation").val('');
    $("#storeName").val('');
    TStoreProvince.search();
};
 
$(function () {
    // 初始化图片上传
    var carPhoto = new $WebUpload("cover");
    carPhoto.setUploadBarId("progressBar");
    carPhoto.init();
    var defaultColunms = TStoreProvince.initColumn();
    var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeDetailsOfSearch", defaultColunms);
    table.setPaginationType("client");
    TStoreProvince.table = table.init();
 
    queryProvince();
});