Kaynağa Gözat

Merge branch 'develop_lcgz' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_lcgz

chenrui 3 yıl önce
ebeveyn
işleme
01c2dc199d
1 değiştirilmiş dosya ile 5 ekleme ve 20 silme
  1. 5 20
      src/libs/JGPrint.js

+ 5 - 20
src/libs/JGPrint.js

@@ -38,28 +38,13 @@ export const JGPrint = function (data, type, printerType) {
     }
   } else {
     // 喷墨打印
-    const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
-    const dlen = data.data.length
-    LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);//隐藏打印按钮
-    // LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW",1);//隐藏设置按钮
-    LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
-    LODOP.SET_PRINT_STYLEA(0,"PDFScalMode",1);
-    // const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
-    // document.getElementById('print').innerHTML = '<iframe id="printfsqd" name="printfsqd" src="' + url + '" hidden></iframe>'
+    const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+    document.getElementById('print').innerHTML = '<iframe id="printfsqd" name="printfsqd" src="' + url + '" hidden></iframe>'
     if (type == 'preview') { //  预览
-      // window.open(url)
-      console.log(data.data)
-      LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
-      LODOP.SET_PRINT_PAGESIZE(3,2090,0,"");
-      LODOP.PREVIEW()
+      window.open(url)
     } else if (type == 'print') { //  打印
-      // window.frames['printfsqd'].focus()
-      // window.frames['printfsqd'].print()
-      for(let i=0;i<dlen;i++){
-        LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[i])
-        LODOP.SET_PRINT_PAGESIZE(3, 2090, 0, '')
-        LODOP.PRINT()
-      }
+      window.frames['printfsqd'].focus()
+      window.frames['printfsqd'].print()
     }
   }
 }