/**
|
* 人脸识别记录管理初始化
|
*/
|
var TDriverFacialFail = {
|
id: "TDriverFacialFailTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
TDriverFacialFail.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: false},
|
{title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '异常记录时间', field: 'createTime', visible: true, align: 'center', valign: 'middle',width:'10%',
|
formatter: function (value, row) {
|
var btn = "";
|
if(row.createTime != '' && row.createTime != null) {
|
var time = row.createTime.replace(" ",'<br>');
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.createTime + '" onfocus="TUser.tooltip()">' + time + '</p>']
|
}
|
return btn;
|
}
|
},
|
{title: '司机姓名', field: 'driverName', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
var btn = "";
|
if(row.driverName != '' && row.driverName != null) {
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.driverName + '" onfocus="TUser.tooltip()">' + row.driverName + '</p>']
|
}
|
return btn;
|
}
|
},
|
{title: '手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle',width:'10%',
|
formatter: function (value, row) {
|
var btn = "";
|
if(row.driverPhone != '' && row.driverPhone != null) {
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.driverPhone + '" onfocus="TUser.tooltip()">' + row.driverPhone + '</p>']
|
}
|
return btn;
|
}
|
},
|
{title: '所属城市', field: 'city', visible: true, align: 'center', valign: 'middle',
|
formatter: function (value, row) {
|
var btn = "";
|
if(row.city != '' && row.city != null) {
|
btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.city + '" onfocus="TUser.tooltip()">' + row.city + '</p>']
|
}
|
return btn;
|
}
|
},
|
{title: '识别结果', field: 'city', visible: true, align: 'center', valign: 'middle',width:'10%',
|
formatter: function (value, row) {
|
var btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.carNum + '" onfocus="TUser.tooltip()">人脸认证失败</p>'];
|
return btn;
|
}
|
},
|
{title: '操作', visible: true, align: 'center', valign: 'middle',width:'16%',
|
formatter: function (value, row) {
|
return '<a href="#" onclick="TDriverFacialFail.openTDriverFacialFailDetail('+row.id+')" style="color:cornflowerblue">详情</a>' +' ' +
|
'<a href="#" onclick="TDriverFacialFail.delete('+row.id+')" style="color:cornflowerblue">删除</a>' +' ' +
|
'<a href="#" onclick="TDriverFacialFail.unsealing('+row.id+')" style="color:cornflowerblue">解封</a>'
|
}
|
}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
TDriverFacialFail.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
TDriverFacialFail.seItem = selected[0];
|
return true;
|
}
|
};
|
|
/**
|
* 打开查看人脸识别记录详情
|
*/
|
TDriverFacialFail.openTDriverFacialFailDetail = function (tDriverFacialFailId) {
|
var index = layer.open({
|
type: 2,
|
title: '异常记录详情',
|
area: ['70%', '50%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tDriverFacialFail/tDriverFacialFail_update/' + tDriverFacialFailId
|
});
|
this.layerIndex = index;
|
};
|
|
|
|
/**
|
* 删除人脸识别记录
|
*/
|
TDriverFacialFail.delete = function (id, nickname) {
|
if (nickname == "" || nickname == null || nickname == undefined){
|
nickname = "该记录";
|
}else{
|
nickname = "【"+nickname+"】";
|
}
|
swal({
|
title: "您是否确认删除"+ nickname + "?",
|
text: "请谨慎操作,删除后数据无法恢复!",
|
type: "warning",
|
showCancelButton: true,
|
confirmButtonColor: "#DD6B55",
|
confirmButtonText: "删除",
|
closeOnConfirm: true
|
}, function () {
|
var ajax = new $ax(Feng.ctxPath + "/tDriverFacialFail/delete", function (data) {
|
swal("删除成功", "您已经删除了" + nickname + "。", "success");
|
TDriverFacialFail.table.refresh();
|
}, function (data) {
|
swal("删除失败", data.responseJSON.message + "!", "warning");
|
});
|
ajax.set("tDriverFacialFailId", id);
|
ajax.start();
|
});
|
};
|
|
/**
|
* 批量删除人脸识别记录
|
*/
|
TDriverFacialFail.deleteBatch = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
var ids = '';
|
if (selected.length > 0) {
|
for (var i = 0; i < selected.length; i++) {
|
ids += selected[i]['id'] + ",";
|
}
|
ids = ids.substring(0, ids.length - 1);
|
}
|
console.log(ids);
|
if(this.check()){
|
var nickname = TDriverFacialFail.seItem.name;
|
if (nickname == "" || nickname == null || nickname == undefined){
|
nickname = "该记录";
|
}else{
|
nickname = "【"+nickname+"】";
|
}
|
swal({
|
title: "您是否确认删除"+ nickname + "?",
|
text: "请谨慎操作,删除后数据无法恢复!",
|
type: "warning",
|
showCancelButton: true,
|
confirmButtonColor: "#DD6B55",
|
confirmButtonText: "删除",
|
closeOnConfirm: true
|
}, function () {
|
var ajax = new $ax(Feng.ctxPath + "/tDriverFacialFail/deleteBatch", function (data) {
|
swal("删除成功", "您已经删除了" + nickname + "。", "success");
|
TDriverFacialFail.table.refresh();
|
}, function (data) {
|
swal("删除失败", data.responseJSON.message + "!", "warning");
|
});
|
ajax.set("tDriverFacialFailIds", ids);
|
ajax.start();
|
});
|
}
|
};
|
|
/**
|
* 解封司机人脸认证
|
*/
|
TDriverFacialFail.unsealing = function (id,nickname) {
|
if (nickname == "" || nickname == null || nickname == undefined){
|
nickname = "该记录";
|
}else{
|
nickname = "【"+nickname+"】";
|
}
|
swal({
|
title: "您是否确认解封"+ nickname + "?",
|
text: "操作解封后,司机该轮人脸认证即可通过,可继续接单 \n是否确认解封?",
|
type: "warning",
|
showCancelButton: true,
|
confirmButtonColor: "#DD6B55",
|
confirmButtonText: "确认",
|
closeOnConfirm: true
|
}, function () {
|
var ajax = new $ax(Feng.ctxPath + "/tDriverFacialFail/unsealing", function (data) {
|
swal("操作成功", "您已经解封了" + nickname + "。", "success");
|
TDriverFacialFail.table.refresh();
|
}, function (data) {
|
swal("操作失败", data.responseJSON.message + "!", "warning");
|
});
|
ajax.set("tDriverFacialFailId", id);
|
ajax.start();
|
});
|
};
|
|
/**
|
* 查询人脸识别记录列表
|
*/
|
TDriverFacialFail.search = function () {
|
var queryData = {};
|
queryData['createTime'] = $("#createTime").val();
|
queryData['name'] = $("#name").val();
|
queryData['phone'] = $("#phone").val();
|
TDriverFacialFail.table.refresh({query: queryData});
|
};
|
|
TDriverFacialFail.resetSearch = function () {
|
$("#createTime").val("");
|
$("#name").val("");
|
$("#phone").val("");
|
TDriverFacialFail.search();
|
};
|
|
$(function () {
|
var defaultColunms = TDriverFacialFail.initColumn();
|
var table = new BSTable(TDriverFacialFail.id, "/tDriverFacialFail/list", defaultColunms);
|
table.setPaginationType("server");
|
TDriverFacialFail.table = table.init();
|
});
|