﻿﻿
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%
    ResourceBundle res = ResourceBundle.getBundle("config.jdbc");
%>
<html>
<head>
    <title>病案室终审</title>
    <meta http-equiv="Content-Type"  content="text/html;charset=utf-8">
    <meta name="referrer" content="never">
    <!-- 解决部分兼容性问题，如果安装了GCF，则使用GCF来渲染页面，如果未安装GCF，则使用最高版本的IE内核进行渲染。 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <!-- 页面按原比例显示 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%@include file="../../jspf/comm.jspf" %>
    <%@include file="../../jspf/ztreeCommom.jsp" %>
    <script type="text/javascript"
            src="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js?time=2019-12-25"></script>
    <link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css" type="text/css">
    <style>
        .modal-header2 {
            height: 30px;
            text-align: center !important;
            vertical-align: middle !important;
            background-color: #3c8dbc !important;
            color: #fff;
            font-size: 16px;
            font-weight: bold;
            padding: 5px 5px 5px 5px !important;
        }

        .modal-footer {
            padding: 5px;
        }

        .divCss {
            margin-top: 5px;
        }

        .divCss2 {
            margin-top: 5px;
            margin-left: 20px;
        }

        .divCss8 {
            margin-top: 5px;
            margin-right: 20px;
        }

        .divCss3 {
            margin-top: 5px;
            margin-left: 20px;
            color: blue;
        }

        .divCss7{
            margin-top: 15px;
            margin-left: 0px;
        }

        .modal-content {
            width: calc(210%); /*width: 1300px;*/
            overflow-x: hidden;
            overflow-y: auto;
        }

        .modal {
            margin-left: -45%;
            overflow-x: auto;
            /*z-index: 1049;*/
        }

        .divCss4 {
            border-top: 1px solid #e5e5e5;
            width: 97.5%;
            margin-top: 10px;
            margin-bottom: 5px;
            color: blue;
            margin-left: 20px;
        }


        #wzContent {
            margin-left: 30px;
            margin-right: 30px;
            /*height: 60px;*/
            overflow-x: hidden;
            overflow-y: hidden;
        }

        .labCss {
            /*color: gainsboro;*/
            color: #c1c3c4;
        }

        .titleCss {
            text-align: left;
            vertical-align: middle;
            background-color: #3c8dbc;
            color: #fff;
            font-size: 19px;
            font-weight: bold;
            height: 30px;
            margin-bottom: 10px;
        }

        .treeBtn1 {
            margin-top: 10px;
            margin-right: 10px;
            width: 42%;
        }

        .treeBtn {
            margin-top: 10px;
            margin-left: 10px;
            margin-right: 10px;
            width: 42%;
        }

        #key {
            width: 70%;
        !important;
        }

        #searchBtn1 {
            width: 20%;
        !important;
        }

        .zTreeDemo {
            height: auto;
            min-height: 350px;
            margin-left: -10px;
        }

        #ztree{
            overflow-x: hidden;
            overflow-y: auto;
            max-height: calc(60vh );
        !important;
        }

        .toolbarCss {
            margin-right: 20px;
            margin-bottom: 0px;
        !important;
        }

        .fixed-table-toolbar .bs-bars .pull-right {
            height: 20px;
        !important;
        }

        #maxImg > div > div {
            width: calc(210%);
        }


        #delPdfPageModal .modal-header2 {
            width: calc(210%); /*margin-left:-15%;*/
        }

        #delPdfPageModal .modal-content {
            width: calc(210%); /*margin-left:-15%;*/
            height: calc(100vh - 100px);
            overflow: hidden;
        !important;
        }

        #signModal .modal-content {
            margin-left: calc(60%);
            width: 500px; /*width: 1300px;*/
            overflow: hidden;
        }
        #archiveIdSign{
            margin-left:8px;
            width: 450px;
        }

        #infoDiv {
            width: 18%;
            height: 98%;
            float: right;
            overflow-y: hidden;
            overflow-x: hidden;
        }

        #pdf_page {
            width: 100%;
            height: 95%;
        !important;
        }

        #imglist {
            text-align: center;
            margin-left: 0px;
            margin-bottom: 5px;
            width: 98%;
            height: 80%;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .divCss5 {
            border-left: 2px solid #e5e5e5;
            height: auto;
            min-height: 350px;
        }

        .btnGroupCss {
            text-align: right;
        }

        /* dataTables表头居中 */
        .table > thead:first-child > tr:first-child > th {
            text-align: center !important;
        }

        #assortModal > div > div {
            margin-top: 30%;
            margin-left: 60%;
            width: 500px;
        !important;
        }

        #exampleModal > div > div {
            margin-top: 30%;
            margin-left: 60%;
            width: 400px;
        !important;
        }

        #delPdfModal > div > div {
            margin-top: 30%;
            margin-left: 60%;
            width: 400px;
        !important;
        }

        #tsPdfModal > div > div {
            margin-top: 40%;
            margin-left: 70%;
            width: 400px;
        !important;
        }

        .imgDivCss {
            min-height: 400px !important;
        }

        .showImg {
            width: 100%;
            /*height: 100%*/
        }

        .shadeImg {
            height: 100%;
        }

        #returnModal .modal-content {
            margin-left: 0%;
            margin-top: 5%;
            width: calc(210%);
        }

        #firstModal .modal-content {
            margin-left: 20%;
            margin-top: 0%;
            width: calc(180%);
        }

        #verifyModal .modal-content {
            margin-left: 20%;
            margin-top: 5%;
            width: calc(150%);
        }

        #verinfyQZModal .modal-content {
            margin-left: 50%;
            margin-top:10%;
            width: 450px;
        }

        #delPdfPageModal2 > div > div {
            margin-top: 20%;
            margin-left: 60%;
            width: 400px;
        !important;
        }

        #timeLineModal .modal-content {
            margin-left: 50%;
            margin-top: 0%;
            width: 100%;
        }

        /**固定列样式*/
        .fixed-table-body-columns {
            top: 40px !important;
            /*height:226px!important;*/
        }

        #mb {
            display: none;
            height: 120%;
            width: 100%;
            /*position: fixed;*/
            position: absolute;
            z-index: 1200;
            /*height: 1380px;*/
            background: #FFF;
            top: 0;
            left: 0;
            opacity: 0.6;
        }

        #arrow {
            color: #fff;
            background: #000;
            width: 20px;
            height: 90px;
            line-height: 90px;
            font-size: 12px;
            font-family: "宋体";
            text-align: center;
            font-weight: bold;
            float: left;
        }

        /*.panel-primary > .panel-heading{*/
        /*background-color: #3c8dbc;*/
        /*border-color: #3c8dbc;*/
        /*}*/
        .showDelDiv {
            margin-left: 0px;
            border: 1px solid #e5e5e5;
            width: 90%;
            margin-bottom: 5px;
        }

        .showImg2 {
            margin-left: 2%;
            margin-bottom: 2px;
            width: 95%;
            height: 200px;
        }

        .returnPageCls {
            margin-right: 2px;
        }

        #addDelDiv {
            width: 85%;
            background-color: #0b93d5;
            text-align: center;
            color: red;
        }

        #upLoadImgBtn {
            width: 35%;
            text-align: left;
        }

        #delAllImgBtn {
            width: 35%;
        }

        #addPdfPageBtn {
            width: 40%;
        }

        #delImgPageModal > div > div {
            width: 400px;
            margin-left: 55%;
            margin-top: 20%;
        }

        .img_div{
            overflow-y:auto; overflow-x:hidden; height:calc(75vh);
        !important;
        }

        .img_div2{
            overflow-y:auto; overflow-x:hidden; height:calc(75vh);
        !important;
        }

        #imgDelPageModal .modal-content {
            margin-left: 5%;
            width: calc(200%); /*margin-left:-15%;*/
            height: calc(90vh );
            overflow-x: hidden;
            overflow-y: auto;
        !important;
        }

        #QXInfoModal .modal-header2 {
            width: calc(210%);
        }

        #titleSearch {
            align: left;
            margin-left: 5px;
            height: 34px;
            width: 300px;
        !important;
        }

        #assortNameQX{
            width:600px;
        !important;
        }

        /*选中行颜色*/
        .fixed-table-container tbody .selected td {
            background-color: #9acfea;
        }
    </style>
</head>

<body>
<input type="text" value="" id="collectionID" hidden>
<input type="text" value="" id="pid" hidden>
<div id="mb"></div>
<div style="margin-left:30px;margin-right:10px;height:auto">
    <!--搜索-->
    <form style="margin-top:20px;"  >
        <div class="form-inline">
            <%--<div class="form-group divCss8" hidden="hidden">--%>
            <%--<label for="id">病案号:</label>--%>
            <%--<input type="text" class="input-sm form-control" hidden id="id" placeholder="请输入病案号">--%>
            <%--</div>--%>
            <div class="form-group divCss8">
                <label for="inpNo">住院号:</label>
                <input type="text" class="input-sm form-control" id="inpNo" placeholder="请输入住院号">
            </div>
            <div class="form-group divCss8">
                <label for="visitId">住院次数:</label>
                <input type="number" class="input-sm form-control" id="visitId" placeholder="请输入次数">
            </div>
            <div class="form-group divCss8">
                <label for="name">姓名:</label>
                <input type="text" class="input-sm form-control" id="name" placeholder="请输入姓名">
            </div>
            <%--<div class="form-group divCss8">--%>
            <%--<label for="name">身份证号:</label>--%>
            <%--<input type="text" class="input-sm form-control" id="idNo" placeholder="请输入身份证号">--%>
            <%--</div>--%>
            <div class="form-group divCss8" id="deptDiv" >
                <label>出院科室:</label>
                <select class="selectpicker bla bla bli" multiple data-live-search="true" name="deptName" id="deptName"
                        data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" title="请输入科室"  data-none-results-text="没找到相应记录{0}">
                    <option value="">全部</option>
                </select>
            </div>

            <div class="form-group divCss8">
                <label>出院日期:</label>
                <div class="input-daterange input-group" id="datepicker">
                    <input type="text" class="input-sm form-control" name="start" id="startDateTo"/>
                    <span class="input-group-addon">-</span>
                    <input type="text" class="input-sm form-control" name="end" id="endDateTo"/>
                </div>
            </div>
            <div class="form-group divCss8" style="height: 18px;margin-top: -5px;">
                <label>是否扫描:</label>
                <select class="selectpicker bla bla bli" data-live-search="true" name="isScanning" id="isScanning"
                        title="是否扫描">
                    <option value="">全部</option>
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
            <div class="form-group divCss8" >
                <label>科室是否提交纸质病历:</label>
                <select class="selectpicker bla bla bli" data-live-search="true" name="isscaned" id="isscaned" title="科室是否提交纸质病历">
                    <option value="">全部</option>
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
                <div class="form-group divCss8" style="margin-top: 10px">
                    <label>是否签收:</label>
                    <select class="selectpicker bla bla bli" data-live-search="true" name="isSign" id="isSign" title="是否签收">
                        <option value="">全部</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            <%--<div class="form-group divCss2">--%>
            <%--<label for="archivestate">归档状态:</label>--%>
            <%--<select class="input-sm form-control" id="archivestate">--%>
            <%--<option value="">全部</option>--%>
            <%--&lt;%&ndash;<option value="未归档">未归档</option>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<option value="归档中">归档中</option>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<option value="初审">初审</option>&ndash;%&gt;--%>
            <%--<option value="已认证">已认证</option>--%>
            <%--<option value="已归档">已归档</option>--%>
            <%--</select>--%>
            <%--</div>--%>
            <button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>
            <button type="button" class="btn btn-info btn-sm divCss" id="excelBtn">条件导出</button>
            <button type="button" class="btn btn-success btn-sm divCss" id="signBtn" style="visibility:hidden">签收</button>
        </div>
    </form>
    <!--数据表格-->
    <table id="table" class="table text-nowrap table-striped"></table>
    <div id="toolbar" class="btn-group pull-right" style="margin-right: 20px;">
        <div class="columns columns-right btn-group pull-right" style="margin-top:0px;">
            <div class="btn-group btn-info">
                <select id="sel_exportoption" class="form-control">                
                    <option value="">导出当前页面数据</option>
                                   
                    <option value="all">导出全部数据</option>
                                   
                    <option value="selected">导出选中数据</option>
                </select>
            </div>
            <button class=" btn btn-success" style="height: 34px" type="button" id="refreshBtn" name="refresh"
                    aria-label="Refresh"
                    title="Refresh">
                <i class="glyphicon glyphicon-refresh icon-refresh"></i>
            </button>
        </div>
    </div>
</div>


<%--<div id="modal">--%>
<%--<div class="mask"></div>--%>
<%--<!-- 这里开始才是真正的内容 -->--%>
<%--<div class="dialog"></div>--%>
<%--</div>--%>

<!-- 模态框3（Modal）查看档案 -->
<div class="modal fade" id="selModal" tabindex="1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header2">
                <button type="button" class="close" id="closeBtn">
                    &times;
                </button>
                <h4 class="modal-title">
                    病历清单
                </h4>
            </div>
            <div class="modal-body divCss2">
                <!--通过审批且未过期的patientId集合-->
                <form class="form-horizontal" id="form1">
                    <div class="row">
                        <div class="row divCss3">病历信息</div>
                        <div class="row divCss2">
                            <div class="seal-result" style="display:none;" id="printTableFlag">已打印</div>
                            <div class="col-sm-5" hidden>
                                病案号：<label id="idLab" class="labCss"></label><label id="assortId" hidden></label>
                            </div>
                            <label id="patientId" hidden></label>
                            <div class="col-sm-5" hidden>
                                来源：<label id="idsource" class="labCss"></label><label id="source" hidden></label>
                            </div>
                            <div class="col-sm-4">
                                住院号：<label id="inLab" class="labCss"></label>
                            </div>
                            <div class="col-sm-4">
                                住院次数：<label id="inTimeLab" class="labCss"></label>
                            </div>
                            <div class="col-sm-3">
                                姓名：<label id="nameLab" class="labCss"></label>
                            </div>
                        </div>
                        <div class="row divCss2">
                            <div class="col-sm-4"><input type="text" id="outDateLab" hidden/>
                                入院科室：<label id="deptToLab" class="labCss"></label>
                            </div>
                            <div class="col-sm-4">
                                入院日期：<label id="inDateLab" class="labCss"></label>
                            </div>
                            <div class="col-sm-3" id="firstDiv">
                                初审管理:
                                <button type="button" class="btn btn-danger btn-sm" id="getFirstBtn">初审查看</button>
                            </div>
                            <div class="col-sm-3" id="recallDiv">
                                缺陷管理:
                                <button type="button" class="btn btn-danger btn-sm" id="getRecallBtn">缺陷查看</button>
                            </div>
                            <div class="col-sm-4"><input type="text" id="outDeptLab" hidden/>
                                出院科室：<label id="outDeptToLab" class="labCss"></label>
                            </div>
                            <div class="col-sm-4">
                                出院日期：<label id="outDeptDateLab" class="labCss"></label>
                            </div>
                            <div class="col-sm-3" id="timeLine">
                                跟踪管理:
                                <button type="button" class="btn btn-info btn-sm" id="getTimeline">跟踪查看</button>
                            </div>
                        </div>
                        <div class="row divCss4">完整性审核:
                            <button type="button" class="btn btn-warning btn-sm" id="getReloadWz">校验完整性</button>
                        </div>
                        <div id="wzContent"></div>
                        <%--<div class="row divCss2">
                            &lt;%&ndash;<div class="col-sm-4">&ndash;%&gt;
                            &lt;%&ndash;离院方式：<label id="outHospLab" class="labCss"></label>&ndash;%&gt;
                            &lt;%&ndash;</div>&ndash;%&gt;
                            &lt;%&ndash;<div class="col-sm-5">&ndash;%&gt;
                            &lt;%&ndash;主管医生：<label id="chargeLab" class="labCss"></label>&ndash;%&gt;
                            &lt;%&ndash;</div>&ndash;%&gt;
                            <div class="col-sm-2">
                                完整性审核：
                            </div>
                            <div class="col-sm-10" style="margin-left: -70px" id="wzContent">
                            </div>
                            <div class="col-sm-3" id="reloadWz">

                            </div>
                        </div>--%>
                    </div>

                    <div class="divCss4"></div>
                    <div class="row">
                        <%--<div class="row divCss3 ">病历清单</div>--%>
                        <div class="col-sm-3 divCss2">
                            <div class="row titleCss"></div>
                            <div class="row form-inline">
                                <input type="text" id="key" value="" class="input-sm form-control empty"
                                       placeholder="分段名称"/>
                                <button type="button" class="btn btn-primary btn-sm" id="searchBtn1">查询</button>
                            </div>
                            <div class="row">
                                <button type="button" class="btn  btn-success btn-sm treeBtn1" onclick="expandAll();">
                                    全部展开
                                </button>
                                <button type="button" class="btn  btn-success btn-sm treeBtn" onclick="collapseAll();">
                                    全部收缩
                                </button>
                            </div>
                            <div class="row">
                                <!--树-->
                                <div class="zTreeDemo" id="foo">
                                    <ul id="ztree" class="ztree"></ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-8 divCss5">
                            <div class="row ">
                                <div class="col-sm-3 " style="margin-top: 5px;">
                                    <input type="checkbox" id="flag" value="1">只显示作废</input>
                                </div>
                                <div class="col-sm-9 btnGroupCss">
                                    <button type="button" class="btn btn-primary btn-sm" id="collectionBtn">按需采集</button>
                                    <button type="button" class="btn btn-primary btn-sm" id="viewBtn">患者统一视图</button>
                                    <button type="button" class="btn btn-danger btn-sm" id="addPdfBtn">添加pdf</button>
                                    <button type="button" class="btn btn-default btn-sm" id="uploadBtn">上传文件</button>
                                    <button type="button" class="btn btn-info btn-sm" id="pdfBtn">查看分段PDF</button>
                                    <button type="button" class="btn btn-success btn-sm" id="pdfBtn2">查看PDF</button>
                                   <%-- <button type="button" class="btn btn-info btn-sm" id="pdfBtn3">查看扫描PDF</button>--%>
                                    <%--<button type="button" class="btn btn-primary btn-sm" id="addBtn">添加清单</button>--%>
                                    <button type="button" class="btn btn-warning btn-sm" id="updateStateBtn">选中作废
                                    </button>
                                    <button type="button" class="btn btn-primary btn-sm" id="updateStateBtn2">选中使用
                                    </button>
                                </div>
                            </div>
                            <div class="row">
                                <!--数据表格-->
                                <table id="table2" class="table  text-nowrap  table-striped"></table>
                                <div id="toolbar2" class="btn-group pull-left toolbarCss">
                                    <div class=" row columns  btn-group pull-right " style="margin-top:0px;">
                                        <div class="row form-inline" style="margin-left: 10px">标题:
                                            <input class="input-sm form-control form-inline" type="text"
                                                   id="titleSearch" name="titleSearch" aria-label="Refresh"
                                                   title="Refresh" placeholder="请输入pdf相关标题"/>
                                            <select class="selectpicker bla bla bli" data-live-search="true" name="sourceSearch" id="sourceSearch" title="来源">
                                            </select>
                                            <button type="button" class="btn btn-primary btn-sm" id="titleSearchBtn">
                                                查询
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<%--时间轴弹窗--%>
<div class="modal fade" id="timeLineModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">流转节点时间轴</h4>
            </div>
            <div class="modal-body" style="height:500px;overflow:auto">
                <div class="cx-time-main" id="cxTime">

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <%--<button type="button" class="btn btn-primary btn-sm" id="verifyBtn">通过</button>--%>
            </div>
        </div>
    </div>
