<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('过程质控列表')" />
	<th:block th:include="include :: layout-latest-css" />
	<link th:href="@{/mrqc/css/zktx/zk_tips_defect.css}" rel="stylesheet" />
	<th:block th:include="include :: select2-css" />
	<th:block th:include="include :: ztree-css" />
	<link th:href="@{/mrqc/js/layui/css/layui.css}" rel="stylesheet" />
	<style type="text/css">
		.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
			position: relative;
			margin-top: 0px;
			margin-bottom: 2px;
			line-height: 34px;
		}
		.control-label {
			padding: 0;
			text-align: right;
			height: 36px;
			line-height: 36px;
		}
		.zk_chartArea {
			height: auto;
			background: rgb(255, 255, 255);
			overflow: hidden;
			border-radius: 10px;
			padding: 10px 0px 0px 0px;
		}
		.layui-badge-dot {
			width: 22px;
			height: 18px;
			padding: 0;
			border-radius: 50%;
			font-size: 12px;
			text-align: center;
			background-color: #FF5722;
			color: #fff;
			display: inline-block;
			margin: 0px -2px 0px;
			position: absolute;
			top: 12px;
			right: -4px;
		}
		body .layer-ext-myskin {
			min-width: 100px;
			background-color: rgba(255, 255, 255, 0);
			filter: alpha(opacity=60);
			background-color: rgba(0,0,0,0);
			color: #fff;
			border: none;
			box-shadow: 1px 1px 5px rgba(0,0,0,0);
		}
	</style>
</head>
<body class="gray-bg">
<div class="container-div ui-layout-center" onmousedown="closeLayOpen()">
	<div class="row">
		<div class="col-sm-12 zk_chartArea">
			<form id="user-form">
				<div class="row">
					<div class="form-group col-xs-3 col-sm-3 col-md-3 col-lg-3" id="div11">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label"><font id="inpatientAreaInputName">[[${@mrqcConfig.getAlias('inpatient_area')}]]：</font></label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="hidden" class="form-control" id="inpatientArea" name="inpatientArea" />
							<input type="hidden" class="form-control" id="iptaCode" name="iptaCode" th:value="${iptaCode}"/>
							<select id="inpatientAreaSel" class="form-control select2">
							</select>
						</div>
					</div>
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label"><font id="departmentInputName">[[${@mrqcConfig.getAlias('department_name')}]]：</font></label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="hidden" class="form-control" name="departmentName" id="departmentName"/>
							<input type="hidden" class="form-control" id="deptCode" name="deptCode" th:value="${deptCode}"/>
							<select id="departmentSel" class="form-control select2-multiple" multiple>
							</select>
						</div>
					</div>
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3" >
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">医生：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="hidden" class="form-control" name="mainDoctor" id="mainDoctor" th:value="${doctorName}"/>
							<select id="mainDoctorSel" class="form-control select2-multiple" multiple  th:value="${doctorName}">
							</select>
						</div>
					</div>
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">患者：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="text" class="form-control" name="patientNameSearch"/>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label id="mouth" class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">出院月份：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="text" class="form-control col-lg-2" autocomplete="off" id="hospitDate" name="hospitDate"/>
						</div>
					</div>
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">病历情况：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<select name="recordLevel" id="recordLevel" class="form-control select2">
								<option value="" checked="checked">全部</option>
								<option value="甲">甲级</option>
								<option value="乙">乙级</option>
								<option value="丙">丙级</option>
							</select>
						</div>
					</div>
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">重点指标：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="hidden" name="keyIndices" id="keyIndiceVals"/>
							<select id="keyIndices" class="form-control select2-multiple" multiple>
							</select>
						</div>
					</div>
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">质控类型：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<select name="machineOrLabor" id="machineOrLabor" class="form-control select2" style="min-width: 75px">
								<option value="1" checked="checked">机器</option>
								<option value="0">人工</option>
							</select>
						</div>
					</div>

				</div>
				<div class="row">
					<div class="form-group col-xs-3 col-md-3 col-md-3 col-lg-3">
						<label class="col-xs-5 col-sm-5 col-md-6 col-lg-3 control-label">在院/出院：</label>
						<div class="col-xs-7 col-sm-7 col-md-6 col-lg-9">
							<input type="hidden" name="status" id="status" value="1" />
							<i id="changeStatusBox" style="margin-top: 2.5px;" class="fa fa-toggle-on text-info fa-2x" onclick="changeStatus()"></i>
						</div>
					</div>
					<div class="form-group col-xs-6 col-sm-6 col-md-6 col-lg-6" style="text-align: center;">
						<a class="btn btn-primary btn-rounded btn-sm"
						   onclick="query()"><i class="fa fa-search"></i>&nbsp;查询</a>
						<a class="btn btn-warning btn-rounded btn-sm" th:if="${#strings.isEmpty(doctorName)}"
						   onclick="resetIndex()"><i class="fa fa-refresh" ></i>&nbsp;重置</a>
						<a shiro:hasPermission="mrqc:emr:refreshAllEmr" class="btn btn-success btn-rounded btn-sm"
						   onclick="refreshAllKqyy()"><i class="fa fa-refresh"></i>&nbsp;刷新在院病历</a>
					</div>
				</div>
			</form>
		</div>
		<div class="tab-content ">
			<div class="tab-pane active" style="margin-right: 1px">
				<div>
					<!--卡片列表-->
					<div class="zk_resultList" id="zk_resultList">
						<div class="buttons-toolbar" id="toolbar" role="group">
