添加病案浏览日志管理功能

master
jian.wang 2 years ago
parent 9639e5a18c
commit 9091882ecf

@ -0,0 +1,170 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>其他管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<!--[if lt IE 9]>
<script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<script>
var path = "${path}";
</script>
<style type="text/css">
.mainDiv{
background-color: #fff;
}
/**搜索区*/
.searchDiv {
padding-top: 10px;
width:100%;
height: 30px;
}
.dateSearchDiv{
width:29%;
}
.dateSearchInput{
width:30%;
margin-left:5px;
}
.dateLabelDiv{
width: 30%;
text-align: right;
}
.searchInput{
width:21%;
margin-left: 5px;
text-align: right;
}
.searchElement{
width:40%;
}
.searchInputElement{
width:60%;
}
.labelDiv{
padding-top:4%;
margin-left: 2%;
}
/**查询按钮组*/
.btnsDiv{
margin-top: 15px;
height:35px;
text-align: right;
margin-right: 25px;
}
/**表格div*/
.tableDiv{
margin-left: 1%;
margin-top: -15px;
}
</style>
</head>
<body>
<div class="main">
<div class="headDiv">
<div class="headSpanDiv">
<span class="headspan">
日志管理
</span>
</div>
</div>
<div class="mainDiv">
<!-- tab标签 -->
<%--<ul id="tab" class="nav nav-tabs">
<li class="active">
<a href="#tab1" data-toggle="tab">
数据库备份
</a>
</li>
<li>
<a href="#tab2" data-toggle="tab">
日志管理
</a>
</li>
<li>
<a href="#tab3" data-toggle="tab">
通知管理
</a>
</li>
</ul>
<!-- 每个tab页对应的内容 -->
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="tab1">
<p>数据库备份</p>
</div>
<div class="tab-pane fade" id="tab2">--%>
<div class="searchDiv">
<div class="searchInput left" style="display:none;margin-left: 10px;">
<div class="searchElement left">
<label class="labelDiv">日志主题:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logTitle">
</div>
</div>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">病案号:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logContent">
</div>
</div>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">操作人账号:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="creater">
</div>
</div>
<div class="dateSearchDiv left">
<div class="dateLabelDiv left">
<label class="labelDiv">操作时间:</label>
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间" autocomplete="off">
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间" autocomplete="off">
</div>
</div>
<div class="left">
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
</div>
</div>
<div class="btnsDiv">
<shiro:hasPermission name="/otherManage/exportExcel">
<button type="button" class="btn btn-sm btn-primary btns" onclick="exportExcel()"><i class="fa fa-reply"></i>导出</button>
</shiro:hasPermission>
<shiro:hasPermission name="/otherManage/deleteLogByIds">
<button type="button" class="btn btn-sm btn-danger btns" onclick="deleteLogByIds()">批量删除</button>
</shiro:hasPermission>
</div>
<!--数据表格-->
<div id="tableDiv" class="tableDiv">
<input type="hidden" id="checks">
<table id="mytab" class="table text-nowrap table-bordered">
</table>
</div>
</div>
<%-- <div class="tab-pane fade" id="tab3">
<p>通知管理</p>
</div>
</div>--%>
</div>
</div>
<script type="text/javascript" src="${path}/static/js/otherManage/recordLogList.js?t=4"></script>
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
</body>
</html>

