From b8b16d90fd13bcad5881a4562b5bbe96e576bd6b Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 03 八月 2022 16:27:56 +0800
Subject: [PATCH] 1.解决工单手动打印大二维码问题

---
 src/views/scgl/gd.vue |   71 +++++++++++++++++++++++++----------
 1 files changed, 50 insertions(+), 21 deletions(-)

diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index 1c12268..8e70301 100644
--- a/src/views/scgl/gd.vue
+++ b/src/views/scgl/gd.vue
@@ -569,7 +569,7 @@
       <div id="printMe" style="padding: 30px">
         <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div>
 
-        <div style="display: flex;justify-content: space-around;margin-top: 20px">
+        <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;">
           <div style="width: 78%">
             <el-form
               ref="formApprove"
@@ -606,10 +606,18 @@
               </div>
             </el-form>
           </div>
-          <div style="width: 22%;display: flex;justify-content: center;align-items: center">
-            <!--            <div :id="'qrCode'+0" :ref="'qrCodeDiv'+0" />-->
-            <div />
+          <div
+            id="qrCode"
+            style="width: 22%;height:97px;
+            margin-top: 20px;
+            overflow-x: scroll;display: flex;
+            justify-content: center;
+            position: relative;"
+          >
+            <!--            <div id="qrCode0" ref="qrCodeDiv0" />-->
           </div>
+          <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />
+          <div style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px" />
         </div>
 
         <!--          <div style="width:100%;height: 30px;border-bottom: 1px solid #eee;margin-bottom: 20px" />-->
@@ -1215,10 +1223,15 @@
           this.formApprove.lm_date = res3[0].lm_date
 
           this.$nextTick(() => {
-            // this.bindQRCode(0, this.formApprove.mesordercode, 'big')
             res3.forEach(i => {
               this.bindQRCode(i.seq, i.stepqrcode, 'small')
             })
+            // this.bindQRCode('0', this.formApprove.mesordercode, 'big')
+
+            const div = document.getElementById('qrCode')
+            // 杩欎箞澶氫唬鐮佸彧闇�瑕佽繖涓�鍙ュ疄鐜版垜浠墍闇�瑕佺殑鍔熻兘锛屽畾浣峝iv婊氬姩鏉′綅缃湪搴曢儴锛宻crollHeight璁$畻鍑篸iv鐨勯珮搴︼紝鍐峴crollTop 璁剧疆婊氬姩鏉$殑楂樺害涓哄灏�
+            // div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
+            div.scrollTop = 0 // 婊氬姩鏉′綅浜庢渶椤堕儴
           })
         }
       })
@@ -1251,15 +1264,28 @@
     // },
     // 鐢熸垚浜岀淮鐮�
     bindQRCode(seq, text, size) {
-      new QRCode(this.$refs['qrCodeDiv' + seq], {
-        text: text,
-        width: size === 'big' ? 90 : 60,
-        height: size === 'big' ? 90 : 60,
-        // colorDark: '#333333', // 浜岀淮鐮侀鑹�
-        colorDark: '#000', // 浜岀淮鐮侀鑹�
-        colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
-        correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
-      })
+      if (size === 'big') {
+        console.log(text, 1)
+        new QRCode(this.$refs.qrCodeDiv0, {
+          text: text,
+          width: size === 'big' ? 90 : 60,
+          height: size === 'big' ? 90 : 60,
+          // colorDark: '#333333', // 浜岀淮鐮侀鑹�
+          colorDark: '#000', // 浜岀淮鐮侀鑹�
+          colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
+          correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
+        })
+      } else {
+        new QRCode(this.$refs['qrCodeDiv' + seq], {
+          text: text,
+          width: size === 'big' ? 90 : 60,
+          height: size === 'big' ? 90 : 60,
+          // colorDark: '#333333', // 浜岀淮鐮侀鑹�
+          colorDark: '#000', // 浜岀淮鐮侀鑹�
+          colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
+          correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
+        })
+      }
     },
 
     dialogVisibleConfirmClose() {
@@ -1271,19 +1297,22 @@
       this.formApprove.plan_qty = ''
       this.formApprove.routename = ''
       this.formApprove.lm_date = ''
-      // this.$refs.qrCodeDiv0 = ''
+
+      // this.$refs.qrCodeDiv0.title = ''
+
       // this.$refs.qrCodeDiv1 = ''
       // this.$refs.qrCodeDiv2 = ''
       // this.$refs.qrCodeDiv3 = ''
 
-      // // this.$ref['qrCodeDiv'].clearable()
+      // this.$ref['qrCodeDiv'].clearable()
       // this.tableDataPrint.forEach((item, index) => {
-      //   this.$ref[('qrCodeDiv' + index).toString()] = ''
-      // //   this.bindQRCode(item.seq, '')
+      // this.$refs['qrCodeDiv' + item.seq] = ''
+      //   this.$refs[('qrCodeDiv' + index).toString()] = ''
+      // //   this.bindQRCode(item.seq, '', 'small')//姝ゆ柟娉曟病鐢�
       // })
-      // // this.bindQRCode(this.tableDataPrint.length, '')
-      // this.$ref[('qrCodeDiv' + this.tableDataPrint.length).toString()] = ''
-      // // this.bindQRCode()
+      // this.bindQRCode(this.tableDataPrint.length, '', 'big')//姝ゆ柟娉曟病鐢�
+      // this.$refs[('qrCodeDiv' + this.tableDataPrint.length).toString()] = ''
+
       this.tableDataPrint = []
     },
     // 琛ユ墦鎸夐挳

--
Gitblit v1.9.3