/**
|
* 系统日志
|
*/
|
$(function(){
|
getLocStatusList();
|
|
$('#test-table').bootstrapTable('destroy');
|
$('#test-table').bootstrapTable({
|
method : 'GET',
|
url: "user/sysLogList.action",
|
cache : false,
|
striped : true,
|
pagination : true, //在表格底部显示分页工具栏
|
pageSize : 10, //默认每页条数
|
pageNumber : 1, //默认分页
|
pageList : [ 10, 20, 50, 100, 200, 500 ],//分页数
|
showColumns : true, //显示隐藏列
|
showRefresh : false, //显示刷新按钮
|
showExport : false,
|
toolbar:"#toolbar",
|
singleselect : true,
|
clickToSelect: true, // 单击行即可以选中
|
search : false,//显示搜素表单
|
silent : true, //刷新事件必须设置
|
sidePagination : "server", //表示服务端请求
|
columns : [ {
|
field : "log_id",
|
title : "ID",
|
class : 'col-md-1',
|
align : "center",
|
valign : "middle",
|
sortable : "true",
|
visible: false
|
}, {
|
field : "login_no",
|
title : "用户账号",
|
align : "center",
|
valign : "middle",
|
}, {
|
field : "login_name",
|
title : "用户名称",
|
align : "center",
|
valign : "middle",
|
}, {
|
field : "login_date",
|
title : "日期",
|
align : "center",
|
valign : "middle",
|
sortable : "true"
|
}, {
|
field : "machine_ip",
|
title : "客户端IP",
|
align : "center",
|
valign : "middle",
|
sortable : "true"
|
}, {
|
field : "form_no",
|
title : "请求API",
|
align : "center",
|
valign : "middle",
|
sortable : "true"
|
}, {
|
field : "tts_keyname",
|
title : "操作内容",
|
align : "center",
|
valign : "middle",
|
}, {
|
field : "modi_user",
|
title : "修改人员",
|
align : "center",
|
valign : "middle",
|
sortable : "true"
|
}, {
|
field : "modi_time",
|
title : "修改时间",
|
align : "center",
|
valign : "middle",
|
sortable : "true"
|
// }, {
|
// field: 'operate',
|
// title: '操作',
|
// class : 'col-md-2',
|
// align: 'center',
|
// valign: 'middle',
|
// formatter: operateFormatter,
|
}],
|
queryParamsType: "undefined",
|
queryParams: function queryParams(params) { //设置查询参数
|
var param = {
|
pageNumber: params.pageNumber,
|
pageSize: params.pageSize,
|
login_no:$("#login_no").val(),
|
login_name:$("#login_name").val(),
|
machine_ip:$("#machine_ip").val(),
|
form_no:$("#form_no").val(),
|
tts_keyname:$("#tts_keyname").val(),
|
begin_date:$("#begin_date").val(),
|
end_date:$("#end_date").val()
|
// searchText: params.searchText
|
};
|
return param;
|
},
|
formatLoadingMessage : function() {
|
return "请稍等,正在加载中...";
|
},
|
|
formatNoMatches : function() {
|
return '无符合条件的记录';
|
},
|
//注册加载子表的事件。注意下这里的三个参数!
|
onExpandRow: function (index, row, $detail) {
|
oInit.InitSubTable(index, row, $detail);
|
}
|
|
});
|
});
|
|
function operateFormatter(value, row, index) {
|
return [
|
'<button type="button" class=" btn btn-info" onclick="getvalue(\''+row.log_id+'\')">修改</button>',
|
' <button class=" btn btn-danger" type="button" onclick="delSysLog(\''+row.log_id+'\')">删除</button>'
|
].join('');
|
}
|
|
/**
|
* 会议室列表
|
* @returns
|
*/
|
function getLocStatusList(){
|
$.ajax({
|
url:'basic/getLocStatus.action',
|
dataType:'json',
|
type:'post',
|
data:{
|
pageNumber:1,
|
pageSize:1000
|
},
|
success:function(data){
|
$("#loc_sts").empty();
|
$("#loc_sts").append("<option value=''>请选择库位状态</option>");
|
$.each(data.rows,function(){
|
$("#loc_sts").append("<option value='"+this.loc_sts+"'>"+this.loc_desc+"</option>");
|
});
|
|
},
|
error:function(){
|
alert("请求失败!");
|
}
|
});
|
}
|
|
/**
|
* 条件查询库位
|
* @returns
|
*/
|
function getSysLogByCon(){
|
// $("#test-table").bootstrapTable('refresh');
|
$("#test-table").bootstrapTable('refreshOptions',{pageNumber:1}); //分页后重新搜索时,初始化页码为1
|
}
|
|
function formValidator(){
|
$("#addForm").bootstrapValidator({
|
message: 'This value is not valid',
|
feedbackIcons: {
|
valid: 'glyphicon glyphicon-ok',
|
invalid: 'glyphicon glyphicon-remove',
|
validating: 'glyphicon glyphicon-refresh'
|
},
|
|
fields:{
|
s_row:{
|
message: '起始排验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
e_row:{
|
message: '终止排验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
s_bay:{
|
message: '起始列验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
e_bay:{
|
message: '终止列验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
s_lev:{
|
message: '起始层验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
e_lev:{
|
message: '终止层验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
loc_type:{
|
message: '库位类型验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
}
|
}
|
});
|
|
$("#myform").bootstrapValidator({
|
message: 'This value is not valid',
|
feedbackIcons: {
|
valid: 'glyphicon glyphicon-ok',
|
invalid: 'glyphicon glyphicon-remove',
|
validating: 'glyphicon glyphicon-refresh'
|
},
|
|
fields: {
|
s_row:{
|
message: '起始排验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
e_row:{
|
message: '终止排验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
s_bay:{
|
message: '起始列验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
e_bay:{
|
message: '终止列验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
s_lev:{
|
message: '起始层验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
e_lev:{
|
message: '终止层验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
},
|
loc_type:{
|
message: '库位类型验证失败',
|
validators:{
|
notEmpty:{message:'不能为空'},
|
numeric:{message:'只能输入数字'}
|
}
|
}
|
}
|
});
|
}
|
//表单验证
|
$(function(){
|
formValidator();
|
|
});
|
|
//添加,打开模态框
|
function addSysLog(){
|
$("#addDlg").modal('show');
|
}
|
|
////添加时验证是否唯一
|
//function checkSysLog(){
|
// var x=$("#log_id1").val();
|
// if(x!=""){
|
// $.ajax({
|
// url:'basic/checkSysLog.action',
|
// dataType:'json',
|
// type:'post',
|
// data:{
|
// did:$("#log_id1").val()
|
// },
|
// success:function(data){
|
// $("#info").text(data.msg);
|
// },
|
// error:function(){
|
// alert("请求失败");
|
// }
|
// });
|
// }else{
|
// return false;
|
// }
|
//}
|
|
//// 提交插入
|
//function insertSysLog(){
|
//// var msg=$("#info").text();
|
//// if(msg=="代号可用"){
|
// if(confirm('确定初始化?')){
|
// $("#initLoc").attr("disabled", true);
|
// if($("#addForm").data('bootstrapValidator').validate().isValid()){
|
// $.ajax({
|
// url:'basic/addSysLog.action',
|
// type:'post',
|
// dataType:'json',
|
// data:$("#addForm").serialize(),
|
// success:function(info){
|
// if(info>0){
|
// alert("初始化成功!共" + info + "个库位");
|
// }else{
|
// alert("初始化失败");
|
// }
|
// $("#test-table").bootstrapTable('refresh');
|
// $("#addDlg").modal('hide');
|
// $("#log_id1").val("");
|
// $("#s_row").val("");
|
// $("#e_row").val("");
|
// $("#s_bay").val("");
|
// $("#e_bay").val("");
|
// $("#s_lev").val("");
|
// $("#e_lev").val("");
|
// $("#loc_type").val("");
|
// },
|
// error:function(){
|
// alert('请求失败');
|
// }
|
// });
|
// }else{
|
// return false;
|
// }
|
// $("#initLoc").attr("disabled", false);
|
// }
|
//// }else{
|
//// alert("代号不可用");
|
//// }
|
//
|
//}
|
|
|
//打开模态框,数据回写
|
function getvalue(id){
|
$.ajax({
|
url:'basic/querySysLogById.action',
|
type:'post',
|
dataType:'json',
|
data:{did:id},
|
success:function(data){
|
$("#log_id").val(data.log_id);
|
},
|
error:function(){
|
alert("请求失败");
|
}
|
});
|
$("#mydlg").modal("show");
|
}
|
|
////保存修改内容
|
//function upSysLog(){
|
// if($("#myform").data('bootstrapValidator').validate().isValid()){
|
// $.ajax({
|
// url:'basic/upSysLog.action',
|
// type:'post',
|
// dataType:'json',
|
// data:$("#myform").serialize(),
|
// success:function(data){
|
// if(data>0){
|
// alert("修改成功");
|
// }else{
|
// alert("修改失败");
|
// }
|
// $("#test-table").bootstrapTable('refresh');
|
// $("#mydlg").modal("hide");
|
// },
|
// error:function(){
|
// alert("请求失败");
|
// }
|
// });
|
// }else{
|
// return false;
|
// }
|
//}
|
|
//关闭模态框
|
function closedlg(){
|
$("#mydlg").modal("hide");
|
$("#addDlg").modal("hide")
|
$("#info").text("");
|
$("#infos").text("");
|
|
$('#myform').data('bootstrapValidator', null);
|
$("#addForm").data('bootstrapValidator',null);
|
formValidator();
|
//$('#mydlg').data('bootstrapValidator').resetForm(true);
|
$("input[type=reset]").trigger("click");
|
|
|
}
|
|
//单个删除
|
function resetSysLog(){
|
if(confirm('确定清空?将清空所有日志数据')){
|
$.ajax({
|
url:'user/resetSysLog.action',
|
type:'post',
|
dataType:'json',
|
// data:{did:id},
|
success:function(data){
|
if(data>0){
|
alert("重置成功");
|
}else{
|
alert("重置失败");
|
}
|
$("#test-table").bootstrapTable('refresh');
|
},
|
error:function(){
|
alert("请求失败");
|
}
|
});
|
}
|
}
|
|
//导出
|
function ExportExcel(){
|
if(confirm("确认导出excel?")){
|
var url = "user/exportSysLog.action?";
|
url += "login_no=" + $("#login_no").val();
|
url += "&login_name=" + $("#login_name").val();
|
url += "&machine_ip=" + $("#machine_ip").val();
|
url += "&form_no=" + $("#form_no").val();
|
url += "&tts_keyname=" + $("#tts_keyname").val();
|
url += "&begin_date=" + $("#begin_date").val();
|
url += "&end_date=" + $("#end_date").val();
|
location.href=url;
|
}else{
|
return false;
|
}
|
}
|