<%@ 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" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<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>
   <link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css" type="text/css">
    <link href="${path}/static/bootstrap-3.3.7/bower_components/select2/dist/css/select2.min.css" rel="stylesheet"/>
    <script type="text/javascript"
            src="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js?time=2019-12-25"></script>
    <script type="text/javascript" src="${path}/static/js/pinying.js"></script>
    <script src="${path}/static/bootstrap-3.3.7/bower_components/select2/dist/js/select2.min.js"></script>
    <![endif]-->
    <script>
        var path = "${path}";
    </script>
    <style type="text/css">
        .mainDiv {
            background-color: #fff;
        }


        /**搜索区*/
        .searchDiv {
            padding-top: 1%;
            height: 30px;
        }

        .searchDiv1 {
            padding-top: 2%;
            height: 30px;
        }

        .tableDiv {
            width: 100%;
            background-color: #fff;
            margin-left: 1%;
        }

        .dateSearchDiv {
            width: 29%;
        }

        .dateSearchInput {
            width: 30%;
            margin-left: 3%;
        }

        .dateLabelDiv {
            width: 30%;
            text-align: right;
        }

        .searchInput {
            width: 22%;
        }

        .searchElement {
            width: 40%;
        }

        .searchInputElement {
            width: 60%;
            text-align: right;
        }

        .labelDiv {
            padding-top: 4%;
            margin-left: 2%;
        }

        /**查询按钮组*/
        .btnsDiv {
            height: 5%;
        }

        .btn {
            margin-right: 5px;
            margin-left: 10px;
        }

    </style>
</head>
<body>
<input type="hidden" id="checks">
<div class="main">
    <div class="headDiv">
        <div class="headSpanDiv">
             <span class="headspan">
                借阅详情
            </span>
        </div>
    </div>
    <div class="mainDiv">
        <!--搜索区-->
        <div class="searchDiv">
            <div class="searchInput left" style="margin-left: 10px;">
                <div class="searchElement left">
                    <label class="labelDiv">病案号：</label>
                </div>
                <div class="searchInputElement left">
                    <input type="test" class="form-control input-sm" id="inpatientNo" maxlength="16">
                </div>
            </div>
            <div class="searchInput left" style="margin-left: 10px;">
                <div class="searchElement left">
                    <label class="labelDiv">住院次数：</label>
                </div>
                <div class="searchInputElement left">
                    <input type="test" class="form-control input-sm" id="admissTimes" maxlength="16">
                </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="btnsDiv">
                <button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
                <button type="button" class="btn btn-sm btn-primary" onclick="empty()">清空</button>
                <button class="btn btn-sm btn-warning btns" id="borrowings" data-toggle="modal"
                        data-target="#borrowingModal" onclick="addApprovesMore()">批量添加
                </button>
            </div>
        </div>
        <div class="searchDiv1">
            <div class="searchInput left" style="margin-left: 10px;">
                <div class="searchElement left">
                    <label class="labelDiv">出院科室：</label>
                </div>
                <div class="searchInputElement left">
                    <select class="form-control input-sm" id="dis_dept">
                    </select>
                </div>
            </div>
        </div>
        <div id="tableDiv" class="table-responsive tableDiv">
            <table id="mytab" class="table text-nowrap table-bordered">
            </table>
        </div>
    </div>
</div>

<!-- 模态框1（Modal）借阅申请 -->
<div class="modal fade" id="borrowingModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    <font size="30">&times;</font>
                </button>
                <h4 class="modal-title" style="font-weight: bold">
                    申请信息
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form">
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">申请天数：</label>
                            <div class="col-sm-7">
                                <input type="number" class="form-control input-sm input" id="effeDays"
                                       name="effeDays">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">申请类型：</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control input-sm input" id="applyFlag"
                                       name="applyFlag" ovalue="1" placeholder="借阅申请" readonly="readonly">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">申请理由：</label>
                            <div class="col-sm-7">
                                    <textarea class="form-control input-sm  input" id="applyReason" name="applyReason"
                                              maxlength="250"></textarea>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                </form>
                <div id="tabDiv" style="height: 490px;overflow: auto;">
                    <table id="moreApproveTable" class="table table-striped" bgcolor="#FFFAFA" border="0"
                           cellspacing="0" cellpadding="0">
                        <caption>所选批量申请借阅信息</caption>
                        <thead>
                        <tr>
                            <th>病案号</th>
                            <th>姓名</th>
                            <th>住院次数</th>
                            <th>出院科室</th>
                        </tr>
                        </thead>
                        <tbody id="moreApproveBody">

                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">
                    关闭
                </button>
                <button type="button" class="btn btn-sm btn-primary" onclick="add()">
                    确认提交
                </button>
            </div>
        </div>
    </div>
</div>


<%--------------------------------------------------------------------------<申请借阅列表>-------------------------------------------------------%>


