Browse Source

导引单打印

zengfanwei 2 weeks ago
parent
commit
cf92bfa9df

+ 51 - 71
src/main/resources/static/js/mz/clinic.js

@@ -13290,81 +13290,63 @@ function printGuideCard(patientId, times, clnicId, payMark, printType) {
                             $("#guideCardDetail").html(html);
                             let totalAmount = res.totalAmount;
                             let jsonData = {
-                                "subject": '门诊收费',
-                                "body": '门诊收费_' + patientId,
+                                // "subject": "1234",
+                                // "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.PREVIEW();
-                                    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);
-                            // }
+                            // 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;
+                            //         }
+                            //
+                            //     }
+                            // })
+                            // + JSON.stringify(jsonData)
+                            let qrCodeUrl = `https://218.93.214.118:6082/cashier?queryJson=${JSON.stringify(jsonData)}`
+                            // console.log("jsonData",JSON.stringify(jsonData))
+                            // console.log("qrCodeUrl",qrCodeUrl)
+                            new QRCode(document.getElementById("payQrcodeGuideCard"),{
+                                text: qrCodeUrl,
+                                width: 120,
+                                height: 120,
+                                version: 40,
+                                colorDark: '#000000',
+                                colorLight: '#ffffff',
+                                correctLevel: QRCode.CorrectLevel.L  // 最低容错,最大化容量
+                            });  // 设置要生成二维码的链接
+                            $("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;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();
+                            }
                         } else if (res.code == -2) {
                             warningMesageSimaple(res.message)
-                            // if (printType == 1) {
-                            //     LODOP.PREVIEW();
-                            // } else if (printType == 2) {
-                            //     LODOP.PRINT_SETUP();
-                            // }
                         } else {
                             errorMesage(res);
                         }
@@ -13902,8 +13884,6 @@ function printOpRecord(patientId, times, printType) {
                 $("#patientAgeOpRecord").text(mzPatientMi.ageString);
                 $("#responseTypeOpRecord").text(mzPatientMi.responseTypeName);
                 $("#patientCardNoOpRecord").text(mzPatientMi.icCardNo);
-
-
                 var needNewPageA = false;
                 for (var i = 0; i < res.data.length; i++) {
                     var obj = res.data[i];

+ 4 - 2
src/main/resources/templates/mz/clinic.html

@@ -3053,8 +3053,10 @@
                 <span class="hospitalName" style="margin-left: 20px">沭阳铭和医院</span><br>
                 <span style="margin-left: 12px">门诊就诊指引单</span>
             </div>
-            <div style="float: left;"><img id="imgcode" style="width: 100%;height: 60px;
-            transform-origin: top left;"/></div>
+            <div style="float: left;">
+                <img id="imgcode" style="width: 100%;height: 60px;
+            transform-origin: top left;"/>
+            </div>
             <div style="float: left;width: 170px;">
                 <div style="margin-bottom: 8px">门诊号:<span id="patientIdGuideCard"></span></div>
                 <div style="margin-bottom: 8px">姓名:<span id="patientNameGuideCard"></span></div>