瀏覽代碼

Merge branch 'master' into Haozi

hu hao 4 年之前
父節點
當前提交
06148b5b40
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      resources/views/store/deliveryAppointment/list.blade.php

+ 10 - 10
resources/views/store/deliveryAppointment/list.blade.php

@@ -196,8 +196,8 @@
                 index:"",
                 index:"",
                 selectDate:{},
                 selectDate:{},
                 periods:@json(\App\DeliveryAppointment::PERIOD),
                 periods:@json(\App\DeliveryAppointment::PERIOD),
-                printInfo:{},
                 infoShow:false,
                 infoShow:false,
+                printInfo:{},
                 today:"",
                 today:"",
             },
             },
             mounted(){
             mounted(){
@@ -249,7 +249,6 @@
             },
             },
             methods: {
             methods: {
                 exePrint(){
                 exePrint(){
-                    this.infoShow = true;
                     if (!this.printInfo.signer){
                     if (!this.printInfo.signer){
                         window.tempTip.setIndex(1099);
                         window.tempTip.setIndex(1099);
                         window.tempTip.show("请填写签收人");
                         window.tempTip.show("请填写签收人");
@@ -257,19 +256,20 @@
                     }
                     }
                     $("#printModal").modal('hide');
                     $("#printModal").modal('hide');
                     let iframe=document.getElementById("print-iframe");
                     let iframe=document.getElementById("print-iframe");
+                    this.infoShow=true;
                     if(!iframe){
                     if(!iframe){
-                        let el = document.getElementById("printContent");
                         iframe = document.createElement('IFRAME');
                         iframe = document.createElement('IFRAME');
                         iframe.setAttribute("id", "print-iframe");
                         iframe.setAttribute("id", "print-iframe");
                         iframe.setAttribute('style', 'position:absolute;width:0;height:0;left:-500px;top:-500px;');
                         iframe.setAttribute('style', 'position:absolute;width:0;height:0;left:-500px;top:-500px;');
                         document.body.appendChild(iframe);
                         document.body.appendChild(iframe);
-                        let doc = iframe.contentWindow.document;
-                        doc.write('<LINK rel="stylesheet" type="text/css" href="{{ asset(mix("css/app.css")) }}">');
-                        doc.write('<div>' + el.innerHTML + '</div>');
-                        doc.close();
-                        iframe.contentWindow.focus();
-                    }
-                    this.infoShow = false;
+                    }else iframe.contentWindow.document.getElementById("iframe-content").remove();
+                    let doc = iframe.contentWindow.document;
+                    let el = document.getElementById("printContent");
+                    doc.write('<LINK rel="stylesheet" type="text/css" href="{{ asset(mix("css/app.css")) }}">');
+                    doc.write('<div id="iframe-content">' + el.innerHTML + '</div>');
+                    doc.close();
+                    iframe.contentWindow.focus();
+                    this.infoShow=false;
                     setTimeout(function () {
                     setTimeout(function () {
                         iframe.contentWindow.print();
                         iframe.contentWindow.print();
                         if (navigator.userAgent.indexOf("MSIE") > 0){
                         if (navigator.userAgent.indexOf("MSIE") > 0){