/**
|
* 通知管理初始化
|
*/
|
var PaymentRecord = {
|
id: "PaymentRecordTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
PaymentRecord.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '充值时间', field: 'insertTime', align: 'center', valign: 'middle'},
|
{title: '流水ID', field: 'code', align: 'center', valign: 'middle'},
|
{title: '用户ID', field: 'userId', align: 'center', valign: 'middle'},
|
{title: '用户名称', field: 'userName', align: 'center', valign: 'middle'},
|
{title: '用户手机号', field: 'phone', align: 'center', valign: 'middle'},
|
{title: '充值金额', field: 'amount', align: 'center', valign: 'middle'},
|
{title: '充值方式', field: 'payType', align: 'center', valign: 'middle',
|
formatter: function (value,row) {
|
switch (value) {
|
case 1:
|
return "微信";
|
case 2:
|
return "支付宝";
|
}
|
}
|
},
|
{title: '状态', field: 'state', align: 'center', valign: 'middle',
|
formatter: function (value,row) {
|
switch (value) {
|
case 1:
|
return "失败";
|
case 2:
|
return "成功";
|
}
|
}
|
}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
PaymentRecord.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if (selected.length == 0) {
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
} else {
|
PaymentRecord.seItem = selected[0];
|
return true;
|
}
|
};
|
|
|
/**
|
* 删除
|
*/
|
PaymentRecord.delete = function(){
|
if (this.check()){
|
var operation = function(){
|
var ajax = new $ax(Feng.ctxPath + "/paymentRecord/delete", function (data) {
|
Feng.success("删除成功!");
|
PaymentRecord.table.refresh();
|
}, function (data) {
|
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("paymentRecordId", PaymentRecord.seItem.id);
|
ajax.start();
|
};
|
Feng.confirm("是否删除充值记录?", operation);
|
}
|
};
|
|
|
/// 导出
|
PaymentRecord.excel = function(){
|
var arr = $("#insertTime").val().split(" - ");
|
window.location.href = Feng.ctxPath + "/paymentRecord/exportRecord?userName=" + $("#userName").val()
|
+ "&phone=" + $("#phone").val() + "&code=" + $("#code").val() + "&startTime=" + arr[0] + "&endTime=" + arr[1];
|
};
|
|
|
/**
|
* 查询通知列表
|
*/
|
PaymentRecord.search = function () {
|
var queryData = {};
|
queryData['userName'] = $("#userName").val();
|
queryData['phone'] = $("#phone").val();
|
queryData['code'] = $("#code").val();
|
var arr = $("#insertTime").val().split(" - ");
|
queryData['startTime'] = arr[0];
|
queryData['endTime'] = arr[1];
|
PaymentRecord.table.refresh({query: queryData});
|
};
|
|
|
PaymentRecord.resetSearch = function () {
|
$("#userName").val("");
|
$("#phone").val("");
|
$("#userId").val("");
|
$("#insertTime").val("");
|
PaymentRecord.search();
|
};
|
|
$(function () {
|
var defaultColunms = PaymentRecord.initColumn();
|
var table = new BSTable(PaymentRecord.id, "/paymentRecord/list", defaultColunms);
|
table.setPaginationType("server");
|
PaymentRecord.table = table.init();
|
});
|