/**
|
* 管理初始化
|
*/
|
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();
|
|
|
});
|