/**
|
* 司机单单返活动管理初始化
|
*/
|
var SettlementAllocation = {
|
id: "SettlementAllocationTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
SettlementAllocation.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '结算日期', field: 'day', visible: true, align: 'center', valign: 'middle'},
|
{title: '结算金额', field: 'payMoney', visible: true, align: 'center', valign: 'middle'},
|
{title: '结算方式', field: 'payType', visible: true, align: 'center', valign: 'middle',
|
formatter:function (value, row) {
|
if(1 == value){
|
return "手机支付";
|
}
|
if(2 == value){
|
return "银行卡支付";
|
}
|
if(3 == value){
|
return "余额支付";
|
}
|
}
|
},
|
{title: '结算状态', field: 'paymentStatus', visible: true, align: 'center', valign: 'middle',
|
formatter:function (value, row) {
|
if(1 == value){
|
return "未支付";
|
}
|
if(2 == value){
|
return "支付成功";
|
}
|
}
|
},
|
{title: '结算人', field: 'driverName', visible: true, align: 'center', valign: 'middle'}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
SettlementAllocation.check = function (type) {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}
|
};
|
|
|
|
/**
|
* 删除司机单单返活动
|
*/
|
SettlementAllocation.setSettlementAllocation = function () {
|
var type = $($('input[name="type"]:checked')[0]);
|
if(typeof type == "undefined"){
|
Feng.error("请选择结算周期");
|
return
|
}
|
if(type.val() == '1'){
|
var day = $(type.siblings('.day')[0]).val();
|
if('' == day || null == day){
|
Feng.error("请输入金额上限")
|
return
|
}
|
}else{
|
var day = $(type.siblings('.date')[0]).val();
|
if('' == day || null == day){
|
Feng.error("请输入有效的结算日期")
|
return
|
}
|
}
|
var maxPrice = $('#maxPrice').val();
|
if('1' == type.val()){
|
maxPrice = day;
|
}
|
if('' == maxPrice || null == maxPrice){
|
Feng.error("请输入金额上限")
|
return
|
}
|
if(maxPrice < 0){
|
Feng.error("金额上限不能小于0")
|
return
|
}
|
let json = {
|
type: type.val(),
|
day: day,
|
maxPrice: maxPrice
|
}
|
|
var ajax = new $ax(Feng.ctxPath + "/settlementAllocation/setSettlementAllocation", function (data) {
|
if(data.code == 200){
|
Feng.success("配置成功!");
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("配置失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("json", JSON.stringify(json));
|
ajax.start();
|
};
|
|
/**
|
* 查询司机单单返活动列表
|
*/
|
SettlementAllocation.search = function () {
|
var queryData = {};
|
queryData['time'] = $('#time').val();
|
queryData['money'] = $('#money').val();
|
queryData['status'] = $('#payStatus').val();
|
queryData['driverName'] = $("#userName").val();
|
SettlementAllocation.table.refresh({query: queryData});
|
};
|
|
SettlementAllocation.resetSearch = function () {
|
$("#time").val("");
|
$("#money").val("");
|
$("#payStatus").val("");
|
$("#userName").val("");
|
SettlementAllocation.search();
|
};
|
|
|
|
$(function () {
|
var defaultColunms = SettlementAllocation.initColumn();
|
var table = new BSTable(SettlementAllocation.id, "/settlementAllocation/querySettlementRecordList", defaultColunms);
|
table.setPaginationType("server");
|
SettlementAllocation.table = table.init();
|
});
|