@ -0,0 +1,209 @@
var pageNumber;
$('#mytab').bootstrapTable({
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText : '上一页',
paginationNextText : '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,50,1000],//可供选择的每页的行数(*
height: $(window).height()-109, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',
field:'select',
checkbox:true,
width:25,
align:'center',
valign:'middle'
},
{
field: 'no',
title: '序号',
sortable: true,
formatter: function (value, row, index) {
//获取每页显示的数量
var pageSize=$('#mytab').bootstrapTable('getOptions').pageSize;
//获取当前是第几页
var pageNumber=$('#mytab').bootstrapTable('getOptions').pageNumber;
//返回序号注意index是从0开始的所以要加上1
return pageSize * (pageNumber - 1) + index + 1;
}
},
{
title:'操作人账号',
field:'creater',
},
{
title:'日志主题',
field:'logTitle',
},
{
title:'日志内容',
field:'logContent',
},
{
title:'病案号',
field:'remark',
},
{
title:'操作时间',
field:'createDate',
},
{
title:'操作',
field:'id',
formatter: function(value,row,index){
var deleteOper = row.deleteOper;
if(deleteOper == 1){
var editanddrop = '<button type="button" onclick="deleteLogById('+row.logId+')" class="btn btn-sm btn-danger">删除</button>';
return editanddrop;
}
}
}
],
locale:'zh-CN',//中文支持,
url:path+'/otherManage/getLogList',//排序方式
queryParams: function (params) {
return{
limit : params.limit, // 每页显示数量
offset : params.offset, // SQL语句起始索引
page : (params.offset / params.limit) + 1, //当前页码,
startTime:$("#startTime1").val(),
endTime:$("#endTime1").val(),
creater:$("#creater").val(),
logTitle: "病案浏览",
logContent:$("#logContent").val()
}
},
//选中单个复选框
onCheck:function(row){
var checks = $("#checks").val();
$("#checks").val(checks+=row.logId + ",");
},
//取消单个复选框
onUncheck:function(row){
var checks = $("#checks").val();
checks = checks.replace(row.logId + ",");
$("#checks").val(checks);
},
//全选
onCheckAll:function(rows){
$("#checks").val("");
var checks = '';
for(var i=0;i<rows.length;i++)
{
checks += rows[i].logId + ","
}
$("#checks").val(checks);
},
//全不选
onUncheckAll: function (rows) {
$("#checks").val("");
},
responseHandler:function(res){
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total:res.total,rows:res.list});
return nres[0];
},
onLoadSuccess:function(){
$(".page-list").show();
$(".fixed-table-body").css("overflow","auto");
},
//监听分页点击事件
onPageChange: function(num, type) {
pageNumber = num;
}
})
//查询按钮
function refreshTable(){
$("#checks").val("");
$('#mytab').bootstrapTable('refresh',{
url : path+'/otherManage/getLogList'
})
$('#mytab').bootstrapTable('selectPage', pageNumber);
}
//删除
function deleteLogById(logId){
Common.confirm({
title: "提示",
message: '确定删除这条数据吗?',
operate: function (reselt) {
if (reselt) {
$.ajax({
type: 'post',
url: path + '/otherManage/deleteLogById/' + logId,
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("删除成功!");
refreshTable();
} else {
toastr.warning(data.msg);
}
}
})
}
}
})
}
//批量删除
function deleteLogByIds(){
var ids = $("#checks").val();
if(ids != ''){
var idStr = ids.split(",");
Common.confirm({
title: "提示",
message: '确定删除选中的'+ (idStr.length-1)+ '条数据吗?',
operate: function (reselt) {
if (reselt) {
$.ajax({
type: 'post',
url: path + '/otherManage/deleteLogByIds/' + ids,
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("删除成功!");
$("#checks").val("");
refreshTable();
} else {
toastr.warning(data.msg);
}
}
})
}
}
})
}else{
toastr.warning("请至少选中一个!");
}
}
//导出excel功能
function exportExcel(){
var checks = $("#checks").val();
if(checks != '') {
checks = checks.substring(0, checks.length - 1);
var url = path+"/otherManage/exportRecordExcel?startTime="+$("#startTime1").val()+"&endTime="+$("#endTime1").val()+"&creater="+$("#creater").val()+"&logTitle=病案浏览"+"&logContent="+$("#logContent").val()
+"&checks="+checks;
window.location.href = url;
}else{
Common.confirm({
title: "提示",
message: "没有选中,您确定要按搜索栏条件导出?",
operate: function (reselt) {
if (reselt) {
var url = path+"/otherManage/exportRecordExcel?startTime="+$("#startTime1").val()+"&endTime="+$("#endTime1").val()+"&creater="+$("#creater").val()+"&logTitle=病案浏览"+"&logContent="+$("#logContent").val();
window.open(url);
}
}
})
}
}
$(function () {
initDateInput(1);
})
Loading…
Cancel
Save