lilei 2 lat temu
rodzic
commit
aa0d67410b

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1662082617822
+  "version": 1662087307987
 }

+ 24 - 6
src/libs/JGPrint.js

@@ -5,7 +5,7 @@ import store from '@/store'
 import { getLodop } from '@/libs/LodopFuncs'
 import moment from 'moment'
 // 打印页签,支持批量打印
-export const JGPrintTag = function (html, width, height, data) {
+export const JGPrintTag = function (width, height, data) {
   const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
   if (!LODOP) {
     confirm({
@@ -26,15 +26,33 @@ export const JGPrintTag = function (html, width, height, data) {
     })
     return
   }
-  LODOP.PRINT_INIT("")
+  LODOP.PRINT_INITA("0mm","0mm",width,height,"标签");
   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)
-  LODOP.ADD_PRINT_BARCODE('36%','65%',90,90,"QRCode",data.qrCodeContent)
-  LODOP.SET_PRINT_STYLEA(0,"QRCodeVersion",5)
-  // LODOP.SET_PRINT_STYLEA(0,"QRCodeErrorLevel",'H')
+  const top = data.dealerName.length > 12 ? '5mm' : '7mm';
+  const top1 = data.dealerName.length > 12 ? '17mm' : '15mm';
+  const top2 = data.dealerName.length > 12 ? '29mm' : '27mm';
+  // 经销商名称
+  LODOP.SET_PRINT_STYLE("TextNeatRow",true);
+  LODOP.SET_PRINT_STYLE("FontSize",11);
+  LODOP.ADD_PRINT_TEXT(top,"5mm","50mm","10mm",data.dealerName);
+  LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
+  LODOP.SET_PRINT_STYLEA(0,"Horient",2);
+  // 货位号
+  LODOP.SET_PRINT_STYLE("TextNeatRow",true);
+  LODOP.SET_PRINT_STYLE("FontSize",32);
+  LODOP.ADD_PRINT_TEXT(top1,"50%","28mm","15mm",data.shelfPlaceCode);
+  // 产品编码
+  LODOP.SET_PRINT_STYLE("TextNeatRow",true);
+  LODOP.SET_PRINT_STYLE("FontSize",11);
+  LODOP.ADD_PRINT_TEXT(top2,"50%","30mm","15mm",data.productCode);
+  // 二维码
+  LODOP.ADD_PRINT_BARCODE(top1,'7mm',90,90,"QRCode",data.qrCodeContent)
+  LODOP.SET_PRINT_STYLE("QRCodeVersion",5)
+  // LODOP.SET_PRINT_STYLE("QRCodeErrorLevel",'H')
   LODOP.SET_PRINT_COPIES(data.printQty)// 指定份数
   LODOP.SET_PRINT_PAGESIZE(1, width, height)
+  // LODOP.PREVIEW()
   LODOP.PRINT()
 }
  

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

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