<!--							<a shiro:hasPermission="mrqc:processt:remind" class="btn btn-warning" id="remindAllBtn">-->
<!--								批量提醒-->
<!--							</a>-->
							<a class="btn btn-info" id="export" onclick="$.table._option.modalName = '丙级病历';$.table.exportExcel(); $.table._option.modalName = '过程质控';">
								丙级病历导出
							</a>
						</div>

						<div class="col-sm-12 select-table table-striped" style="margin-top: 0px;">
							<table id="bootstrap-table" data-mobile-responsive="true"></table>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
</div>

<div id="defectDiv" class="tips-contentfixed-new" style="display: none">
	<div class="bg-frame-top">
		<img th:src="@{/mrqc/images/zktx/bg-frame-top.png}" width="330" height="15">
	</div>

	<div class="tips-content-box">
		<div class="tips-box-title" id="box-title" style="cursor:move">
			病历缺陷项：
			<div class="title-icons-right">
				<a href="#" onclick="closeLayOpen()">
					<!--<img th:src="@{/mrqc/images/zktx/tips-arrow.png}" width="14" height="14">-->
					<i class="layui-icon">&#x1006;</i>
				</a>
			</div>
		</div>
		<div class="tips-mid-content">
			<div id="defectContentDiv" class="layui-collapse" lay-accordion style="width: 99%; margin-left: 2px;">

			</div>
		</div>
	</div>
	<div class="bg-frame-bottom">
		<img id="topImage" th:src="@{/mrqc/images/zktx/bg-frame-top.png}" width="330" height="15">
	</div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="mrqc/include :: select2-js"/>
<th:block th:include="include :: ztree-js" />
<script th:src="@{/mrqc/js/layui/layui.js}"></script>
<script th:inline="javascript">
	var hasRemind = false;
	var prefix = ctx + "mrqc/process";
	var prefixApi = ctx + "api";
	var prefixKqyy = ctx + "kqyyApi";
	var doctorName = [[${doctorName}]];//默认医师名称
	var inpatientAreaName = [[${inpatientAreaName}]];  // 默认大部门
	var deptName = [[${deptName}]]; //默认小部门
	var inpatientAreaInputName = [[${@config.getKey('mrqc.process.inpatientAreaInputName')}]];
	var departmentInputName = [[${@config.getKey('mrqc.process.departmentInputName')}]];
	var allDepartment = JSON.parse('[[${allDepartment}]]');
	var allInpatientArea = JSON.parse('[[${allInpatientArea}]]');
	var allAreaAndDepatment = JSON.parse('[[${allAreaAndDepatment}]]');
	var doctorMapByArea =JSON.parse('[[${doctorMapByArea}]]');
	var allDoctor = JSON.parse('[[${allDoctor}]]');
	var inOrOutHospital = [[${@config.getKey('mrqc.search.inOrOutHospital')}]];

	var lvYTopScore = [[${@mrqcConfig.getEmrScore('LV2')}]];
	var lvBTopScore = [[${@mrqcConfig.getEmrScore('LV3')}]];

</script>
<script th:inline="javascript" shiro:hasPermission="mrqc:processt:remind">
	hasRemind = true;
</script>
<script th:inline="javascript">
	if(undefined !== inOrOutHospital && '' !== inOrOutHospital){
		$("#changeStatusBox").removeClass("class");
		if(inOrOutHospital === "1"){
			$("#mouth").html("出院月份：");
			$("#status").val("1");
			$("#changeStatusBox").removeClass("fa-toggle-off");
			$("#changeStatusBox").addClass("fa-toggle-on");
		}
		if(inOrOutHospital === "0"){
			$("#mouth").html("入院月份：");
			$("#status").val("0");
			$("#changeStatusBox").removeClass("fa-toggle-on");
			$("#changeStatusBox").addClass("fa-toggle-off");
		}
	}
</script>
<script th:src="@{/mrqc/kqyy/js/doctorQcList.js}"></script>

<script TYPE="application/javascript">
	//首先获取鼠标位置 x坐标：e.pageX和y坐标：e.pageY
	$('#box-title').mousedown(function (e) {
		//拖动时鼠标相对于div左上角的left值和top值是不变的
		//要求黑色线段，则用:绿色线段-红色线段
		var positionDiv = $(this).offset();
		var distenceX = e.pageX - positionDiv.left;
		var distenceY = e.pageY - positionDiv.top;

		$('#defectDiv').mousemove(function (e) {
			var x = e.pageX - distenceX;
			var y = e.pageY - distenceY;
			//使div在可视窗口内拖动
			if (x < 0) { //防止左边移出可视窗口
				x = 0;
			} else if (x > $(document).width() - $('#defectDiv').outerWidth(true)) { //防止右边移出可视窗口
				x = $(document).width() - $('#defectDiv').outerWidth(true);
			}
			if (y < 0) //防止顶部移出可视窗口
			{
				y = 0;
			} else if (y > $(document).height() - $('#defectDiv').outerHeight(true)) { //防止底部移出可视窗口
				y = $(document).height() - $('#defectDiv').outerHeight(true);
			}
			//step2：将x坐标和y坐标赋值给div
			$('#defectDiv').css({
				'left': x + 'px',
				'top': y + 'px'
			});
		});
	});
	$('#defectDiv').mouseup(function () {//当鼠标左键被释放时
		$('#defectDiv').unbind('mousemove');//解除mousemove事件(unbind规定从指定元素上删除的一个或多个事件处理程序。如果没有规定参数，unbind() 方法会删除指定元素的所有事件处理程序。)
		//除了unbind()外 .off()也可以用于解除事件  高版本的jquery库不兼容低版本的jquery库的方法
	});

</script>
</body>
</html>
