/**
|
* 角色管理的单例
|
*/
|
var Statistics = {
|
id: "StatisticsTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
Statistics.initColumn = function () {
|
var columns = [
|
{field: 'select_item', radio: true},
|
{title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '券包ID', field: 'code', align: 'center', valign: 'middle'},
|
{title: '类型', field: 'seckillState', align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
return value == 1 ? "秒杀" : "普通";
|
}
|
},
|
{title: '券包名称', field: 'name', align: 'center', valign: 'middle', width: '150px'},
|
{title: '券包浏览pv', field: 'browse_pv', align: 'center', valign: 'middle', width: '300px'},
|
{title: '券包浏览uv', field: 'browse_uv', align: 'center', valign: 'middle', width: '150px'},
|
{title: '立即抢购点击pv', field: 'click_pv', align: 'center', valign: 'middle'},
|
{title: '立即抢购点击uv', field: 'click_uv', align: 'center', valign: 'middle'},
|
{title: '购买量', field: 'pay_uv', align: 'center', valign: 'middle'}
|
]
|
return columns;
|
};
|
|
|
/**
|
* 检查是否选中
|
*/
|
Statistics.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if (selected.length == 0) {
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
} else {
|
Statistics.seItem = selected[0];
|
return true;
|
}
|
};
|
|
|
Statistics.exportStatistics = function(){
|
const code = $("#code").val();
|
const time = $("#time").val();
|
const seckillState = $("#seckillState").val();
|
let url = Feng.ctxPath + "/statistics/exportCouponStatistics?";
|
if(null != code && '' != code){
|
url += "code=" + code + "&";
|
}
|
if(null != time && '' != time){
|
url += "time=" + time + "&";
|
}
|
if(null != seckillState){
|
url += "seckillState=" + seckillState + "&";
|
}
|
window.location.href = url;
|
}
|
|
|
/**
|
* 搜索
|
*/
|
Statistics.search = function () {
|
var queryData = {};
|
queryData['code'] = $("#code").val();
|
queryData['time'] = $("#time").val();
|
queryData['seckillState'] = $("#seckillState").val();
|
Statistics.table.setQueryParams({});
|
Statistics.table.refresh({query: queryData});
|
}
|
|
/**
|
* 重置
|
*/
|
Statistics.resetSearch = function(){
|
var queryData = {};
|
$("#code").val('');
|
$("#time").val('');
|
$("#seckillState").val('');
|
Statistics.table.setQueryParams({});
|
Statistics.table.refresh({query: queryData});
|
}
|
|
|
$(function () {
|
var defaultColunms = Statistics.initColumn();
|
var table = new BSTable(Statistics.id, "/statistics/queryCouponStatistics", defaultColunms);
|
table.setPaginationType("server");
|
Statistics.table = table.init();
|
|
});
|