<div class="main">
    <div class="headDiv">
        <div class="headSpanDiv">
             <span class="headspan">
                申请借阅列表
            </span>
        </div>
    </div>
    <div class="mainDiv">
        <!--搜索区-->
        <div class="searchDiv">
            <div class="searchInput left" style="margin-left: 10px;">
                <div class="searchElement left">
                    <label class="labelDiv">病案号：</label>
                </div>
                <div class="searchInputElement left">
                    <input type="test" class="form-control input-sm" id="inpatientNo1" maxlength="16">
                </div>
            </div>
            <!--操作区-->
            <div class="btnsDiv">
                <button type="button" class="btn btn-sm btn-primary" onclick="refreshBorrowingTab()">查询</button>
                <button type="button" class="btn btn-sm btn-primary" onclick="borrowingEmpty()">清空</button>
                <shiro:hasPermission name="/approve/updateReturn">
                    <button class="btn btn-sm btn-warning btns" data-toggle="modal" data-target="#myModal">快速归还
                    </button>
                </shiro:hasPermission>
                <shiro:hasPermission name="/approve/updateReturn">
                    <button class="btn btn-sm btn-warning btns" data-toggle="modal" data-target="#myBorrowing">快速借阅
                    </button>
                </shiro:hasPermission>
                <button class="btn btn-sm btn-warning btns" id="addApprove" data-toggle="modal"
                        data-target="#approveModal" onclick="batchApprove()">批量审核
                </button>
            </div>
        </div>
        <div id="borrowingDiv" class="table-responsive tableDiv">
            <table id="borrowingTab" class="table text-nowrap table-bordered">
            </table>
        </div>
    </div>
</div>


<!-- 模态框2（Modal）批量审核申请 -->
<div class="modal fade" id="approveModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    <font size="30">&times;</font>
                </button>
                <h4 class="modal-title" style="font-weight: bold">
                    审核信息
                </h4>
            </div>
            <div class="modal-body">
                <div id="approveTabDiv" style="height: 490px;overflow: auto;">
                    <table id="approveTable" class="table table-striped" bgcolor="#FFFAFA" border="0" cellspacing="0"
                           cellpadding="0">
                        <caption>所选批量审核信息</caption>
                        <thead>
                        <tr>
                            <th>病案号</th>
                            <th>姓名</th>
                            <th>住院次数</th>
                            <th>申请天数</th>
                        </tr>
                        </thead>
                        <tbody id="approveBody">

                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">
                    关闭
                </button>
                <button type="button" class="btn btn-sm btn-primary" onclick="addApprove()">
                    确认提交
                </button>
            </div>
        </div>
    </div>
</div>


<%--快速归还弹窗--%>
<div class="modal fade" id="myModal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    <font size="30">&times;</font>
                </button>
                <h4 class="modal-title" style="font-weight: bold">
                    快速归还
                </h4>
            </div>
            <div class="modal-body">
                <form onsubmit="return false;" id="barCodeReturnTable">
                    <div class="form-group">
                        <label class="col-form-label">归还人:</label>
                        <input type="text" autofocus class="form-control" id="barCodeName">
                    </div>
                    <div class="form-group">
                        <label class="col-form-label">条形码:</label>
                        <input type="text" autofocus class="form-control" id="barCodeReturn">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="emptyForm()">取消</button>
                <button type="button" class="btn btn-primary" onclick="updateReturn()">确定</button>
            </div>
        </div>
    </div>
</div>


<%--快速借阅弹窗--%>
<div class="modal fade" id="myBorrowing" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    <font size="30">&times;</font>
                </button>
                <h4 class="modal-title" style="font-weight: bold">
                    快速借阅
                </h4>
            </div>
            <div class="modal-body">
                <form onsubmit="return false;" id="borrowingTable">
                    <div class="form-group">
                        <label class="col-form-label">申请天数:</label>
                        <input type="text" autofocus class="form-control" id="effeDaysBorrowing">
                    </div>
                    <div class="form-group">
                        <label class="col-form-label">申请类型：</label>
                        <input type="text" class="form-control input-sm input" id="applyTypeBorrowing"
                               name="applyTypeBorrowing" ovalue="2" placeholder="纸质申请" readonly="readonly">
                    </div>
                    <div class="form-group">
                        <label class="col-form-label">申请理由:</label>
                        <input type="text" autofocus class="form-control" id="applyReasonBorrowing">
                    </div>
                    <div class="form-group">
                        <label class="col-form-label">申请人工号:</label>
                        <input type="text" autofocus class="form-control" id="applyUserName">
                    </div>
                    <div class="form-group">
                        <label class="col-form-label">条形码:</label>
                        <input type="text" autofocus class="form-control" id="barCodeBorrowing">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="emptyBorrowingForm()">取消
                </button>
                <button type="button" class="btn btn-primary" onclick="fastBorrowing()">确定</button>
            </div>
        </div>
    </div>
</div>


<script src="${path}/static/js/batchApply/batchApplyDetails.js?t=2021-08-20"></script>
<script src="${path}/static/js/commom.js"></script>
<script src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js"></script>
<script src="${path}/static/js/dateUtil.js"></script>
</body>
</html>
