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