Browse Source

入院登记成功后自动打印腕带

lighter 2 years ago
parent
commit
df6291573d

+ 11 - 4
src/main/resources/static/js/zy/hospitalized.js

@@ -662,6 +662,7 @@ function saveZyActpatient() {
                     hide: true,
                     styling: 'bootstrap3'
                 });
+                printWristStrap();
                 clearInput();
             } else {
                 new PNotify({
@@ -1463,8 +1464,13 @@ function copyAddress() {
     });
 }
 
-$("#printWristStrap").on("click", function (t) {
-    var phone =  $("#contractPhone").val()
+function printWristStrap() {
+    var patNo = $("#admissionNumber").val()
+    if (!patNo) {
+        errorMesageSimaple('住院号不能为空!')
+        return
+    }
+    var phone =  $("#contractPhone").val();
     if (!phone) {
         phone = $("#phoneNum").val()
     }
@@ -1475,14 +1481,15 @@ $("#printWristStrap").on("click", function (t) {
     LODOP.SET_PRINT_STYLE('FontSize', 9)
     LODOP.SET_PRINT_STYLE('Bold', 1)
 
-    LODOP.ADD_PRINT_BARCODE('7mm', '30mm', '18.5mm', '18.5mm', 'QRCode', $("#admissionNumber").val())
+    LODOP.ADD_PRINT_BARCODE('7mm', '30mm', '18.5mm', '18.5mm', 'QRCode', patNo)
 
     LODOP.ADD_PRINT_TEXT('8mm', '50mm', '220mm', '7mm', '姓名:' + $("#userName").val() + ' / 性别:' + filterGender() + ' / 年龄:' + $("#age").val())
     LODOP.ADD_PRINT_TEXT('14mm', '50mm', '220mm', '7mm', '入院科室:' + smallDeptDict[$("#smallWard").val()])
     LODOP.ADD_PRINT_TEXT('20mm', '50mm', '220mm', '7mm', '紧急联系人:' + phone)
 
     LODOP.PRINT()
-});
+    // LODOP.PREVIEW()
+}
 
 function filterGender() {
     switch ($("#gender").val()) {

+ 1 - 1
src/main/resources/templates/zy/hospitalized.html

@@ -65,7 +65,7 @@
                         <a onclick="saveZyPatient(false)" id="saveUser" hidden><i
                                 class="fa fa-user">&nbsp;保存患者信息</i></a>
                         <a id="copyAddress" hidden><i class="fa fa-copyright" onclick="copyAddress()">&nbsp;复制身份证地址</i></a>
-                        <a id="printWristStrap"><i class="fa fa-print">&nbsp;打印腕带</i></a>
+                        <a id="printWristStrap" onclick="printWristStrap()"><i class="fa fa-print">&nbsp;打印腕带</i></a>
                         <a id="clearRegistration"><i class="fa fa-trash">&nbsp;清空</i></a>
                     </div>
                 </div>