Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/report/rptDayLogList.jsp
2026-01-16 14:13:44 +08:00

352 lines
15 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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;
}
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;
}
var addFun = function () {
var time = getNowFormatDate();
$.post(ext.contextPath + '/report/RptDayLog/doadd.do', {
unitId: unitId,
rptdt: time,
rptdeptId: '${param.rptdeptId}'
}, function (data) {
$("#rptDiv").html(data);
openModal('subModal');
});
};
var editRptDayLogFun = function (id) {
$.post(ext.contextPath + '/report/RptDayLog/doedit.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 deletesFun = function () {
var checkedItems = $("#table").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems, function (index, item) {
if (item.status == "未提交" || item.status == "已退回") {
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/dodeletes.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,
}
},
sortName: 'rptdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
onClickRow: function (row) {//单击行事件,执行查看功能
//viewFun(row.id);
},
columns: [
{
checkbox: true, // 显示一个勾选框
formatter: function (value, row, index) {
if (row.status == "未提交" || row.status == "已退回") {
return { disabled: false,}
} else {
return { disabled: 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,
formatter: function (value, row, index) {
return row.user.caption;
}
}, {
field: 'insdt', // 返回json数据中的name
title: '填报时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: 200,
formatter: function (value, row, index) {
return value.substring(0,19);
}
}, {
field: 'status', // 返回json数据中的name
title: '填报状态', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: 200,
}, {
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 = '';
if (row.status == "未提交" || row.status == "已退回" || row.status == "已审核" || row.status == "已提交") {
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editRptDayLogFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
}else{
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">${rptDeptSet.name}</h3>
<div class="box-tools pull-right">
</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 class="btn-group btn-group-sm" role="group" aria-label="...">
<a type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i>新增</a>
<a type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa-trash-o"></i>删除</a>
<a type="button" class="btn btn-default" onclick="importFun();"><i class="fa fa-cloud-upload"></i>导入</a>
<a type="button" class="btn btn-default" onclick="downloadFun();"><i class="fa fa-cloud-download"></i>下载模板</a>
</div>
</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"></table>
<%-- <table id="table" style="table-layout:fixed; word-break:break-all"></table>--%>
</div>
</div>