| 
					
				 | 
			
			
				@@ -26,31 +26,8 @@ $(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 增加收款方式按钮事件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#addPayType").on("click", function (t) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // var arr = $("#payForm").find("div.pay-item"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // if (arr.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //     for (var i = 0; i < arr.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //         var temp = parseFloat($(arr[i]).find("input").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //         if (temp == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //                 title: '错误提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //                 text: "存在未使用的收款方式,请不要重复添加!", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //                 type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //                 hide: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //                 styling: 'bootstrap3' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        var payTypeIndex = $("#payTypeIndex").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        var payTypeId = "payType_" + payTypeIndex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        var html = '<div class="item form-group pay-item"><div class="col-md-12 col-sm-12 col-xs-12"><div class="col-md-2 col-sm-2 col-xs-12"></div><label class="col-md-3 col-sm-3 col-xs-12"><select class="form-control selectpicker show-tick" required="true" id="' + payTypeId + '" onchange="checkFee(false)"></select></label><div class="col-md-3 col-sm-3 col-xs-12"><input class="form-control col-md-5 col-xs-12" type="number" data-placement="bottom-right" min="0" onchange="checkFee()"></div><div class="col-md-1 col-sm-1 col-xs-12" style="line-height: 34px;">元  <a style="line-height: 34px;cursor: pointer;" onclick="closeThisParent(this)"><i class="fa fa-close"></i></a></div></div></div>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#changeAmountParent").before(html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        initChequeType(payTypeId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        payTypeIndex = payTypeIndex + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#payTypeIndex").val(payTypeIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#addPayType").parent().removeClass("in").addClass("hide"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#addPayType").on("click", function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        addPayType(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //初始门诊收银方式下拉选 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -94,7 +71,7 @@ $(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //         }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //         $("#editWindowsModal").modal(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    postCMD("login",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    postCMD("login", localStorage.getItem("userID"), '000000', '收费项目', 0, 0, 0, '', '祝您早日康复', 0, 0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // setTimeout(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //     postCMD("login",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // }, 3000); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -376,7 +353,7 @@ function initFeeTable() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (payMarkGroup == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         str += '<button type="button" class="registration-no-color-foot-button" title="退费" onclick="refundFee(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ',' + row.printFlag + ');"><i class="fa fa-reply"></i></button>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (row.printFlag == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            str += '<button type="button" id="button_'+row.realNo+'" class="registration-no-color-foot-button" title="发票打印" onclick="prn1PrintHand(\'' + row.patientId + '\',' + row.times + ',true,' + row.receiptNo + ','+row.realNo+');" style="color: #35D082;"><i class="fa fa-print"></i></button>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            str += '<button type="button" id="button_' + row.realNo + '" class="registration-no-color-foot-button" title="发票打印" onclick="prn1PrintHand(\'' + row.patientId + '\',' + row.times + ',true,' + row.receiptNo + ',' + row.realNo + ');" style="color: #35D082;"><i class="fa fa-print"></i></button>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } else if (row.printFlag == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             str += '<button type="button" class="registration-no-color-foot-button" title="发票重打" onclick="repPrint(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ');" style="color: #F4BD00;"><i class="fa fa-print"></i></button>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             str += '<button type="button" class="registration-no-color-foot-button" title="发票作废重打" onclick="obsoleteAndRepPrint(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ');" style="color: #E73E48;"><i class="fa fa-print"></i></button>'; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -796,14 +773,23 @@ function confirmFeeModal(times, totalCharge, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $("#changeAmountParent").prev().remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         prevAll = $("#changeAmountParent").prevAll(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#realMoney").val($("#amountMoneyConfirm").text()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#cash").val($("#amountMoneyConfirm").text()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // $("#realMoney").val($("#amountMoneyConfirm").text()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // $("#cash").val($("#amountMoneyConfirm").text()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#tallyDetailModal").modal('hide'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#haveTallyModal").modal('hide'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#confirmFeeModal").modal(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#amountMoneyConfirm").text(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var fundPay = $("#fundPay").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (fundPay > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        addPayType("payType_0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $('#payType_0').selectpicker('val', 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $('#payType_0').selectpicker('refresh'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $("#payType_0").parent().parent().next().children(':first').val(fundPay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $("#payType_0").parent().parent().next().next().children(':first').remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var realMoney = Minus(data, fundPay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#realMoney").val(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#cash").val(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#cash").val(realMoney); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // $("#cash").val(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     setTimeout(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //默认光标在卡号输入框 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -813,11 +799,10 @@ function confirmFeeModal(times, totalCharge, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#payType").selectpicker('refresh'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#changeAmount").val(0.0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#surplusAmount").val(0.0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    sendPeiceMessage(data,0,0,'您本次应付金额为'+data+'元',$("#patientIdHaveTally").val(),$("#nameHaveTally").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    sendPeiceMessage(realMoney, 0, 0, '您本次应付金额为' + realMoney + '元', $("#patientIdHaveTally").val(), $("#nameHaveTally").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 打开收费明细窗口 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @param data 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -831,7 +816,6 @@ function chargeDetailModal(patientId, times, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 病人当前就诊次数的诊断查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @param data 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -889,6 +873,7 @@ function initChequeType(payType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         url: '/thmz/getAllZdChequeTypeForMz', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         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' 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -924,7 +909,7 @@ function closeThisParent(obj) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function checkFee(flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var realMoney = parseFloat($("#realMoney").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     realMoney = realMoney.toFixed(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#realMoney").val(realMoney) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#realMoney").val(realMoney); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var arr = $("#payForm").find("div.pay-item"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (arr.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //非现金收款总金额 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -937,9 +922,9 @@ function checkFee(flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 temp = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if ($(arr[i]).find("select").val() != 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                notCashAmount=Add(notCashAmount,temp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                notCashAmount = Add(notCashAmount, temp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                cashAmount =Add(cashAmount,temp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cashAmount = Add(cashAmount, temp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (var j = 0; j < arr.length; j++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if ($(arr[i]).find("select").val() == $(arr[j]).find("select").val() && i != j) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -965,7 +950,7 @@ function checkFee(flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $("#addPayType").parent().removeClass("in").addClass("hide"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        var totalAmount = Add(cashAmount,notCashAmount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        var totalAmount = Add(cashAmount, notCashAmount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $("#surplusAmount").val(0.0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (totalAmount < realMoney) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (flag) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -995,7 +980,7 @@ function checkFee(flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $("#changeAmount").val(changeAmount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $("#addPayType").parent().removeClass("in").addClass("hide"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                sendPeiceMessage(realMoney,totalAmount,changeAmount,'实际支付金额为'+totalAmount+'元,应找零'+changeAmount+'元',$("#patientIdHaveTally").val(),$("#nameHaveTally").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sendPeiceMessage(realMoney, totalAmount, changeAmount, '实际支付金额为' + totalAmount + '元,应找零' + changeAmount + '元', $("#patientIdHaveTally").val(), $("#nameHaveTally").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //设置收费首页找零与应收和实收金额 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1007,7 +992,7 @@ function checkFee(flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var discount = 100; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (realMoney < amountMoneyConfirm) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        discount = Division(realMoney,Multiply(amountMoneyConfirm ,100)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        discount = Division(realMoney, Multiply(amountMoneyConfirm, 100)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#discount").text(discount.toFixed(2)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1056,6 +1041,40 @@ function tipHaveTally(data, patientId, times, name, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: "POST", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url: '/thmz/getTmFee', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        contentType: "application/json;charset=UTF-8", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dataType: "json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo}), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        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) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (res.data != undefined && res.data != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $("#fundPay").val(res.data.fundPay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //$("#realMoney").val(res.data.selfPay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $("#fundPay").val(0.0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title: '错误提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    text: res.message, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    hide: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    styling: 'bootstrap3' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#saveConfirmFee").attr("disabled", false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     confirmFeeModal(null, null, null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1201,9 +1220,9 @@ function initTallyDetailTable() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 提交缴费申请 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function saveConfirmFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#saveConfirmFee").attr("disabled",true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#saveConfirmFee").attr("disabled", true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!checkFee(true)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $("#saveConfirmFee").attr("disabled",false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $("#saveConfirmFee").attr("disabled", false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var jsonData = JSON.parse('{"patientId":"","times":"","receiptNo":"","mzDepositFiles":[]}'); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1252,10 +1271,11 @@ function saveConfirmFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("#patientId").val(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("#cardNo").val(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("#name").val(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $("#fundPay").val(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 initFeeTable(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //默认光标在卡号输入框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("#cardNo").focus(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                postCMD("appraise",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                postCMD("appraise", localStorage.getItem("userID"), '000000', '收费项目', 0, 0, 0, '', '祝您早日康复', 0, 0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     title: '错误提示', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1265,7 +1285,7 @@ function saveConfirmFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     styling: 'bootstrap3' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $("#saveConfirmFee").attr("disabled",false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $("#saveConfirmFee").attr("disabled", false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1277,8 +1297,8 @@ function saveConfirmFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @param times 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @param chargeFeeFlag 收费 退费标记  true 收费和重打发票来源 false 退费来源 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-function prn1PrintHand(patientId, times, chargeFeeFlag, receiptNo,realNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $("#button_"+realNo).css("display","none"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function prn1PrintHand(patientId, times, chargeFeeFlag, receiptNo, realNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#button_" + realNo).css("display", "none"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     prn1Print(patientId, times, chargeFeeFlag, receiptNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1695,7 +1715,7 @@ function initRefundFeeDetailTable(patientId, times, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sortable: true,                     //是否启用排序 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sortOrder: "asc",                   //排序方式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // sortName: 'orderNo',                //排序字段 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        queryParams: queryParamsForRefundFee(patientId, times,receiptNo),           //传递参数(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queryParams: queryParamsForRefundFee(patientId, times, receiptNo),           //传递参数(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sidePagination: "server",           //分页方式:client客户端分页,server服务端分页(*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         pageNumber: 1,                       //初始化加载第一页,默认第一页 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         pageSize: 10,                       //每页的记录行数(*) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1774,7 +1794,7 @@ function initRefundFeeDetailTable(patientId, times, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 valign: 'middle' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 , 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 formatter: function (value, row, index) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    return value*row.drugWin; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return value * row.drugWin; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }, { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 field: 'unitPrice', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1888,11 +1908,11 @@ function initRefundFeeDetailTable(patientId, times, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @param times 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @returns {{patientId: *, times: *}} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-function queryParamsForRefundFee(patientId, times,receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function queryParamsForRefundFee(patientId, times, receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var temp = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         patientId: patientId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         times: times, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        receiptNo:receiptNo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        receiptNo: receiptNo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return temp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1903,7 +1923,7 @@ function queryParamsForRefundFee(patientId, times,receiptNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function getRefundFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     extracted(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(chargeItemCodes==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (chargeItemCodes == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $("#refundFeePrepare").text(0.00); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1915,7 +1935,7 @@ function getRefundFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         data: JSON.stringify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             patientId: $("#patientIdRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             times: $("#timesRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            receiptNo:$("#receiptNoRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            receiptNo: $("#receiptNoRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             chargeItemCodes: chargeItemCodes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1940,7 +1960,6 @@ function getRefundFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 发起预退费 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2096,7 +2115,7 @@ function queryParamsForRefundDetail(chargeItemCodes) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         patientId: $("#patientIdRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         times: $("#timesRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        receiptNo:$("#receiptNoRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        receiptNo: $("#receiptNoRefund").val(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         chargeItemCodes: chargeItemCodes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2170,3 +2189,75 @@ function cleanParams() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     $("#ownData").removeAttr("checked"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 增加收费方式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function addPayType(id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // var arr = $("#payForm").find("div.pay-item"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // if (arr.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //     for (var i = 0; i < arr.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //         var temp = parseFloat($(arr[i]).find("input").val()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //         if (temp == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //             new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //                 title: '错误提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //                 text: "存在未使用的收款方式,请不要重复添加!", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //                 type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //                 hide: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //                 styling: 'bootstrap3' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //             }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var payTypeId = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (id != undefined && id != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        payTypeId = id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        var payTypeIndex = $("#payTypeIndex").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        payTypeId = "payType_" + payTypeIndex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var html = '<div class="item form-group pay-item"><div class="col-md-12 col-sm-12 col-xs-12"><div class="col-md-2 col-sm-2 col-xs-12"></div><label class="col-md-3 col-sm-3 col-xs-12"><select class="form-control selectpicker show-tick" required="true" id="' + payTypeId + '" onchange="checkFee(false)"></select></label><div class="col-md-3 col-sm-3 col-xs-12"><input class="form-control col-md-5 col-xs-12" type="number" data-placement="bottom-right" min="0" onchange="checkFee()"></div><div class="col-md-1 col-sm-1 col-xs-12" style="line-height: 34px;">元  <a style="line-height: 34px;cursor: pointer;" onclick="closeThisParent(this)"><i class="fa fa-close"></i></a></div></div></div>'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#changeAmountParent").before(html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    initChequeType(payTypeId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (id != undefined && id != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        payTypeIndex = Add(payTypeIndex, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $("#payTypeIndex").val(payTypeIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $("#addPayType").parent().removeClass("in").addClass("hide"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 取消费用上传 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function cancelFee() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var patientId = $("#patientIdHaveTally").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var times = $("#timesHaveTally").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var receiptNo = $("#receiptNoHaveTally").val(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: "POST", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url: '/thmz/cancelTmFee', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        contentType: "application/json;charset=UTF-8", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dataType: "json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo}), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        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) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $("#fundPay").val(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                new PNotify({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title: '错误提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    text: res.message, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    hide: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    styling: 'bootstrap3' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |