Browse Source

修改电子发票凭据展示项目

‘chenzhilei’ 2 weeks ago
parent
commit
8314bfbd7a

+ 40 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -327,16 +327,55 @@ public class MzChargeDetailController {
                 if ("0".equals(mzChargeDetail.getBillItemCode())) {
                     billItemTypes.add(Constants.XYF);
                     billItemTypes.add(Constants.ZCYF);
+                    mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), mzChargeDetail.getBillItemCode(), billItemTypes);
+
                 } else if ("1".equals(mzChargeDetail.getBillItemCode())) {
                     billItemTypes.add(Constants.CYF);
+                    mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), mzChargeDetail.getBillItemCode(), billItemTypes);
+
                 } else if ("2".equals(mzChargeDetail.getBillItemCode())) {
                     billItemTypes.add(Constants.XYF);
                     billItemTypes.add(Constants.ZCYF);
                     billItemTypes.add(Constants.CYF);
                     billItemTypes.add(Constants.SSWRF);
                     billItemTypes.add(Constants.TC);
+                    mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), mzChargeDetail.getBillItemCode(), billItemTypes);
+
+                }else if ("012".equals(mzChargeDetail.getBillItemCode())) {
+                    List<String> billItemTypes1 = new ArrayList<>();
+                    billItemTypes1.add(Constants.XYF);
+                    billItemTypes1.add(Constants.ZCYF);
+                    List<MzChargeDetail> mzChargeDetailList1 = mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), "0", billItemTypes1);
+                    List<String> billItemTypes2 = new ArrayList<>();
+                    billItemTypes2.add(Constants.CYF);
+                    List<MzChargeDetail> mzChargeDetailList2 = mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), "1", billItemTypes2);
+                    List<String> billItemTypes3 = new ArrayList<>();
+                    billItemTypes3.add(Constants.XYF);
+                    billItemTypes3.add(Constants.ZCYF);
+                    billItemTypes3.add(Constants.CYF);
+                    billItemTypes3.add(Constants.SSWRF);
+                    billItemTypes3.add(Constants.TC);
+                    List<MzChargeDetail> mzChargeDetailList3 = mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), "2", billItemTypes3);
+
+                    billItemTypes.add(Constants.XYF);
+                    billItemTypes.add(Constants.ZCYF);
+                    billItemTypes.add(Constants.CYF);
+                    billItemTypes.add(Constants.SSWRF);
+                    billItemTypes.add(Constants.TC);
+                    mzChargeDetailList.addAll(mzChargeDetailList1);
+                    mzChargeDetailList.addAll(mzChargeDetailList2);
+                    mzChargeDetailList.addAll(mzChargeDetailList3);
+                    mzChargeDetailList = mzChargeDetailList.stream().distinct().collect(Collectors.toList());
+                } else {
+                    billItemTypes.add(Constants.XYF);
+                    billItemTypes.add(Constants.ZCYF);
+                    billItemTypes.add(Constants.CYF);
+                    billItemTypes.add(Constants.SSWRF);
+                    billItemTypes.add(Constants.TC);
+                    billItemTypes.add(Constants.SSWRF);
+                    mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), mzChargeDetail.getBillItemCode(), billItemTypes);
+
                 }
-                mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark(), mzChargeDetail.getBillItemCode(), billItemTypes);
             }
             mzChargeDetailList = mzChargeDetailService.getMzChargeDetails(mzChargeDetailList);
             resultMap.put("code", 0);

+ 76 - 12
src/main/resources/static/js/mz/toll_administration.js

@@ -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=" + 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);

+ 44 - 16
src/main/resources/templates/mz/toll_administration.html

@@ -382,6 +382,8 @@
                     <input id="timesHaveTally" type="hidden"/>
                     <!--查询记账明细所需条件-->
                     <input id="receiptNoHaveTally" type="hidden"/>
+                    <!--查询记账明细所需条件-->
+                    <input id="doctorNameHaveTally" type="hidden"/>
                 </form>
             </div>
             <div class="modal-footer">
@@ -767,7 +769,7 @@
             </div>
             <div class="modal-footer">
 <!--                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="downOrPrintDzfp(1)">打印二维码</button>-->
-                <button type="button" class="btn btn-success" data-dismiss="modal" onclick="downOrPrintDzfp(2)">下载发票PDF文件</button>
+                <button type="button" class="btn btn-success" data-dismiss="modal" onclick="downloadDzfp()">下载发票PDF文件</button>
             </div>
         </div>
     </div>
@@ -775,24 +777,50 @@
 <!-- 电子发票下载窗口结尾 -->
 
 <div class="in hide"
