| 
					
				 | 
			
			
				@@ -5,6 +5,9 @@ var msg_list_loading = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 var pageIndex = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //药品使用方法,天数和频次的集合 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 var groupIdMap = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+var LODOP; //声明为全局变量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//默认打印机下标 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+var printIndex = -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 $(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     initGenderSelect(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     initResponceTypeSelect(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1362,7 +1365,7 @@ function callTemplate() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     clearWorkSpace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         type: "GET", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        url: '/thmz/getTemplateById?id=' + $("#idTemplate").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url: '/thmz/increaseNumber?id=' + $("#idTemplate").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         contentType: "application/json;charset=UTF-8", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         dataType: "json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         async: false, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5498,7 +5501,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $("#printPrescription").removeClass("hide").addClass("in"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $("#callPrescription").removeClass("in").addClass("hide"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $("#printPrescription").off("click").on("click", function (t) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        alert("打印处方"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        printPrescription(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $("#printPrescription").removeClass("in").addClass("hide"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5512,4 +5515,54 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 查询默认打印机 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function setPrint() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (printIndex >= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: "GET", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url: '/thmz/getLastWindowsByCurrentUser', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        contentType: "application/json;charset=UTF-8", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dataType: "json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        async: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        success: function (res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res == '401' || res == 401) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                window.location.href = '/thmz/login/view' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res.code == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                printIndex = res.data.cgPrintIndex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                printIndex = -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 打印门诊处方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function printPrescription() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // $("#dcountDate").html(format(res.dcountDate, "yyyy-MM-dd HH:mm:ss")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // $("#dcountDate_gh").html(format(res.dcountDate, "yyyy-MM-dd HH:mm:ss")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    setPrint(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP = getLodop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "湖南泰和医院处方笺"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //设置默认打印机 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.SET_PRINTER_INDEX(printIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "297mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var strStyle="<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.ADD_PRINT_HTM("0mm", "5mm", "200mm", "280mm",strStyle+ document.getElementById("prescription_table").innerHTML); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //LODOP.PRINT(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.PREVIEW(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //刷新数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |