<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<title>我的借阅单</title>
|
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
|
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
|
<link href="static/styles/initialize.css" rel="stylesheet" type="text/css">
|
<link href="static/styles/common.css" rel="stylesheet" type="text/css">
|
<link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
|
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
|
<script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
|
<script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
|
<!-- 弹窗加载组件 -->
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
|
<script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
|
<!-- wcp组件 -->
|
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
|
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
|
|
<style>
|
/* .panel-body{border:0 none;} */
|
.tabs-header, .tabs-tool {
|
background-color: #fff;
|
}
|
|
.textbox {
|
margin-top: 3px;
|
}
|
</style>
|
</head>
|
|
<body>
|
<div class="pt-main-top clear">
|
<div class="pt-nav">
|
<span class="pt-title-icon"><i class="fa fa-language"></i></span>
|
<div class="pt-title">
|
<div>
|
<h4>个人利用记录</h4>
|
</div>
|
</div>
|
</div>
|
<div class="pt-search">
|
<p class="pt-retrieval">
|
<input id="txtKeySearch" type="text" placeholder="请输入借阅编码/借阅人搜索">
|
<button id="btnKeySearch">
|
<i class="fa fa-search"></i>
|
</button>
|
</p>
|
<input class="easyui-combobox" id="flowState"
|
data-options="
|
panelHeight: 'auto',
|
valueField: 'label',
|
textField: 'value',
|
editable: false,
|
width:100,
|
data: [{
|
label: '-2',
|
value: '所有的',
|
selected: true
|
},
|
{
|
label: '0',
|
value: '流程中'
|
},{
|
label: '1',
|
value: '已结束'
|
},{
|
label: '-1',
|
value: '已终止'
|
}]"/>
|
|
</div>
|
</div>
|
<div class="pt-form-inline">
|
<div id="right">
|
<div>
|
<table id="tb_borrowForm" style="width:100%;">
|
</table>
|
</div>
|
</div>
|
</div>
|
</body>
|
|
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
|
<script>
|
$(function () {
|
$("#flowState").combobox({
|
onChange: function (n, o) {
|
getMyBorrowFormList(n);
|
}
|
});
|
//绑定关键字检索输入框回车事件
|
$("#btnKeySearch").click(function () {
|
SearchKey();
|
});
|
|
//关键字检索按钮事件
|
$('#txtKeySearch').bind('keypress', function (event) {
|
if (event.keyCode == "13") {
|
SearchKey();
|
}
|
});
|
})
|
|
//关键字搜索方法
|
function SearchKey() {
|
var keyValue = $("#txtKeySearch").val();
|
$('#tb_borrowForm').datagrid('load', {
|
searchText: keyValue
|
});
|
}
|
|
//删除借阅单
|
function deleteBorrowForm() {
|
//获取dg选中的数据行
|
var checkRows = $("#tb_borrowForm").datagrid("getChecked");
|
if (checkRows.length == 0) {
|
wcp.message.info("请选择需要删除的数据!");
|
} else {
|
var ids = new Array();
|
$.each(checkRows, function (index, value) {
|
ids.push(value.formId);
|
});
|
wcp.ui.setBusy("body", wcp.ajax({
|
url: "borrow/deleteBorrowForm",
|
data: JSON.stringify(ids),
|
}).done(function (result) {
|
wcp.notify.success('删除成功!');
|
$('#tb_borrowForm').datagrid('reload');
|
}));
|
}
|
}
|
|
//根据状态获取申请单列表
|
function getMyBorrowFormList(flowState) {
|
var url = 'borrow/getMyBorrowFormList?flowState=' + flowState;
|
$("#tb_borrowForm").datagrid({
|
rownumbers: true,
|
fitColumns: true,
|
method: "get",
|
checkOnSelect: false,
|
selectOnCheck: false,
|
pagination: true,
|
sortOrder: 'desc',
|
sortName: "form_id",
|
url: url,
|
toolbar: "#toolbar_form",
|
emptyMsg: "没有找到匹配的记录",
|
idField: "formId",
|
columns: [[
|
{
|
field: 'ck',
|
checkbox: true
|
},
|
{
|
field: 'applyCode',
|
title: '借阅单编号',
|
width: 100,
|
sortable: true
|
},
|
|
{
|
field: 'borrowUserName',
|
title: '借阅人名称',
|
width: 100,
|
sortable: true
|
},
|
{
|
field: 'borrowTel',
|
title: '借阅人手机号',
|
width: 100,
|
sortable: true
|
},
|
{
|
field: 'borrowDate',
|
title: '借阅日期',
|
width: 100
|
},
|
{
|
field: 'flowStep',
|
title: '当前步骤信息',
|
width: 100
|
}
|
]]
|
, onClickRow: function (rowIndex, rowData) {
|
var pageUrl = "borrow/borrowForm?formId=" + rowData.formId;
|
if (top.addPanel) {
|
top.addPanel(pageUrl, "我的借阅单" + rowData.formId);
|
var curTabWin = null;
|
var curTab = top.$('#tt').tabs('getSelected');
|
if (curTab && curTab.find('iframe').length > 0) {
|
curTabWin = curTab.find('iframe')[0].contentWindow;
|
//将回调函数传给子页面
|
$(curTabWin).load(function () {
|
if (curTabWin.params) {
|
//将回调函数传给子页面
|
//if(ids){
|
// curTabWin.params.ids = ids;
|
//}
|
curTabWin.params.callBack = refreshData;
|
}
|
});
|
}
|
} else {
|
window.open(pageUrl);
|
}
|
}
|
, rowStyler: function (index, row) {
|
var curDate = new Date();
|
var currentDate = getNowFormatDate(curDate);
|
var utilizationValidDate = new Date(row.utilizationValidDate);
|
var uvd = getNowFormatDate(utilizationValidDate);
|
var backDate = utilizationValidDate.setDate(utilizationValidDate.getDate() - 3);
|
var currentBackDate = getNowFormatDate(new Date(backDate));
|
var color = "";
|
if (row.originalBorrow == 1 && row.state == 0 && row.flowState == 1 && uvd >= currentDate && currentDate >= currentBackDate) {
|
color = 'background-color:#FFF8DC;';
|
}
|
if (row.originalBorrow == 1 && row.state == 0 && row.flowState == 1 && uvd <= currentDate) {
|
color = "background-color:red;";
|
}
|
return color;
|
}
|
, onLoadSuccess: function (data) {
|
$('#tb_borrowForm').datagrid('clearChecked');
|
}
|
})
|
}
|
|
function getNowFormatDate(date) {
|
var seperator1 = "-";
|
var year = date.getFullYear();
|
var month = date.getMonth() + 1;
|
var strDate = date.getDate();
|
if (month >= 1 && month <= 9) {
|
month = "0" + month;
|
}
|
if (strDate >= 0 && strDate <= 9) {
|
strDate = "0" + strDate;
|
}
|
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
return currentdate;
|
}
|
|
//刷新表格数据
|
function refreshData() {
|
$('#tb_borrowForm').datagrid('reload');
|
}
|
|
</script>
|
</html>
|