lilei 3 éve
szülő
commit
c5826ebee3
2 módosított fájl, 4 hozzáadás és 9 törlés
  1. 3 8
      src/libs/JGPrint.js
  2. 1 1
      src/views/common/print.vue

+ 3 - 8
src/libs/JGPrint.js

@@ -42,17 +42,12 @@ export const JGPrint = function (data, type, printerType) {
     }
   } else {
     // 喷墨打印机
+    LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
+    LODOP.SET_PRINT_PAGESIZE(3,2090,0,"");
     if (type == 'preview') { //  预览
-      LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);//隐藏打印按钮
-      LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
-      LODOP.SET_PRINT_PAGESIZE(3,2090,0,"");
       LODOP.PREVIEW()
     } else if (type == '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()
-      }
+      LODOP.PRINT()
     }
   }
 }

+ 1 - 1
src/views/common/print.vue

@@ -39,7 +39,7 @@ export default {
   },
   methods: {
     handlePrint (type) {
-      this.$emit('handlePrint', type, this.printerType)
+      this.$emit('handlePrint', type, type == 'preview' ? 'INK' : this.printerType)
     }
   }
 }