382 lines
16 KiB
Plaintext
382 lines
16 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single{
|
||
height:34px;
|
||
line-height: 34px;
|
||
}
|
||
.select2-selection__arrow{
|
||
margin-top:3px;
|
||
}
|
||
</style>
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||
<!-- 文件上传-->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||
<!-- 引入daterangepicker-->
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css" />
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript">
|
||
function getNowFormatDate() {
|
||
var date = new Date();
|
||
var seperator1 = "-";
|
||
var seperator2 = ":";
|
||
var month = date.getMonth() + 1;
|
||
var strDate = date.getDate();
|
||
var hour = date.getHours();
|
||
var minute = date.getMinutes();
|
||
var second = date.getSeconds();
|
||
if (month >= 1 && month <= 9) {
|
||
month = "0" + month;
|
||
}
|
||
if (strDate >= 0 && strDate <= 9) {
|
||
strDate = "0" + strDate;
|
||
}
|
||
if (hour >= 0 && hour <= 9) {
|
||
hour = "0" + hour;
|
||
}
|
||
if (minute >= 0 && minute <= 9) {
|
||
minute = "0" + minute;
|
||
}
|
||
if (second >= 0 && second <= 9) {
|
||
second = "0" + second;
|
||
}
|
||
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
||
+ " " + hour + seperator2 + minute
|
||
+ seperator2 + second;
|
||
return currentdate;
|
||
}
|
||
//----------------------------------------------------------------------------------------------------------------------
|
||
var beginTimeStore2 = '';
|
||
var endTimeStore2 = '';
|
||
|
||
function paramsMatter(value, row, index) {
|
||
var values = row.memo;
|
||
var span=document.createElement('span');
|
||
span.setAttribute('title',values);
|
||
span.innerHTML = row.memo;
|
||
return span.outerHTML;
|
||
}
|
||
function initDate2() {
|
||
//定义locale汉化插件
|
||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||
var locale = {
|
||
"format" : 'YYYY-MM-DD',
|
||
"separator" : " ~ ",
|
||
"applyLabel" : "确定",
|
||
"cancelLabel" : "取消",
|
||
"fromLabel" : "起始时间",
|
||
"toLabel" : "结束时间'",
|
||
"customRangeLabel" : "自定义",
|
||
"weekLabel" : "W",
|
||
"daysOfWeek" : [ "日", "一", "二", "三", "四", "五", "六" ],
|
||
"monthNames" : [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||
"九月", "十月", "十一月", "十二月" ],
|
||
"firstDay" : 1
|
||
};
|
||
$('#reservationtime2').daterangepicker(
|
||
{
|
||
"timePicker" : false,
|
||
"timePicker24Hour" : false,
|
||
"linkedCalendars" : false,
|
||
"autoUpdateInput" : false,
|
||
"timePickerIncrement" : 10,
|
||
"locale" : locale,
|
||
//汉化按钮部分
|
||
ranges : {
|
||
'今日' : [ moment(), moment().subtract(-1, 'days') ],
|
||
'昨日' : [ moment().subtract(1, 'days'), moment() ],
|
||
'最近7日' : [ moment().subtract(6, 'days'),
|
||
moment().subtract(-1, 'days') ],
|
||
'本月' : [ moment().startOf('month'),
|
||
moment().endOf('month').subtract(-1, 'days') ],
|
||
'上月' : [
|
||
moment().subtract(1, 'month').startOf('month'),
|
||
moment().subtract(1, 'month').endOf('month')
|
||
.subtract(-1, 'days') ]
|
||
},
|
||
startDate : beginTimeStore2,
|
||
endDate : endTimeStore2
|
||
},
|
||
function(start, end, label) {
|
||
beginTimeStore2 = start.format(this.locale.format);
|
||
endTimeStore2 = end.format(this.locale.format);
|
||
if (!this.startDate) {
|
||
this.element.val('');
|
||
|
||
} else {
|
||
this.element.val(this.startDate
|
||
.format(this.locale.format)
|
||
+ this.locale.separator
|
||
+ this.endDate.format(this.locale.format));
|
||
}
|
||
});
|
||
$('#reservationtime2').val(
|
||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||
};
|
||
//----------------------------------------------------------------------------
|
||
var addFun = function() {
|
||
var time = getNowFormatDate();
|
||
$.post(ext.contextPath + '/report/RptDayLog/checkRptdt.do',{unitId:unitId,rptdt:time,rptdeptId:'${param.rptdeptId}'}, function(data) {
|
||
$("#rptDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
var editRptDayLogFun = function(id) {
|
||
$.post(ext.contextPath + '/report/RptDayLog/doaudit.do',{id:id,unitId:unitId,rptdeptId:'${param.rptdeptId}'}, function(data) {
|
||
$("#rptDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
|
||
var viewRptDayLogFun = function (id) {
|
||
$.post(ext.contextPath + '/report/RptDayLog/doview.do', {
|
||
id: id,
|
||
unitId: unitId,
|
||
rptdeptId: '${param.rptdeptId}'
|
||
}, function (data) {
|
||
$("#rptDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
//导入数据填报
|
||
function importFun(){
|
||
var companyId = unitId;
|
||
$.post(ext.contextPath + '/report/RptDayLog/importRptDayLog.do', {rptdeptId:'${param.rptdeptId}'} , function(data) {
|
||
$("#fileInputDiv").html(data);
|
||
openModal('fileInputModel');
|
||
});
|
||
// }
|
||
}
|
||
//导出模板
|
||
function downloadFun() {
|
||
|
||
window.open(ext.contextPath + "/report/RptDayLog/downloadExcel.do?unitId="+unitId
|
||
+"&rptdeptId="+'${param.rptdeptId}');
|
||
//}
|
||
}
|
||
|
||
var onekeyAudit = function() {
|
||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||
var datas="";
|
||
$.each(checkedItems, function(index, item){
|
||
datas+=item.id+",";
|
||
});
|
||
if(datas==""){
|
||
showAlert('d','请先选择记录','mainAlertdiv');
|
||
}else{
|
||
swal({
|
||
text: "您确定要通过这些记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function(willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/report/RptDayLog/onekeyAudit.do', {ids:datas} , function(data) {
|
||
if(data.code>0){
|
||
$("#table").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','审核失败','mainAlertdiv');
|
||
}
|
||
},'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
var dosearch = function() {
|
||
$("#table").bootstrapTable('refresh');
|
||
};
|
||
|
||
$(function() {
|
||
|
||
$("#table").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/report/RptDayLog/getlist.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1,
|
||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
useRowAttrFunc: true,
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
var rpt_sdt = $("#rpt_sdt").val();
|
||
var rpt_edt = $("#rpt_edt").val();
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||
sort: 'rptdt', // 要排序的字段
|
||
order: 'desc',
|
||
unitId: unitId,
|
||
rptdeptId: '${param.rptdeptId}',
|
||
stdt: rpt_sdt,
|
||
eddt: rpt_edt,
|
||
view:'1',
|
||
}
|
||
},
|
||
sortName: 'rptdt', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||
//viewFun(row.id);
|
||
},
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
}, {
|
||
field: 'rptdt', // 返回json数据中的name
|
||
title: '日期', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 200,
|
||
// width: '20%'
|
||
}, {
|
||
field: '_insuser', // 返回json数据中的name
|
||
title: '填报人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 200,
|
||
// width: '18%',
|
||
formatter: function (value, row, index) {
|
||
return row.user.caption;
|
||
}
|
||
}, {
|
||
field: 'insdt', // 返回json数据中的name
|
||
title: '填报时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 200,
|
||
// width: '18%',
|
||
formatter: function (value, row, index) {
|
||
return value.substring(0,19);
|
||
}
|
||
}, {
|
||
field: 'status', // 返回json数据中的name
|
||
title: '填报状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
width: 200,
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'checkuser', // 返回json数据中的name
|
||
title: '审核人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 200,
|
||
formatter: function (value, row, index) {
|
||
if(value!=null && value!=''){
|
||
return row._checkuser.caption;
|
||
}else{
|
||
return value;
|
||
}
|
||
}
|
||
}, {
|
||
field: 'checkdt', // 返回json数据中的name
|
||
title: '审核时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 200,
|
||
formatter: function (value, row, index) {
|
||
return value.substring(0,19);
|
||
}
|
||
}, {
|
||
field: 'memo', // 返回json数据中的name
|
||
title: '备注', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 300,
|
||
cellStyle: function (value, row, index, field) {
|
||
return {
|
||
css: {
|
||
"min-width": "150px",
|
||
"white-space": "nowrap",
|
||
"text-overflow": "ellipsis",
|
||
"overflow": "hidden",
|
||
"max-width":"300px"
|
||
}
|
||
}
|
||
},
|
||
formatter: paramsMatter
|
||
}, {
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 160, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts = '';
|
||
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewRptDayLogFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
|
||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("table");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
|
||
createDatetimepickerTwo('rpt_sdt','rpt_edt','${rptDeptSet.dateType}');
|
||
});
|
||
</script>
|
||
<div class="box box-primary" style="margin-bottom:0px;">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">浏览</h3>
|
||
|
||
<div class="box-tools pull-right">
|
||
<!-- <a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a> -->
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<div id="mainAlertdiv"></div>
|
||
<div id="rptDiv"></div>
|
||
<div id="fileInputDiv"></div>
|
||
|
||
<div class="row" style="margin-bottom:5px;">
|
||
<div class="col-lg-7">
|
||
</div>
|
||
<div class="col-lg-5">
|
||
<div class="input-group input-group-sm">
|
||
<div class="input-group-addon">时间范围:</div>
|
||
<input type="text" class="form-control" id="rpt_sdt" name ="rpt_sdt" value="" readOnly>
|
||
<div class="input-group-addon">至</div>
|
||
<input type="text" class="form-control" id="rpt_edt" name ="rpt_edt" value="" readOnly>
|
||
<span class="input-group-btn">
|
||
<a class="btn btn-default" onclick="dosearch();" ><i class="fa fa-search"></i> 搜索</a>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<table id="table" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||
</div>
|
||
</div>
|