Explorar o código

打印bug 修复

lilei %!s(int64=3) %!d(string=hai) anos
pai
achega
0238948de0

+ 3 - 2
src/libs/JGPrint.js

@@ -22,8 +22,9 @@ export const JGPrintTag = function (html, width, height, data) {
   LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
   LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true) // 可使输出以纸张边缘为基点
   LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', html)
-  console.log(data.qrCodeContent)
-  LODOP.ADD_PRINT_BARCODE('22%','55%',79,79,"QRCode",data.qrCodeContent)
+  // LODOP.ADD_PRINT_BARCODE('36%','65%',90,90,"QRCode",data.qrCodeContent)
+  // LODOP.SET_PRINT_STYLEA(0,"QRCodeVersion",5)
+  // LODOP.SET_PRINT_STYLEA(0,"QRCodeErrorLevel",'L')
   LODOP.SET_PRINT_COPIES(data.printQty)// 指定份数
   LODOP.SET_PRINT_PAGESIZE(1, width, height)
   LODOP.PRINT()

+ 11 - 14
src/views/numsGoodsShelves/replenishmentManagement/printView.vue

@@ -14,28 +14,26 @@
         v-for="(item,index) in list"
         :key="index"
         class="print-pages"
-        style="font-size: 9px;padding:3pt 16pt;">
-        <div class="storeName" style="text-align: center;font-weight: bold;margin: 2pt 0;">
+        style="font-size: 12px;padding:3pt 5pt;">
+        <div class="storeName" style="text-align: center;margin: 2pt 0 4pt;">
           {{ nowData.dealerName }}
         </div>
         <div style="overflow: hidden;">
-          <div style="float: left;width:60%;">
-            <div class="shelfName" style="margin-bottom: 2pt;">
+          <div style="float: left;width:65%;padding-top: 5pt;">
+            <div class="shelfName" style="margin-bottom: 3pt;">
               {{ nowData.shelfInfo.shelfName }}
             </div>
-            <div class="productCode" style="font-weight: bold;">{{ item.productCode }}</div>
+            <div class="productCode" style="margin-bottom: 2pt;">{{ item.productCode }}</div>
             <div class="productName">{{ item.product.name }}</div>
-            <div class="userName" style="margin-top: 2pt;font-size: 8px;">
+            <div class="userName" style="margin-top: 4pt;">
               <span style="margin: 0 5pt 0 0;">{{ moment().format('YYYY-MM-DD HH:mm') }}</span>
-            </div>
-            <div class="userName" style="margin-top: 2pt;font-size: 8px;">
               <span>{{ nowData.parintUser }}</span>
             </div>
           </div>
-          <div style="float: right;width: 40%;">
+          <div style="float: right;width: 34%;">
             <div class="productSno" style="font-size: 15pt;text-align: center;">{{ item.shelfPlaceCode }}</div>
             <div class="qrcode" ref="qrCodeUrl" style="text-align: center;">
-              <vue-qr :text="`dealerSn=${nowData.dealerSn}&shelfSn=${item.shelfSn}&productSn=${item.productSn}&productCode=${item.productCode}&shelfPlaceCode=${item.shelfPlaceCode}&shelfPlaceSn=${item.shelfPlaceSn}`" :margin="0" :size="70"></vue-qr>
+              <vue-qr :text="`${item.shelfSn}&${item.productCode}`" :margin="0" :size="70"></vue-qr>
             </div>
           </div>
         </div>
@@ -78,11 +76,10 @@ export default {
       const printBox = document.querySelectorAll('.print-pages')
       console.log(printBox)
       for (let i = 0; i < printBox.length; i++) {
-        const htmlStr = printBox[i].outerHTML.replace(/<\s?img[^>]*>/gi, '')
+        const htmlStr = printBox[i].outerHTML
         const item = this.list[i]
-        const nowData = this.nowData
-        this.list[i].qrCodeContent = `dealerSn=${nowData.dealerSn}&shelfSn=${item.shelfSn}&productCode=${item.productCode}&shelfPlaceCode=${item.shelfPlaceCode}`
-        JGPrintTag(htmlStr, '45mm', '30mm', this.list[i])
+        this.list[i].qrCodeContent = `${item.shelfSn}&${item.productCode}`
+        JGPrintTag(htmlStr, '60mm', '40mm', this.list[i])
       }
     },
     setData (nowData, list) {