/**
|
* 管理初始化
|
*/
|
var OfflineOrderStatistics = {
|
id: "OfflineOrderStatisticsTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
OfflineOrderStatistics.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: '', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '订单号', field: 'orderNum', visible: true, align: 'center', valign: 'middle'},
|
{title: '用户手机号', field: 'userPhone', visible: true, align: 'center', valign: 'middle'},
|
{title: '打车方式', field: 'orderSource', visible: true, align: 'center', valign: 'middle'},
|
{title: '接单司机手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle'},
|
{title: '司机所属机构', field: 'company', visible: true, align: 'center', valign: 'middle'},
|
{title: '扣除司机抽成', field: 'income', visible: true, align: 'center', valign: 'middle'},
|
{title: '下单时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
|
{title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
return '<a onclick="OfflineOrderStatistics.openOfflineOrderStatisticsDetail(' + value + ')" style="color: blue;">订单详情</a>';
|
}
|
}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
OfflineOrderStatistics.check = function (type) {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
//验证类型null删除,1=审核,2=编辑,3=启动/暂停
|
if(type==null){
|
OfflineOrderStatistics.seItem = selected[0];
|
return true;
|
}else if(type==3 && selected[0].status!=3 && selected[0].status!=4){
|
Feng.info("当前状态不能暂停/启动!");
|
return false;
|
}else if(type==3 && selected[0].status==3 && (selected[0].startTime>new Date() || new Date()>selected[0].endTime)){
|
Feng.info("当前状态不能暂停/启动!");
|
return false;
|
}else if(type==1 && selected[0].status!=1){
|
Feng.info("当前状态不能审核!");
|
return false;
|
}else if(type==2 && selected[0].status!=2){
|
Feng.info("当前状态不能编辑!");
|
return false;
|
}
|
OfflineOrderStatistics.seItem = selected[0];
|
return true;
|
}
|
};
|
/**
|
* 打开查看详情
|
*/
|
OfflineOrderStatistics.openOfflineOrderStatisticsDetail = function (id) {
|
var index = layer.open({
|
type: 2,
|
title: '出租车订单详情',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tOrderTaxi/tOrderTaxi_update/' + id
|
});
|
this.layerIndex = index;
|
};
|
|
|
OfflineOrderStatistics.export = function (){
|
let orderCode = $("#orderCode").val();
|
let userPhone = $("#userPhone").val();
|
let driverPhone = $("#driverPhone").val();
|
let createTime = $("#createTime").val();
|
let orderSource = $("#orderSource").val();
|
window.location.href = Feng.ctxPath + '/financialStatement/offlineOrderStatisticsList_export?orderCode=' + orderCode +
|
"&userPhone=" + userPhone + "&driverPhone=" + driverPhone + "&createTime=" + createTime + "&orderSource=" + orderSource
|
}
|
|
|
|
/**
|
* 查询列表
|
*/
|
OfflineOrderStatistics.search = function () {
|
var queryData = {};
|
queryData['orderCode'] = $("#orderCode").val();
|
queryData['userPhone'] = $("#userPhone").val();
|
queryData['driverPhone'] = $("#driverPhone").val();
|
queryData['createTime'] = $("#createTime").val();
|
queryData['orderSource'] = $("#orderSource").val();
|
OfflineOrderStatistics.table.refresh({query: queryData});
|
};
|
|
|
OfflineOrderStatistics.resetSearch = function () {
|
$("#orderCode").val("");
|
$("#userPhone").val("");
|
$("#driverPhone").val("");
|
$("#createTime").val("");
|
$("#orderSource").val("");
|
OfflineOrderStatistics.search();
|
};
|
|
|
$(function () {
|
var defaultColunms = OfflineOrderStatistics.initColumn();
|
var table = new BSTable(OfflineOrderStatistics.id, "/financialStatement/offlineOrderStatisticsList", defaultColunms);
|
table.setPaginationType("server");
|
OfflineOrderStatistics.table = table.init();
|
});
|