</div>

<%--按需采集弹窗--%>
<div class="modal fade" id="collectionModal" tabindex="2" role="dialog" aria-hidden="true">
    <div class="modal-dialog"style="width:300px">
        <div class="modal-content">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">
                    按需采集详情
                </h4>
            </div>
            <div class="modal-body">
                <!--通过审批且未过期的patientId集合-->
                <%--<form class="form-horizontal" id="logForm">--%>
                <div class="row divCss2">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">体温单：</label>
                        <div class="col-sm-7">
                            <button type="button" class="btn btn-info btn-sm button1" id="button1" name="button1"style="width:100px">体温单采集 </button>
                        </div>
                    </div>
                </div>
                <div class="row divCss2">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">护理记录：</label>
                        <div class="col-sm-7">
                            <button type="button" class="btn btn-info btn-sm button2" id="button2" name="button2"style="width:100px">护理记录采集 </button>
                        </div>
                    </div>
                </div>
                <div class="row divCss2">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">首页：</label>
                        <div class="col-sm-7">
                            <button type="button" class="btn btn-info btn-sm button3" id="button3" name="button3"style="width:100px">首页采集 </button>
                        </div>
                    </div>
                </div>
                <div class="row divCss2">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">医生文书：</label>
                        <div class="col-sm-7">
                            <button type="button" class="btn btn-info btn-sm button4" id="button4" name="button4"style="width:100px">医生文书采集 </button>
                        </div>
                    </div>
                </div>
                <div class="row divCss2">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">护士文书：</label>
                        <div class="col-sm-7">
                            <button type="button" class="btn btn-info btn-sm button5" id="button5" name="button5"style="width:100px">护士文书采集 </button>
                        </div>
                    </div>
                </div>
                <div class="row divCss2">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">评估单：</label>
                        <div class="col-sm-7">
                            <button type="button" class="btn btn-info btn-sm button6" id="button6" name="button6" style="width:100px">评估单采集</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 模态框3（Modal）分段信息 -->
<div class="modal fade" id="assortModal" tabindex="2" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">
                    病历清单详情
                </h4>
            </div>
            <div class="modal-body">
                <!--通过审批且未过期的patientId集合-->
                <%--<form class="form-horizontal" id="logForm">--%>
                <input type="hidden" id="inpId" name="inpId">
                <div class="row divCss8">
                    <div class="form-group"><input id="fileUrlInp" hidden/>
                        <label class="col-sm-3 control-label">标题：</label>
                        <div class="col-sm-7">
                            <input type="text" class="input-sm form-control" id="inpTitle" name="inpTitle">
                        </div>
                    </div>
                </div>
                <div class="row divCss8">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">类型：</label>
                        <div class="col-sm-6">
                            <%--<input type="text" class="input-sm form-control"  id="inpType" name="inpType">--%>
                            <select class="input-sm form-control" id="inpType">

                            </select>
                        </div>
                    </div>
                </div>
                <div class="row divCss8">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">页码：</label>
                        <div class="col-sm-6">
                            <input type="number" class="input-sm form-control" id="pageNumber" name="pageNumber">
                        </div>
                    </div>
                </div>
                <div class="row divCss8">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">来源：</label>
                        <div class="col-sm-6">
                            <input type="text" class="input-sm form-control" readonly id="inpSource" name="inpSource">
                        </div>
                    </div>
                </div>
                <div class="row divCss8">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">状态：</label>
                        <div class="col-sm-3">
                            <select class="input-sm form-control" id="inpFlag">
                                <option value="0">使用</option>
                                <option value="1">作废</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row divCss8">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">上传pdf：</label>
                        <div class="col-sm-9">
                            <input type="text" id="pdfPathVal" readonly
                                   style="width:100%;background-color: #eee"></input>
                            <%--<a href="javascript:void(0);" target="_self" id="previewFile" style="display:none">预览</a>--%>
                            <div id="upPdfDiv">
                                <form action="path/uploadPDF1" id="formUpload" enctype="multipart/form-data"
                                      method="post">
                                    <input id="addFile" class="inp_file" type="file" accept="application/pdf"
                                           name="addFile"
                                           size="chars">
                                    <%--<iframe id="pdf_page" name="pdf_page" style="width:1500px;height:640px">--%>
                                    <%--</iframe>--%>
                                </form>
                            </div>

                        </div>
                        <%--<div class="col-sm-1"></div>--%>
                    </div>
                </div>
                <%--</form>--%>
            </div>
            <div class="modal-footer">

                <button type="button" class="btn btn-primary btn-sm" id="saveBtn">保存</button>
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">关闭</button>

            </div>
        </div>
    </div>
</div>
<%--多图片框--%>
<div class="modal fade" id="pdfModal" tabindex="-1" role="dialog"
     aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content enterCss">
            <div class="modal-header2">

                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">手动上传扫描病历（图片上传）</h4>
            </div>
            <div class="modal-body">
                <form id="filesUpload" style="margin-top:20px;" method="POST" enctype="multipart/form-data">
                    <div class="imgDivCss" id="divImg">
                        <%--<form>--%>

                        <%--<p class="form-group">--%>
                        <%--<h3>Bootstrap File Input Demo1</h3>--%>
                        <%--</p>--%>


                        <%--<input name="uploadFile" type="file" id="uploadFile" multiple class="file-loading"/>--%>

                        <%--</form>--%>

                        <div class="form-inline">
                            <div class="form-group divCss">
                                <label for="inpGl">归类 :</label>
                                <select class="input-sm form-control" id="inpGl">
                                    <option value="非类型">非类型</option>
                                    <option value="">全部</option>
                                    <%--<option value="在院">在院</option>--%>
                                    <%--<option value="未归档">未归档</option>--%>
                                    <%--<option value="归档中">归档中</option>--%>
                                    <%--<option value="初审">初审</option>--%>
                                    <%--<option value="已认证">已认证</option>--%>
                                    <%--<option value="已归档">已归档</option>--%>
                                </select>
                            </div>
                            <button type="button" class="btn btn-primary btn-sm divCss" id="imgBtn">查询</button>
                            <%--<button type="button" class="btn btn-info btn-sm divCss" id="imgsBtn">批量上传</button>--%>
                            <%--<button type="button" class="btn btn-danger btn-sm divCss" id="imgsDelBtn">批量删除</button>--%>
                            <button type="button" class="btn btn-warning btn-sm divCss" id="imgsSaveBtn">保存</button>
                            <a href="javascript:;" class="a-upload btn btn-info btn-sm">
                                <input type="file" name="myFile" id="myFile" multiple="multiple" accept="image/*"
                                       hidden/>选择文件
                            </a>

                        </div>

                        <div class="img_div"></div>

                        <div class="shade" onclick="javascript:closeShade()">
                            <div class=""><span class="text_span"></span>
                            </div>
                        </div>
                        <%--<div class="shadeImg"  onclick="javascript:closeShadeImg()">--%>
                        <%--<div class="">--%>
                        <%--<img class="showImg" src=""/>--%>
                        <%--</div>--%>
                        <%--</div>--%>

                    </div>
                </form>
                <%--<div id="handout_wrap_inner"><input id="tsInfo" type="text" style="border:none" size="100" readonly/></div>--%>
                <%--<iframe id="pdf_page" name="pdf_page" data-target="_bank" style="width:100%;height:100%"></iframe>--%>
            </div>
            <%--<div class="modal-footer">--%>
            <%--<button type="button" class="btn btn-default btn-sm"--%>
            <%--data-dismiss="modal">返回--%>
            <%--</button>--%>
            <%--</div>--%>
        </div>
    </div>
</div>
<%--发大弹窗--%>
<div class="modal fade" id="maxImg" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-header2">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                    aria-hidden="true">×</span></button>
        </div>
        <div class="modal-content ">
            <div class="modal-body" style="height: 90%;">
                <div class="shadeImg" onclick="javascript:closeShadeImg()">
                    <div class="">
                        <img class="showImg" src=""/>
                    </div>
                </div>
            </div>
            <%--<div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
            </div>--%>
        </div>
    </div>
</div>
<%--确认框--%>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">确认作废</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <input type="hidden" id="idT" name="idT" value=""/>
                        <label class="control-label">作废该分段记录吗？</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="stateBtn">确认</button>
            </div>
        </div>
    </div>
</div>


<%--退回弹窗--%>
<div class="modal fade" id="returnModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">退回信息</h4>
            </div>
            <div class="modal-body divCss2">
                <!--通过审批且未过期的patientId集合-->
                <form class="form-horizontal" id="form2">
                    <%--<div class="row">--%>
                    <%--<div class="row divCss3">缺陷信息</div>--%>
                    <%--<div class="row divCss2">--%>
                    <%--<div class="row divCss2">--%>
                    <%--<span style="float:left;vertical-align:top;">选项：</span>--%>
                    <%--<div style="float:left;" id="faultTypeDiv">--%>
                    <%--&lt;%&ndash;<div class="row " style="width:600px">&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<label class="col-xs-6"><input name="Fruit" type="checkbox" value=""/>苹果 </label>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<label class="col-xs-6"><input name="Fruit" type="checkbox" value=""/>桃子 </label>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<div class="row " style="width:600px">&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<label class="col-xs-6"><input name="Fruit" type="checkbox" value=""/>苹果水电费是否是的范德萨</label>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<label class="col-xs-6"><input name="Fruit" type="checkbox" value=""/>桃子</label>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                    <%--</div>--%>
                    <%--</div>--%>
                    <%--<div class="row divCss2">--%>
                    <%--<span style="vertical-align:top;">内容：</span>--%>
                    <%--<textarea id="content" rows="6" style="width:80%;"></textarea>--%>
                    <%--</div>--%>
                    <%--</div>--%>
                    <%--</div>--%>
                    <%--<div class="divCss4"></div>--%>
                    <div class="row"><input id="backArchiveId" hidden>
                        <%--<div class="row divCss3 ">退回信息</div>--%>
                        <div class="row divCss2">
                            <div class="row " hidden>
                                <span style="vertical-align:center;">病案评分：</span>
                                <input id="score" type="number" class="input-sm "/> 分
                            </div>
                            <div class="row ">
                                <span style="vertical-align:top;">退回内容：</span>
                                <textarea id="backContent" rows="6" style="width:80%;"></textarea>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="returnBtn">确认</button>
            </div>
        </div>
    </div>
</div>

<%--审核弹窗--%>
<div class="modal fade" id="verifyModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">终审信息</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group ">
                        <input id="archiveId" hidden/><input id="isScaned2" hidden/><input id="isSign2" hidden/>
                        <span style="vertical-align:top;">内容：</span>
                        <textarea rows="12" style="width:90%;" id="verifyText"></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="verifyBtn">通过</button>
            </div>
        </div>
    </div>
</div>



<%--缺陷窗口--%>
<div class="modal fade" id="QXInfoModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-header2">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
            <h4 class="modal-title">缺陷列表</h4>
            <input id="archIdQX" type="text" hidden/>
        </div>
        <div class="modal-content" style="height:80%;">
            <div class="modal-body" style="height:100%;width:100%;overflow:hidden;">
                <div class="form-inline">
                    <div class="form-group divCss8">
                        <label for="inpNo">缺陷类型:</label>
                        <input type="text" class="input-sm form-control" id="assortNameQX" placeholder="请输入缺陷类型">
                    </div>
                    <div class="form-group ">
                        <label>处理否:</label>
                        <select class="input-sm form-control" id="dealFlagQX">
                            <option value="">全部</option>
                            <option value="1">已处理</option>
                            <option value="0">未处理</option>
                        </select>
                    </div>
                    <button type="button" class="btn btn-primary btn-sm divCss" id="searchBtnQX">查询</button>
                </div>
                <div style="height:80%;">
                    <!--数据表格-->
                    <table id="tableQX" class="table text-nowrap table-striped"></table>
                    <div id="toolbarQX" class="btn-group pull-right" style="margin-left:1100px">
                        <div class="columns columns-right btn-group pull-left"  style="margin-top:0px;">
                            <button type="button" class="btn btn-warning btn-sm" id="QXDealBtn" onclick="dealAndConcelFun()">进行处理</button>
                            <button type="button" class="btn btn-danger btn-sm" id="QXDealCancelBtn" onclick="dealAndConcelFun()">取消处理</button>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <!-- <div class="modal-footer">
             <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
         </div>-->
    </div>
</div>


<!--缺陷详情弹窗-->
<div class="modal fade" id="qxModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">缺陷信息</h4>
            </div>
            <div class="modal-body">
                <div class="row" style="margin-left:5px;">
                    <div class="col-sm-4"><input id="qxId" hidden/>
                        病案退回：<label id="backPerson" class="labCss"></label>
                    </div>
                    <div class="col-sm-4">
                        处理否：<label id="dealFlag" class="labCss"></label>
                    </div>
                    <div class="col-sm-3">
                        处理人：<label id="dealPerson" class="labCss"></label>
                    </div>

                </div>
                <div class="row" style="margin-left:5px;margin-top:5px;">
                    <div class="col-sm-4">
                        处理日期：<label id="dealTime" class="labCss"></label>
                    </div>
                </div>
                <div class="row form-inline" style="margin-left:20px;margin-top:5px;">
                    选项：<select class="input-sm " disabled style="min-width: 200px" id="faultType">
                    <%--<option value="非类型">非类型</option>--%>
                    <%--<option value="">全部</option>--%>
                </select>
                </div>
                <div class="row divCss2">
                    <span style="vertical-align:top;">内容：</span>
                    <textarea id="content" rows="10" style="width:90%;" readonly></textarea>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info btn-sm" id="dealBtn" hiddendata-dismiss="modal">已处理</button>
                <button type="button" class="btn btn-warning btn-sm" id="dealNoBtn" data-dismiss="modal">未处理</button>
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
            </div>
        </div>
    </div>
</div>

<%--初审核弹窗--%>
<div class="modal fade" id="firstModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">初审信息</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group ">
                        <input id="archiveId2" hidden/>
                        <span style="vertical-align:top;">初审内容：</span>
                        <textarea rows="8" style="width:90%;" readonly="readonly" maxlength="255"
                                  id="firstTrial"></textarea>
                    </div>
                    <div class="form-group ">
                        <span style="vertical-align:top;">护士备注：</span>
                        <textarea id="nuresText" rows="8" style="width:90%;" disabled></textarea>
                    </div>
                    <div class="form-group ">
                        <span style="vertical-align:top;">医生备注：</span>
                        <textarea id="doctorText" rows="8" style="width:90%;" disabled></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <%--<button type="button" class="btn btn-primary btn-sm" id="verifyBtn">通过</button>--%>
            </div>
        </div>
    </div>
</div>

<%--确认框--%>
<div class="modal fade" id="delPdfModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">确认</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <input type="hidden" id="idPdfT" name="idPdfT" value=""/>
                        <label class="control-label">是否删除该记录？</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="statePdfBtn">确认</button>
            </div>
        </div>
    </div>
</div>

<%--确认框--%>
<div class="modal fade" id="tsPdfModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">确认</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label class="control-label">是否替换原有的PDF文件？</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="thPdfBtn">确认</button>
            </div>
        </div>
    </div>
</div>

<%--删除pdf某页弹窗--%>
<div class="modal fade" id="delPdfPageModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-header2">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
            <h4 class="modal-title">PDF页信息</h4>
        </div>
        <div class="modal-content ">
            <div class="modal-body divCss2" id="delPdfBody">
                <div class="row form-inline">
                    <div style="width: 80%;float:left;" id="pdfDiv">
                        <iframe id="pdf_page"></iframe>
                    </div>
                    <div id="arrow">&gt;</div>
                    <div id="infoDiv">
                        <form>
                            <div class="row " hidden>
                                <input id="pdfId" hidden/>
                                <span style="vertical-align:top;" hidden>pdf路径：</span>
                                <textarea rows="6" style="width:85%;" readonly id="pathPdf" hidden></textarea>
                            </div>
                            <div class="row" style="margin-left:5px; ">
                                页码：
                                <input type="number" id="pagePdf" style="max-width:20%"/>-<input type="number"
                                                                                                 id="pagePdf2"
                                                                                                 style="max-width:20%"/>
                                <button type="button" class="btn btn-primary btn-sm" id="delPageBtn">确认</button>
                            </div>
                        </form>
                        <div class="row" style="margin-left:15px; ">
                            <div class="row" id="addDelDiv">---不可恢复--</div>
                            <div class="row" style="margin-bottom: 5px;">
                                <button type="button" class="btn btn-primary btn-sm" id="returnPdfBtn2"
                                        onclick="bfPdfFun()">重新备份PDF
                                </button>
                                <button type="button" class="btn btn-default btn-sm" id="upLoadImgBtn"
                                        onclick="upLoadImgFun()">上传额外图片
                                </button>
                            </div>
                            <div class="row">
                                <%--<button type="button" class="btn btn-warning btn-sm" id="addPdfPageBtn" onclick="addPdfPageFun()">PDF添加页码</button>--%>
                                <button type="button" class="btn btn-warning btn-sm" id="returnPdfBtn"
                                        onclick="returnPdfFun()">还原最初PDF
                                </button>
                                <button type="button" class="btn btn-danger btn-sm" id="delAllImgBtn">删除全部图片</button>
                            </div>
                        </div>
                        <div class="imglist" id="imglist">

                        </div>
                    </div>
                </div>
            </div>
            <%--<div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
            </div>--%>
        </div>
    </div>
</div>

<%--删除pdf某页确认框--%>
<div class="modal fade" id="delPdfPageModal2" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">确认</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label class="control-label">是否删除pdf第<span id="numDel"></span>的页面？</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="delPageBtn2">确认</button>
            </div>
        </div>
    </div>
</div>

<%--确认框提示清空所有图片--%>
<div class="modal fade" id="delImgPageModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">确认</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label class="control-label">删除所有的图片将不可恢复，是否删除？</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="delImgPageBtn">确认</button>
            </div>
        </div>
    </div>
</div>

<%--多图片框删除页--%>
<div class="modal fade" id="imgDelPageModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content enterCss">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">手动图片上传</h4>
            </div>
            <div class="modal-body">
                <form id="filesUpload2" method="POST" enctype="multipart/form-data">
                    <div class="imgDivCss" id="divImg2">
                        <div class="form-inline">
                            <button type="button" class="btn btn-primary btn-sm divCss" id="imgsClearBtn2">清空图片</button>
                            <button type="button" class="btn btn-warning btn-sm divCss" id="imgsSaveBtn2">保存</button>
                            <a href="javascript:;" class="a-upload btn btn-info btn-sm">
                                <input type="file" name="myFile2" id="myFile2" multiple="multiple" accept="image/*"
                                       hidden/>选择文件
                            </a>
                        </div>
                        <div class="img_div2"></div>
                        <div class="shade" onclick="javascript:closeShade()">
                            <div class=""><span class="text_span"></span>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<%--签收弹窗--%>
