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