<%@ 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" %>
<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>
    <![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;
        }

        .searchDiv2 {
            padding-top: 3%;
            height: 30px;
        }

        .tableDiv {
            width: 100%;
            background-color: #fff;
            margin-left: 1%;
            transform:translateY(8%);/**下移元素**/
            -ms-transform:translateY(8%);
            -webkit-transform:translateY(8%);

        }

        .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;
        }

        /**批准驳回按钮组*/
        .approveBtns {
            margin-left: 110px;
        }

        /*模态框头*/
        .modal-header {
            background-color: #199ED8;
            text-align: center;
        }
    </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="applyerSearch" 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="searchInput left">
                <div class="searchElement left">
                    <label class="labelDiv">申请天数：</label>
                </div>
                <div class="searchInputElement left">
                    <input type="number" class="form-control input-sm" id="effeDaysSearch"
                           oninput="if(value.length>4)value=value.slice(0,4)">
                </div>
            </div>
            <div class="searchInput left">
                <div class="searchElement left">
                    <label class="labelDiv">姓名：</label>
                </div>
                <div class="searchInputElement left">
                    <input type="test" class="form-control input-sm" id="searchName" maxlength="16">
                </div>
            </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="searchApproveState">
                        <option value="">请选择</option>
                        <option value="待审批" <c:if test="${flag == 1}">selected</c:if>>待审批</option>
                        <option value="审核通过">审核通过</option>
                        <option value="审核不通过">审核不通过</option>
                        <option value="已过期">已过期</option>
                    </select>
                </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="startTime2" placeholder="开始时间"
                           autocomplete="off">
                </div>
                <div class="dateSearchInput left">
                    <input type="text" class="form-control input-sm" id="endTime2" placeholder="结束时间"
                           autocomplete="off">
                </div>
            </div>
            <div class="searchInput left">
                <div class="searchElement left">
                    <label class="labelDiv">审批人：</label>
                </div>
                <div class="searchInputElement left">
                    <input type="text" class="form-control input-sm" id="approver" maxlength="16">
                </div>
            </div>
            <div class="btnsDiv">
                <button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
            </div>
        </div>
        <div class="searchDiv2">
            <div class="btnsDiv">
                <shiro:hasPermission name="/approve/updateApprove">
                    <button id="addApprovesMore" type="button" class="btn btn-sm btn-warning"
                            onclick="addApprovesMore()">批量审批
                    </button>
                </shiro:hasPermission>
                <shiro:hasPermission name="/approve/exportExcelApproveList">
                    <button type="button" class="btn btn-sm btn-primary" onclick="exportExcel()"><i
                            class="fa fa-reply"></i>导出
                    </button>
                </shiro:hasPermission>
                <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>
            </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="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabe1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content" style="width:80%">
            <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" style="height:600px">
                <form class="form-horizontal" id="form1">
                    <input type="hidden" id="approveId" name="id">
                    <input type="hidden" id="approveState" name="approveState">
                    <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" readonly id="applyer"
                                       maxlength="16">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row" style="Display:none">
                        <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="effeTime" name="effeTime"
                                       autocomplete="off">
                            </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="number" class="form-control input-sm input" id="effeDays" name="effeDays"
                                       oninput="if(value.length>4)value=value.slice(0,4)">
                            </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">
                                <select class="form-control input-sm input" id="applyType" readonly>
                                </select>
                            </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">
                                <textarea class="form-control input-sm input" id="applyReason" readonly
                                          maxlength="250"></textarea>
                            </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">
                                <select class="form-control input-sm input" id="parentId" name="parentId">
                                </select>
                            </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">
                                <textarea class="form-control input-sm input" id="approveNotes" name="approveNotes"
                                          maxlength="250"></textarea>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label collectLabel">病案号：</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control input-sm input" readonly id="inpatientNo"
                                       maxlength="16">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label collectLabel">患者姓名：</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control input-sm input" readonly id="name"
                                       maxlength="16">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label collectLabel">住院次数：</label>
                            <div class="col-sm-7">
                                <input type="number" class="form-control input-sm input" readonly id="admissTimes"
                                       oninput="if(value.length>4)value=value.slice(0,4)">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="">
                        <button type="button" class="btn btn-sm btn-primary approveBtns" onclick="add(1)">批准</button>
                        <button type="button" class="btn btn-sm btn-danger approveBtns" onclick="add(2)">驳回</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<%-- 模态框2 批量审批--%>
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabe2" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content" style="width:80%">
            <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" style="height:700px">
                <form class="form-horizontal" id="form2">
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">批注模板：</label>
                            <div class="col-sm-7">
                                <select class="form-control input-sm input" id="moreParentId" name="parentId">
                                </select>
                            </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">
                                <textarea class="form-control input-sm input" id="moreApproveNotes" name="approveNotes"
                                          maxlength="250"></textarea>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="">
                        <button type="button" class="btn btn-sm btn-primary approveBtns" onclick="moreAdd(1)">批准
                        </button>
                        <button type="button" class="btn btn-sm btn-danger approveBtns" onclick="moreAdd(2)">驳回
                        </button>
                    </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>
    </div>
</div>
<!-- 模态框3修改过有效日期（Modal） -->
<div class="modal fade" id="myModal3" 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">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    确认是否修改申请者的有效日期
                </h4>
            </div>
            <div class="modal-body">
                有效日期有改动,请确认是否修改
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="saveMethod('y')">
                    确认修改
                </button>
                <button type="button" class="btn btn-primary" onclick="saveMethod('n')">
                    取消修改
                </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>
                        <select class="form-control" id="applyTypeBorrowing" name="applyTypeBorrowing">
                        </select>
                        <div class="col-sm-1"></div>
                    </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>
    $(function () {
        $(".modal-dialog").draggable();//为模态对话框添加拖拽
    })
</script>
<script src="${path}/static/js/approveManage/approveManageList/approveManageList174.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>
