Browse Source

导引单打印

zengfanwei 2 weeks ago
parent
commit
346de45913
2 changed files with 217 additions and 35 deletions
  1. 212 32
      src/main/resources/static/js/mz/clinic.js
  2. 5 3
      src/main/resources/templates/mz/clinic.html

+ 212 - 32
src/main/resources/static/js/mz/clinic.js

@@ -11525,13 +11525,15 @@ function realSavePrescription(wpMedicineFlag,mallFlag) {
                     loadClinicTableList();
                     //$("#messageModal").modal();
                     if(wpyHide === 0){
-                        $("#messageContent").html("门诊处方保存成功,是否打印处方和门诊指引单?");
+                        $("#messageContent").html("门诊处方保存成功,是否打印门诊指引单?");
                         $("#messageButton").off("click").on("click", function (t) {
                             $("#messageModal").modal("hide");
                             if(mallFlag){
-                                printPrescription(res.data.patientId, res.data.times, res.data.id, 0, 1);
+                                // printPrescription(res.data.patientId, res.data.times, res.data.id, 0, 1);
+                                printGuideCard(res.data.patientId, res.data.times, res.data.id, 0, 1);
                             }else {
-                                printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
+                                // printPrescription(res.data.patientId, res.data.times, res.data.id, 5, 1);
+                                printGuideCard(res.data.patientId, res.data.times, res.data.id, 5, 1);
                             }
                         });
                         $("#cancelButton").off("click");
@@ -12219,16 +12221,26 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                 if (type == 0) {
                     $("#callPrescription").removeClass("in").addClass("hide");
                     if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0) && (jsonData.rxDruginfoList == null || jsonData.rxDruginfoList.length == 0)) {
-                        $("#printPrescription").removeClass("in").addClass("hide");
-                        $("#printPrescriptionSetup").removeClass("in").addClass("hide");
+                        // $("#printPrescription").removeClass("in").addClass("hide");
+                        // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
+                        $("#printGuideCard").removeClass("in").addClass("hide");
+                        $("#printGuideCardSetup").removeClass("in").addClass("hide");
                     } else {
-                        $("#printPrescription").removeClass("hide").addClass("in");
-                        $("#printPrescription").off("click").on("click", function (t) {
-                            printPrescription(patientId, times, clnicId, payMark, 1);
+                        // $("#printPrescription").removeClass("hide").addClass("in");
+                        // $("#printPrescription").off("click").on("click", function (t) {
+                        //     printPrescription(patientId, times, clnicId, payMark, 1);
+                        // });
+                        $("#printGuideCard").removeClass("hide").addClass("in");
+                        $("#printGuideCard").off("click").on("click", function (t) {
+                            printGuideCard(patientId, times, clnicId, payMark, 1);
                         });
-                        $("#printPrescriptionSetup").removeClass("hide").addClass("in");
-                        $("#printPrescriptionSetup").off("click").on("click", function (t) {
-                            printPrescription(patientId, times, clnicId, payMark, 2);
+                        // $("#printPrescriptionSetup").removeClass("hide").addClass("in");
+                        // $("#printPrescriptionSetup").off("click").on("click", function (t) {
+                        //     printPrescription(patientId, times, clnicId, payMark, 2);
+                        // });
+                        $("#printGuideCardSetup").removeClass("hide").addClass("in");
+                        $("#printGuideCardSetup").off("click").on("click", function (t) {
+                            printGuideCard(patientId, times, clnicId, payMark, 2);
                         });
                     }
                     if (jsonData.mzYjReqList != null && jsonData.mzYjReqList.length > 0) {
@@ -12311,7 +12323,8 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                         registration(patientId);
                     });
                 } else {
-                    $("#printPrescription").removeClass("in").addClass("hide");
+                    // $("#printPrescription").removeClass("in").addClass("hide");
+                    $("#printGuideCard").removeClass("in").addClass("hide");
                     $("#printZyReq").removeClass("in").addClass("hide");
                     $("#printBlRecord").removeClass("in").addClass("hide");
                     $("#printJcReq").removeClass("in").addClass("hide");
@@ -12323,20 +12336,32 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                     });
                 }
                 if (oriPayMark == 1) {
-                    $("#printPrescription").removeClass("in").addClass("hide");
-                    $("#printPrescriptionSetup").removeClass("in").addClass("hide");
+                    // $("#printPrescription").removeClass("in").addClass("hide");
+                    // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
+                    $("#printGuideCard").removeClass("in").addClass("hide");
+                    $("#printGuideCardSetup").removeClass("in").addClass("hide");
                 } else {
                     if ((jsonData.mzChargeDetailList == null || jsonData.mzChargeDetailList.length == 0) && (jsonData.mzYjReqList == null || jsonData.mzYjReqList.length == 0) && (jsonData.rxDruginfoList == null || jsonData.rxDruginfoList.length == 0)) {
-                        $("#printPrescription").removeClass("in").addClass("hide");
-                        $("#printPrescriptionSetup").removeClass("in").addClass("hide");
+                        // $("#printPrescription").removeClass("in").addClass("hide");
+                        // $("#printPrescriptionSetup").removeClass("in").addClass("hide");
+                        $("#printGuideCard").removeClass("in").addClass("hide");
+                        $("#printGuideCardSetup").removeClass("in").addClass("hide");
                     } else {
-                        $("#printPrescription").removeClass("hide").addClass("in");
-                        $("#printPrescription").off("click").on("click", function (t) {
-                            printPrescription(patientId, times, clnicId, payMark, 1);
+                        // $("#printPrescription").removeClass("hide").addClass("in");
+                        // $("#printPrescription").off("click").on("click", function (t) {
+                        //     printPrescription(patientId, times, clnicId, payMark, 1);
+                        // });
+                        // $("#printPrescriptionSetup").removeClass("hide").addClass("in");
+                        // $("#printPrescriptionSetup").off("click").on("click", function (t) {
+                        //     printPrescription(patientId, times, clnicId, payMark, 2);
+                        // });
+                        $("#printGuideCard").removeClass("hide").addClass("in");
+                        $("#printGuideCard").off("click").on("click", function (t) {
+                            printGuideCard(patientId, times, clnicId, payMark, 1);
                         });
-                        $("#printPrescriptionSetup").removeClass("hide").addClass("in");
-                        $("#printPrescriptionSetup").off("click").on("click", function (t) {
-                            printPrescription(patientId, times, clnicId, payMark, 2);
+                        $("#printGuideCardSetup").removeClass("hide").addClass("in");
+                        $("#printGuideCardSetup").off("click").on("click", function (t) {
+                            printGuideCard(patientId, times, clnicId, payMark, 2);
                         });
                     }
                 }
@@ -12543,15 +12568,6 @@ function setTableHtml(prescriptionDetail) {
     return {html: html, j: j};
 }
 
-// /**
-//  * 打印门诊指引单
-//  * @param patientId
-//  * @param times
-//  */
-// function printGuideCard(patientId, times) {
-//
-// }
-
 /**
  * 保存门诊处方打印记录
  * @param patientId
@@ -13182,7 +13198,6 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                             }
                         }
                     });
-                    // printGuideCard(patientId, times);
                 }
             } else {
                 errorMesage(res);
@@ -13191,6 +13206,171 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
     });
 }
 
+    function printGuideCard(patientId, times, clnicId, payMark, printType) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        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){
+                var mzPatientMi = res.mzPatientMi;
+                $("#payQrcodeGuideCard").empty();
+                $("#selfPayDetail").empty();
+                var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
+                $.ajax({
+                    type: "GET",
+                    url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '&times=' + times,
+                    contentType: "application/json;charset=UTF-8",
+                    dataType: "json",
+                    headers: {
+                        'Accept': 'application/json',
+                        'Authorization': 'Bearer ' + localStorage.getItem("token")
+                    },
+                    success: function (res) {
+                        setPrint();
+                        LODOP = getLodop();
+                        LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
+                        LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"门诊导引单");
+                        if (res == '401' || res == 401) {
+                            window.location.href = '/thmz/login/view'
+                            return;
+                        }
+                        if (res.code == 0) {
+                            var selfPayList = res.selfPayList;
+                            $("#zfcns_time").text("时间:" + res.zfcns_time);
+                            if (selfPayList != null && selfPayList.length > 0) {
+                                $("#patientNameSelfPay").text(mzPatientMi.name);
+                                $("#patientGenderSelfPay").text(mzPatientMi.gender);
+                                $("#patientAgeSelfPay").text(mzPatientMi.ageString);
+                                $("#patientIdSelfPay").text(mzPatientMi.patientId);
+                                $("#deptSelfPay").text(deptName);
+                                $("#zdSelfPay").text(res.icdText);
+                                var selfPayListHtml = "";
+                                for (var i = 1; i <= selfPayList.length; i++) {
+                                    selfPayListHtml += "<tr><td>";
+                                    selfPayListHtml += i + "." + selfPayList[i - 1];
+                                    selfPayListHtml += "</td></tr>";
+                                }
+                                $("#selfPayDetail").html(selfPayListHtml);
+                                if (index > 0) {
+                                    LODOP.NewPageA();
+                                }
+                                //view-source:http://www.c-lodop.com/demolist/PrintSample43.html  分页看这里
+                                LODOP.ADD_PRINT_TABLE(158, "5%", "90%", 400, strStyle + document.getElementById("self_pay_table_body").innerHTML);
+                                LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
+                                LODOP.ADD_PRINT_HTM(26, "5%", "90%", 119, document.getElementById("self_pay_table_header").innerHTML);
+                                LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
+                                LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
+                                LODOP.ADD_PRINT_HTM(560, "5%", "90%", 200, document.getElementById("self_pay_table_foot").innerHTML);
+                                LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
+                                LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
+                                // LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("self_pay_table").innerHTML);
+                                index++;
+                            }
+                            let html = `<tr style="font-weight: 700"><td>项目</td><td>地点</td></tr>`;
+                            if (res.guideCardData != null && res.guideCardData.length > 0) {
+                                if(res.guideCardData.length > 0){
+                                    for (var i = 0; i < res.guideCardData.length; i++) {
+                                        html += "<tr><td>" + res.guideCardData[i].name + "</td><td>" + res.guideCardData[i].address + "</td></tr>"
+                                    }
+                                }
+                            }
+                            $("#guideCardDetail").html(html);
+                            let totalAmount = res.totalAmount;
+                            let jsonData = {
+                                "subject": '门诊收费',
+                                "body": '门诊收费_' + patientId,
+                                "patientId": patientId,
+                                "times" : times,
+                                "amount" : totalAmount
+                            }
+                            infoMessage("获取支付信息耗时较长,请耐心等待")
+                            $.ajax({
+                                type: "POST",
+                                url: '/thmz/NongPay/unifiedOrderByCodeImgUrl',
+                                contentType: "application/json;charset=UTF-8",
+                                dataType: "json",
+                                data: JSON.stringify(jsonData),
+                                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.data != null && res.data != "" && res.data.payData != null && res.data.payData != "") {
+                                        // new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode);  // 设置要生成二维码的链接
+                                        // $("canvas").attr("id", "erw");
+                                        // let canvas = document.getElementById('erw');
+                                        // let src = canvas.toDataURL("image/png");
+                                        let payQrcodeGuideCardHtml = `<img src="${res.data.payData}" style="width: 100px;height: 100px;margin: 20px 0"/><div style="width: 140px;margin-top: 2px;">微信扫码支付</div>`;
+                                        $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
+                                    }
+                                    $("#totalAmountGuideCard").text("¥" + totalAmount +"元");
+                                    JsBarcode('#imgcode', patientId, {
+                                        lineColor: '#000000', //线条颜色
+                                        width: 2, //线宽
+                                        height: 60, //条码高度
+                                        displayValue: false, //是否显示文字信息
+                                    });
+                                    LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
+                                    //LODOP.PRINT();
+                                    if (printType == 1) {
+                                        LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true);
+                                        LODOP.PREVIEW();
+                                    } else if (printType == 2) {
+                                        LODOP.PRINT_SETUP();
+                                    }
+                                }
+                            })
+                            // if (res.payQrcode != null && res.payQrcode != "") {
+                            //     new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode);  // 设置要生成二维码的链接
+                            //     $("canvas").attr("id", "erw");
+                            //     let canvas = document.getElementById('erw');
+                            //     let src = canvas.toDataURL("image/png");
+                            //     let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(自费)</div>`;
+                            //     $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
+                            // }
+                            // if(!stringIsBlank(res.healthEducationUrl)){
+                            //     new QRCode(document.getElementById("healthEducationCard"), res.healthEducationUrl);  // 设置要生成二维码的链接
+                            //     $("canvas").attr("id", "erw");
+                            //     let canvas = document.getElementById('erw');
+                            //     let src = canvas.toDataURL("image/png");
+                            //     let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 120px;margin-top: 2px;">健康宣教</div>`;
+                            //     $("#healthEducationCard").html(wxPayQrCardHtml);
+                            // }
+                            // if(!stringIsBlank(res.wxPayQrUrl)){
+                            //     new QRCode(document.getElementById("wxPayQrCard"), res.wxPayQrUrl);  // 设置要生成二维码的链接
+                            //     $("canvas").attr("id", "erw");
+                            //     let canvas = document.getElementById('erw');
+                            //     let src = canvas.toDataURL("image/png");
+                            //     let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(医保统筹)</div>`;
+                            //     $("#wxPayQrCard").html(wxPayQrCardHtml);
+                            // }
+                        } else if (res.code == -2) {
+                            warningMesageSimaple(res.message)
+                            // if (printType == 1) {
+                            //     LODOP.PREVIEW();
+                            // } else if (printType == 2) {
+                            //     LODOP.PRINT_SETUP();
+                            // }
+                        } else {
+                            errorMesage(res);
+                        }
+                    }
+                });
+            } else {
+                errorMesage(res);
+            }
+        }})
+
+}
+
 /**
  * 构建体征描述
  * @param mzBlRecord

+ 5 - 3
src/main/resources/templates/mz/clinic.html

@@ -2364,7 +2364,8 @@
                 <button type="button" class="btn btn-primary hide" id="printBlRecord">打印门诊病历</button>
                 <button type="button" class="btn btn-primary hide" id="printJcReq">打印检查申请单</button>
                 <button type="button" class="btn btn-primary hide" id="printJyReq">打印检验申请单</button>
-                <button type="button" class="btn btn-primary hide" id="printPrescription">打印处方、门诊指引单</button>
+<!--                <button type="button" class="btn btn-primary hide" id="printPrescription">打印处方、门诊指引单</button>-->
+                <button type="button" class="btn btn-primary hide" id="printGuideCard">打印门诊指引单</button>
                 <button type="button" class="btn btn-primary hide" id="callPrescription">调用</button>
                 <button type="button" class="btn btn-primary hide" id="showMzBlRecordModal">修改病历</button>
                 <button type="button" class="btn btn-primary hide" id="previewYjReq">检查检验报告</button>
@@ -2397,8 +2398,9 @@
                         <button type="button" class="btn btn-primary hide" id="printBlRecordSetup">门诊病历打印设置</button>
                         <button type="button" class="btn btn-primary hide" id="printJcReqSetup">检查申请单打印设置</button>
                         <button type="button" class="btn btn-primary hide" id="printJyReqSetup">检验申请单打印设置</button>
-                        <button type="button" class="btn btn-primary hide" id="printPrescriptionSetup">处方、门诊指引单打印设置
-                        </button>
+<!--                        <button type="button" class="btn btn-primary hide" id="printPrescriptionSetup">处方、门诊指引单打印设置-->
+<!--                        </button>-->
+                        <button type="button" class="btn btn-primary hide" id="printGuideCardSetup">门诊指引单打印设置</button>
                     </div>
                 </div>