/**
|
* 车队管理管理初始化
|
*/
|
var TDriverTeam = {
|
id: "TDriverTeamTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
TDriverTeam.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'},
|
{title: '车队名称', field: 'teamName', visible: true, align: 'center', valign: 'middle'},
|
{title: '插入时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'},
|
{title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle'}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
TDriverTeam.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
TDriverTeam.seItem = selected[0];
|
return true;
|
}
|
};
|
|
/**
|
* 点击添加车队管理
|
*/
|
TDriverTeam.openAddDriverTeam = function () {
|
var index = layer.open({
|
type: 2,
|
title: '添加车队管理',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tDriverTeam/driverTeam_add'
|
});
|
this.layerIndex = index;
|
};
|
|
/**
|
* 打开查看车队管理详情
|
*/
|
TDriverTeam.openDriverTeamDetail = function () {
|
if (this.check()) {
|
var index = layer.open({
|
type: 2,
|
title: '车队管理详情',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tDriverTeam/driverTeam_update/' + TDriverTeam.seItem.id
|
});
|
this.layerIndex = index;
|
}
|
};
|
|
/**
|
* 删除车队管理
|
*/
|
TDriverTeam.delete = function () {
|
if (this.check()) {
|
var id=this.seItem.id;
|
var operation = function() {
|
var ajax = new $ax(Feng.ctxPath + "/tDriverTeam/delete", function (data) {
|
Feng.success("删除成功!");
|
TDriverTeam.table.refresh();
|
}, function (data) {
|
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("driverTeamId",id);
|
ajax.start();
|
};
|
Feng.confirm("是否确认删除车队?", operation);
|
}
|
};
|
|
/**
|
* 查询车队管理列表
|
*/
|
TDriverTeam.search = function () {
|
var queryData = {};
|
queryData['teamName'] = $("#teamName").val();
|
TDriverTeam.table.refresh({query: queryData});
|
};
|
|
$(function () {
|
var defaultColunms = TDriverTeam.initColumn();
|
var table = new BSTable(TDriverTeam.id, "/tDriverTeam/list", defaultColunms);
|
table.setPaginationType("server");
|
TDriverTeam.table = table.init();
|
});
|