| 
					
				 | 
			
			
				@@ -6,14 +6,18 @@ $(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     setTimeout(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         getLodop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 800); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#jmtj_table").hide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $(".selectpicker").selectpicker({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         dropuAuto: false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //初始化页面上面的按钮事件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#btn_search").click(function (t) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        getSpiritAnestheticPrintData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if($('#drugFlagSearch').val() == 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getSendDrugRecordData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getSpiritAnestheticPrintData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#btn_clean').click(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         cleanParams(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -24,36 +28,47 @@ $(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#drugFlagSearch").change(function (t,d,e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let drugFlag = $("#drugFlagSearch").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(drugFlag == 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            title = "麻醉药品、精神一类药品使用登记" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else if(drugFlag == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            title = "终止妊娠药统计" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(drugFlag == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            title = "麻醉药品、精神一类药品使用登记"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#jmtj_table").show(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#qbtj_table").hide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }else if(drugFlag == 2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            title = "精二及麻黄碱类统计" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            title = "终止妊娠药统计"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#jmtj_table").show(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#qbtj_table").hide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else if(drugFlag == 3){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            title = "精二及麻黄碱类统计"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#jmtj_table").show(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#qbtj_table").hide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else if(drugFlag == 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            title = "药品发药明细统计表"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#qbtj_table").show(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#jmtj_table").hide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#title").html(title); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#dateRange").html($('#reportrange span').html()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#printDate").html(format(new Date(),"yyyy-MM-dd HH:mm")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $(".title").html(title); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $(".dateRange").html($('#reportrange span').html()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $(".printDate").html(format(new Date(),"yyyy-MM-dd HH:mm")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //初始化药品查询弹出框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    initDrugSearchList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $('#searchText').on('input focus',function(e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    initSearchList('<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'searchTextDrug', 700, 250); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('#searchTextDrug').on('input focus',function(e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         showDrugPopover(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if($('#searchText').val() == ''){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if($('#searchTextDrug').val() == ''){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $('#codeSearch').val(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $('#serialSearch').val(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * 获取统计报表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 获取精麻药统计报表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function getSpiritAnestheticPrintData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#dateRange").html($('#reportrange span').html()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#printDate").html(format(new Date(),"yyyy-MM-dd HH:mm")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $('#searchText').html(format(new Date(),"yyyy-MM-dd HH:mm")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $(".dateRange").html($('#reportrange span').html()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $(".printDate").html(format(new Date(),"yyyy-MM-dd HH:mm")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         type: "GET", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         url: '/thmz/getSpiritAnestheticPrint', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -76,12 +91,6 @@ function getSpiritAnestheticPrintData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     let data = res.data[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if(code == ''){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         code = data.chargeItemCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if(number > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            number = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         number += parseFloat(data.quantity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     }else if(code == data.chargeItemCode){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         number += parseFloat(data.quantity); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -89,7 +98,7 @@ function getSpiritAnestheticPrintData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        code = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        code = data.chargeItemCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         number = parseFloat(data.quantity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if(data.sex == 1){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -100,27 +109,37 @@ function getSpiritAnestheticPrintData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         sex = "未知" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.chargeDate.substring(5,11) + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.patientId + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.name + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + sex + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.age + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td>' + data.socialNo + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.chargeDate.substring(5,11) + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.patientId + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.name + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + sex + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.age + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td style="mso-number-format: \'\\@\';">' + data.socialNo + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     html += '<td>' + data.icdText + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.chargeItemCode + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.chargeItemCode + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     html += '<td>' + data.drugname + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     html += '<td>' + data.specification + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.quantity + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.employeeName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td style="text-align: center;">' + data.warnDeptName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    html += '<td></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.quantity + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.employeeName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" ></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" ></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $("#tj_table").append(html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $("#jmtj_table").append(html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let drugFlag = $("#drugFlagSearch").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if(drugFlag == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title = "麻醉药品、精神一类药品使用登记"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else if(drugFlag == 2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title = "终止妊娠药统计"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else if(drugFlag == 3){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title = "精二及麻黄碱类统计"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                tableToExcel('jmtj_table', title); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else if (res.code == -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     title: '错误提示', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -134,6 +153,103 @@ function getSpiritAnestheticPrintData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 获取所有药品类型统计报表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function getSendDrugRecordData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $(".dateRange").html($('#reportrange span').html()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $(".printDate").html(format(new Date(),"yyyy-MM-dd HH:mm")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: "POST", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url: '/thmz/getSendDrugRecord', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        contentType: "application/json;charset=UTF-8", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dataType: "json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        data: JSON.stringify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'beginDate': getRePortRangeArr()[0], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'endDate': getRePortRangeArr()[1], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'chargeCode': $('#codeSearch').val()==''?null:$('#codeSearch').val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'serial': $('#serialSearch').val()==''?null:$('#serialSearch').val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'warnDept': $('#unitCodeSearch').val()!=null?$('#unitCodeSearch').val()[0]:null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'queryScope': $("#queryScopeSearch").val() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        success: function (res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res == '401' || res == 401) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                window.location.href = '/thmz/login/view' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res.code == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let html = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let flag = '';//区分门诊住院 -1住院 其它门诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let number = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let totalNumber = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let sex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $('.sjh').remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for (var i = 0; i < res.data.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    let data = res.data[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if(flag == ''){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        flag = data.id.indexOf("-")!=-1?'0':'1'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        number += parseFloat(data.quantity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else if(flag == (data.id.indexOf("-")!=-1?'0':'1')){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        number += parseFloat(data.quantity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        html += '<td colspan="11" style="text-align: right;font-weight: 700;">小计:' + number + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        html += '<td colspan="5"></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        flag = data.id.indexOf("-")!=-1?'0':'1'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        totalNumber += number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        number = parseFloat(data.quantity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if(data.sex == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sex = "男" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else if(data.sex == 2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sex = "女" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sex = "未知" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    let queryScope = data.id.indexOf("-")!=-1?'门诊':'住院'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.id + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.name + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + sex + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.age + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td>' + data.icdText + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.chargeCode + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td>' + data.drugName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td>' + data.specification + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td>' + data.abbrName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.quantity + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td style="text-align: center;">' + data.chargeDate + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.employeeName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.supplyName + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + data.frequency + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '<td class="xtd" style="text-align: center;">' + queryScope + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '<td colspan="11" style="text-align: right;font-weight: 700;">小计:' + number + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '<td colspan="5"></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '<tr class="sjh">'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '<td colspan="11" style="text-align: right;font-weight: 700;">总计:' + parseFloat(totalNumber+number) + '</td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '<td colspan="5"></td>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                html += '</tr>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $("#qbtj_table").append(html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                tableToExcel('qbtj_table', '药品发药明细统计表'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else if (res.code == -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title: '错误提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    text: res.message, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    hide: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    styling: 'bootstrap3' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 获取按钮组选择的下标 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -171,9 +287,13 @@ function cleanParams() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 14:00:00") + ' - ' + moment().format("YYYY-MM-DD 13:59:59")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#unitCodeSearch').empty(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#drugFlagSearch').val(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('#qbtj_table').show(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('#jmtj_table').hide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('.sjh').remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#drugFlagSearch').selectpicker('refresh'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $('#searchText').empty(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('#searchTextDrug').empty(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#codeSearch').empty(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $('#serialSearch').empty(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -182,7 +302,7 @@ function cleanParams() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function print() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     setDefaultPrint(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     LODOP = getLodop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "药房精麻药品发放统计表"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "药品发放统计表"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     LODOP.SET_PRINT_PAGESIZE(2, 0, 0,"A4"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //设置默认打印机 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     LODOP.SET_PRINTER_INDEX(defaultPrintIndex); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -195,117 +315,8 @@ function print() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var strStyle="<style>table{width: 1050px;} table,td,th {border-width: 1px;" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         "border-style: solid;border-collapse: collapse;table-layout:fixed;word-wrap:break-word;font-size: 14px}</style>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     LODOP.ADD_PRINT_HTM("0mm", "2mm", "RightMargin:0mm", "BottomMargin:15mm",strStyle+ document.getElementById("report_table_1").innerHTML); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LODOP.PRINT(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //LODOP.PREVIEW(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//显示查询的药品悬浮窗 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-function showDrugPopover() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $('#tb_table_medicine').bootstrapTable('destroy'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $('#tb_table_medicine').bootstrapTable({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        url: '/thmz/getYpZdDictBase',         //请求后台的URL(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        method: 'GET',                      //请求方式(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        toolbar: '#toolbar',                //工具按钮用哪个容器 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        striped: true,                      //是否显示行间隔色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        cache: true,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        pagination: false,                   //是否显示分页(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        sortable: true,                     //是否启用排序 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        sortOrder: "asc",                   //排序方式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        queryParams:queryParamsDrugTable,           //传递参数(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        pageNumber: 1,                       //初始化加载第一页,默认第一页 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        pageSize: 5,                       //每页的记录行数(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        strictSearch: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        showColumns: false,                  //是否显示所有的列 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        showRefresh: false,                  //是否显示刷新按钮 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        minimumCountColumns: 2,             //最少允许的列数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        clickToSelect: true,                //是否启用点击选中行 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        cardView: false,                    //是否显示详细视图 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        detailView: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //rowStyle:rowStyle,//通过自定义函数设置行样式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ajaxOptions: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            headers: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                'Accept': 'application/json', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                'Authorization': 'Bearer ' + localStorage.getItem("token") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        columns: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                field: 'code', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                title: '编码', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                align: "center", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            },{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                field: 'name', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                title: '药品名', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                align: "center", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                field: 'specification', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                title: '规格', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                align: "center", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }, { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                field: 'manufactoryName', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                title: '厂家', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                align: "center", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                field: 'packRetprice', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                title: '单价', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                align: "center", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                visible: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }, { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                field: 'stockAmount', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                title: '药库库存', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                align: "center", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                visible: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        responseHandler: function (res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (res == '401' || res == 401) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                window.location.href = '/thmz/login/view' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            var ress = eval(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (ress.code == -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                errorMesage(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "total": 0,//总页数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "rows": {}   //数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                "total": ress.data.length,//总页数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                "rows": ress.data   //数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        onClickRow: function (row, $element) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $('#searchText').webuiPopover('hide'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $('#codeSearch').val(row.code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $('#searchText').val(row.name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * 药品列表查询参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-function queryParamsDrugTable() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    var temp = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        groupYk: 11, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        searchText: $("#searchText").val() == "" ? null : $("#searchText").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    return temp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //LODOP.PRINT(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LODOP.PREVIEW(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -314,12 +325,12 @@ function queryParamsDrugTable() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function queryParams() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let drugFlags = new Array(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let flag = $("#drugFlagSearch").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(flag == 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if(flag == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         drugFlags[0] = 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         drugFlags[1] = 3; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }else if(flag == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        drugFlags[0] = 6; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }else if(flag == 2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        drugFlags[0] = 6; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }else if(flag == 3){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         drugFlags[0] = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         drugFlags[1] = 4; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         drugFlags[2] = 5; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -382,4 +393,41 @@ function init_daterangepickertime() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $('#reportrange span').html(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss')); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 14:00:00") + ' - ' + moment().format("YYYY-MM-DD 13:59:59")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//base64转码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function base64(s) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return window.btoa(unescape(encodeURIComponent(s))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//替换table数据和worksheet名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function format1(s, c) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return s.replace(/{(\w+)}/g, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        function (m, p) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return c[p]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function tableToExcel(tableid, sheetName) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var uri = 'data:application/vnd.ms-excel;base64,'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        + '<x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets>' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        + '</x:ExcelWorkbook></xml><![endif]-->' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '<style type="text/css">' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'table td{' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'border: 1px solid #000000;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'width: 150px;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'height: 30px;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'text-align: center;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '}' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '.xtd{' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'border: 1px solid #000000;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'width: 50px;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'height: 30px;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'text-align: center;' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '}' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '</style>' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '</head><body ><table class="excelTable">{table}</table></body></html>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (!tableid.nodeType) tableid = document.getElementById(tableid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var ctx = {worksheet: sheetName || 'Worksheet', table: tableid.innerHTML}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#btn_excel").attr('href',uri + base64(format1(template, ctx))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |