/**
|
* 交易明细管理初始化
|
*/
|
var UserPubTransactionDetails = {
|
id: "UserPubTransactionDetailsTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
UserPubTransactionDetails.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '交易时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
|
{title: '用户id', field: 'userId', visible: true, align: 'center', valign: 'middle'},
|
{title: '用户昵称', field: 'nickName', visible: true, align: 'center', valign: 'middle'},
|
{title: '手机号码', field: 'phone', visible: true, align: 'center', valign: 'middle'},
|
{title: '类型', field: 'type', visible: true, align: 'center', valign: 'middle',formatter:function(value, row){
|
if(1==row.type){
|
return "余额变更";
|
}else if(2==row.type){
|
return "积分变更";
|
}else{
|
return ""
|
}
|
}},
|
{title: '数量', field: 'money', visible: true, align: 'center', valign: 'middle'},
|
{title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle',formatter:function (value,row) {
|
if(1==row.state){
|
return "增加";
|
}else if(2==row.state){
|
return "减少";
|
}else{
|
return ""
|
}
|
}}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
UserPubTransactionDetails.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
UserPubTransactionDetails.seItem = selected[0];
|
return true;
|
}
|
};
|
|
|
/**
|
* 查询列表
|
*/
|
UserPubTransactionDetails.search = function () {
|
var queryData = {};
|
queryData['userId'] = $("#userId").val();
|
queryData['phone'] = $("#phone").val();
|
queryData['state'] = $("#state").val();
|
UserPubTransactionDetails.table.refresh({query: queryData});
|
};
|
|
UserPubTransactionDetails.resetSearch=function(){
|
$("#userId").val("");
|
$("#phone").val("");
|
$("#state").val("");
|
UserPubTransactionDetails.search();
|
}
|
|
$(function () {
|
var defaultColunms = UserPubTransactionDetails.initColumn();
|
var table = new BSTable(UserPubTransactionDetails.id, "/pubTransactionDetails/userList", defaultColunms);
|
table.setPaginationType("server");
|
UserPubTransactionDetails.table = table.init();
|
});
|