|  | @@ -13,7 +13,7 @@ var fpVsesionNo = 0;
 | 
	
		
			
				|  |  |  var hospitalName ='沭阳铭和医院'
 | 
	
		
			
				|  |  |  $(function () {
 | 
	
		
			
				|  |  |      $("#dzfpDownModal1").modal();
 | 
	
		
			
				|  |  | -    prn1PrintAndQRCode("1522962-4",12,"4691714",1);
 | 
	
		
			
				|  |  | +//    prn1PrintAndQRCode("1522962-4",12,"4691714",1);
 | 
	
		
			
				|  |  |      getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
 | 
	
		
			
				|  |  |          hospitalName = res.data
 | 
	
		
			
				|  |  |      })
 | 
	
	
		
			
				|  | @@ -608,7 +608,7 @@ function initFeeTable() {
 | 
	
		
			
				|  |  |                                      str += '<button type="button" class="registration-no-color-foot-button"title="医保读卡" onclick="mztczfSiReadCardTypeModel(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-newspaper-o"></i></button>';
 | 
	
		
			
				|  |  |                                      str += '<button type="button" class="registration-no-color-foot-button"title="医保结算" onclick="directRegistration(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-credit-card"></i></button>';
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  | -                        str += '<button type="button" class="registration-no-color-foot-button"title="确认收费" onclick="tipHaveTally(' + row.amount + ',\'' + row.patientId + '\',' + row.times + ',\'' + row.name + '\',' + row.receiptNo + ')"><i class="fa fa-rmb"></i></button>';
 | 
	
		
			
				|  |  | +                        str += '<button type="button" class="registration-no-color-foot-button"title="确认收费" onclick="tipHaveTally(' + row.amount + ',\'' + row.patientId + '\',' + row.times + ',\'' + row.name + '\',' + row.receiptNo + ',\'' + row.doctorCode + '\'' + ')"><i class="fa fa-rmb"></i></button>';
 | 
	
		
			
				|  |  |                          if (buttonCodes != null) {
 | 
	
		
			
				|  |  |                              if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
 | 
	
		
			
				|  |  |                                  str += '<button type="button" class="registration-no-color-foot-button" title="就诊记录修复" onclick="initClinicForException(\'' + row.patientId + '\',' + row.times + ',\'5\',' + row.receiptNo + ');"><i class="fa fa-wrench"></i></button>';
 | 
	
	
		
			
				|  | @@ -632,8 +632,8 @@ function initFeeTable() {
 | 
	
		
			
				|  |  |                              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>';
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          if(fpVsesionNo == 1){
 | 
	
		
			
				|  |  | -                            str += '<button type="button" class="registration-no-color-foot-button" title="发票重打" onclick="prn1PrintAndQRCode(\'' + row.patientId + '\',' + row.times +',\'' + row.serialNo + '\''+',\'' + row.name + '\''+',' + row.amount + ')" style="color: #F4BD00;"><i class="fa fa-print"></i></button>';
 | 
	
		
			
				|  |  | -                            str += '<button type="button" class="registration-no-color-foot-button" title="上传电子发票" onclick="printDzfp(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo +',1'+ ');" style="color: #35D082;"><i class="fa fa-upload"></i></button>';
 | 
	
		
			
				|  |  | +                            str += '<button type="button" class="registration-no-color-foot-button" title="发票重打" onclick="prn1PrintAndQRCode(\'' + row.patientId + '\',' + row.times +',\'' + row.serialNo + '\''+',\'' + row.name + '\''+',' + row.amount +',\'' + row.doctorCode + '\'' +  ')" style="color: #F4BD00;"><i class="fa fa-print"></i></button>';
 | 
	
		
			
				|  |  | +                            str += '<button type="button" class="registration-no-color-foot-button" title="上传电子发票" onclick="printDzfp(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo +',1'+ ',\'' + row.name + '\'' + ',' + row.amount + ',\'' + row.doctorCode + '\'' + ');" style="color: #35D082;"><i class="fa fa-upload"></i></button>';
 | 
	
		
			
				|  |  |  //                            str += '<button type="button" class="registration-no-color-foot-button" title="开具电子发票" onclick="issueEBill(\'' + row.realNo + '\',' + row.amount + ',\'' + row.name + '\',\'' + row.doctorCode +'\'' + ');" style="color: #35D082;"><i class="fa fa-sign-in"></i></button>';
 | 
	
		
			
				|  |  |                              str += '<button type="button" class="registration-no-color-foot-button"title="下载电子发票" onclick="openDzfpDownModal(\'' + row.patientId + '\',' + row.times +',\'' + row.serialNo + '\'' + ')"><i class="fa fa-download"></i></button>';
 | 
	
		
			
				|  |  |                              str += '<button type="button" class="registration-no-color-foot-button"title="查询电子发票" onclick="getEBill(\'' + row.serialNo+ '\',)"><i class="fa fa-search"></i></button>';
 | 
	
	
		
			
				|  | @@ -1565,7 +1565,7 @@ function initClinicForException(patientId, times, payMark, receiptNo) {
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 提示有记账记录
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -function tipHaveTally(data, patientId, times, name, receiptNo) {
 | 
	
		
			
				|  |  | +function tipHaveTally(data, patientId, times, name, receiptNo,doctorName) {
 | 
	
		
			
				|  |  |      addOrderLock(patientId,times,null)
 | 
	
		
			
				|  |  |      closeConfirmFeeModal();
 | 
	
		
			
				|  |  |      if (patientId == null || patientId == "") {
 | 
	
	
		
			
				|  | @@ -1576,6 +1576,7 @@ function tipHaveTally(data, patientId, times, name, receiptNo) {
 | 
	
		
			
				|  |  |      $("#dataIdHaveTally").val(data);
 | 
	
		
			
				|  |  |      $("#timesHaveTally").val(times);
 | 
	
		
			
				|  |  |      $("#receiptNoHaveTally").val(receiptNo);
 | 
	
		
			
				|  |  | +    $("#doctorNameHaveTally").val(doctorName);
 | 
	
		
			
				|  |  |      saveFeeGzzf()
 | 
	
		
			
				|  |  |      // postAjaxJsonHttpRequst("/thmz/queryCountYbZf",{"patientId": patientId, "times": times},true,function (rs) {
 | 
	
		
			
				|  |  |      //     if (rs == '401' || rs == 401) {
 | 
	
	
		
			
				|  | @@ -1844,6 +1845,7 @@ function saveConfirmFee() {
 | 
	
		
			
				|  |  |      var name = $("#nameHaveTally").val();
 | 
	
		
			
				|  |  |      var times = $("#timesHaveTally").val();
 | 
	
		
			
				|  |  |      var receiptNo = $("#receiptNoHaveTally").val();
 | 
	
		
			
				|  |  | +    var doctorName = $("#doctorNameHaveTally").val();
 | 
	
		
			
				|  |  |      var realMoney = $("#realMoney").val();
 | 
	
		
			
				|  |  |      jsonData.patientId = patientId;
 | 
	
		
			
				|  |  |      jsonData.times = times;
 | 
	
	
		
			
				|  | @@ -1896,7 +1898,7 @@ function saveConfirmFee() {
 | 
	
		
			
				|  |  |  //                    printDzfp(patientId, times,res.receiptNo,0)
 | 
	
		
			
				|  |  |  //                }
 | 
	
		
			
				|  |  |                  //进入电子发票开票
 | 
	
		
			
				|  |  | -                printDzfp(patientId, times,res.receiptNo,0,name,realMoney)
 | 
	
		
			
				|  |  | +                printDzfp(patientId, times,res.receiptNo,0,name,realMoney,doctorName)
 | 
	
		
			
				|  |  |                  successMesage(res);
 | 
	
		
			
				|  |  |                  closeConfirmFeeModal();
 | 
	
		
			
				|  |  |                  //缴费成功后清空全局参数
 | 
	
	
		
			
				|  | @@ -1960,10 +1962,13 @@ function saveProject() {
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  //上传电子发票
 | 
	
		
			
				|  |  | -function printDzfp(patientId,times,receiptNo,loadingFlag,name,amount) {
 | 
	
		
			
				|  |  | +//function printDzfp(patientId,times,receiptNo,loadingFlag,name,amount,doctorName,chargeDate) {
 | 
	
		
			
				|  |  | +function printDzfp(patientId,times,receiptNo,loadingFlag,name,amount,doctorName) {
 | 
	
		
			
				|  |  |      if(loadingFlag == 1){
 | 
	
		
			
				|  |  |          $("#dzfpLoadingModal").modal('show');
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      postAjaxJsonHttpRequst("/thmz/getNewAllSerialForThisTime",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
 | 
	
		
			
				|  |  |          if(res.code == 0){
 | 
	
		
			
				|  |  |          var typeFlag = "1";
 | 
	
	
		
			
				|  | @@ -1974,7 +1979,7 @@ function printDzfp(patientId,times,receiptNo,loadingFlag,name,amount) {
 | 
	
		
			
				|  |  |                  if(rs.code ==0){
 | 
	
		
			
				|  |  |                      successMesageSimaple("电子发票上传成功,即将打印!")
 | 
	
		
			
				|  |  |                      setTimeout(function(){
 | 
	
		
			
				|  |  | -                        prn1PrintAndQRCode(patientId, times,rs.data.serialNo,name,amount);
 | 
	
		
			
				|  |  | +                        prn1PrintAndQRCode(patientId, times,rs.data.serialNo,name,amount,doctorName);
 | 
	
		
			
				|  |  |                      },3000)
 | 
	
		
			
				|  |  |                      if(typeFlag == 1){
 | 
	
		
			
				|  |  |                          initFeeTable();
 | 
	
	
		
			
				|  | @@ -2003,6 +2008,20 @@ function uploadMzInvoice(patientId,times,receiptNo,typeFlag) {
 | 
	
		
			
				|  |  |          if(typeFlag == 1){
 | 
	
		
			
				|  |  |              $("#dzfpLoadingModal").modal('hide');
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +//        if(rs.code ==0){
 | 
	
		
			
				|  |  | +//            successMesageSimaple("电子发票上传成功,即将打印!")
 | 
	
		
			
				|  |  | +//            setTimeout(function(){
 | 
	
		
			
				|  |  | +//                prn1PrintAndQRCode(patientId, times,rs.data.serialNo,name,amount,doctorName);
 | 
	
		
			
				|  |  | +//            },3000)
 | 
	
		
			
				|  |  | +//            if(typeFlag == 1){
 | 
	
		
			
				|  |  | +//                            initFeeTable();
 | 
	
		
			
				|  |  | +//                        }
 | 
	
		
			
				|  |  | +//            if(typeFlag == 1){
 | 
	
		
			
				|  |  | +//                initFeeTable();
 | 
	
		
			
				|  |  | +//            }
 | 
	
		
			
				|  |  | +//        }else {
 | 
	
		
			
				|  |  | +//            errorMesage(rs);
 | 
	
		
			
				|  |  | +//        }
 | 
	
		
			
				|  |  |          if(rs.code ==0){
 | 
	
		
			
				|  |  |              successMesageSimaple("电子发票上传成功!")
 | 
	
		
			
				|  |  |              if(typeFlag == 1){
 | 
	
	
		
			
				|  | @@ -2319,6 +2338,23 @@ function printCommon(url, patientId, times, chargeFeeFlag) {
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +//下载电子发票
 | 
	
		
			
				|  |  | +function downloadDzfp() {
 | 
	
		
			
				|  |  | +    postAjaxJsonHttpRequst("/thmz/selectDzfpUploadAboutSerialNo",{patientId:dzfp_patientId,times:dzfp_times,serialNo:dzfp_serialNo},true,function (res) {
 | 
	
		
			
				|  |  | +        if(res.code == 0){
 | 
	
		
			
				|  |  | +            $("#dzfpDownModal").modal("hide");
 | 
	
		
			
				|  |  | +            if(res.data.resUrl){
 | 
	
		
			
				|  |  | +                window.open(res.data.resUrl)
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                errorMesage("未获取到电子发票,请重新上传发票!");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }else {
 | 
	
		
			
				|  |  | +            errorMesage(res)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 打印发票通用方法
 | 
	
		
			
				|  |  |   * @param patientId
 | 
	
	
		
			
				|  | @@ -2329,7 +2365,7 @@ function printCommon(url, patientId, times, chargeFeeFlag) {
 | 
	
		
			
				|  |  |   * 直接打印发票
 | 
	
		
			
				|  |  |   * @param patientId
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -function prn1PrintAndQRCode(patientId, times,serialNo,name,fee) {
 | 
	
		
			
				|  |  | +function prn1PrintAndQRCode(patientId, times,serialNo,name,fee,doctorName) {
 | 
	
		
			
				|  |  |  //    getInvoiceBase64(patientId,times,serialNo)
 | 
	
		
			
				|  |  |  //    setPrint();
 | 
	
		
			
				|  |  |  //    var height = "93.15mm";
 | 
	
	
		
			
				|  | @@ -2351,6 +2387,30 @@ function prn1PrintAndQRCode(patientId, times,serialNo,name,fee) {
 | 
	
		
			
				|  |  |  //    LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
 | 
	
		
			
				|  |  |  //    LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
 | 
	
		
			
				|  |  |  //    LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", hospitalName);
 | 
	
		
			
				|  |  | +    //获取项目集合
 | 
	
		
			
				|  |  | +    var params = {
 | 
	
		
			
				|  |  | +        billItemCode:'012',
 | 
	
		
			
				|  |  | +        patientId:patientId,
 | 
	
		
			
				|  |  | +        times:times,
 | 
	
		
			
				|  |  | +        payMark:0,
 | 
	
		
			
				|  |  | +        receiptNo:'1',
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +//    initChargeDetailTablePublic('/thmz/getMzChargeDetailByBillItem', $('#charge_detail_table'), queryParamsForDetail);
 | 
	
		
			
				|  |  | +//    var projectList = [];
 | 
	
		
			
				|  |  | +    $("#printProjectName").empty();
 | 
	
		
			
				|  |  | +    postAjaxJsonHttpRequst("/thmz/getMzChargeDetailByBillItem",params,true,function (res) {
 | 
	
		
			
				|  |  | +        if(res.code == 0){
 | 
	
		
			
				|  |  | +        res.data.forEach((item,index)=>{
 | 
	
		
			
				|  |  | +//            projectList.add({
 | 
	
		
			
				|  |  | +//                name:item.name,
 | 
	
		
			
				|  |  | +//                fee:item.chargeAmount
 | 
	
		
			
				|  |  | +//            })
 | 
	
		
			
				|  |  | +            var html = '<div style="font-size:15px;line-height:15px;float:left;width:150px;"><span style="width:105px;display:inline-block;overflow:hidden;white-space: nowrap;" id="printProjectName'+(index+1)+'">'+item.tcName+'</span><span style="margin-left: 5px;line-height:15px;" id="printProjectFee1">'+item.amount+'</span><br /></div>'
 | 
	
		
			
				|  |  | +            $('#printProjectName').append(html);
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  |      postAjaxJsonHttpRequst("/thmz/selectDzfpUploadAboutSerialNo",{patientId:patientId,times:times,serialNo:serialNo},true,function (dzfp) {
 | 
	
		
			
				|  |  |          if(dzfp.code == 0){
 | 
	
		
			
				|  |  |              if(dzfp.data.resUrl){
 | 
	
	
		
			
				|  | @@ -2360,13 +2420,15 @@ function prn1PrintAndQRCode(patientId, times,serialNo,name,fee) {
 | 
	
		
			
				|  |  |                      width: 1, //线宽
 | 
	
		
			
				|  |  |                      height: 30, //条码高度
 | 
	
		
			
				|  |  |                      displayValue: true, //是否显示文字信息
 | 
	
		
			
				|  |  | +                    fontSize: 14,
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  |                  $("#printDate1").text(name);
 | 
	
		
			
				|  |  |                  $("#printDate2").text(fee);
 | 
	
		
			
				|  |  |                  $("#printDate3").text(dzfp.data.fpNo);
 | 
	
		
			
				|  |  |                  $("#printDate4").text(dzfp.data.opCode);
 | 
	
		
			
				|  |  |                  $("#printDate5").text(dzfp.data.blueIssueDate);
 | 
	
		
			
				|  |  | -                $("#printDate5").text(dzfp.data.blueIssueDate);
 | 
	
		
			
				|  |  | +                console.log("doctorName",doctorName)
 | 
	
		
			
				|  |  | +                $("#printDate6").text(doctorName);
 | 
	
		
			
				|  |  |                  let src = createInMemoryQR(dzfp.data.resUrl);
 | 
	
		
			
				|  |  |                  let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;"></div>`;
 | 
	
		
			
				|  |  |                  $("#dzfpImg").html(wxPayQrCardHtml);
 | 
	
	
		
			
				|  | @@ -3139,7 +3201,7 @@ function saveRefundFee(refundType) {
 | 
	
		
			
				|  |  |                          if(fpVsesionNo == 0){
 | 
	
		
			
				|  |  |                              prn1Print(res.patientId, res.times, false, 1);
 | 
	
		
			
				|  |  |                          }else {
 | 
	
		
			
				|  |  | -                            printDzfp(res.patientId, res.times,1,0)
 | 
	
		
			
				|  |  | +//                            printDzfp(res.patientId, res.times,1,0)
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  } else {
 | 
	
	
		
			
				|  | @@ -3900,6 +3962,8 @@ function chargeFeeForMztcbl() {
 | 
	
		
			
				|  |  |      var patientId = $("#mzblPatientId").val();
 | 
	
		
			
				|  |  |      var times = $("#mzblTimes").val();
 | 
	
		
			
				|  |  |      var receiptNo = $("#mzblReceiptNo").val();
 | 
	
		
			
				|  |  | +    var doctorName = $("#doctorNameHaveTally").val();
 | 
	
		
			
				|  |  | +    var realMoney = $("#realMoney").val();
 | 
	
		
			
				|  |  |      $.ajax({
 | 
	
		
			
				|  |  |          type: "GET",
 | 
	
		
			
				|  |  |          url: '/thmz/chargeFeeForMztcbl?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo,
 | 
	
	
		
			
				|  | @@ -3920,7 +3984,7 @@ function chargeFeeForMztcbl() {
 | 
	
		
			
				|  |  |                  if(fpVsesionNo == 0){
 | 
	
		
			
				|  |  |                      prn1Print(patientId, times, false, res.receiptNo);
 | 
	
		
			
				|  |  |                  }else {
 | 
	
		
			
				|  |  | -                    printDzfp(patientId, times,res.receiptNo,0)
 | 
	
		
			
				|  |  | +                    printDzfp(patientId, times,res.receiptNo,0,realMoney,doctorName)
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              } else {
 | 
	
		
			
				|  |  |                  errorMesage(res);
 |