<div class="modal fade" id="signModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">签收信息</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group ">
                        <input id="archiveIdSign" type="text"/>
                        <input id="hiddenText" type="text" style="display:none" />
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="signBtn2">签收</button>
                <button type="button" class="btn btn-warning btn-sm" id="signBtn3">取消签收</button>
            </div>
        </div>
    </div>
</div>

<%--没签收是否强制提交弹窗--%>
<div class="modal fade" id="verinfyQZModal" tabindex="-5" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header2">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">是否强制提交</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group ">
                        没签收是否强制提交
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
                <button type="button" class="btn btn-primary btn-sm" id="verinfyQZBtn">通过</button>
            </div>
        </div>
    </div>
</div>


</body>

<script type="text/javascript">
    var tipLoad = 1;
    //创建数组保存图片
    var files = new Array();
    var id = 0;
    $(function () {


        var objUrl;
        var img_html;

        var oMoveBox = $("#arrow"), infoDiv = $("#infoDiv"), maxL = 0;
        oMoveBox.click(function () {
            if (maxL > 0) {
                maxL = 0;
                $("#pdfDiv").css("width", '80%');
                $("#arrow").html(">");
                $("#infoDiv").show();
            } else {
                maxL = 1;
                $("#pdfDiv").css("width", '97%');
                $("#arrow").html("<");
                $("#infoDiv").hide();
            }
        });

        $("#myFile").change(function () {
            var img_div = $(".img_div");
            var filepath = $("input[name='myFile']").val();
            //获取所有图片
            var fileALL = this.files;
            for (var i = 0; i < fileALL.length; i++) {
                //获取图片路径
                objUrl = getObjectURL(fileALL[i]);
                if(fileALL[i]!=undefined && fileALL[i]!=null && fileALL[i]!=""){
                    if(fileALL[i].name!=undefined && fileALL[i].name!=null && fileALL[i].name!=""){
                        var extStart = fileALL[i].name.lastIndexOf(".");
                        var ext = fileALL[i].name.substring(extStart, fileALL[i].name.length).toUpperCase();
                        /**
                         *描述：鉴定每个图片上传尾椎限制
                         */
                        if (ext != ".PNG" && ext != ".GIF" && ext != ".JPG" && ext != ".JPEG") {
                            toastr.warning("图片:"+fileALL[i].name+"不符，限于png,gif,jpeg,jpg格式");
                            return false;
                        }else{
                            files.push(fileALL[i]);
                            /**
                             *若规则全部通过则在此提交url到后台数据库
                             */
                            img_html = "<div class='isImg' id='-1'><img src='" + objUrl + "' id='" + fileALL[i].name + "' onclick='javascript:lookBigImg(this)' style='height: 100%; width: 100%;' />"
                            img_html += selectStr+ " <button class='removeBtn' onclick='javascript:removeImg(this)'>x</button></div>";
                            img_div.append(img_html);
                        }
                    }
                }

            }
            /**
             *描述：鉴定每个图片大小总和
             */
            var file_size = 0;
            var all_size = 0;
            for (j = 0; j < fileALL.length; j++) {
                file_size = fileALL[j].size;
                all_size = all_size + fileALL[j].size;
                var size = all_size / 1024;
                if (size > 500000000) {//500
                    //$(".shade").fadeIn(500);
                    //$(".text_span").text("上传的图片大小不能超过100k!");
                    toastr.warning("上传的图片大小不能超过10000000k!");
                    this.value = "";
                    $(".img_div").html("");
                    return false;
                }
            }
            /**
             *描述：鉴定每个图片宽高 以后会做优化 多个图片的宽高 暂时隐藏掉 想看效果可以取消注释就行
             */
            // var img = new Image();
            // img.src = objUrl;
            // img.onload = function() {
            // 	if (img.width > 100 && img.height > 100) {
            //      toastr.warning("图片宽高不能大于一百!");
            // 		$("#myFile").val("");
            // 		$(".img_div").html("");
            // 		return false;
            // 	}
            // }
            return true;
        });

        $("#myFile2").change(function () {
            var img_div = $(".img_div2");
            // var filepath = $("input[name='myFile2']").val();

            //获取所有图片
            var fileALL = this.files;
            for (var i = 0; i < fileALL.length; i++) {
                //获取图片路径
                objUrl = getObjectURL(fileALL[i]);
                if(fileALL[i]!=undefined && fileALL[i]!=null && fileALL[i]!=""){
                    if(fileALL[i].name!=undefined && fileALL[i].name!=null && fileALL[i].name!=""){
                        var extStart = fileALL[i].name.lastIndexOf(".");
                        var ext = fileALL[i].name.substring(extStart, fileALL[i].name.length).toUpperCase();
                        /**
                         *描述：鉴定每个图片上传尾椎限制
                         */
                        if (ext != ".PNG" && ext != ".GIF" && ext != ".JPG" && ext != ".JPEG") {
                            toastr.warning("图片:"+fileALL[i].name+"不符，限于png,gif,jpeg,jpg格式");
                            return false;
                        }else{
                            files.push(fileALL[i]);
                            /**
                             *若规则全部通过则在此提交url到后台数据库
                             */
                            img_html = "<div class='isImg' id='-1'><img src='" + objUrl + "' id='" + fileALL[i].name + "' onclick='javascript:lookBigImg(this)' style='height: 100%; width: 100%;' />"
                            img_html +=" <button class='removeBtn' onclick='javascript:removeImg2(this)'>x</button></div>";
                            img_div.append(img_html);
                        }
                    }
                }
            }

            /**
             *描述：鉴定每个图片大小总和
             */
            var file_size = 0;
            var all_size = 0;
            for (j = 0; j < fileALL.length; j++) {
                file_size = fileALL[j].size;
                all_size = all_size + fileALL[j].size;
                var size = all_size / 1024;
                if (size > 500000000) {
                    toastr.warning("上传的图片大小不能超过10000000k!");
                    this.value = "";
                    $(".img_div2").html("");
                    return false;
                }
            }
            return true;
        });

        /**
         *描述：鉴定每个浏览器上传图片url 目前没有合并到Ie,返回值为blob的url
         */
        function getObjectURL(file) {
            var url = null;
            if (window.createObjectURL != undefined) { // basic
                url = window.createObjectURL(file);
            } else if (window.URL != undefined) { // mozilla(firefox)
                url = window.URL.createObjectURL(file);
            } else if (window.webkitURL != undefined) { // webkit or chrome
                url = window.webkitURL.createObjectURL(file);
            }
            //console.log(url);
            return url;
        }

        //blob转base64
        function blobToDataURL(blob) {
            var a = new FileReader();
            a.readAsDataURL(blob);//读取文件保存在result中
            a.onload = function (e) {
                var getRes = e.target.result;//读取的结果在result中
            }

        }
    });

    /**
     * 描述：上传图片附带删除 再次地方可以加上一个ajax进行提交到后台进行删除
     */
    function removeImg(r) {
        //获取data中的图片名
        var filename = $(r).siblings("img").attr('id');

        //删除父节点
        $(r).parent().remove();
        var fileList = Array.from(files);
        //遍历数组
        for (var j = 0; j < fileList.length; j++) {
            //通过图片名判断图片在数组中的位置然后删除
            // console.log(fileList[j].name + "111");
            if(fileList[j].name!=undefined)
            if (fileList[j].name == filename) {
                fileList.splice(j, 1);
                id--;
                break;
            }
        }
        files = fileList;
        var id = $(r).parent().attr('id');
        var maxPicture = $(r).siblings("img").attr('src');


        if ($(r).parent().attr('id') != -1) {
            var target = document.getElementById('filesUpload');
            spinner.spin(target);//给id为foo的div 中绑上spinner
            $.ajax({
                url: "${path}/inHosp/delImg",
                type: "POST",
                data: {id: id, maxPicture: maxPicture},
                success: function (result) {
                    spinner.spin();
                    if (result.indexOf("成功") != -1) {
                        //刷新
                        $('#table2').bootstrapTable('refresh');
                        initTree($("#idLab").html());
                        toastr.success(result);
                    } else {
                        toastr.error(result);
                    }
                }, error: function () {
                    //toastr.error("加载失败!");
                }
            });
        }
    }

    /**
     * 描述：上传图片附带删除 再次地方可以加上一个ajax进行提交到后台进行删除
     */
    function removeImg2(r) {
        //获取data中的图片名
        var filename = $(r).siblings("img").attr('id');
        //删除父节点
        $(r).parent().remove();
        var fileList = Array.from(files);
        //遍历数组
        for (var j = 0; j < fileList.length; j++) {
            //通过图片名判断图片在数组中的位置然后删除
            if(fileList[j].name!=undefined)
            if (fileList[j].name == filename) {
                fileList.splice(j, 1);
                id--;
                files = fileList;
                break;
            }
        }
    }

    /**
     * 描述：上传图片附带放大查看处理
     */
    function lookBigImg(b) {
        $('#maxImg').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });

        $(".shadeImg").fadeIn(500);
        $(".showImg").attr("src", $(b).attr("src"));

    }

    /**
     * 描述：关闭弹出层
     */
    function closeShade() {
        // $(".shade").fadeOut(500);
    }

    /**
     *描述：关闭弹出层
     */
    function closeShadeImg() {
        // $(".shadeImg").fadeOut(500);
    }

    //初始化类别
    var selectStr = "";

    function getAssortFun() {
        $.ajax({
            url: "${path}/zdAssort/getAssort",
            type: "POST",
            //data: {patientId: $("#idLab").html()},
            async: true,
            success: function (result) {
                if (result.length > 0) {
                    if (result != null) {
                        selectStr = "<select class='selectB'>";
                        for (i = 0; i < result.length; i++) {
                            selectStr += "<option value='" + result[i].assortId + "' title='"+result[i].assortName+"'>" + result[i].assortName + "</option>";
                            $("#inpGl").append("<option value=" + result[i].assortId + ">" + result[i].assortName + "</option>");
                            $("#inpType").append("<option value=" + result[i].assortId + ">" + result[i].assortName + "</option>");
                        }
                        selectStr += " </select>";
                    }
                }
            }, error: function () {
                // toastr.error("加载失败!");
            }
        });


    }

    getAssortFun();

    var opts = {
        lines: 13, // 花瓣数目
        length: 20, // 花瓣长度
        width: 10, // 花瓣宽度
        radius: 30, // 花瓣距中心半径
        corners: 1, // 花瓣圆滑度 (0-1)
        rotate: 0, // 花瓣旋转角度
        direction: 1, // 花瓣旋转方向 1: 顺时针, -1: 逆时针
        color: '#000', // 花瓣颜色
        speed: 1, // 花瓣旋转速度
        trail: 60, // 花瓣旋转时的拖影(百分比)
        shadow: false, // 花瓣是否显示阴影
        hwaccel: false, //spinner 是否启用硬件加速及高速旋转
        className: 'spinner', // spinner css 样式名称
        zIndex: 2e9, // spinner的z轴 (默认是2000000000)
        top: '50%', // spinner 相对父容器Top定位 单位 px
        left: '450%'// spinner 相对父容器Left定位 单位 px
    };
    var spinner = new Spinner(opts);
    var url = "";

    function uploadFileAndDate() {
        var formData = new FormData();
        formData.append('file', $('#addFile')[0].files[0]);
        formData.append('fileName', $("#outDateLab").val());
        formData.append('id', $("#inpId").val());
        formData.append('masterID', $("#idLab").html());
        formData.append('assortID', $("#inpType").val());
        formData.append('title', $("#inpTitle").val());
        if ($("#pageNumber").val() < 1) {
            $("#pageNumber").val(1);
        }
        formData.append('pageNumber', $("#pageNumber").val());
        formData.append('source', $("#inpSource").val());
        formData.append('flag', $("#inpFlag").val());
        formData.append('sys', "emr_medical_record");
        $.ajax({
            url: "${path}/inHosp/uploadPdf2",
            scriptCharset: "UTF-8",
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
            success: function (result) {
                if (result.indexOf("文件") == -1) {
                    toastr.success("操作成功!");
                    $('#addFile').attr("src", result);
                    url = result;
                    $('#previewFile').css("display", "block");//显示预览按钮
                } else {
                    toastr.warning(result);
                }
                $('#assortModal').modal('hide');  //手动关闭
                //刷新
                $('#table2').bootstrapTable('refresh');
                initTree($("#idLab").html());

            }, error: function (result) {
                $('#assortModal').modal('hide');  //手动关闭
                toastr.success("操作成功!");
                //$('#addFile').attr("src", $("#outDateLab").val() + ".pdf");//.val($("#outDateLab").val()+".pdf");
                //toastr.error("上传PDF失败!");
                //刷新
                $('#table2').bootstrapTable('refresh');
                initTree($("#idLab").html());

            }
        });
    }

    function uploadFileFun() {
        if ($('#addFile')[0].files[0] != undefined) {
            if ($('#addFile')[0].files[0].size > 0) {
                //新增或修改
                uploadFileAndDate();
            } else {
                toastr.warning("文件为空!");
            }
        } else {
            if ($('#pdfPathVal').val() == null && $('#pdfPathVal').val() == 0) {
                toastr.warning("请选择文件!");
            } else {
                //修改
                uploadFileAndDate();
            }
        }
    }

    function blobToDataURL(blob, callback) {

        var a = new FileReader();

        a.onload = function (e) {

            callback(e.target.result);

        }

        a.readAsDataURL(blob);

    }

    function blobToFile(blob, fileName) {
        blob.lastModifiedDate = new Date();
        blob.name = fileName;
        return blob;
    }

    function imgSelectFun() {
        var img_div = $(".img_div");
        if ($("#inpGl").val() != "非类型") {
            var target = document.getElementById('divImg');
            spinner.spin(target);//给id为foo的div 中绑上spinner
            var data = {};
            data.relationId = $("#idLab").html();
            data.assortId = $("#inpGl").val();
            $.ajax({
                url: "${path}/inHosp/getPicList",
                type: "post",
                data: data,
                success: function (result) {
                    if (result != null) {
                        img_div.empty();
                        for (var i = 0; i < result.length; i++) {
                            /**
                             *若规则全部通过则在此提交url到后台数据库
                             */
                                //selectStr= selectStr.replace(result[i].assortId+'\"','\" selected');
                            var fileName = result[i].maxPicture.split("\\");
                            if (result[i].maxPicture.indexOf("..") != -1) {
                                img_html = "<div class='isImg' id='" + result[i].id + "'><img src='" + result[i].maxPicture + "' id='" + fileName[fileName.length - 1] + "' onclick='javascript:lookBigImg(this)' style='height: 100%; width: 100%;' />"
                                    + selectStr//+"<label  class='oldSel' id='oldSel"+i+"' value='"+result[i].assortId+"' hidden></label>"
                                    + " <button class='removeBtn' onclick='javascript:removeImg(this)'>x</button></div>";
                            } else {
                                var reg = /\\/g;
                                var path = "getImg2?path=" + (result[i].maxPicture).replace(reg, "/");
                                //path= "getImg2?path=C:/Users/Administrator/Desktop/测试/lunfan4.jpg";
                                //console.log((result[i].maxPicture).replace(reg, "/"));
                                img_html = "<div class='isImg' id='" + result[i].id + "'><img src='" + path + "' id='" + fileName[fileName.length - 1] + "' onclick='javascript:lookBigImg(this)' style='height: 100%; width: 100%;' />"
                                    + selectStr//+"<label  class='oldSel' id='oldSel"+i+"' value='"+result[i].assortId+"' hidden></label>"
                                    + " <button class='removeBtn' onclick='javascript:removeImg(this)'>x</button></div>";

                            }
                            img_div.append(img_html);
                            img_div.find("select").eq(i).val(result[i].assortId);
                        }
                    } else {
                        toastr.success("暂无数据!");
                    }
                    spinner.spin();

                },
                error: function () {
                    toastr.error("获取图片列表失败!");
                }
            });
        } else {
            img_div.empty();
        }

    }

    $("#imgBtn").click(function () {
        //console.log("===查询图片列表===");
        //var target = document.getElementById('filesUpload');
        imgSelectFun();

    });

    $("#imgsSaveBtn").click(function () {
        //console.log("===保存图片===");
        var target = document.getElementById('divImg');
        spinner.spin(target);//给id为foo的div 中绑上spinner
        var fileArr = [];
        var b = 0;
        //获取图片src和下拉框值
        var div_p = $(".img_div").children();
        var div_data = div_p.children();
        if (div_data != null)
            for (var i = 0; i < div_data.length; i++) {
                if (div_data[i].value != null && div_data[i].value != "") {
                    var obj = {};
                    //console.log("第select" + (i + 1) + "个的value=" + div_data[i].value);
                    var selectedIndex=div_data[i].selectedIndex;
                    //console.log(div_data[i].options[index].getAttribute("title"));
                    obj.selectName=div_data[i].options[selectedIndex].getAttribute("title");
                    obj.selectVal = div_data[i].value;
                    if (b < div_data.length / 2) {
                        obj.id = div_p[b].id;
                        b++;
                    }
                    fileArr.push(obj);
                }
            }

        if (fileArr.length > 0) {
            //创建FormData根据form
            var uploadFile = new FormData($("#filesUpload")[0]);
            uploadFile.append('fileName', $("#outDateLab").val());
            uploadFile.append('masterID', $("#idLab").html());
            uploadFile.append("list", JSON.stringify(fileArr));
            //console.log(fileArr);
            //遍历图片数组把图片添加到FormData中
            for (var i = 0; i < files.length; i++) {
                uploadFile.append("imgs", files[i]);
            }
            if ("undefined" != typeof (uploadFile) && uploadFile != null && uploadFile != "") {
                //通过ajax上传
                $.ajax({
                    url: "${path}/inHosp/uploadImgS",
                    type: "post",
                    data: uploadFile, //把FormData作为参数
                    contentType: false, //不设置内容类型
                    processData: false, //不处理数据
                    success: function (data) {
                        initTree($("#idLab").html());
                        setTimeout(function () {
                            //刷新当前类别
                            imgSelectFun();
                            if (data.indexOf("成功") != -1) {
                                toastr.success(data);
                            } else if (data.indexOf("成功") != -1) {
                                toastr.error(data);
                            } else {
                                toastr.warning(data);
                            }
                            spinner.spin();
                        }, 1000);
                        files = new Array();
                    },
                    error: function () {
                        spinner.spin();
                        toastr.error("批量上传失败!");
                    }
                });
            }
        } else {
            spinner.spin();
            toastr.warning("请选择上传的图片!");
        }

    });


    $("#pdfBtn").click(function () {
        //上传后预览pdf文件
        //生成pdf返回url
        var masterId = $("#idLab").html();
        var flag = "0";
        if (masterId != "" && masterId != null) {
            var imgStr = "";
            var zTree = $.fn.zTree.getZTreeObj("ztree");//换成实际的图层的id
            var changedNodes = zTree.getChangeCheckedNodes(); //获取改变的全部结点
            for (var i = 0; i < changedNodes.length; i++) {
                var treeNode = changedNodes[i];
                if (treeNode.id != 0) {
                    imgStr += treeNode.id + ",";
                }
            }
            //判断id
            if (imgStr == null || imgStr == '') {
                toastr.warning("请选择分段类别!");
                return;
            }
            if ($("#flag").is(":checked") == true) {
                flag = "1";
            }
            //打开一个不被拦截的新窗口
            var newWindow = window.open();
            var titleName=document.getElementById("nameLab").innerText;
            $.ajax({
                url: "${path}/inHosp/getPdfToPdf",
                type: "POST",
                data: {masterId: masterId, imgStr: imgStr, flag: flag},
                success: function (result) {
                    if (result != "") {
                        //绝对路径
                        //var pdfPath = result;
                        //newWindow.location.href = "${path}/static/pdfjs/web/viewer.html?file=" + encodeURIComponent("${path}/inHosp/pdfStreamHandeler?url=" + pdfPath);
                        var archiveDetailId = $("#idLab").html();
                        newWindow.location.href = "${path}/pdfCtr/pdfLastDir?archiveDetailId=" + encodeURI(archiveDetailId) + "&isscanedVal=" + encodeURI(isscanedVal)+ "&isSignVal=" + encodeURI(isSignVal)+ "&pdfPath=" + encodeURI(result)+"&titleName="+encodeURI(titleName);

                        <%--var pdfUrl = "${path}/static/pdfjs/web/viewer.html?file=../../../static/img/pdfFiles/" + result;//+ result;--%>
                        <%--newWindow.location.href = pdfUrl;--%>
                    } else {
                        newWindow.close();//此处为ajax失败方法，自动关闭刚才会打开的页面
                        toastr.warning("勾选的PDF文件不存在或破损!");
                    }
                }, error: function (result) {
                    newWindow.close();//此处为ajax失败方法，自动关闭刚才会打开的页面
                    toastr.error("操作失败!");
                }
            });
        } else {
            toastr.warning("病案不存在!");
        }
    });

    $("#titleSearchBtn").click(function () {
        $('#table2').bootstrapTable('refreshOptions', {limit: 1, offset: 10});
    });

    $("#pdfBtn2").click(function () {
        //选中批量使用
        var idStr = "";
        var getSelectRows = $("#table2").bootstrapTable('getSelections');
        if (getSelectRows.length > 0) {
            for (var i = 0; i < getSelectRows.length; i++) {
                idStr += getSelectRows[i].id + ",";
            }
        } else {
            toastr.warning("请选择记录!");
            return;
        }
        //上传后预览pdf文件,根据id直接获取pdf并合成
        //打开一个不被拦截的新窗口
        var newWindow = window.open();
        var titleName=document.getElementById("nameLab").innerText;
        $.ajax({
            url: "${path}/inHosp/getPdfById",
            type: "POST",
            data: {idStr: idStr},
            success: function (result) {
                //console.log(result);
                if (result != "") {
                    //绝对路径
                    // var pdfPath = result;
                    //newWindow.location.href = "${path}/static/pdfjs/web/viewer.html?file=" + encodeURIComponent("${path}/inHosp/pdfStreamHandeler?url=" + pdfPath);
                    var archiveDetailId = $("#idLab").html();
                    newWindow.location.href = "${path}/pdfCtr/pdfLastDir?roleVal=" + encodeURI(2) + "&archiveDetailId=" + encodeURI(archiveDetailId) + "&isscanedVal=" + encodeURI(isscanedVal)+ "&isSignVal=" + encodeURI(isSignVal)+ "&pdfPath=" + encodeURI(result)+"&titleName="+encodeURI(titleName);

                    //相对路径
                    <%--var pdfUrl = "${path}/static/pdfjs/web/viewer.html?file=../../../static/img/pdfFiles/typesPdf/" + result;//+ result;--%>
                    <%--newWindow.location.href = pdfUrl;--%>

                } else {
                    newWindow.close();//此处为ajax失败方法，自动关闭刚才会打开的页面
                    toastr.warning("勾选的PDF文件不存在或破损!");
                }
            }, error: function (result) {
                newWindow.close();//此处为ajax失败方法，自动关闭刚才会打开的页面
                toastr.error("操作失败!");
            }
        });
    });

    $("#uploadBtn").click(function () {
        $("#inpGl").val("非类型");
        $(".img_div").html("");
        files = new Array();
        // console.log("批量上传图片模态框");
        $('#pdfModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });
    });


    $('#addFile').on('change', function () {
        //判断文件类型，并上传pdf
        //uploadFileFun();
    });

    $("#previewFile").on('click', function () {
        //上传后预览pdf文件
        var fileUrl = $("#fileUrlInp").val();
        //console.log(fileUrl);
        var pdfUrl = "${path}/static/pdfjs/web/viewer.html?file=" + fileUrl;
        if (fileUrl != null && fileUrl != "") {
            window.open(pdfUrl, 'PDF', 'width:50%;height:50%;top:100;left:100;');

        }
    });

    function validateNum(value) {
        var testReg = /^(((\d|[1-9]\d)(\.\d{1,2})?)|100|100.0|100.00)$/;
        if (testReg.test(value) != true) {
            toastr.warning("评分范围0-100,保留两位小数!");
            return false;
        } else {
            return true;
        }
    }


    $("#returnBtn").on('click', function () {
        if ($("#backContent").val().length > 1000) {
            toastr.warning("退回内容长度不超过1000!");
            return;
        } //else if (!validateNum($("#score").val())) {
        //     toastr.warning("评分范围0-100!");
        //     return;
        // }
        //根据角色是医生还是护士来获取评分
        var data = {};
        data.archiveDetailId = $("#backArchiveId").val();
        //退回信息
        data.score = $("#score").val();
        data.backContent = $("#backContent").val();
        data.state = "复审退回";
        data.backFlag = 4;

        //根据病案号保存缺陷信息
        $.ajax({
            url: "${path}/lastVerify/updateDetailByArchivId",
            type: "POST",
            data: data,
            success: function (result) {
                if (result == 1) {
                    //关闭modal
                    $('#returnModal').modal('hide');  //手动关闭
                    //$('#firstModal').modal('hide');  //手动关闭
                    toastr.success("退回成功!");
                    //刷新
                    $('#table').bootstrapTable('refresh');
                } else if (result == 2) {
                    toastr.warning("请先登记缺陷!");
                    $('#returnModal').modal('hide');  //手动关闭
                } else {
                    toastr.error("退回失败!");
                }
            }
        });
    });

    function getStaffFun(flag) {
        $.ajax({
            url: "${path}/staffRemark/staffRemarkList",
            type: "POST",
            data: {masterId: $("#idLab").html(), effective: 1},
            success: function (result) {
                if (result != null) {
                    for (var i = 0; i < result.length; i++) {
                        if (result[i].typeFlag == 1) {
                            //1护士
                            if (flag == 1) {
                                $("#nuresText").val(result[i].content);
                            }
                        } else if (result[i].typeFlag == 0) {
                            //0医生
                            if (flag == 1) {
                                $("#doctorText").val(result[i].content);
                            }
                        }
                    }
                }
            }
        });
    }

    $("#getFirstBtn").on('click', function () {
        //退回信息保存
        $('#firstModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });
        //console.log($("#idLab").html());
        getStaffFun(1);
        //获取初审
        $.ajax({
            url: "${path}/lastVerify/getDetailByArchId", // 获取表格数据的url
            type: "POST",
            data: {archiveDetailId: $("#idLab").html()},
            success: function (result) {
                //console.log(result);
                if (result != null) {
                    $("#firstTrial").val(result.firstTrial);
                }
            }, error: function () {
                // toastr.error("失败!")
            }
        });
    });

    $("#getRecallBtn").on('click', function () {
        $('#form2').find('input,textarea').prop('readonly', true);
        $('#returnBtn').hide();

        //根据病案号获取缺陷信息
        $.ajax({
            url: "${path}/lastVerify/getDetailByArchId",
            type: "POST",
            data: {archiveDetailId: $("#idLab").html(), backFlag: backFlagVal},
            success: function (result) {
                if (result != null && result != "") {
                    $("#backContent").val(result.backContent);
                    $("#score").val(result.score);

                    //退回信息保存
                    $('#returnModal').modal({
                        backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                        keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                        show: true//弹出对话框
                    });
                } else {
                    toastr.warning("数据不存在!");
                }
            }
        });
    });

    function verinfyFun(){
        //审核信息保存
        var archiveDetailId = $("#archiveId").val();
        var firstTrial = $("#verifyText").val();
        if (firstTrial.length > 255) {
            toastr.warning("内容长度不超过255!");
            return;
        }
        var state = "已归档";
        //归档状态改为初审还是有就是初审内容保存
        $.ajax({
            url: "${path}/lastVerify/updateStateByArchivId",
            type: "POST",
            data: {archiveDetailId: archiveDetailId, firstTrial: firstTrial, state: state},
            success: function (result) {
                $("#verifyModal").modal('hide');
                $("#table").bootstrapTable("refresh");
                toastr.success("终审操作成功!");
            }
        });
    }

    $("#verifyBtn").on('click', function () {
        var isscaned=""+$("#isScaned2").val();
        var isSign=""+$("#isSign2").val();
       if(((isscaned=="1") && (isSign=="1"))||(isscaned=="0")){
           //无纸质 或 有纸质且已签收
           verinfyFun();
       }else{
           //弹窗是否强制提交
           $('#verinfyQZModal').modal({
               backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
               keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
               show: true//弹出对话框
           });
       }
    });
    $("#verinfyQZBtn").on('click', function () {
        //有纸质且未签收，强制提交
        verinfyFun();
        $("#verinfyQZModal").modal('hide');
    });

    $(function () {
        //日期控件
        $(".input-daterange").datepicker({
            format: "yyyy-mm-dd",
            language: "zh-CN"
        });

        var url = window.location.href;
        var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");
        if (index != null && index != "" && index.indexOf("excel") != -1) {
            $("#excelBtn").show();
            $("#toolbar").show();
        } else {
            $("#excelBtn").hide();
            $(".columns-right").hide();
        }

        if (index != null && index != "" && index.indexOf("addPdf") != -1) {
            $("#addPdfBtn").show();
        } else {
            $("#addPdfBtn").hide();
        }
        if (index != null && index != "" && index.indexOf("upload") != -1) {
            $("#uploadBtn").show();
        } else {
            $("#uploadBtn").hide();
        }
        if (index != null && index != "" && index.indexOf("pdf") != -1) {
            $("#pdfBtn").show();
        } else {
            $("#pdfBtn").hide();
        }
        if (index != null && index != "" && index.indexOf("pdf2") != -1) {
            $("#pdfBtn2").show();
        } else {
            $("#pdfBtn2").hide();
        }
        if (index != null && index != "" && index.indexOf("cancelAll") != -1) {
            $("#updateStateBtn").show();
        } else {
            $("#updateStateBtn").hide();
        }
        if (index != null && index != "" && index.indexOf("useAll") != -1) {
            $("#updateStateBtn2").show();
        } else {
            $("#updateStateBtn2").hide();
        }
        if (index.indexOf("signFlg") != -1) {
            $("#signBtn").show();
        } else {
            $("#signBtn").hide();
        }
        // var deptAdmissionTo = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
        // if (deptAdmissionTo == null || deptAdmissionTo == '') {
        //     $('#deptDiv').show();
        // } else {
        //     $('#deptDiv').hide();
        // }


    });

    function getDept() {
        //获取科室列表
        $.ajax({
            url: "${path}/inHosp/getDept",
            type: "POST",
            data: {effective: 1, typecode: "dept_code"},
            success: function (result) {
                if (result != null) {

                    for (var i = 0; i < result.length; i++) {
                        $("#deptName").append("<option value=" + result[i].code + ">" + result[i].name + "</option>");
                    }
                }

                $(".selectpicker").selectpicker('refresh'); //
            }
        });
    }

    getDept();

    function getFaultType() {
        $("#faultTypeDiv").empty();
        //获取列表
        $.ajax({
            url: "${path}/lastVerify/getFaultType",
            type: "POST",
            data: {effective: 1},
            success: function (result) {
                if (result != null) {
                    var html = '';
                    for (var i = 0; i < result.length; i++) {
                        if (i % 2 == 0) {
                            html += '<div class="row" style="width:600px"><label class="col-xs-6"><input name="Fruit" type="checkbox" value="' + result[i].id + '">' + result[i].typeName + '</label>'

                        } else {
                            html += '<label class="col-xs-6"><input name="Fruit"  type="checkbox" value="' + result[i].id + '">' + result[i].typeName + '</label></div>';
                        }
                    }
                    $("#faultTypeDiv").append(html);
                }
            }
        });
    }
    getFaultType();

    $("#imgsClearBtn2").click(function () {
        //console.log("===清空删除页的图片===");
        $(".img_div2").empty();
        files = new Array();
    });

    $("#imgsSaveBtn2").click(function () {
        //console.log("===保存删除页的图片===");
        var parentId = $("#pdfId").val();
        //pdf文件名
        //console.log(parentId+"=====获取相应的pdf被删除的图片列表========");
        if (parentId != null && parentId != "") {
            var uploadFile = new FormData($("#filesUpload")[0]);
            uploadFile.append('parentId', parentId);
            if (files.length > 0) {
                //遍历图片数组把图片添加到FormData中
                for (var i = 0; i < files.length; i++) {
                    uploadFile.append("imgs", files[i]);
                }
                if ("undefined" != typeof (uploadFile) && uploadFile != null && uploadFile != "") {
                    $("#mb").css("display", "block");
                    var target = document.getElementById('divImg2');
                    spinner.spin(target);//给id为foo的div 中绑上spinner
                    //通过ajax上传
                    $.ajax({
                        url: "${path}/inHosp/uploadDelPageImgS",
                        type: "post",
                        data: uploadFile, //把FormData作为参数
                        contentType: false, //不设置内容类型
                        processData: false, //不处理数据
                        success: function (result) {
                            setTimeout(function () {
                                $('#imgDelPageModal').modal("hide");
                                if (result.indexOf("成功") != -1) {
                                    getDelPicPageFun();
                                    toastr.success(result);
                                } else if (result != "") {
                                    toastr.warning(result);
                                } else {
                                    toastr.warning("多图片保存失败!");
                                }
                                spinner.spin();
                            }, 2000);
                            files = new Array();
                        },
                        error: function () {
                            spinner.spin();
                            toastr.error("批量上传失败!");
                        }
                    });
                    $("#mb").css("display", "none");

                }
            } else {
                toastr.warning("请选择上传的图片!");
            }

        } else {
            toastr.warning("记录不存在!");
        }

    });

    function upLoadImgFun() {
        //console.log("======删除页上传图片=======");
        $(".img_div2").empty();
        files = new Array();
        $('#imgDelPageModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });
    }

    function bfPdfFun() {
        $("#mb").css("display", "block");
        //console.log("======重新备份=======");
        var parentId = $("#pdfId").val();
        if (parentId != "" && parentId != null) {
            $.ajax({
                url: "${path}/inHosp/bfPdfFile",
                type: "POST",
                data: {id: parentId},
                success: function (result) {
                    setTimeout(function () {
                        if (result.indexOf("成功") != -1) {
                            getDelPicPageFun();
                            $('#pdf_page').attr('src', $('#pdf_page').attr('src'));
                            toastr.success(result);
                        } else if (result != "") {
                            toastr.warning(result);
                        } else {
                            toastr.warning("重新备份pdf文件失败!");
                        }
                    }, 1000);
                }
            });
        } else {
            toastr.warning("暂无备份pdf文件!");
        }
        $("#mb").css("display", "none");
    }

    function returnPdfFun() {
        //console.log("======还原PDF=======");
        var parentId = $("#pdfId").val();
        if (parentId != "" && parentId != null) {
            $.ajax({
                url: "${path}/inHosp/returnPdfFile",
                type: "POST",
                data: {id: parentId},
                success: function (result) {
                    setTimeout(function () {
                        if (result == "") {
                            $("#mb").css("display", "none");
                            getDelPicPageFun();
                            $('#pdf_page').attr('src', $('#pdf_page').attr('src'));
                            spinner.spin();
                            toastr.success("pdf文件还原备份成功!");
                        } else {
                            toastr.warning(result);
                        }
                    }, 1000);
                }
            });
        } else {
            toastr.warning("暂无备份pdf文件!");
        }
    }

    function returnPageFun(maxPicture, btnObj) {
        maxPicture = decodeURIComponent(maxPicture, "UTF-8");
        var minPicture = null;
        var parentId = $("#pdfId").val();
        // var parentId=$("#pdfId").val();
        var inpuObj = btnObj.parentNode.firstChild;
        var delPage = inpuObj.value;
        if (delPage == "" || delPage == null || delPage < 0) {
            toastr.warning("请输入还原的页码大于等于0!");
            return;
        }
        var delid = btnObj.id;
        var id = 0;
        var pictureNumber = 0;
        if (delid != "" && delid != null && delid != "delId_") {
            delid = delid.replace("delId_", "");
            id = parseInt(delid);
        }

        if (delPage != "" && delPage != null && delPage >= 0) {
            pictureNumber = delPage;
        }
        if ($("#pathPdf").val() != null && $("#pathPdf").val() != "" && $("#pathPdf").val() != undefined && $("#pathPdf").val() != "undefined") {
            minPicture = $("#pathPdf").val();
        }
        if (id != 0 && pictureNumber >= 0) {
            var entity = {};
            entity.id = id;
            entity.pictureNumber = pictureNumber;
            entity.maxPicture = maxPicture;
            entity.minPicture = minPicture;
            entity.parentId = parentId;
            //console.log(entity);

            $("#mb").css("display", "block");
            var target = document.getElementById('delPdfBody');
            spinner.spin(target);//给id为foo的div 中绑上spinner
            $.ajax({
                url: "${path}/inHosp/returnPage",
                type: "POST",
                data: entity,
                success: function (result) {
                    setTimeout(function () {
                        //if(result!=null && result!="") {
                        if (result.indexOf("成功") != -1) {
                            getDelPicPageFun();
                            // $('#pdf_page').attr('src', result);
                            $('#pdf_page').attr('src', $('#pdf_page').attr('src'));
                            toastr.success(result);
                        } else {
                            toastr.warning(result);
                        }
                        // }else{
                        // toastr.warning("图片还原失败!");
                        // }

                        $("#mb").css("display", "none");
                        spinner.spin();
                    }, 2000);
                }
            });
        }
    }

    function addPdfPageFun() {
        var maxPicture = $("#pathPdf").val();
        if (maxPicture != null && maxPicture != "" && maxPicture != undefined) {
            //console.log("=====添加pdf页码成功=========maxPicture:"+maxPicture);
            $("#mb").css("display", "block");
            var target = document.getElementById('delPdfBody');
            spinner.spin(target);//给id为foo的div 中绑上spinner
            $.ajax({
                url: "${path}/inHosp/addPdfPageBtn",
                type: "POST",
                data: {maxPicture: maxPicture},
                success: function (result) {
                    $("#mb").css("display", "none");
                    $('#pdf_page').attr('src', $('#pdf_page').attr('src'));
                    spinner.spin();
                    if (result == 1) {
                        toastr.success("添加pdf页码成功!");
                    }
                }
            });
        } else {
            // toastr.warning("删除所有图片失败!");
        }
    }


    function delAllImgFun() {
        var parentId = $("#pdfId").val();
        var maxPicture = $("#pathPdf").val();
        var picArr = maxPicture.split("\\");
        maxPicture = picArr[picArr.length - 1].replace(".pdf", "");
        if (parentId != null && parentId != "" && parentId != undefined) {
            var target = document.getElementById('delPdfBody');
            spinner.spin(target);//给id为foo的div 中绑上spinner
            //console.log(parentId+":parentId=====删除所有图片=========maxPicture:"+maxPicture);
            $.ajax({
                url: "${path}/inHosp/delPageImgAll",
                type: "POST",
                data: {parentId: parentId, maxPicture: maxPicture},
                success: function (result) {
                    getDelPicPageFun();
                    spinner.spin();
                    if (result == 1) {
                        toastr.success("删除所有图片成功!");
                    } else {
                        toastr.warning("没图片可删除!");
                    }
                }
            });
            // $('#delImgPageModal').modal('hide');  //手动关闭
        } else {
            // toastr.warning("删除所有图片失败!");
        }
        $('#delImgPageModal').modal('hide');  //手动关闭
    }

    $("#delAllImgBtn").click(function () {
        //弹窗提示不可复原
        $('#delImgPageModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: true,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });
    });
    $("#delImgPageBtn").click(function () {
        delAllImgFun();
    });

    function delPageFun(maxPicture, obj) {
        $("#mb").css("display", "block");
        var target = document.getElementById('delPdfBody');
        spinner.spin(target);//给id为foo的div 中绑上spinner
        maxPicture = decodeURIComponent(maxPicture, "UTF-8");
        var id = 0;
        if (obj.id != null && obj.id != "" && obj.id != "delId_") {
            id = parseInt(obj.id.replace("delId_", ""));
            //console.log(id+"==========删除图片：===="+maxPicture);
            $.ajax({
                url: "${path}/inHosp/delPageImg",
                type: "POST",
                data: {id: id, maxPicture: maxPicture},
                success: function (result) {
                    setTimeout(function () {
                        if (result == 1) {
                            getDelPicPageFun();
                            toastr.success("删除图片成功!");
                        } else {
                            toastr.warning("删除图片失败!");
                        }
                        $("#mb").css("display", "none");
                        spinner.spin();
                    }, 500);
                }
            });
        } else {
            toastr.warning("图片记录不存在!");
        }
    }

    function getDelPicPageFun() {
        var parentId = $("#pdfId").val();
        //console.log(parentId+"=====获取相应的pdf被删除的图片列表========");
        if (parentId != null && parentId != "") {
            //获取相应的pdf被删除的图片列表
            $.ajax({
                url: "${path}/inHosp/selDelPicList",
                type: "POST",
                data: {effective: 1, parentId: parentId},
                success: function (result) {
                    $("#imglist").empty();
                    var img_div = $("#imglist");
                    if (result != null && result.length > 0) {
                        //console.log(result);
                        var img_html = "";
                        var delId = "delId_";
                        var delPageV = "delPageV_";
                        var maxPicture = "";
                        for (var i = 0; i < result.length; i++) {
                            delId = "delId_" + result[i].id;
                            delPageV = "delPageV_" + result[i].id;
                            //console.log("========="+result[i].id+"======delId:"+delId+"===="+result[i].pictureNumber);
                            maxPicture = result[i].maxPicture.replace(/(\/)+/g, '\\');//.replaceAll("/","\\");
                            //console.log(result[i].maxPicture);
                            img_html = "${path}\\" + maxPicture;
                            img_html = "<div class='row showDelDiv'><img class='showImg2' src='" + img_html + "' onclick='javascript:lookBigImg(this)'/>";
                            img_html += "<div clas='row'>"
                                + "<input type='number' class='returnPageCls' id='" + delPageV + "' value='" + result[i].pictureNumber + "' style='max-width:40%'/>"
                                + "<button class='btn btn-primary btn-sm' id='" + delId + "' onclick='javascript:returnPageFun(\"" + encodeURIComponent(maxPicture, "UTF-8") + "\",this)'>还原</button>"
                                + '<button onclick="javascript:delPageFun(\'' + encodeURIComponent(maxPicture, "UTF-8") + '\',this);"  id="' + delId + '" class="btn btn-danger btn-sm">' + '删除' + '</button>'
                                + "</div>";
                            img_html += "</div>";
                            $("#imglist").append(img_html);
                        }
                    } else {
                        $("#imglist").append("暂无可删除图片!");
                        //toastr.warning("暂无删除图片!");
                    }
                }
            });
        } else {
            toastr.warning("记录不存在!");
        }
    }

    //处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容
    function DoOnCellHtmlData(cell, row, col, data) {
        if (row == 0) {
            return data;
        }

        //由于备注列超过6个字的话,通过span标签处理只显示前面6个字,如果直接导出的话会导致内容不完整,因此要将携带完整内容的span标签中title属性的值替换
        if (col == 4 || col == 11 || col == 7) {
            var spanObj = $(data);//将带 <span title="val"></span> 标签的字符串转换为jQuery对象
            var title = spanObj.attr("title");//读取<span title="val"></span>中title属性的值
            //var span = cell[0].firstElementChild;//读取cell数组中的第一个值下的第一个元素
            if (typeof (title) != 'undefined') {
                return title;
            }
        }

        return data;
    }

    /**
     * 根据两个日期，判断相差天数
     * @param sDate1 开始日期 如：2016-11-01
     * @param sDate2 结束日期 如：2016-11-02
     * @returns {number} 返回相差天数
     */
    function daysBetween(sDate1, sDate2) {
        //Date.parse() 解析一个日期时间字符串，并返回1970/1/1 午夜距离该日期时间的毫秒数
        var time1 = Date.parse(new Date(sDate1));
        var time2 = Date.parse(new Date(sDate2));
        var nDays = Math.abs(parseInt((time2 - time1) / 1000 / 3600 / 24));
        return nDays;
    };

    function show() {
        var mydate = new Date();
        var str = "" + mydate.getFullYear() + "-";
        str += (mydate.getMonth() + 1) + "-";
        str += mydate.getDate() + "";
        return str;
    }

    $("#searchBtnQX").click(function () {
        $('#tableQX').bootstrapTable('refresh');
    });

    var editId=null;
    function dealAndConcelFun() {
        if (editId == null) {
            toastr.warning("选中1条记录!");
            return;
        }
        if (editId != null && editId != "") {
            //处理记录，登录处理人信息
            $.ajax({
                url: "${path}/fault/dealFault",
                type: "POST",
                data: {id: editId},
                success: function (result) {
                    if (result.indexOf("成功") != -1) {
                        //刷新
                        $('#table').bootstrapTable('refresh');
                        $('#tableQX').bootstrapTable('refresh');
                        toastr.success(result);
                    } else if (result.indexOf("失败") != -1) {
                        toastr.error(result);
                    } else {
                        toastr.warning(result);
                    }

                }
            });
        } else {
            toastr.warning("记录不存在!");
        }
    }

    var scollPostion = null;
    var docNorFlag=1;
    function initTableQX() {
        $("#QXDealCancelBtn").hide();
        $("#QXDealBtn").show();
        $('#tableQX').bootstrapTable({
            url: "${path}/fault/getFaultList", // 获取表格数据的url
            queryParams: function (params) {
                //console.log($("#archIdQX").val());
                var backFlag=1;
                if(docNorFlag==3){
                    backFlag=3
                }else if(docNorFlag==4){
                    backFlag=4
                }
                //(1,2,5,6)
                /* if($("#backFlagQX").val()!=null && $("#backFlagQX").val()!=null){
                     backFlag=$("#backFlagQX").val();
                 }*/
                var temp = {
                    ///limit: limit,     //页面大小
                    // offset: offset,   //页码
                    //order: params.order,      //排位命令（desc，asc）
                    //id: $("#id").val(),
                    archiveDetailId: $("#archIdQX").val(),
                    backContent:$("#assortNameQX").val(),
                    dealFlag:$("#dealFlagQX").val(),
                    backFlag:backFlag,
                    //backFlag: 1
                };
                return temp;
            },
            cache: false, // 设置为 false 禁用 AJAX 数据缓存， 默认为true
            showColumns: true,
            toolbar: '#toolbarQX',//指定工具栏
            undefinedText: '---', //当数据为 undefined 时显示的字符
            singleSelect: true,//设置True 将禁止多选
            clickToSelect: true,//设置true 将在点击行时，自动选择rediobox 和 checkbox
            striped: true,  //是否显示行间隔色
            toolbarAlign: 'left',// 指定 toolbar 水平方向的位置。'left' 或 'right'
            paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
            showHeader: true,//是否显示列头。
            trimOnSearch: true,//设置为 true 将自动去掉搜索字符的前后空格。
            //smartDisplay: false,
            //height:'300',
            //width:'100%',
            //height: $(window).height() / 2,//自定义高度
            sortName: 'id', // 要排序的字段
            sortOrder: 'desc', // 排序规则
            columns: [
                {
                    title: '全选',
                    field: 'select',   //复选框
                    checkbox: true,
                    width: 30,
                    align: 'center',
                    valign: 'middle'
                },
                {
                    field: 'id2',
                    title: '序号',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'archiveDetailId',
                    title: '病案号',
                    visible: false
                },
                {
                    field: 'assortId',
                    title: '缺陷类型',
                    //width: 150,
                    visible: false
                }, {
                    field: 'assortName',
                    title: '缺陷类型',
                    // width: '30%'
                }, {
                    field: 'price',
                    title: '类型分',
                    //width: 80,
                    visible: false,
                    formatter: function (value, row, index) {
                        var result = '';
                        if (value != null && value != '' && value != undefined && value != "null") {
                            result = '<span style="color:blue;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>' + value + '分</span>';
                        } else {
                            result = '<span style="color:grey;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>未知</span>';
                        }
                        return result
                    }
                }, {
                    title: '退回',
                    field: 'backFlag',
                    align: 'center',
                    //width: 100,
                    formatter: function (value, row, index) {
                        var result = "";
                        if (value == 1) {
                            result = '<span style="color:green;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>科主任退回医生</span>';
                        } else if (value == 2) {
                            result = '<span style="color:red;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>科主任退回护士</span>';
                        } else if (value == 5) {
                            result = '<span style="color:orange;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>病案室退回医生</span>';
                        } else if (value == 6) {
                            result = '<span style="color:dodgerblue;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>病案室退回护士</span>';
                        }

                        return result;
                    }
                }, {
                    field: 'dealFlag',
                    title: '处理否',
                    align: 'center',
                    //width: 80,
                    formatter: function (value, row, index) {
                        var result = "";
                        if (value == "1") {
                            result = '<span style="color:green;"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>已处理</span>';
                        } else {
                            result = '<span style="color:blue;"><i class="glyphicon glyphicon-remove-circle" aria-hidden="true"></i>未处理</span>';
                        }
                        return result
                    }
                }, {
                    field: 'dealPerson',
                    title: '处理人',
                    //width: 80

                }, {
                    field: 'dealTime',
                    title: '处理时间',
                    //width: 80

                },/*{
                    field: 'backTime',
                    title: '病案室退回时间',
                    //width: 150
                }, */{
                    field: 'content',
                    title: '内容',
                    //width: 200
                }], onUncheck: function (rowsAfter, rowsBefore) {
                editId = null;
                //console.log("====取消选中");
            },
            onClickRow : function(row, tr,flied){
                //console.log("====选中");
            },
            onCheck:function(row){
                editId = row.id;
                scollPostion = $('#tableQX').bootstrapTable('getScrollPosition');
                if(row!=null){
                    if(row.dealFlag=="0"){
                        $("#QXDealCancelBtn").hide();
                        $("#QXDealBtn").show();
                    }else{
                        $("#QXDealCancelBtn").show();
                        $("#QXDealBtn").hide();
                    }
                }

            },
            //如果想双击获取row，把onlClickRow改为onDbClickRow，如下
            onDblClickRow: function (row) {
                // if (template.defaults.imports.hasPermission('/payment_manager/payment_detail')) {
                //     EditBook(row.id);
                // }
            }, onRefresh: function (result) {

            } , onLoadSuccess: function (result) {  //加载成功时执行
                $('#tableQX').bootstrapTable('scrollTo', scollPostion);  //注意此代码要在setTimeout里面执行，原因是重新获取数据后还要生成dom节
                //console.log("====加载成功时执行"+editId);
                if (editId != null) {
                    //对刷新表格的数据选中之前选的id行
                    $('#tableQX').bootstrapTable("checkBy", {field: 'id', values: [editId]});
                }
            },
            onLoadError: function () {  //加载失败时执行
                //$('#table').bootstrapTable("checkBy", {field: 'id', values: [selectNodeId]});
            }
        });
    }
    initTableQX();

    function getWzxFun(archiveDetailId){
        //实时获取完整性
        $.ajax({
            url: "${path}/beHosp/wzByArchivId",
            type: "POST",
            data: {archiveDetailId: archiveDetailId},
            success: function (resultWz) {
                $("#wzContent").empty();
                $("#wzContent").html(resultWz);
            }
        });
    }

    var scollPostion1 = null;
    var editSelRow=[];
    var isscanedVal="";
    var isSignVal="";
    function initTable() {
        if (tipLoad == 1) {
            $("#table").bootstrapTable({ // 对应table标签的id
                //method: 'POST',
                url: "${path}/lastVerify/lastVerifyList", // 获取表格数据的url
                contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求，注释掉这句话也能拿到数据
                //dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
                cache: false, // 设置为 false 禁用 AJAX 数据缓存， 默认为true
                striped: true,  //是否显示行间隔色
                pagination: true, // 在表格底部显示分页组件，默认false
                paginationShowPageGo: true,
                pageList: [10, 20, 50, 100], // 如果设置了分页，设置可供选择的页面数据条数。设置为All 则显示所有记录。
                smartDisplay: false,
                pageSize: 2, // 页面数据条数
                pageNumber: 1, // 初始化加载第一页，默认第一页
                sidePagination: 'server', // 设置为服务器端分页     客户端：client
                search: false,
                showColumns: true,
                // sortable: true,
                // sortOrder: "asc",
                // fixedColumns: true,//固定列
                // fixedNumber:3,//固定前两列
                // rightFixedRow:1,
                // fixedRightNumber:32,
                // addNum:70,
                toolbar: '#toolbar',//指定工具栏
                searchOnEnterKey: true, //设置为 true时，按回车触发搜索方法，否则自动触发搜索方法
                undefinedText: '---', //当数据为 undefined 时显示的字符
                singleSelect: false,//设置True 将禁止多选
                clickToSelect: true,//设置true 将在点击行时，自动选择rediobox 和 checkbox
                //height: 560,     //定义表格的高度。
                searchTimeOut: 500,// 默认500  设置搜索超时时间。
                toolbarAlign: 'right',// 指定 toolbar 水平方向的位置。'left' 或 'right'
                paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
                showHeader: true,//是否显示列头。
                trimOnSearch: true,//设置为 true 将自动去掉搜索字符的前后空格。
                //是否显示导出按钮
                showExport: true,
                //导出表格方式（默认basic：只导出当前页的表格数据；all：导出所有数据；selected：导出选中的数据）
                exportDataType: "basic",
                //导出文件类型
                exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
                exportOptions: {
                    fileName: document.title
                },
                rowStyle: rowStyle,//通过自定义函数设置行样式
                // showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                // cardView: false,                    //是否显示详细视图
                // detailView: false,                   //是否显示父子表
                queryParams: function (params) {
                    var currPageSize = this.pageSize;
                    if (currPageSize == 2) {
                        currPageSize = 10;
                    }
                    var limit = null;
                    var offset = params.offset;
                    //判断是否导出全部all
                    if ($("#sel_exportoption").val() == "all") {
                        offset = 0;
                        limit = this.totalRows;
                        this.pageSize = limit;
                    } else {
                        limit = currPageSize;
                        this.pageSize = currPageSize;
                    }
                    // var url = window.location.href;
                    // var deptName = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
                    // if (deptName != null && deptName != '') {
                    //     deptName +=  "," + $("#deptName").val();
                    // } else {
                    //     deptName = $("#deptName").val();
                    // }
                    //
                    var deptName = $("#deptName").val();
                    if (deptName.indexOf("") != -1) {
                        deptName = "";
                    } else {
                        deptName = $("#deptName").val().toString();
                    }

                    var temp = {
                        limit: limit,     //页面大小
                        offset: offset,   //页码
                        order: params.order,      //排位命令（desc，asc）
                        //id: $("#id").val(),
                        idNo: $("#idNo").val(),
                        inpNo: "" + $("#inpNo").val(),
                        visitId: "" + $("#visitId").val(),
                        name: "" + $("#name").val(),
                        //archivestate: "" + $("#archivestate").val(),
                        deptName: deptName,
                        startDateTo: $("#startDateTo").val(),
                        endDateTo: $("#endDateTo").val(),
                        isscaned: $("#isscaned").val(),
                        isScanning: $("#isScanning").val(),

                        /*signer: "" + $("#signer").val(),*/
                        startSignDate: $("#startSignDate").val(),
                        endSignDate: $("#endSignDate").val(),
                        isSign: $("#isSign").val()
                    };
                    return temp;
                },
                sortName: 'id', // 要排序的字段
                sortOrder: 'desc', // 排序规则
                columns: [{
                    title: '全选',
                    field: 'select',   //复选框
                    checkbox: true,
                    width: 25,
                    align: 'center',
                    valign: 'middle',

                }, {
                    title: '病案清单id',
                    field: 'id',
                    align: 'left',
                    valign: 'middle',
                    visible: false
                },
                    {
                        title: '住院号',
                        field: 'inpNo',
                        align: 'left',
                        valign: 'middle',
                        /*formatter: function (value, row, index) {
                            //console.log(row);
                            var redFlag = row.numb;
                            var a = "";
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //缺陷
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '住院次数',
                        field: 'visitId',
                        align: 'center',
                        valign: 'middle',
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //缺陷
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '姓名',
                        field: 'name',
                        align: 'left',
                        valign: 'middle',
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (redFlag == 0) {
                                if (value == null) {
                                    a = "";
                                } else {
                                    a = value;
                                }
                            } else {
                                //缺陷
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '性别',
                        field: 'sex',
                        align: 'center',
                        valign: 'middle',
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value == null || value == "null") {
                                a = "";
                            } else {
                                a = value;
                            }
                            if (redFlag != 0) {
                                //缺陷
                                a = '<span style="color:red;">' + a + '</span>';
                            }
                            return a;
                        }*/
                    },
                    // {
                    //     title: '身份证号',
                    //     field: 'idNo',
                    //     align: 'center',
                    //     valign: 'middle',
                    //     visible: false
                    // },
                    {
                        title: '出院科室',
                        field: 'deptName',
                        align: 'left',
                        valign: 'middle',
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //缺陷
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '出院日期',
                        field: 'dischargeDateTime',
                        align: 'center',
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value != null && value != "") {
                                value = value.substring(0, 10);
                            }
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //缺陷
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '主管医生',
                        field: 'doctorInCharge',
                        align: 'left',
                        visible: false
                    },
                    {//医生是否提交、医生、提交日期、护士是否提交、护士、提交日期
                        title: '医生是否提交',
                        field: 'cmtDoctor',
                        align: 'center',
                        visible: false,
                        formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (redFlag == 0) {
                                if (value == 1) {
                                    a = '<span style="color:green;"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>已提交</span>';
                                } else {
                                    a = '<span style="color:red;"><i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>未提交</span>';
                                }
                            } else {
                                //缺陷
                                if (value == 1) {
                                    //有缺陷显示红色
                                    a = '<i class="glyphicon glyphicon-ok-circle" aria-hidden="true" style="color:green;"></i><span style="color:red;">已提交</span>';
                                } else {
                                    a = '<span style="color:red;"><i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>未提交</span>';
                                }
                            }
                            return a;
                        }
                    },
                    {
                        title: '医生',
                        field: 'doctorName',
                        align: 'left',
                        /*formatter: function (value, row, index) {
                            //调接口 参数：工号   返回：名字
                            var redFlag = row.numb;
                            var a = "";
                            if (value == null || value == "null") {
                                a = "";
                            } else {
                                a = value;
                            }
                            if (redFlag != 0) {
                                //有缺陷显示红色
                                a = '<span style="color:red;">' + a + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '医生提交日期',
                        field: 'cmtDoctorDate',
                        align: 'center',
                        visible: false,
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value != null && value != "") {
                                a = value.substring(0, 10);
                            } else if (value == null) {
                                a = "";
                            } else {
                                a = value;
                            }
                            if (redFlag != 0) {
                                //有缺陷显示红色
                                a = '<span style="color:red;">' + a + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '护士是否提交',
                        field: 'cmtNurse',
                        align: 'center',
                        visible: false,
                        formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (redFlag == 0) {
                                if (value == 1) {
                                    a = '<span style="color:green;"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>已提交</span>';
                                } else {
                                    a = '<span style="color:red;"><i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>未提交</span>';
                                }
                            } else {
                                //有缺陷显示红色
                                if (value == 1) {
                                    //有缺陷显示红色
                                    a = '<i class="glyphicon glyphicon-ok-circle" aria-hidden="true" style="color:green;"></i><span style="color:red;">已提交</span>';
                                } else {
                                    a = '<span style="color:red;"><i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>未提交</span>';
                                }
                            }
                            return a;
                        }
                    },
                    {
                        title: '护士',
                        field: 'nurseName',
                        align: 'left',
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value == null || value == "null") {
                                a = "";
                            } else {
                                a = value;
                            }
                            if (redFlag != 0) {
                                //有缺陷显示红色
                                a = '<span style="color:red;">' + a + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '护士提交日期',
                        field: 'cmtNurseDate',
                        align: 'center',
                        visible: false,
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value != null && value != "") {
                                value = value.substring(0, 10);
                            } else if (value == null) {
                                value = "";
                            } else {
                                value = value;
                            }
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //有缺陷显示红色
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    }, {
                        title: '是否死亡',
                        field: 'deathFlag',
                        align: 'center',
                        formatter: function (value, row, index) {
                            var result = "";
                            var days;//当天-出院-7
                            var redFlag = row.numb;
                            if (row.dischargeDateTime != null && row.dischargeDateTime != "") {
                                days = daysBetween(show(), row.dischargeDateTime.split(" ")[0]);
                            }
                            //死亡否
                            var deathExpired = <%=res.getString("deathExpired")%>;
                            if (value != null && value != "" && value == 0) {
                                if (redFlag == 0) {
                                    result = '<span style="color:green;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>否</span>';
                                } else {
                                    //有缺陷显示红色
                                    result = '<span style="color:red;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>否</span>';
                                }
                            } else {
                                if (days > deathExpired) {
                                    var day = days - deathExpired;
                                    result = '<span style="color:red;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>是</span></span>';
                                } else {
                                    result = '<span style="color:red;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>是</span>';
                                }
                            }
                            return result
                        }
                    }, {
                        title: '状态',
                        field: 'archivestate',
                        align: 'center',
                        valign: 'middle',
                        formatter: function (value, row, index) {
                            //在院  未归档  归档中  初审 已归档 已认证
                            var a = '';
                            var days;//= daysBetween('2016-12-01', '2016-11-02');
                            var redFlag = row.numb;
                            //console.log(days+"============相差天数"+show()+row.dischargeDateTime.split(" ")[0]);
                            if (row.dischargeDateTime != null && row.dischargeDateTime != "") {
                                days = daysBetween(show(), row.dischargeDateTime.split(" ")[0]);
                            }
                            if (redFlag == 0) {
                                if (value == "未归档") {
                                    a = '<span style="color:#c0c0c0;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                } else if (value == "已归档") {
                                    a = '<span style="color:#030378"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                } else if (value == "在院") {
                                    a = '<span style="color:#bfa200"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                } else if (value == "归档中") {
                                    a = '<span style="color:#5d9c0a"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                } else if (value == "初审") {
                                    //获取properties配置文件中的属性值
                                    var expired = <%=res.getString("expired")%>;
                                    if (days > expired) {
                                        a = '<span style="color:#8FBC8F"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                    } else {
                                        a = '<span style="color:#8FBC8F"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                    }
                                } else if (value == "已认证") {
                                    a = '<span style="color:#FF7F24"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                } else if (value == "复审退回") {
                                    a = '<span style="color:red"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
                                }
                            } else {
                                //有缺陷显示红色
                                a = '<span style="color:#8FBC8F;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>' + value + '</span>';
                            }
                            return a;
                        }
                    },
                    {
                        // title: '科室是否提交纸质病历',
                        title: '是否有纸质补充资料送病案室',
                        field: 'isscaned',
                        align: 'center',
                        valign: 'middle',
                        formatter: function (value, row, index) {
                            //在院  未归档  归档中  初审 已归档 已认证
                            var a = '';
                            var redFlag = row.numb;
                            var showVal="";
                            var colorVal="red";
                            if (value == "1") {
                                showVal="有";
                                colorVal="#030378;";
                            }else if (value == "0") {
                                showVal="无";
                                colorVal="#c0c0c0;";
                            }else {
                                showVal="未知";
                                colorVal="red;";
                            }
                            if (redFlag == 0) {
                                a = '<span style="color:'+colorVal+'"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>'+showVal+'</span>';
                            }else{
                                a = '<span style="color:'+colorVal+'"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>'+showVal+'</span>';
                            }
                            return a;
                        }
                    },
                    {
                        title: '是否签收',
                        field: 'isSign',
                        align: 'center',
                        valign: 'middle',
                        formatter: function (value, row, index) {
                            //在院  未归档  归档中  初审 已归档 已认证
                            var a = '';
                            var redFlag = row.numb;
                            var showVal="";
                            var colorVal="red";
                            if (value == "1") {
                                showVal="已签收";
                                colorVal="#030378;";
                            }else {
                                showVal="未签收";
                                colorVal="#c0c0c0;";
                            }
                            if (redFlag == 0) {
                                a = '<span style="color:'+colorVal+'"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>'+showVal+'</span>';
                            }else{
                                a = '<span style="color:'+colorVal+'"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>'+showVal+'</span>';
                            }
                            return a;
                        }
                    },
                    {
                        title: '签收人',
                        field: 'signer',
                        align: 'left',
                        visible: false,
                       /* formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value != null && value != "") {
                                value = value.substring(0, 10);
                            } else if (value == null) {
                                value = "";
                            } else {
                                value = value;
                            }
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //有缺陷显示红色
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '签收日期',
                        field: 'signTime',
                        align: 'center',
                        visible: false,
                        /*formatter: function (value, row, index) {
                            var redFlag = row.numb;
                            var a = "";
                            if (value != null && value != "") {
                                value = value.substring(0, 10);
                            } else if (value == null) {
                                value = "";
                            } else {
                                value = value;
                            }
                            if (redFlag == 0) {
                                a = value;
                            } else {
                                //有缺陷显示红色
                                a = '<span style="color:red;">' + value + '</span>';
                            }
                            return a;
                        }*/
                    },
                    {
                        title: '是否扫描',
                        field: 'isScanning',
                        align: 'center',
                        valign: 'middle',
                        formatter: function (value, row, index) {
                            //在院  未归档  归档中  初审 已归档 已认证
                            var a = '';
                            var redFlag = row.numb;
                            var showVal="";
                            var colorVal="red";
                            if (value == "1") {
                                showVal="已扫描";
                                colorVal="#030378;";
                            }else if (value == "0") {
                                showVal="未扫描";
                                colorVal="#c0c0c0;";
                            }else {
                                showVal="未知";
                                colorVal="red;";
                            }
                            if (redFlag == 0) {
                                a = '<span style="color:'+colorVal+'"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>'+showVal+'</span>';
                            }else{
                                a = '<span style="color:'+colorVal+'"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>'+showVal+'</span>';
                            }
                            return a;
                        }
                    },
                    {
                        title: '初审人',
                        field: 'firstInstance',
                        align: 'left'
                    },
                    {
                        title: "操作",
                        align: 'left',
                        valign: 'middle',
                        width: 100, // 定义列的宽度，单位为像素px
                        formatter: function (value, row, index) {
                            var url = window.location.href;
                            var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");
                            //return '<button class="btn btn-danger btn-sm" onclick="selectFun(\'' + row + '\')">查看 </button>';
                            var html = "";
                            if (index != null && index != "" && index.indexOf("select") != -1) {
                                html = '<button type="button" class="btn btn-danger btn-sm selInfo" >查看</button>';// '<a href="javascript:;" class="delete">删除</a>';
                            }
                            if (row.archivestate == '初审') {
                                /*if (index != null && index != "" && index.indexOf("back") != -1) {
                                    html += '<button type="button" class="btn btn-warning btn-sm returnInfo" >退回</button>';
                                }*/
                                if (index != null && index != "" && index.indexOf("last") != -1) {
                                    html += '<button type="button" class="btn btn-sm btn-primary verifyInfo">审核</button>';
                                }
                            }
                            if (index.indexOf("qxSel") != -1) {
                                var redFlag = row.numb;
                                if (redFlag != 0) {
                                    //有退回给医生的缺陷
                                    if(row.faultDoctorNum!= 0){
                                        html = html + '<button type="button" class="btn btn-sm btn-info getQXDoctorInfo">医生查看缺陷</button>';
                                    }
                                    //有退回给护士的缺陷
                                    if(row.faultNurseNum!= 0){
                                        html = html + '<button type="button" class="btn btn-sm btn-info getQXNurseInfo">护士查看缺陷</button>';
                                    }
                                }
                            }
                            if (index.indexOf("signFlg") != -1) {
                               if(row.isSign==0 && row.isscaned==1){
                                   //签收显示取消签收
                                   html += '<button type="button" class="btn btn-sm btn-warning signInfo" style="visibility: hidden;">签收</button>';
                                }else if(row.isSign==1 && row.isscaned==1){
                                   html += '<button type="button" class="btn btn-sm btn-warning signCancelInfo" style="visibility: hidden;">取消签收</button>';
                               }
                            }

                            return html;
                        },
                        events: {
                            'click .returnInfo': function (e, value, row, index) {
                                if (row.id != null && row.id != "") {
                                    $.ajax({
                                        url: "${path}/beHosp/getMaster",
                                        type: "POST",
                                        data: {"id": row.id},
                                        success: function (result) {
                                            if (result != null) {
                                                if (result.id != null) {
                                                    if (result.archivestate == '初审') {
                                                        //console.log("=====退回======");
                                                        $("#backArchiveId").val(row.id);
                                                        $('#form2').find('input,textarea').prop('readonly', false);
                                                        $('#returnBtn').show();
                                                        //清空标签的内容
                                                        $('#backContent').val("");
                                                        //分值只读
                                                        $.ajax({
                                                            url: "${path}/fault/getTotal",
                                                            type: "POST",
                                                            data: {backFlag: 2, archiveDetailId: row.id},
                                                            success: function (result) {
                                                                if (result != null && result != "") {
                                                                    $("#score").val(result.price);
                                                                    $("#score").attr("readonly", true);
                                                                } else {
                                                                    $("#score").val(0);
                                                                }
                                                            }
                                                        });


                                                        $('#returnModal').modal({
                                                            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                                            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                                            show: true//弹出对话框
                                                        });

                                                    } else {
                                                        toastr.warning("病案室已经退回!");
                                                        //刷新
                                                        $('#table').bootstrapTable('refresh');
                                                    }

                                                } else {
                                                    toastr.warning("病案号不存在!");
                                                }
                                            } else {
                                                toastr.warning("病案不存在!");
                                            }
                                        }, error: function () {
                                            toastr.error("操作失败!");
                                        }
                                    });
                                } else {
                                    toastr.warning("病案号不存在!");
                                }
                            },
                            'click .verifyInfo': function (e, value, row, index) {
                                if (row.id != null && row.id != "") {
                                    $.ajax({
                                        url: "${path}/beHosp/getMaster",
                                        type: "POST",
                                        data: {"id": row.id},
                                        success: function (result) {
                                            if (result != null) {
                                                if (result.id != null) {
                                                    if (result.archivestate == '初审') {
                                                        // console.log("====审核====");
                                                        $('#verifyModal').modal({
                                                            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                                            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                                            show: true//弹出对话框
                                                        });
                                                        $("#archiveId").val(row.id);
                                                        $("#isScaned2").val(row.isscaned);
                                                        $("#isSign2").val(row.isSign);
                                                        $("#verifyText").val("");

                                                    } else {
                                                        toastr.warning("病案室已经审核!");
                                                        //刷新
                                                        $('#table').bootstrapTable('refresh');
                                                    }

                                                } else {
                                                    toastr.warning("病案号不存在!");
                                                }
                                            } else {
                                                toastr.warning("病案不存在!");
                                            }
                                        }, error: function () {
                                            toastr.error("操作失败!");
                                        }
                                    });
                                } else {
                                    toastr.warning("病案号不存在!");
                                }

                            },
                            'click .selInfo': function (e, value, row, index) {
                                $("#printTableFlag").hide();
                                //ID供按需采集使用
                                $("#collectionID").val(row.id);
                                $("#pid").val(row.patientId);
                                if(row.printNum!=0){
                                    $("#printTableFlag").show();
                                }
                                //实时获取完整性
                                getWzxFun(row.id);
                                $('#selModal').modal({
                                    backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                    keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                    show: true//弹出对话框
                                });


                                if (row.archivestate != '复审退回') {
                                    $("#recallDiv").hide();
                                } else {
                                    $("#recallDiv").show();
                                }
                                if (row.archivestate == '初审') {
                                    $("#firstDiv").show();
                                } else {
                                    $("#firstDiv").hide();
                                }
                                //同步
                                $("#idLab").html(row.id);
                                 isscanedVal=row.isscaned;
                                 isSignVal=row.isSign;
                                $("#nameLab").html(row.name);
                                // $("#inDateLab").html(row.admissionDateTime.substring(0, 10));
                                if (row.admissionDateTime != null && row.admissionDateTime != '') {
                                    $("#inDateLab").html(row.admissionDateTime.substring(0, 10));
                                }
                                $("#chargeLab").html(row.doctorInCharge);
                                $("#deptToLab").html(row.deptAdmissionTo);
                                $("#outDeptToLab").html(row.deptName);
                                $("#outDeptDateLab").html(row.dischargeDateTime);
                                $("#outHospLab").html(row.dischargeDisposition);
                                $("#inLab").html(row.inpNo);
                                $("#patientId").html(row.patientId);
                                $("#inTimeLab").html(row.visitId);
                                //$("#wzContent").html(row.lockinfo);

                                //入/出院年+出院月+住院号+住院次数
                                var outDate = "";
                                if (row.dischargeDateTime != null && row.dischargeDateTime != "") {
                                    outDate = row.dischargeDateTime.split("-");
                                } else if (row.admissionDateTime != null && row.admissionDateTime != "") {
                                    outDate = row.admissionDateTime.split("-");
                                }
                                $("#outDateLab").val(outDate[0] + "" + outDate[1] + "" + row.inpNo.trim() + "" + row.visitId + "");

                                initTree(row.id);
                                //获取来源下拉框
                                getSourceFun();
                            },
                            'click .getQXDoctorInfo': function (e, value, row, index) {
                                //查看缺陷列表
                                //initTableQX(row.id);
                                docNorFlag= 3;
                                $("#archIdQX").val(row.id);
                                $('#tableQX').bootstrapTable('refresh');
                                $('#QXInfoModal').modal({
                                    backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                    keyboard: true,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                    show: true//弹出对话框
                                });
                            },
                            'click .getQXNurseInfo': function (e, value, row, index) {
                                //查看缺陷列表
                                //initTableQX(row.id);
                                docNorFlag= 4;
                                $("#archIdQX").val(row.id);
                                $('#tableQX').bootstrapTable('refresh');
                                $('#QXInfoModal').modal({
                                    backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                    keyboard: true,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                    show: true//弹出对话框
                                });
                            },
                            'click .signInfo': function (e, value, row, index) {
                                var isscaned=""+row.isscaned;
                                //签收
                                var inpNo=row.inpNo;
                                var visitId=row.visitId;
                                var isSign=1;
                                if(inpNo!=null && inpNo!="" && inpNo!=undefined && inpNo!="undefined"
                                && visitId!=null && visitId!="" && inpNo!=undefined && visitId!="undefined"){
                                    updateSignStateFun(inpNo,visitId,isSign);
                                }else{
                                    toastr.warning("签收值格式应为：住院号-住院次数!");
                                }

                            },'click .signCancelInfo': function (e, value, row, index) {
                                //取消签收
                                var inpNo=row.inpNo;
                                var visitId=row.visitId;
                                var isSign=0;
                                if(inpNo!=null && inpNo!="" && inpNo!=undefined && inpNo!="undefined"
                                    && visitId!=null && visitId!="" && inpNo!=undefined && visitId!="undefined"){
                                    updateSignStateFun(inpNo,visitId,isSign);
                                }else{
                                    toastr.warning("签收值格式应为：住院号-住院次数!");
                                }
                            }


                        },
                        cellStyle: function (value, row, index) {
                            return {classes: 'success'}

                        }
                    }
                ],
                onLoadSuccess: function (result) {  //加载成功时执行
                    // console.info("加载成功");
                    tipLoad = 0;
                    $('#table').bootstrapTable('scrollTo', scollPostion1);
                    //console.info(editSelRow);
                    if (editSelRow!= []) {
                        //对刷新表格的数据选中之前选的id行
                        $('#table').bootstrapTable("checkBy", {field: 'id', values: editSelRow});
                    }
                }, onCheckAll: function (rows) { //点击全选框时触发的操作
                    if (rows != null && rows.length) {
                        for (var i = 0; i < rows.length; i++) {
                            if(editSelRow.indexOf(row.id)==-1) {
                                editSelRow.push(rows[i].id);
                            }
                        }
                    }
                }, onCheck: function (row) {//点击每一个单选框时触发的操作
                    scollPostion1 = $('#table').bootstrapTable('getScrollPosition');
                    if(editSelRow.indexOf(row.id)==-1){
                        editSelRow.push(row.id);
                    }
                }, onUncheck: function (row) {//取消每一个单选框时对应的操作；
                    var index = editSelRow.indexOf(row.id);
                    if (index > -1) {
                        editSelRow.splice(index, 1);
                    }
                }, onUncheckAll: function (row) {//取消每一个单选框时对应的操作；
                    editSelRow = [];
                },
                onLoadError: function () {  //加载失败时执行
                    //console.info("加载数据失败");
                    tipLoad = 0;
                }
            });
        }
    }

    function rowStyle(row, index) {
        var style = {};
        if (row.followingType != null) {
            style = {css: {'color': '#76abed'}};
        }
        return style;
    }

    function getSourceFun(){
        //console.log("获取来源下拉框：sourceSearch");
        var patientId = $("#idLab").html();
        var source=$("#sourceSearch").val();
        var assortId = $("#assortId").html();
        if (assortId == 0) assortId = null;
        var temp = {
            patientId: patientId,
            assortId: assortId,
            source: source,
            flag: flag
        };
        var title = $("#titleSearch").val();
        if (title != null && title != "") {
            temp.title = title;
        }
        $.ajax({
            url: "${path}/inHosp/getSourceByClo", // 获取表格数据的url
            type: "POST",
            data: temp,
            success: function (result) {
                if (result != null) {
                    $("#sourceSearch").empty();
                    if(source==""){
                        $("#sourceSearch").append("<option value=''  selected='slected'>全部</option>");
                    }else {
                        $("#sourceSearch").append("<option value=''>全部</option>");
                    }
                    for(var i=0;i<result.length;i++){
                        if(result[i]!=null) {
                            if (result[i].source != "" && result[i].source != null && result[i].source != undefined) {
                                if(source==result[i].source && source!=""){
                                    $("#sourceSearch").append("<option value='" + result[i].source + "' selected='slected'>" + result[i].source + "</option>");
                                }else {
                                    $("#sourceSearch").append("<option value=" + result[i].source + ">" + result[i].source + "</option>");
                                }
                            } else {
                                $("#sourceSearch").append("<option value='null'>未知</option>");
                            }
                        }else{
                            $("#sourceSearch").append("<option value='-1'>未知</option>");
                        }
                    }
                    $(".selectpicker").selectpicker('refresh');
                } else {
                    toastr.warning("暂无任何来源!");
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    }

    var idArr = [];
    var flag = 0;
    var scollPostion2 = null;
    function initTable2() {
        //idArr = [];
        $("#table2").bootstrapTable({ // 对应table标签的id
            //method: 'POST',
            url: "${path}/inHosp/getAssortdetail", // 获取表格数据的url
            contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求，注释掉这句话也能拿到数据
            //dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
            cache: false, // 设置为 false 禁用 AJAX 数据缓存， 默认为true
            striped: true,  //表格显示条纹，默认为false
            pagination: true, // 在表格底部显示分页组件，默认false
            paginationShowPageGo: true,
            pageList: [10, 20, 50, 100], // 如果设置了分页，设置可供选择的页面数据条数。设置为All 则显示所有记录。
            smartDisplay: false,
            pageSize: 10, // 页面数据条数
            pageNumber: 1, // 初始化加载第一页，默认第一页
            sidePagination: 'server', // 设置为服务器端分页     客户端：client
            search: false,
            toolbar: '#toolbar2',//指定工具栏
            showColumns: true,
            searchOnEnterKey: true, //设置为 true时，按回车触发搜索方法，否则自动触发搜索方法
            undefinedText: '---', //当数据为 undefined 时显示的字符
            singleSelect: false,//设置True 将禁止多选
            clickToSelect: true,//设置true 将在点击行时，自动选择rediobox 和 checkbox
            height: 650,     //定义表格的高度。
            searchTimeOut: 500,// 默认500  设置搜索超时时间。
            toolbarAlign: 'left',// 指定 toolbar 水平方向的位置。'left' 或 'right'
            paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
            showHeader: true,//是否显示列头。
            trimOnSearch: true,//设置为 true 将自动去掉搜索字符的前后空格。
            queryParams: function (params) {
                var currPageSize = this.pageSize;
                /*if (currPageSize == 2) {
                    currPageSize = 10;
                }*/

                var limit = null;
                var offset = params.offset;
                var patientId = $("#idLab").html();
                var assortId = $("#assortId").html();
                if (assortId == 0) assortId = null;

                //判断是否导出全部all
                if ($("#sel_exportoption").val() == "all") {
                    offset = 0;
                    limit = this.totalRows;
                    this.pageSize = limit;
                } else {
                    limit = currPageSize;
                    this.pageSize = currPageSize;
                }
                var source =null;
                if($("#sourceSearch").val()!=null){
                    source=$("#sourceSearch").val();
                }
                var temp = {
                    limit: limit,     //页面大小
                    offset: offset,   //页码
                    order: params.order,      //排位命令（desc，asc）
                    patientId: patientId,
                    assortId: assortId,
                    source: source,
                    flag: flag
                };

                var title = $("#titleSearch").val();
                if (title != null && title != "") {
                    temp.title = title;
                }
                return temp;
            },
            sortName: 'assortSort', // 要排序的字段
            sortOrder: 'desc', // 排序规则
            columns: [{
                title: '全选',
                field: 'select',   //复选框
                checkbox: true,
                width: 25,
                align: 'center',
                hidden: true,
            }, {
                title: '序',
                field: 'id',
                align: 'left',
                visible: false
            },

                {
                    title: '分段类id',
                    field: 'assortId',
                    align: 'left',
                    valign: 'middle',
                    visible: false
                },

                {
                    title: '标题',
                    field: 'title',
                    align: 'left',
                    valign: 'middle',
                },
                {
                    title: '上传时间',
                    field: 'uploaddatetime',
                    align: 'left',
                    valign: 'middle',
                    width: 150, // 定义列的宽度，单位为像素px
                },
                {
                    title: '来源',
                    field: 'source',
                    align: 'center',
                    valign: 'middle',
                    width: 50, // 定义列的宽度，单位为像素px
                },
                {
                    title: '状态',
                    field: 'flag',
                    align: 'center',
                    valign: 'middle',
                    width: 80, // 定义列的宽度，单位为像素px
                    formatter: function (value, row, index) {
                        //在院  未归档  归档中  初审 已归档 已认证
                        var a = '';
                        if (value == "1") {
                            a = '<span style="color:red;"><i class="fa fa-times-circle-o" aria-hidden="true"></i>作废</span>';
                        } else if (value == "0") {
                            a = '<span style="color:green"><i class="fa fa-check-circle-o" aria-hidden="true"></i>使用</span>';
                        }
                        return a;
                    }
                },
                {
                    title: "操作",
                    align: 'left',
                    valign: 'middle',
                    width: 120, // 定义列的宽度，单位为像素px
                    formatter: function (value, row, index) {
                        var url = window.location.href;
                        var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");

                        var html = "";
                        if (index != null && index != "" && index.indexOf("edit") != -1) {
                            //return '<button class="btn btn-danger btn-sm" onclick="selectFun(\'' + row + '\')">查看 </button>';
                            html = html + '<button type="button" class="btn btn-info btn-sm editInfo" >编辑 </button>';// '<a href="javascript:;" class="delete">删除</a>';


                        }

                        if (index != null && index != "" && index.indexOf("cancel") != -1) {
                            if (row.flag == "0") {
                                html = html + '<button type="button" class="btn btn-danger btn-sm stateInfo" >作废 </button>';
                            }
                        }

                        if (index != null && index != "" && index.indexOf("delPdf") != -1) {
                            //console.log("===:" + row.pdfPath + "====" + row.source);
                            //删除
                            if (row.pdfPath != null && row.pdfPath != "") {
                                var pdfName = row.pdfPath.substring(row.pdfPath.lastIndexOf('\\') + 1, row.pdfPath.lastIndexOf('.'));
                                if (pdfName != row.assortId) {
                                    if (row.source != null && row.source != "") {
                                        if (row.source.indexOf("后台") != -1) {
                                            html = html + '<button type="button" class="btn btn-warning btn-sm delPdfInfo" >删除 </button>';
                                        }
                                    }
                                }
                            } else {

                                if (row.source != null && row.source != "") {
                                    if (row.source.indexOf("后台") != -1) {
                                        html = html + '<button type="button" class="btn btn-warning btn-sm delPdfInfo" >删除 </button>';
                                    }
                                }
                            }
                        }

                        if (row.source != null && row.source != "") {
                            //if (row.source.indexOf("后台") != -1) {
                            if (index != null && index != "" && index.indexOf("delPage") != -1) {
                                //return '<button class="btn btn-danger btn-sm" onclick="selectFun(\'' + row + '\')">查看 </button>';
                                html = html + '<button type="button" class="btn btn-primary btn-sm delPdfPage" >删除页 </button>';// '<a href="javascript:;" class="delete">删除</a>';
                            }
                            //}
                        }


                        //return '<button class="btn btn-danger btn-sm" onclick="selectFun(\'' + row + '\')">查看 </button>';
                        //var html = '<button type="button" class="btn btn-info btn-sm editInfo" >编辑 </button>';// '<a href="javascript:;" class="delete">删除</a>';

                        return html;
                    }, events: {
                        'click .editInfo': function (e, value, row, index) {

                            //console.log(row);
                            if (row.pdfPath != null && row.pdfPath != "") {
                                //console.log("===:" + row.pdfPath.indexOf(row.assortId + ".pdf") != -1);
                                if (row.pdfPath.indexOf(row.assortId + ".pdf") != -1) {
                                    $("#upPdfDiv").hide();
                                    $("#inpType").attr("disabled", "true");

                                } else {
                                    $("#upPdfDiv").show();
                                    $("#inpType").removeAttr("disabled");
                                }
                            } else {
                                $("#upPdfDiv").show();
                                $("#inpType").removeAttr("disabled");
                            }
                            if (row.source.indexOf("后台") != -1) {
                                $("#addFile").show();
                            } else {
                                $("#addFile").hide();
                                $("#inpType").attr("disabled", "true");
                            }


                            //同步
                            $("#inpId").val(row.id);
                            $("#inpTitle").val(row.title);
                            $("#inpType").val(row.assortId);
                            $("#inpSource").val(row.source);
                            $("#inpFlag").val(row.flag);
                            $("#pageNumber").val(row.pageNumber);
                            //console.log("===="+ row.pdfPath);
                            $("#pdfPathVal").val(row.pdfPath);
                            if (row.pdfPath != "" && row.pdfPath != null) {
                                $("#pdfPathVal").show();

                                //..\..\..\static\img\pdfFiles\980bda8d-18e3-4deb-bb25-9d2b3784e9f3\HC3SL2HENH348M8X619PMCA7GC5R3125\HC3SL2HENH348M8X619PMCA7GC5R3125.pdf
                                var pdfUrl = "../../" + (row.pdfPath).replace(/\\/g, "/");

                                $("#fileUrlInp").val(pdfUrl);
                                // var pdfUrl = "${path}/static/pdfjs/web/viewer.html?file=../../../static/img/pdfFiles/typesPdf/" + result;//+ result;

                                $('#previewFile').css("display", "block");//显示预览按钮
                                $('#addFile').attr("src", row.pdfPath);
                                //$("#addFile").val("ssss");
                                $('.inp_file').val(null);
                            } else {
                                $("#pdfPathVal").hide();
                                $('#addFile').attr("src", "");
                                $('.inp_file').val(null);
                            }

                            $('#assortModal').modal({
                                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                show: true//弹出对话框
                            });
                        }, 'click .stateInfo': function (e, value, row, index) {
                            $('#exampleModal').modal({
                                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                show: true//弹出对话框
                            });

                            //同步
                            $("#idT").val(row.id);

                        }, 'click .delPdfInfo': function (e, value, row, index) {
                            $('#delPdfModal').modal({
                                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                show: true//弹出对话框
                            });
                            //同步
                            $("#idPdfT").val(row.id);
                        }, 'click .delPdfPage': function (e, value, row, index) {
                            $("#mb").css("display", "block");
                            var target = document.getElementById('delPdfBody');
                            spinner.spin(target);//给id为foo的div 中绑上spinner
                            var pdfPath = row.pdfPath;//.replaceAll("\\","/");
                            //C:/Users/Administrator/Desktop/test/autoPdf/1617156631367.pdf
                            if (pdfPath != "") {
                                pdfPath = pdfPath.replace(/(\\)+/g, '/');
                                pdfPath = "${path}/static/pdfjs/web/viewer.html?file=" + encodeURIComponent("${path}/inHosp/pdfStreamHandeler?url=" + pdfPath);
                                $('#pdf_page').attr('src', pdfPath);
                                //病案号 45e9b098f9da49ffba1843bfc6930cb8
                            } else {
                                toastr.warning("勾选的PDF文件不存在或破损!");
                            }

                            //删除pdf某一页
                            $('#delPdfPageModal').modal({
                                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                                show: true//弹出对话框
                            });

                            // //同步
                            $("#pdfId").val(row.id);
                            $("#pathPdf").val(row.pdfPath);
                            getDelPicPageFun();
                            setTimeout(function () {
                                $("#mb").css("display", "none");
                                spinner.spin();
                            }, 1500);
                        }
                    },
                    cellStyle: function (value, row, index) {
                        return {classes: 'success'}

                    }
                }
            ],
            onLoadSuccess: function (result) {  //加载成功时执行
                // console.info("加载成功");
                //idArr = [];
                $('#table2').bootstrapTable('scrollTo', scollPostion2);
                if (idArr != []) {
                    //对刷新表格的数据选中之前选的id行
                    $('#table2').bootstrapTable("checkBy", {field: 'id', values: idArr});
                }
            },
            onLoadError: function () {  //加载失败时执行
                // console.info("加载数据失败");
                // toastr.warning("用户长时间未操作，请重新登录!");
            }, onCheckAll: function (rows) { //点击全选框时触发的操作
                if (rows != null && rows.length) {
                    for (var i = 0; i < rows.length; i++) {
                        if(idArr.indexOf(row.id)==-1) {
                            idArr.push(rows[i].id);
                        }
                    }
                }
            }, onCheck: function (row) {//点击每一个单选框时触发的操作
                scollPostion2 = $('#table2').bootstrapTable('getScrollPosition');
                if(idArr.indexOf(row.id)==-1){
                    idArr.push(row.id);
                }
            }, onUncheck: function (row) {//取消每一个单选框时对应的操作；
                var index = idArr.indexOf(row.id);
                if (index > -1) {
                    idArr.splice(index, 1);
                }
            }, onUncheckAll: function (row) {//取消每一个单选框时对应的操作；
                idArr = [];
            }

        });
    }

    initTable2();

    //点击扫描全选分段列表，查询来源为嘉时扫描系统
    /*$("#pdfBtn3").click(function () {
        $("#assortId").html("");
        $("#source").html("嘉时扫描系统");
        $("#table2").bootstrapTable("refreshOptions", {pageNumber: 1});
    });*/

    $("#flag").click(function () {
        if ($("#flag").is(":checked") == true) {
            //选中触发事件
            flag = 1;
            $('#table2').bootstrapTable('refreshOptions', {limit: 1, offset: 10});
        } else {
            flag = 0;
            //取消选中触发事件
            $('#table2').bootstrapTable('refreshOptions', {limit: 1, offset: 10});
        }
        initTree($("#idLab").html());
        //idArr = [];

    });

    $("#signBtn").click(function () {
        //签收
        $('#signModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });
    });

    function updateSignStateFun(inpNo,visitId,isSign){
        $.ajax({
            url: "${path}/lastVerify/updateSignState",
            type: "POST",
            data: {inpNo:inpNo, visitId: visitId, isSign:isSign},
            success: function (result) {
                if (result.indexOf("成功")!=-1) {
                    //刷新
                    $('#table').bootstrapTable('refresh');
                    toastr.success(result);
                } else {
                    toastr.warning(result);
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    }

    //回车事件绑定
    $('#archiveIdSign').bind('keyup', function(event) {
        if (event.keyCode == "13") {
            //回车执行查询
            $('#signBtn2').click();
        }
    });

    $("#signBtn2").click(function () {
        //签收
        var signVal= $('#archiveIdSign').val();
        signVal=signVal.trim();
        if(signVal==null || signVal==""){
            toastr.warning("签收值不能为空!");
            return;
        }
        if(signVal.indexOf("-")!=-1){
            var signArr=signVal.split("-");
            var inpNo=signArr[0];
            var visitId=signArr[1];
            var isSign=1;
            updateSignStateFun(inpNo,visitId,isSign);
            $('#archiveIdSign').val('');
        }else{
            toastr.warning("签收值格式应为：住院号-住院次数!");
            return;
        }

    });

    $("#signBtn3").click(function () {
        //取消签收
        //签收
        var signVal= $('#archiveIdSign').val();
        signVal=signVal.trim();
        if(signVal==null || signVal==""){
            toastr.warning("签收值不能为空!");
            return;
        }
        if(signVal.indexOf("-")!=-1){
            var signArr=signVal.split("-");
            var inpNo=signArr[0];
            var visitId=signArr[1];
            var isSign=0;
            updateSignStateFun(inpNo,visitId,isSign);
            $('#archiveIdSign').val('');
        }else{
            toastr.warning("签收值格式应为：住院号-住院次数");
            return;
        }
    });


    $("#selModal").keydown(function (e) {
        if (e.keyCode == 13) {
            event.preventDefault();//禁用默认回车事件
        }
    });

    //采集体温单
    $("#button1").click(function () {
        $.ajax({
            url: "${path}/signList/collection",
            type: "POST",
            data: {flagNum: 1,id:$("#collectionID").val(),pid:$("#pid").val()},
            success: function (result) {
                if (result != null) {
                    toastr.success(result);
                }
            }
        });
    });



    //采集护理记录
    $("#button2").click(function () {
        $.ajax({
            url: "${path}/signList/collection",
            type: "POST",
            data: {flagNum: 2,id:$("#collectionID").val(),pid:$("#pid").val()},
            success: function (result) {
                if (result != null) {
                    toastr.success(result);
                }
            }
        });
    });


    //采集首页
    $("#button3").click(function () {
        $.ajax({
            url: "${path}/signList/collection",
            type: "POST",
            data: {flagNum: 3,id:$("#collectionID").val(),pid:$("#pid").val()},
            success: function (result) {
                toastr.success(result);
            }
        });

    });


    //采集医生文书
    $("#button4").click(function () {
        $.ajax({
            url: "${path}/signList/collection",
            type: "POST",
            data: {flagNum: 4,id:$("#collectionID").val(),pid:$("#pid").val()},
            success: function (result) {
                toastr.success(result);
            }
        });

    });


    //采集护士文书
    $("#button5").click(function () {
        $.ajax({
            url: "${path}/signList/collection",
            type: "POST",
            data: {flagNum: 6,id:$("#collectionID").val(),pid:$("#pid").val()},
            success: function (result) {
                toastr.success(result);
            }
        });

    });


    //采集评估单
    $("#button6").click(function () {
        $.ajax({
            url: "${path}/signList/collection",
            type: "POST",
            data: {flagNum: 5,id:$("#collectionID").val(),pid:$("#pid").val()},
            success: function (result) {
                if (result != null) {
                    toastr.success(result);
                }
            }
        });

    });

    //查询
    $('#searchBtn').click(function () {
        if (tipLoad == 0) {
            $("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
        } else {
            toastr.warning("正在查询，请稍等...");
        }
    });

    //添加pdf记录
    $("#collectionBtn").click(function () {
        $('#collectionModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });
    });


    //添加pdf记录
    $("#addPdfBtn").click(function () {
        if ($('#inpType').val() != null || $('#inpType').val() != "") {
            $("#inpId").val("");
            $("#inpTitle").val("");
            $("#pageNumber").val(1);
            $("#inpSource").val("后台");
            $('#addFile').attr("src", "");
            $('.inp_file').val(null);
            $('#upPdfDiv').show();
            $("#pdfPathVal").hide();
            $('#addFile').show();
            $("#inpType").removeAttr("disabled");
            $('#assortModal').modal({
                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                show: true//弹出对话框
            });
            $('#pdfPathVal').val("");

        } else {
            toastr.warning("请选择分段类别!");
        }

    });
    //点击跳转至平台统一视图
    $("#viewBtn").click(function () {
        debugger;
        var patientId=$("#patientId").html() ;
        var newWindow = window.open("http://10.6.0.158:8089/hdrciv/civ/jsp/visitView/visitView.jsp/rpc?username=00000&patient_id="+patientId);
    });

    //获取table的高度
    function getHeight() {
        return $(window).height() - 100;
    }

    initTable();


    //2.初始化select的change事件
    $("#sel_exportoption").change(function () {
        $('#table').bootstrapTable('refreshOptions', {
            exportDataType: $(this).val()
        });
    });
    $("#refreshBtn").click(function () {
        //刷新
        $('#table').bootstrapTable('refresh');
    });

    //导出excel功能
    $("#excelBtn").click(function () {
        // var id = "" + $("#id").val();
        var inpNo = "" + $("#inpNo").val();
        var visitId = "" + $("#visitId").val();
        var name = "" + $("#name").val();
        //var idNo = "" + $("#idNo").val();
        //var state = "" + $("#state").val();
        // var archivestate = "" + $("#archivestate").val();
        // var url = window.location.href;
        // var deptName = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
        // if (deptName != null && deptName != '') {
        //     deptName +=  "," + $("#deptName").val();
        // } else {
        //     deptName = $("#deptName").val();
        // }
        var deptName = $("#deptName").val();
        if (deptName.indexOf("") != -1) {
            deptName = "";
        } else {
            deptName = $("#deptName").val().toString();
        }
        var startDateTo = $("#startDateTo").val();
        var endDateTo = $("#endDateTo").val();

        //2021-05-13
        var idNo=$("#idNo").val();
        var isScanning= $("#isScanning").val();
        var isSign = $("#isSign").val();
        var isscaned = $("#isscaned").val();
        //var signer = $("#signer").val();
        var startSignDate = $("#startSignDate").val();
        var endSignDate = $("#endSignDate").val();
        window.location.href = "${path}/lastVerify/exportExcel?inpNo=" + inpNo + "&visitId=" + visitId +
            "&name=" + name + "&deptName=" + deptName  + "&startDateTo=" + startDateTo + "&endDateTo=" + endDateTo
            + "&isscaned=" + isscaned + "&isSign=" + isSign + "&signer=" + signer+ "&startSignDate=" + startSignDate
            + "&endSignDate=" + endSignDate+ "&idNo=" + idNo+ "&isScanning=" + isScanning;

    });

    var zNodes = [];
    var nodeList = [];

    function initTree(patientId) {
        var target = document.getElementById('foo');
        spinner.spin(target);//给id为foo的div 中绑上spinner
        zNodes = [];
        //获取所有分段列表
        $.ajax({
            url: "${path}/inHosp/getAssort",
            type: "POST",
            data: {patientId: patientId, flag: flag},
            async: true,
            success: function (result) {
                zNodes.push({id: 0, pId: 0, name: "分段列表", open: true});
                if (result.length > 0) {
                    for (var i = 0; i < result.length; i++) {
                        //下拉类别
                        //$("#inpType").append("<option value=" + result[i].assortId + ">" + result[i].assortName + "</option>");
                        //树列表
                        var obj = {};
                        obj.id = result[i].assortId;
                        obj.pId = 0;
                        obj.name = "" + result[i].assortName + "(" + (result[i].pageNum) + ")";
                        obj.assortSort = result[i].assortSort;
                        obj.patientId = result[i].patientId;
                        obj.printFlag = result[i].printFlag;
                        zNodes.push(obj);
                    }
                }
                //$.fn.zTree.init($("#ztree"), setting, zNodes);
                var treeObj = $.fn.zTree.init($("#ztree"), setting, zNodes);
                var node;
                var currId = $("#assortId").html();
                if (currId != "" && currId != null) {
                    //修改选中已选节点
                    node = treeObj.getNodeByParam("id", currId);
                } else {
                    //添加选中父节点
                    var node = treeObj.getNodeByParam("id", 0);
                }
                treeObj.selectNode(node, true);//将指定ID的节点选中
                $('#table2').bootstrapTable('refresh');
                spinner.spin();
            }, error: function () {
                //toastr.error("加载失败!");
            }
        });


    }

    var setting = {
        view: {
            addHoverDom: false,
            removeHoverDom: false,
            selectedMulti: false,
            autoCancelSelected: false
        },
        check: {
            enable: true
        },
        data: {
            simpleData: {
                enable: true,
                idKey: "id",
                pIdKey: "pId",
                rootPId: "0"
            }
        },
        edit: {
            enable: false
        },
        callback: {
            beforeClick: function (treeId, treeNode) {
                $("#assortId").html(treeNode.id);
                $("#source").html("");
                //查询之后重新从第一页算起
                $('#table2').bootstrapTable('refreshOptions', {limit: 1, offset: 10});
                //刷新
                $('#table2').bootstrapTable('refresh');
                //idArr = [];
            }

        }
    };

    function searchNode() {
        var zTree = $.fn.zTree.getZTreeObj("ztree");
        var value = $("#key").val();
        if (value == "") {
            var nodes = zTree.getNodesByParam("isHidden", true);
            zTree.showNodes(nodes);
        } else {
            nodeList = zTree.getNodesByParamFuzzy("name", value);
            var nodes = zTree.getNodes();
            zTree.hideNodes(nodes[0].children);
            updateNodes(true);
        }
        zTree.expandAll(true);
    }

    function updateNodes(highlight) {
        var zTree = $.fn.zTree.getZTreeObj("ztree");
        for (var i = 0, l = nodeList.length; i < l; i++) {
            zTree.showNode(nodeList[i]);
        }
    }

    /*$(document).keydown(function (event) {
        if (event.keyCode == 13) {
            searchNode();
        }
    });*/

    //展开
    function expandAll() {
        var treeObj = $.fn.zTree.getZTreeObj("ztree");
        treeObj.expandAll(true);
    }

    //收缩
    function collapseAll() {
        var treeObj = $.fn.zTree.getZTreeObj("ztree");
        treeObj.expandAll(false);
    }

    $("#searchBtn1").click(function () {
        searchNode();
    });

    $("#updateStateBtn").click(function () {
        //选中批量作废
        var id = idArr.toString();
        //判断id
        if (id == null || id == '') {
            toastr.warning("请选择记录!");
            return;
        }
        $.ajax({
            url: "${path}/inHosp/updateStateAll",
            type: "POST",
            data: {"id": id, flag: "1"},
            success: function (result) {
                if (result == 1) {
                    //刷新
                    $('#table2').bootstrapTable('refresh');
                    toastr.success("批量作废成功!");
                } else {
                    toastr.error("批量作废失败，无记录!");
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    });

    $("#updateStateBtn2").click(function () {
        //选中批量使用
        var id = idArr.toString();
        //判断id
        if (id == null || id == '') {
            toastr.warning("请选择记录!");
            return;
        }
        $.ajax({
            url: "${path}/inHosp/updateStateAll",
            type: "POST",
            data: {"id": id, flag: "0"},
            success: function (result) {
                if (result == 1) {
                    //刷新
                    $('#table2').bootstrapTable('refresh');
                    toastr.success("批量使用成功!");
                } else {
                    toastr.error("批量使用失败，无记录!");
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    });

    function submitForm(i) {
        var formDate = new FormData($("#form2")[0]);
        $.ajax({
            url: 'upload_importFile.do?ccqoid=' + i,
            type: 'POST',
            data: formDate,
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            success: function (data) {
                if (data.success) {
                    //$.messager.alert('提示', '导入成功!');
                }
            },
            error: function (returndata) {

            }
        });
    };

    $("#stateBtn").click(function () {
        $('#exampleModal').modal('hide');  //手动关闭
        var id = $("#idT").val();
        //console.log("===作废事件=======" + id);
        $.ajax({
            url: "${path}/inHosp/updateState",
            type: "POST",
            data: {"id": id, flag: "1"},
            success: function (result) {
                if (result == 1) {
                    //刷新
                    $('#table2').bootstrapTable('refresh');
                    toastr.success("作废成功!");
                } else {
                    toastr.error("作废失败，无该条记录!");
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    });

    $("#closeBtn").click(function () {
        $('#selModal').modal('hide');  //手动关闭
        //刷新
        $('#table').bootstrapTable('refresh');
    });


    //删除pdf
    $("#statePdfBtn").click(function () {
        $('#delPdfModal').modal('hide');  //手动关闭
        var id = $("#idPdfT").val();
        //console.log("===作废事件=======" + id);
        $.ajax({
            url: "${path}/inHosp/delPdfInfo",
            type: "POST",
            data: {"id": id},
            success: function (result) {
                if (result == 1) {
                    //刷新
                    $('#table2').bootstrapTable('refresh');
                    initTree($("#idLab").html());
                    toastr.success("删除成功!");
                } else {
                    toastr.error("删除失败，无该条记录!");
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });

    });
    //删除pdf页码
    $("#delPageBtn").click(function () {
        var pagePdfVal = $("#pagePdf").val();
        if (pagePdfVal == null || pagePdfVal == "") {
            toastr.warning("页码必填!");
            return;
        }
        if (pagePdfVal != null && pagePdfVal != "") {
            if (pagePdfVal <= 0) {
                toastr.warning("起始页码大于0且必填!");
                return;
            }
        }
        if ($("#pagePdf2").val() != null && $("#pagePdf2").val() != "" && pagePdfVal != null && pagePdfVal != "") {
            if ($("#pagePdf2").val() <= 0) {
                toastr.warning("结尾页码需大于0!");
                return;
            } else if ($("#pagePdf2").val() < $("#pagePdf").val()) {
                toastr.warning("结尾页码必须大于起始页码!");
                return;
            }
        }
        $("#numDel").empty();
        if ($("#pagePdf").val() != "" && $("#pagePdf").val() != null) {
            $("#numDel").append($("#pagePdf").val());
            if ($("#pagePdf2").val() != "" && $("#pagePdf2").val() != null) {
                $("#numDel").append("至" + $("#pagePdf2").val());
            }
            $('#delPdfPageModal2').modal({
                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                show: true//弹出对话框
            });
        } else {
            toastr.warning("请输入页码!");
        }
    });

    //确认删除pdf页码
    $("#delPageBtn2").click(function () {
        $('#delPdfPageModal2').modal('hide');  //手动关闭
        var entity = {};
        entity.id = $("#pdfId").val();
        entity.title = "" + $("#pagePdf").val();
        if ($("#pagePdf2").val() != null && $("#pagePdf2").val() != null) {
            entity.sys = "" + $("#pagePdf2").val();
        } else {
            entity.sys = "";
        }
        entity.pdfPath = $("#pathPdf").val();
        if (entity.id == null || entity.id == "") {
            toastr.warning("id不为空!");
            return;
        }
        if (entity.title == null || entity.title == "") {
            toastr.warning("起始页码必填!");
            return;
        }
        if (entity.title != null && entity.title != "") {
            if (entity.title <= 0) {
                toastr.warning("起始页码大于0必填!");
                return;
            }
        }
        if (entity.pdfPath == null || entity.pdfPath == "") {
            toastr.warning("PDF不存在!");
            return;
        }
        $("#mb").css("display", "block");
        var target = document.getElementById('delPdfBody');
        spinner.spin(target);//给id为foo的div 中绑上spinner
        $.ajax({
            url: "${path}/inHosp/delPdfPage",
            type: "POST",
            data: entity,
            success: function (result) {
                $("#mb").css("display", "none");
                spinner.spin();
                $("#pagePdf").val("");
                $("#pagePdf2").val("");
                //$('#delPdfPageModal').modal('hide');  //手动关闭
                if (result == 1) {
                    //刷新
                    var pageNum = $("#pageNumber").val();
                    $('#pdf_page').attr('src', $('#pdf_page').attr('src'));
                    $("#pageNumber").val(pageNum);
                    getDelPicPageFun();
                    $('#table2').bootstrapTable('refresh');
                    initTree($("#idLab").html());
                    if (entity.sys == "") {
                        toastr.success("删除pdf页数,第" + entity.title + "页成功!");
                    } else {
                        toastr.success("删除pdf页数,第" + entity.title + "至" + entity.sys + "页成功!");
                    }
                } else if (result == 0) {
                    if (entity.sys == "") {
                        toastr.warning("删除pdf页数,第" + entity.title + "页失败!");
                    } else {
                        toastr.success("删除pdf页数,第" + entity.title + "至" + entity.sys + "页成失败!");
                    }
                } else if (result == 2) {
                    toastr.warning("pdf文件不存在!");
                } else if (result == 3) {
                    toastr.warning("删除页码或页数不得大于总页数!");
                } else if (result == 4) {
                    toastr.warning("删除页码前备份失败!");
                } else if (result == 5) {
                    toastr.warning("只剩一页不可再删!");
                }
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    });
    // $("#addBtn").click(function () {
    //     $("#inpId").val("");
    //     $("#inpTitle").val("");
    //     $("#inpSource").val("后台");
    //     $("#inpFlag").val("0");
    //     $('#assortModal').modal({
    //         backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
    //         keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
    //         show: true//弹出对话框
    //     });
    // });

    function inpFun() {
        var temp = {};
        temp.id = $("#inpId").val();
        temp.title = $("#inpTitle").val();
        temp.assortid = $("#inpType").val();
        temp.source = $("#inpSource").val();
        temp.flag = $("#inpFlag").val();
        temp.masterid = $("#idLab").html();
        temp.sys = "emr_medical_record";
        return temp
    }

    $("#saveBtn").click(function () {
        if ($("#inpTitle").val().length > 100) {
            toastr.warning("内容长度不超过100!");
            return;
        }
        //判断file是否为空，如果不是弹出提示框标识该文件已经存在是否替换
        //console.log($("#addFile").attr("src")=="");
        if ($("#addFile").attr("src") == "") {
            //判断文件类型，并上传pdf
            uploadFileFun();
        } else {
            //提示是否替换已有的pdf文件且判断file是否为空
            //console.log($('#addFile')[0].files[0]);
            if ($('#addFile')[0].files[0] != undefined) {
                $('#tsPdfModal').modal({
                    backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                    keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                    show: true//弹出对话框
                });
            } else {
                //判断文件类型，并上传pdf
                uploadFileFun();
            }
        }
        //idArr = [];
    });

    $("#thPdfBtn").click(function () {
        $('#tsPdfModal').modal('hide');  //手动关闭
        //判断文件类型，并上传pdf
        uploadFileFun();
    });


    jQuery(function ($) {
        //解决模态框背景色越来越深的问题
        $(document).on('show.bs.modal', '.modal', function (event) {
            $(this).appendTo($('body'));
        }).on('shown.bs.modal', '.modal.in', function (event) {
            setModalsAndBackdropsOrder();
        }).on('hidden.bs.modal', '.modal', function (event) {
            setModalsAndBackdropsOrder();
        });

        function setModalsAndBackdropsOrder() {
            var modalZIndex = 1040;
            $('.modal.in').each(function (index) {
                var $modal = $(this);
                modalZIndex++;
                $modal.css('zIndex', modalZIndex);
                $modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1);
            });
            $('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden');
        }

        //覆盖Modal.prototype的hideModal方法
        $.fn.modal.Constructor.prototype.hideModal = function () {
            var that = this
            this.$element.hide()
            this.backdrop(function () {
                //判断当前页面所有的模态框都已经隐藏了之后body移除.modal-open，即body出现滚动条。
                $('.modal.fade.in').length === 0 && that.$body.removeClass('modal-open')
                that.resetAdjustments()
                that.resetScrollbar()
                that.$element.trigger('hidden.bs.modal')
            })
        }
    });

    var oTimeAxiosFun = null;
    $("#getTimeline").click(function () {
        $('#timeLineModal').modal({
            backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
            keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
            show: true//弹出对话框
        });

        var param = {
            data: "", // 数据
            id: 'cxTime', //dom节点ID
            index: 0, // 选中时间节点
            sort: 'just', // 正序just，反序back, 其他表示不排序
            sortKey: 'handleTime', //排序的参数key
            // activeColor: '#26a69a', // 选中颜色
            props: ['handleName', 'handleTime', 'followingContent'], //展示的key
        }

        var masterId = $("#idLab").html();
        $.ajax({
            url: "${path}/medicalHandle/getTimeLine?masterId=" + masterId,
            type: "GET",
            success: function (result) {
                param.data = result;
                oTimeAxiosFun = new oTimeAxios(param);
            }, error: function () {
                toastr.error("操作失败!");
            }
        });
    });

    $("#getReloadWz").on('click', function () {
        var masterId = $("#idLab").html();
        $.ajax({
            url: "${path}/reloadWz",
            type: "POST",
            data: {masterId: masterId},
            success: function (result) {
                //console.log(result);
                if (result > 0) {
                    toastr.success("重新校验成功!");
                    $.ajax({
                        url: "${path}/beHosp/wzByArchivId",
                        type: "POST",
                        data: {archiveDetailId: masterId},
                        success: function (resultWz) {
                            //console.log(resultWz);
                            $("#wzContent").html(resultWz);
                        }
                    });
                } else {
                    toastr.warning("重新校验失败!");
                }
            }
        });
    });

    function enter() {
        if (event.keyCode == 13) {
            document.getElementById('searchBtn').click();
        }
    }

</script>

</html>