|  | @@ -1219,7 +1219,7 @@ function saveConfirmFee() {
 | 
	
		
			
				|  |  |                  return;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (res.code == 0) {
 | 
	
		
			
				|  |  | -                prn1Print(patientId, times, true,res.receiptNo);
 | 
	
		
			
				|  |  | +                prn1Print(patientId, times, true, res.receiptNo);
 | 
	
		
			
				|  |  |                  new PNotify({
 | 
	
		
			
				|  |  |                      title: '操作提示',
 | 
	
		
			
				|  |  |                      text: res.message,
 | 
	
	
		
			
				|  | @@ -1254,8 +1254,8 @@ function saveConfirmFee() {
 | 
	
		
			
				|  |  |   * @param times
 | 
	
		
			
				|  |  |   * @param chargeFeeFlag 收费 退费标记  true 收费和重打发票来源 false 退费来源
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -function prn1Print(patientId, times, chargeFeeFlag,receiptNo) {
 | 
	
		
			
				|  |  | -    var url = '/thmz/getAllSerialForThisTime?patientId=' + patientId + "×=" + times+"&receiptNo="+receiptNo;
 | 
	
		
			
				|  |  | +function prn1Print(patientId, times, chargeFeeFlag, receiptNo) {
 | 
	
		
			
				|  |  | +    var url = '/thmz/getAllSerialForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo;
 | 
	
		
			
				|  |  |      printCommon(url, patientId, times, chargeFeeFlag);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1264,10 +1264,10 @@ function prn1Print(patientId, times, chargeFeeFlag,receiptNo) {
 | 
	
		
			
				|  |  |   * @param patientId
 | 
	
		
			
				|  |  |   * @param times
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -function repPrint(patientId, times,receiptNo) {
 | 
	
		
			
				|  |  | +function repPrint(patientId, times, receiptNo) {
 | 
	
		
			
				|  |  |      $.ajax({
 | 
	
		
			
				|  |  |          type: "GET",
 | 
	
		
			
				|  |  | -        url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "×=" + times+"&receiptNo="+receiptNo,
 | 
	
		
			
				|  |  | +        url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo,
 | 
	
		
			
				|  |  |          contentType: "application/json;charset=UTF-8",
 | 
	
		
			
				|  |  |          dataType: "json",
 | 
	
		
			
				|  |  |          headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
 | 
	
	
		
			
				|  | @@ -1632,6 +1632,7 @@ function refundFee(patientId, times, receiptNo, printFlag) {
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |          return;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +    $("#refundFeePrepare").text(0.00);
 | 
	
		
			
				|  |  |      $("#refundFeeDetailModal").modal();
 | 
	
		
			
				|  |  |      $("#refund_bill_item_group").removeClass("in").addClass("hide");
 | 
	
		
			
				|  |  |      $('#refund_fee_bill_table').bootstrapTable("destroy");
 | 
	
	
		
			
				|  | @@ -1798,6 +1799,22 @@ function initRefundFeeDetailTable(patientId, times, receiptNo) {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          ],
 | 
	
		
			
				|  |  | +        //点击全选框时触发的操作
 | 
	
		
			
				|  |  | +        onCheckAll: function (rows) {
 | 
	
		
			
				|  |  | +            getRefundFee();
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //取消所有
 | 
	
		
			
				|  |  | +        onUncheckAll: function (row) {
 | 
	
		
			
				|  |  | +            getRefundFee();
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //点击每一个单选框时触发的操作
 | 
	
		
			
				|  |  | +        onCheck: function (row) {
 | 
	
		
			
				|  |  | +            getRefundFee();
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        //取消每一个单选框时对应的操作;
 | 
	
		
			
				|  |  | +        onUncheck: function (row) {
 | 
	
		
			
				|  |  | +            getRefundFee();
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  |          responseHandler: function (res) {
 | 
	
		
			
				|  |  |              if (res == '401' || res == 401) {
 | 
	
		
			
				|  |  |                  window.location.href = '/thmz/login/view'
 | 
	
	
		
			
				|  | @@ -1840,15 +1857,70 @@ function queryParamsForRefundFee(patientId, times) {
 | 
	
		
			
				|  |  |      return temp;
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * 每次选择费用清单明细时计算实际应退金额
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function getRefundFee() {
 | 
	
		
			
				|  |  | +    var chargeItemCodes = extracted();
 | 
	
		
			
				|  |  | +    if(chargeItemCodes==null){
 | 
	
		
			
				|  |  | +        $("#refundFeePrepare").text(0.00);
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    $.ajax({
 | 
	
		
			
				|  |  | +        type: "POST",
 | 
	
		
			
				|  |  | +        url: '/thmz/getNewListForRefundFee',
 | 
	
		
			
				|  |  | +        contentType: "application/json;charset=UTF-8",
 | 
	
		
			
				|  |  | +        dataType: "json",
 | 
	
		
			
				|  |  | +        data: JSON.stringify({
 | 
	
		
			
				|  |  | +            patientId: $("#patientIdRefund").val(),
 | 
	
		
			
				|  |  | +            times: $("#timesRefund").val(),
 | 
	
		
			
				|  |  | +            chargeItemCodes: chargeItemCodes
 | 
	
		
			
				|  |  | +        }),
 | 
	
		
			
				|  |  | +        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
 | 
	
		
			
				|  |  | +        success: function (res) {
 | 
	
		
			
				|  |  | +            if (res == '401' || res == 401) {
 | 
	
		
			
				|  |  | +                window.location.href = '/thmz/login/view'
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (res.code == 0) {
 | 
	
		
			
				|  |  | +                $("#refundFeePrepare").text(res.pageViewVo.data[0].refundFee.toFixed(2));
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                new PNotify({
 | 
	
		
			
				|  |  | +                    title: '错误提示',
 | 
	
		
			
				|  |  | +                    text: res.message,
 | 
	
		
			
				|  |  | +                    type: 'error',
 | 
	
		
			
				|  |  | +                    hide: true,
 | 
	
		
			
				|  |  | +                    styling: 'bootstrap3'
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 发起预退费
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  function readyRefundFee() {
 | 
	
		
			
				|  |  | +    var chargeItemCodes = extracted();
 | 
	
		
			
				|  |  | +    $("#refundFeeModal").modal();
 | 
	
		
			
				|  |  | +    initRefundChargeDetailTable(chargeItemCodes);
 | 
	
		
			
				|  |  | +    $("#refundFeeDetailModal").modal("hide");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * 获取预退费金额
 | 
	
		
			
				|  |  | + * @returns {*}
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function extracted() {
 | 
	
		
			
				|  |  |      var allSelecteds = $('#refund_fee_detail_table').bootstrapTable('getAllSelections');
 | 
	
		
			
				|  |  | -    chargeItemCodes = null;
 | 
	
		
			
				|  |  | +    var chargeItemCodes = null;
 | 
	
		
			
				|  |  |      if (allSelecteds != null && allSelecteds.length > 0) {
 | 
	
		
			
				|  |  |          for (var i = 0; i < allSelecteds.length; i++) {
 | 
	
		
			
				|  |  | -            var temp = allSelecteds[i].orderNo + "_" + allSelecteds[i].itemNo +"_"+allSelecteds[i].chargeItemCode;
 | 
	
		
			
				|  |  | +            var temp = allSelecteds[i].orderNo + "_" + allSelecteds[i].itemNo + "_" + allSelecteds[i].chargeItemCode;
 | 
	
		
			
				|  |  |              if (chargeItemCodes == null) {
 | 
	
		
			
				|  |  |                  chargeItemCodes = temp;
 | 
	
		
			
				|  |  |              } else {
 | 
	
	
		
			
				|  | @@ -1856,13 +1928,9 @@ function readyRefundFee() {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    $("#refundFeeModal").modal();
 | 
	
		
			
				|  |  | -    initRefundChargeDetailTable(chargeItemCodes);
 | 
	
		
			
				|  |  | -    $("#refundFeeDetailModal").modal("hide");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    return chargeItemCodes;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 初始化退费重收费明细表格
 | 
	
		
			
				|  |  |   */
 | 
	
	
		
			
				|  | @@ -2026,7 +2094,7 @@ function saveRefundFee() {
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  |                  $("#refundFeeModal").modal("hide");
 | 
	
		
			
				|  |  |                  if (res.times > 0) {
 | 
	
		
			
				|  |  | -                    prn1Print(res.patientId, res.times, false,1);
 | 
	
		
			
				|  |  | +                    prn1Print(res.patientId, res.times, false, 1);
 | 
	
		
			
				|  |  |                  } else {
 | 
	
		
			
				|  |  |                      initFeeTable();
 | 
	
		
			
				|  |  |                  }
 |