-     style="width:430px;height:97px;margin:0 auto;border: 1px solid #337ab7;font-size: 10px;padding-top: 12px;overflow-y: auto; overflow-x:hidden;">
+     style="width:300px;height:auto;margin:0 auto;border: 1px solid #337ab7;font-size: 10px;padding-top: 12px;">
     <div id="report_table">
-        `<div id="report_table_1" style="float:left;width:180px">
-            <svg id="barcode" height="20"></svg>
-            <div style="margin-top:50px;font-size:15px;">
-                <span>患者姓名:</span><span style="margin-left: 3px;" id="printDate1"></span><br />
-                <span>结算金额:</span><span style="margin-left: 3px;" id="printDate2"></span><br />
-                <span>票据号码:</span><span style="margin-left: 3px;" id="printDate3"></span><br />
-                <span>票据代码:</span><span style="margin-left: 3px;" id="printDate4"></span><br />
-                <span>发票日期:</span><span style="margin-left: 3px;" id="printDate5"></span><br />
+        <div  style="clear: both;">
+            <div id="report_table_1" style="float:left;width:180px">
+                <svg id="barcode" height="20"></svg>
+                <div style="margin-top:50px;font-size:15px;">
+                    <span>患者姓名:</span><span style="margin-left: 3px;" id="printDate1"></span><br />
+                    <span>结算金额:</span><span style="margin-left: 3px;" id="printDate2"></span><br />
+                    <span>票据号码:</span><span style="margin-left: 3px;" id="printDate3"></span><br />
+                    <span>票据代码:</span><span style="margin-left: 3px;" id="printDate4"></span><br />
+                    <span>发票日期:</span><span style="margin-left: 3px;" id="printDate5"></span><br />
+                    <span>就诊医师:</span><span style="margin-left: 3px;" id="printDate6"></span><br />
+                </div>
+            </div>
+            <div id="report_table_2" style="float:left;width:170px;margin-top:10px">
+                <div style="text-align:center;font-weight: 700;font-size:24px;padding-top: -14px" class="hospitalName">沭阳铭和医院</div>
+                <div style="text-align:center;font-weight: 700;font-size:18px;margin-top: 5px;">电子发票信息</div>
+                <div style="text-align:center;font-weight: 700;font-size:14px;margin-top: 25px;">扫码下载电子票据</div>
+                <div style="text-align:center;font-weight: 700;margin-top: 15px;" id="dzfpImg"></div>
+            </div>`
+        </div>
+        <div style="clear: both;">
+            <div id="report_table_3" style="float:left;width:300px">
+<!--                <div style="margin-top:50px;font-size:15px;">-->
+<!--                    <span>就诊日期:</span><span style="margin-left: 3px;" id="printDate7"></span><br />-->
+<!--                </div>-->
+                <div style="font-size:15px;float:left;width:300px;">
+                    <div style="font-size:15px;float:left;width:150px;">
+                        <span style="width:105px;display:inline-block;overflow:hidden;white-space: nowrap;line-height:15px;" >项目名称</span><span style="margin-left: 5px;line-height:15px;">金额</span><br />
+                    </div>
+                    <div style="font-size:15px;float:left;width:150px;">
+                        <span style="width:105px;display:inline-block;overflow:hidden;white-space: nowrap;line-height:15px;" >项目名称</span><span style="margin-left: 5px;line-height:15px;">金额</span><br />
+                    </div>
+                </div>
+                <div style="font-size:15px;float:left;width:300px;" id="printProjectName">
+
+                </div>
+<!--                <div style="font-size:15px;float:left;width:300px;">-->
+<!--&lt;!&ndash;                    <span style="width:180px;overflow:hidden" id="printProjectName1">葡萄糖</span><span style="margin-left: 5px;" id="printProjectFee1">6.60</span><br />&ndash;&gt;-->
+<!--                    <span style="width:110px;display:bloke;overflow:hidden" id="printProjectName1">葡萄糖</span><span style="margin-left: 5px;" id="printProjectFee1">6.60</span><br />-->
+<!--                </div>-->
             </div>
         </div>
-        <div id="report_table_2" style="float:left;width:170px;margin-top:10px">
-            <div style="text-align:center;font-weight: 700;font-size:24px;padding-top: -14px" class="hospitalName">沭阳铭和医院</div>
-            <div style="text-align:center;font-weight: 700;font-size:18px;margin-top: 5px;">电子发票信息</div>
-            <div style="text-align:center;font-weight: 700;font-size:14px;margin-top: 25px;">扫码下载电子票据</div>
-            <div style="text-align:center;font-weight: 700;margin-top: 15px;" id="dzfpImg"></div>
-        </div>`
+
     </div>
 </div>