/**
|
* 角色管理的单例
|
*/
|
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: '序号', field: '', align: 'center', valign: 'middle', width: '100px',
|
formatter: function (value, row, index) {
|
return index + 1;
|
}
|
},
|
{title: '下单时间', field: 'createTime', align: 'center', valign: 'middle', width: '150px'},
|
{title: '类型', field: 'seckillState', align: 'center', valign: 'middle', width: '100px',
|
formatter: function (value, row) {
|
return value == 1 ? "秒杀" : "普通";
|
}
|
},
|
{title: '微信昵称', field: 'nickname', align: 'center', valign: 'middle', width: '150px'},
|
{title: '会员手机号', field: 'phone', align: 'center', valign: 'middle', width: '150px'},
|
{title: '券包ID', field: 'code', align: 'center', valign: 'middle', width: '100px'},
|
{title: '购买券包名称', field: 'name', align: 'center', valign: 'middle', width: '150px',
|
formatter: function (value, row) {
|
return '<span title="' + value + '">' + value + '</span>'
|
}
|
},
|
{title: '支付金额', field: 'price', align: 'center', valign: 'middle', width: '100px'},
|
{title: '支付时间', field: 'payTime', align: 'center', valign: 'middle', width: '150px'}
|
]
|
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 name = $("#name").val();
|
const nickname = $("#nickname").val();
|
const phone = $("#phone").val();
|
let url = Feng.ctxPath + "/statistics/exportCouponPayStatistics?";
|
if(null != code && '' != code){
|
url += "code=" + code + "&";
|
}
|
if(null != time && '' != time){
|
url += "time=" + time + "&";
|
}
|
if(null != name && '' != name){
|
url += "name=" + name + "&";
|
}
|
if(null != nickname && '' != nickname){
|
url += "nickname=" + nickname + "&";
|
}
|
if(null != phone && '' != phone){
|
url += "phone=" + phone + "&";
|
}
|
window.location.href = url;
|
}
|
|
|
/**
|
* 搜索
|
*/
|
Statistics.search = function () {
|
var queryData = {};
|
queryData['code'] = $("#code").val();
|
queryData['time'] = $("#time").val();
|
queryData['name'] = $("#name").val();
|
queryData['nickname'] = $("#nickname").val();
|
queryData['phone'] = $("#phone").val();
|
Statistics.table.setQueryParams({});
|
Statistics.table.refresh({query: queryData});
|
}
|
|
/**
|
* 重置
|
*/
|
Statistics.resetSearch = function(){
|
var queryData = {};
|
$("#code").val('');
|
$("#time").val('');
|
$("#name").val('');
|
$("#nickname").val('');
|
$("#phone").val('');
|
Statistics.table.setQueryParams({});
|
Statistics.table.refresh({query: queryData});
|
}
|
|
|
$(function () {
|
var defaultColunms = Statistics.initColumn();
|
var table = new BSTable(Statistics.id, "/statistics/queryCouponPayStatistics", defaultColunms);
|
table.setPaginationType("server");
|
Statistics.table = table.init();
|
|
});
|