/**
|
* 用户管理管理初始化
|
*/
|
var TUser = {
|
id: "TUserTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 鼠标悬停提示框 class .toolTip 为无效样式,作用于个别选择器使用
|
*/
|
TUser.tooltip = function(){
|
$(".toolTip").tooltip();
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
TUser.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: '下单时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
|
{title: '订单号', field: 'code', visible: true, align: 'center', valign: 'middle'},
|
|
{title: '司机姓名', field: 'driverName', visible: false, align: 'center', valign: 'middle'},
|
{title: '司机手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle',
|
},
|
{title: '佣金金额', field: 'money', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
var money = row.money;
|
var btn = "";
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: orange;" title="待审核" onfocus="TUser.tooltip()">'+money+'</p>']
|
return btn;
|
}
|
},
|
{title: '支付方式', field: 'payType', visible: true, align: 'center', valign: 'middle',
|
},
|
{title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle',},
|
{title: '状态', field: 'paymentStatus', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
var state = row.state;
|
if (state == 1){
|
var btn = "";
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #68e02c;" title="待审核" onfocus="TUser.tooltip()">已结算</p>']
|
}else{
|
var btn = "";
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #e31452;" title="待审核" onfocus="TUser.tooltip()">未结算</p>']
|
}
|
return btn;
|
|
}
|
},
|
{title: '结算时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',},
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
TUser.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
TUser.seItem = selected[0];
|
return true;
|
}
|
};
|
|
/**
|
* 修改余额
|
*/
|
TUser.updateBalance = function () {
|
if (this.check()) {
|
var index = layer.open({
|
type: 2,
|
title: '修改余额',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tUser/tUser_updateBalance/'+ TUser.seItem.id
|
});
|
this.layerIndex = index;
|
}
|
};
|
/**
|
* 修改密码
|
*/
|
TUser.updatePassword = function () {
|
if (this.check()) {
|
var index = layer.open({
|
type: 2,
|
title: '修改密码',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tUser/tUser_updatePassword/'+ TUser.seItem.id
|
});
|
this.layerIndex = index;
|
}
|
};
|
/**
|
* 查看分享信息
|
*/
|
TUser.inviteInfo=function(){
|
if (this.check()) {
|
var index = layer.open({
|
type: 2,
|
title: '邀请信息',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tUser/inviteInfo/'+ TUser.seItem.id
|
});
|
this.layerIndex = index;
|
|
}
|
};
|
|
/**
|
* 打开查看用户管理详情
|
*/
|
TUser.userDetail = function () {
|
if (this.check()) {
|
var index = layer.open({
|
type: 2,
|
title: '用户详情',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tUser/tUser_userDetail/' + TUser.seItem.id
|
});
|
this.layerIndex = index;
|
}
|
};
|
|
/**
|
* 冻结用户
|
*/
|
TUser.freezeUser = function () {
|
if (this.check()) {
|
var nickname = TUser.seItem.nickName;
|
if (nickname == "" || nickname == null || nickname == undefined) {
|
nickname = "该用户";
|
} else {
|
nickname = "【" + nickname + "】";
|
}
|
if (TUser.seItem.state != 1) {
|
swal("冻结失败", "【正常】状态下才能执行此操作", "warning");
|
return;
|
} else {
|
var index = layer.open({
|
type: 2,
|
title: '冻结用户',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tUser/tUser_optUser/' + TUser.seItem.id +"/"+1
|
});
|
this.layerIndex = index;
|
}
|
}
|
};
|
/**
|
* 解冻用户
|
*/
|
TUser.trawUser = function () {
|
if (this.check()) {
|
var nickname = TUser.seItem.nickName;
|
if (nickname == "" || nickname == null || nickname == undefined) {
|
nickname = "该用户";
|
} else {
|
nickname = "【" + nickname + "】";
|
}
|
if (TUser.seItem.state != 2) {
|
swal("启用失败", "【冻结】状态下才能执行此操作", "warning");
|
return;
|
} else {
|
var index = layer.open({
|
type: 2,
|
title: '解冻用户',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tUser/tUser_optUser/' + TUser.seItem.id +"/"+2
|
});
|
this.layerIndex = index;
|
}
|
}
|
};
|
// 首次
|
TUser.getCount1 = function() {
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/platform/commission/getCount", function(data){
|
|
document.getElementById("num1").innerHTML = data.total;
|
document.getElementById("num2").innerHTML = data.balance;
|
document.getElementById("num3").innerHTML = data.unBalance;
|
},function(data){
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("time",1);
|
ajax.set("insertTime",null);
|
ajax.set("state",null);
|
ajax.start();
|
}
|
// 点击搜索
|
TUser.getCount = function() {
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/platform/commission/getCount", function(data){
|
console.log(data);
|
console.log(data);
|
console.log(data);
|
document.getElementById("num1").innerHTML = data.total;
|
document.getElementById("num2").innerHTML = data.balance;
|
document.getElementById("num3").innerHTML = data.unBalance;
|
},function(data){
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("time",$("#time").val());
|
ajax.set("insertTime",$("#insertTime").val());
|
ajax.set("state",$("#state").val());
|
ajax.start();
|
}
|
/**
|
* 查询用户管理列表
|
*/
|
TUser.search = function () {
|
var queryData = {};
|
queryData['time'] = $("#time").val();
|
queryData['insertTime'] = $("#insertTime").val();
|
queryData['state'] = $("#state").val();
|
TUser.table.refresh({query: queryData});
|
TUser.getCount();
|
};
|
TUser.resetSearch = function () {
|
$("#time").val("");
|
$("#insertTime").val("");
|
$("#state").val("");
|
TUser.search();
|
};
|
|
$(function () {
|
TUser.getCount1();
|
var defaultColunms = TUser.initColumn();
|
var table = new BSTable(TUser.id, "/platform/commission/list", defaultColunms);
|
// 设置物理分页server(逻辑分页client)
|
table.setPaginationType("client");
|
TUser.table = table.init();
|
});
|
TUser.tradeYse = function () {
|
var time =document.getElementById("insertTime");
|
|
if ("" == $("#time").val()){
|
time.value="";
|
time.disabled = true;
|
}else{
|
bTime.value="";
|
bTime.disabled = false;
|
}
|
};
|
TUser.sendAjaxRequest = function(url,type,data){
|
$.ajax({
|
url : url,
|
type : type,
|
data : data,
|
success : function(result) {
|
if(result.code==500) {
|
Feng.info(result.message);
|
}else {
|
Feng.success("导入成功!");
|
}
|
TUser.table.refresh();
|
},
|
error : function() {
|
Feng.error("excel上传失败!");
|
},
|
cache : false,
|
contentType : false,
|
processData : false
|
});
|
};
|
|
var agreement;
|
$(function(){
|
agreement = new agreement();
|
agreement.init();
|
});
|