|
|
|
|
@ -0,0 +1,404 @@
|
|
|
|
|
var tipLoad = 0;
|
|
|
|
|
var url = path + '/statistics/recordStatistics/';
|
|
|
|
|
//定义表格内容最大高度
|
|
|
|
|
var maxHeight = 0;
|
|
|
|
|
$(function(){
|
|
|
|
|
//加载科室
|
|
|
|
|
getDeptStatistics();
|
|
|
|
|
//获取加载层数级
|
|
|
|
|
var level = $("#level").val();
|
|
|
|
|
switch (level) {
|
|
|
|
|
case '1':
|
|
|
|
|
initTable();
|
|
|
|
|
break;
|
|
|
|
|
case '2':
|
|
|
|
|
initTable1();
|
|
|
|
|
break;
|
|
|
|
|
case '3':
|
|
|
|
|
initTable2(getDeptName(),'table2');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
//加载科室
|
|
|
|
|
function getDeptStatistics() {
|
|
|
|
|
//获取科室列表
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: path+"/inHosp/getDept",
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: {effective: 1, typecode: "dept_code"},
|
|
|
|
|
async:false,
|
|
|
|
|
success: function (result) {
|
|
|
|
|
if (result != null) {
|
|
|
|
|
var html = '';
|
|
|
|
|
for (var i = 0; i < result.length; i++) {
|
|
|
|
|
//默认需要选中
|
|
|
|
|
var searchDeptName = $("#searchDeptName").val().split(",");
|
|
|
|
|
//定义是否包含默认需要选中的
|
|
|
|
|
var name = result[i].name;
|
|
|
|
|
var py = makePy(name);
|
|
|
|
|
var pingyin = ConvertPinyin(name);
|
|
|
|
|
html += '<option data-tokens="' + name + '|' + py[0] + '|' + pingyin + '" value="' + result[i].code + '">' + name + '</option>';
|
|
|
|
|
}
|
|
|
|
|
$("#deptName").append(html);
|
|
|
|
|
$("#deptAdmissionTo").append(html);
|
|
|
|
|
$("#deptName").val(searchDeptName);
|
|
|
|
|
}
|
|
|
|
|
$(".selectpicker").selectpicker('refresh'); //
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//第一层,查全部
|
|
|
|
|
function initTable() {
|
|
|
|
|
$("#table").bootstrapTable({ // 对应table标签的id
|
|
|
|
|
url: path+"/statistics/getRecordStatistics", // 获取表格数据的url
|
|
|
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|
|
|
|
striped: true, //表格显示条纹,默认为false
|
|
|
|
|
sidePagination: 'server', // 设置为服务器端分页 客户端:client
|
|
|
|
|
toolbar: '#toolbar',//指定工具栏
|
|
|
|
|
searchOnEnterKey: true, //设置为 true时,按回车触发搜索方法,否则自动触发搜索方法
|
|
|
|
|
detailView:true,//是否可展开
|
|
|
|
|
undefinedText: '--', //当数据为 undefined 时显示的字符
|
|
|
|
|
singleSelect: false,//设置True 将禁止多选
|
|
|
|
|
clickToSelect: true,//设置true 将在点击行时,自动选择rediobox 和 checkbox
|
|
|
|
|
searchTimeOut: 500,// 默认500 设置搜索超时时间。
|
|
|
|
|
showHeader: true,//是否显示列头。
|
|
|
|
|
height:550,
|
|
|
|
|
//是否显示导出按钮
|
|
|
|
|
queryParams: function (params) {
|
|
|
|
|
return queryParams(params,this,'');
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return index + 1;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '出院人数',
|
|
|
|
|
field: 'allRecordCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总文件数',
|
|
|
|
|
field: 'allFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总页数',
|
|
|
|
|
field: 'allPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '自动采集总文件数',
|
|
|
|
|
field: 'autoCollectionFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '自动采集总页数',
|
|
|
|
|
field: 'autoCollectionPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '扫描上传总文件数',
|
|
|
|
|
field: 'manualScanFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '扫描上传总页数',
|
|
|
|
|
field: 'manualScanPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'操作',
|
|
|
|
|
align: 'center',
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
var allRecordCount = row.allRecordCount;
|
|
|
|
|
if(allRecordCount != 0){
|
|
|
|
|
return showDetail('2',null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
onLoadSuccess: function (result) { //加载成功时执行
|
|
|
|
|
$(".page-list").show();
|
|
|
|
|
},
|
|
|
|
|
//展开详情事件
|
|
|
|
|
onExpandRow: function (index, row, $detail) {//點擊datagrid 展開按鈕事件
|
|
|
|
|
var html = '<div id="tableDiv1">\n' +
|
|
|
|
|
' <table id="table1" class="table text-nowrap"></table>\n' +
|
|
|
|
|
' </div>';
|
|
|
|
|
$detail.html(html);
|
|
|
|
|
initTable1();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//第二层,按科室分组查
|
|
|
|
|
function initTable1() {
|
|
|
|
|
$("#table1").bootstrapTable({ // 对应table标签的id
|
|
|
|
|
url: path + "/statistics/getRecordStatisticsGroupDept", // 获取表格数据的url
|
|
|
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|
|
|
|
striped: true, //表格显示条纹,默认为false
|
|
|
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|
|
|
|
paginationShowPageGo: true,
|
|
|
|
|
pageList: [10, 20, 50, 100], // 如果设置了分页,设置可供选择的页面数据条数。设置为All 则显示所有记录。
|
|
|
|
|
sidePagination: 'server', // 设置为服务器端分页 客户端:client
|
|
|
|
|
searchOnEnterKey: true, //设置为 true时,按回车触发搜索方法,否则自动触发搜索方法
|
|
|
|
|
detailView: true,//是否可展开
|
|
|
|
|
undefinedText: '--', //当数据为 undefined 时显示的字符
|
|
|
|
|
singleSelect: false,//设置True 将禁止多选
|
|
|
|
|
clickToSelect: true,//设置true 将在点击行时,自动选择rediobox 和 checkbox
|
|
|
|
|
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
|
|
|
|
|
height:514,
|
|
|
|
|
searchTimeOut: 500,// 默认500 设置搜索超时时间。
|
|
|
|
|
showHeader: true,//是否显示列头。
|
|
|
|
|
//查询条件
|
|
|
|
|
queryParams: function (params) {
|
|
|
|
|
return queryParams(params,this,'');
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return index + 1;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '出院科室',
|
|
|
|
|
field: 'deptNameCn',
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '出院人数',
|
|
|
|
|
field: 'allRecordCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总文件数',
|
|
|
|
|
field: 'allFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总页数',
|
|
|
|
|
field: 'allPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '自动采集总文件数',
|
|
|
|
|
field: 'autoCollectionFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '自动采集总页数',
|
|
|
|
|
field: 'autoCollectionPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '扫描上传总文件数',
|
|
|
|
|
field: 'manualScanFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '扫描上传总页数',
|
|
|
|
|
field: 'manualScanPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'操作',
|
|
|
|
|
align: 'center',
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return showDetail('3',row.deptName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
onLoadSuccess: function (result) { //加载成功时执行
|
|
|
|
|
$(".page-list").show();
|
|
|
|
|
//reloadTableHeight("table1");
|
|
|
|
|
},
|
|
|
|
|
//展开详情事件
|
|
|
|
|
onExpandRow: function (index, row, $detail) {//點擊datagrid 展開按鈕事件
|
|
|
|
|
var deptName = row.deptName;
|
|
|
|
|
var tableId = 'table_'+deptName;
|
|
|
|
|
var html = '<div id="tableDiv2">\n' +
|
|
|
|
|
' <table id="'+tableId+'" class="table2" class="table text-nowrap table-bordered"></table>\n' +
|
|
|
|
|
' </div>';
|
|
|
|
|
$detail.html(html);
|
|
|
|
|
initTable2(deptName,tableId);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//第三层,根据科室查询病患详情
|
|
|
|
|
function initTable2(deptName,tableId) {
|
|
|
|
|
$("#"+tableId).bootstrapTable({ // 对应table标签的id
|
|
|
|
|
url: path+"/statistics/getRecordStatisticsByDeptName", // 获取表格数据的url
|
|
|
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|
|
|
|
striped: true, //表格显示条纹,默认为false
|
|
|
|
|
sidePagination: 'server', // 设置为服务器端分页 客户端:client
|
|
|
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|
|
|
|
paginationShowPageGo: true,
|
|
|
|
|
pageList: [10, 20, 50, 100], // 如果设置了分页,设置可供选择的页面数据条数。设置为All 则显示所有记录。
|
|
|
|
|
toolbar: '#toolbar',//指定工具栏
|
|
|
|
|
searchOnEnterKey: true, //设置为 true时,按回车触发搜索方法,否则自动触发搜索方法
|
|
|
|
|
//detailView:true,//是否可展开
|
|
|
|
|
undefinedText: '--', //当数据为 undefined 时显示的字符
|
|
|
|
|
singleSelect: false,//设置True 将禁止多选
|
|
|
|
|
clickToSelect: true,//设置true 将在点击行时,自动选择rediobox 和 checkbox
|
|
|
|
|
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
|
|
|
|
|
height:475,
|
|
|
|
|
searchTimeOut: 500,// 默认500 设置搜索超时时间。
|
|
|
|
|
showHeader: true,//是否显示列头。
|
|
|
|
|
//是否显示导出按钮
|
|
|
|
|
queryParams: function (params) {
|
|
|
|
|
return queryParams(params,this,deptName);
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return index + 1;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '住院号',
|
|
|
|
|
field: 'inpNo',
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '姓名',
|
|
|
|
|
field: 'name',
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '住院次数',
|
|
|
|
|
field: 'visitId',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '出院科室',
|
|
|
|
|
field: 'deptNameCn',
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '出院日期',
|
|
|
|
|
field: 'dischargeDateTime',
|
|
|
|
|
align: 'center',
|
|
|
|
|
formatter: function (value) {
|
|
|
|
|
return operDisDate(value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总文件数',
|
|
|
|
|
field: 'allFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总页数',
|
|
|
|
|
field: 'allPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '自动采集总文件数',
|
|
|
|
|
field: 'autoCollectionFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '自动采集总页数',
|
|
|
|
|
field: 'autoCollectionPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '扫描上传总文件数',
|
|
|
|
|
field: 'manualScanFileCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '扫描上传总页数',
|
|
|
|
|
field: 'manualScanPageCount',
|
|
|
|
|
align: 'center'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
onLoadSuccess: function (result) { //加载成功时执行
|
|
|
|
|
$(".page-list").show();
|
|
|
|
|
//reloadTableHeight("table2");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//各表格查询条件
|
|
|
|
|
function queryParams(params,_this,deptName){
|
|
|
|
|
var currPageSize = _this.pageSize;
|
|
|
|
|
if (currPageSize == 2) {
|
|
|
|
|
currPageSize = 10;
|
|
|
|
|
}
|
|
|
|
|
var limit = null;
|
|
|
|
|
var offset = params.offset;
|
|
|
|
|
//判断是否导出全部all
|
|
|
|
|
if ($("#sel_exportoption").val() == "all") {
|
|
|
|
|
offset = 0;
|
|
|
|
|
limit = _this.totalRows;
|
|
|
|
|
_this.pageSize = limit;
|
|
|
|
|
} else {
|
|
|
|
|
limit = currPageSize;
|
|
|
|
|
_this.pageSize = currPageSize;
|
|
|
|
|
}
|
|
|
|
|
if(deptName == ''){
|
|
|
|
|
deptName = getDeptName();
|
|
|
|
|
}
|
|
|
|
|
var temp = {
|
|
|
|
|
offset:offset,
|
|
|
|
|
limit:limit,
|
|
|
|
|
startDate: $("#startTime1").val(),
|
|
|
|
|
endDate: $("#endTime1").val(),
|
|
|
|
|
deptName:deptName,
|
|
|
|
|
timeInterval:$("#timeInterval").val(),
|
|
|
|
|
name:$("#name").val(),
|
|
|
|
|
inpNo:$("#inpNo").val()
|
|
|
|
|
};
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
//封装展开显示按钮方法
|
|
|
|
|
function showDetail(level,deptName){
|
|
|
|
|
return '<a type="button" onclick="showDetailMethod('+level+','+deptName+')" target="_blank" class="btn btn-primary btn-sm">展开显示</button></a>'}
|
|
|
|
|
//封装展开显示跳转方法
|
|
|
|
|
function showDetailMethod(level,deptName){
|
|
|
|
|
var startDate =$("#startTime1").val();
|
|
|
|
|
var endDate = $("#endTime1").val();
|
|
|
|
|
var timeInterval = $("#timeInterval").val();
|
|
|
|
|
var name = $("#name").val();
|
|
|
|
|
var inpNo = $("#inpNo").val();
|
|
|
|
|
if(deptName == null){
|
|
|
|
|
deptName = getDeptName();
|
|
|
|
|
}
|
|
|
|
|
var urlTemp = url + level + "?deptName="+deptName+"&startDate="+ startDate
|
|
|
|
|
+ "&endDate="+endDate+"&timeInterval="+timeInterval+"&name="+name
|
|
|
|
|
+"&inpNo="+inpNo;
|
|
|
|
|
window.open(urlTemp);
|
|
|
|
|
}
|
|
|
|
|
//查询按钮
|
|
|
|
|
$('#searchBtnStatistics').click(function () {
|
|
|
|
|
$("#isSearch").val(1);
|
|
|
|
|
//查询之后重新从第一页算起
|
|
|
|
|
if (tipLoad == 0) {
|
|
|
|
|
var level = $("#level").val();
|
|
|
|
|
if(level == '1') {
|
|
|
|
|
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
|
|
|
|
|
}else if(level == '2') {
|
|
|
|
|
$("#table1").bootstrapTable("refreshOptions", {pageNumber: 1});
|
|
|
|
|
}else if(level == '3') {
|
|
|
|
|
$("#table2").bootstrapTable("refreshOptions", {pageNumber: 1});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
toastr.warning("正在查询,请稍等...");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//键盘回车查询
|
|
|
|
|
$(document).keyup(function(event){
|
|
|
|
|
if(event.keyCode ==13){
|
|
|
|
|
$("#searchBtnStatistics").trigger("click");
|
|
|
|
|
}
|
|
|
|
|
});
|