/**
|
* 管理初始化
|
*/
|
var DriverApplyRefund = {
|
id: "DriverApplyRefundTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
DriverApplyRefund.initColumn = function () {
|
return [
|
{field: 'selectItem', checkbox: true},
|
{title: '', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '用户编号', field: 'userId', 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) {
|
switch (value) {
|
case 1:
|
return "昵称";
|
case 2:
|
return "头像";
|
|
}
|
}
|
},
|
{title: '头像', field: 'headImg', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
if (row.headImg == null || row.headImg == '') {
|
return '<button/></button>';
|
} else {
|
var temp = row.headImg
|
return '<button onclick="lookBigImg(\'' + temp + '\')"><img style="width: 90px;height:50px;" src="' + row.headImg + '" /></button>';
|
}
|
},
|
events: 'operateEvents'},
|
{title: '昵称', field: 'name', visible: true, align: 'center', valign: 'middle'},
|
{title: '审核状态', field: 'state', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
switch (value) {
|
case 1:
|
return "待审核";
|
case 2:
|
return "已通过";
|
case 3:
|
return "已驳回";
|
}
|
}
|
},
|
{title: '提交时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
|
{title: '审核时间', field: 'auditTime', visible: true, align: 'center', valign: 'middle'},
|
{title: '操作', field: 'state', visible: true, align: 'center', valign: 'middle',
|
formatter: function (data,row) {
|
var btn = "";
|
if(data==1) {
|
var str = '<button class="btn btn-outline btn-primary" onclick="DriverApplyRefund.audit('+row.id+')" >审核</button>'
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>']
|
}else {
|
var str = '<button class="btn btn-outline btn-primary" onclick="DriverApplyRefund.info(' + row.id + ')" >查看</button>'
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>']
|
}
|
return btn;
|
}
|
},
|
];
|
};
|
|
DriverApplyRefund.audit = function (e) {
|
var index = layer.open({
|
type: 2,
|
title: '审核',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/userAudit/auditHtml/'+e
|
});
|
this.layerIndex = index;
|
};
|
|
DriverApplyRefund.info = function (e) {
|
var index = layer.open({
|
type: 2,
|
title: '详情',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/userAudit/auditInfo/'+e
|
});
|
this.layerIndex = index;
|
};
|
/**
|
* 检查是否选中
|
*/
|
DriverApplyRefund.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}
|
DriverApplyRefund.seItem = selected[0];
|
return true;
|
};
|
|
DriverApplyRefund.viewSensitiveData = function () {
|
if (this.check()) SensitiveInfo.view('/system/sensitive/app-user/' + this.seItem.userId);
|
};
|
|
|
/**
|
* 打开编辑
|
*/
|
/**
|
* 查询列表
|
*/
|
DriverApplyRefund.search = function () {
|
var queryData = {};
|
queryData['phone'] = $("#phone").val();
|
queryData['state'] = $("#status").val();
|
DriverApplyRefund.table.refresh({query: queryData});
|
};
|
DriverApplyRefund.resetSearch = function () {
|
$("#phone").val("");
|
$("#state").val("");
|
DriverApplyRefund.search();
|
};
|
$(function () {
|
var defaultColunms = DriverApplyRefund.initColumn();
|
var table = new BSTable(DriverApplyRefund.id, "/userAudit/list", defaultColunms);
|
table.setPaginationType("client");
|
DriverApplyRefund.table = table.init();
|
});
|