From 18255ac335b65ad97329a1ecfcb038cb57b235bf Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 20 三月 2023 16:12:43 +0800
Subject: [PATCH] 1.工单工序打印二维码bug问题修复

---
 src/views/scgl/gd.vue |   88 ++++++++++++++++++++++++++++++++++++--------
 1 files changed, 72 insertions(+), 16 deletions(-)

diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index 6059f21..2ef34f7 100644
--- a/src/views/scgl/gd.vue
+++ b/src/views/scgl/gd.vue
@@ -147,7 +147,7 @@
                 :label="row.wo_code"
                 style="color: transparent;padding-left: 10px;"
               />
-<!--              @change.native="getCurrentRow(row.wo_code)"-->
+              <!--              @change.native="getCurrentRow(row.wo_code)"-->
             </template>
           </el-table-column>
           <el-table-column
@@ -182,7 +182,12 @@
             label="婧愬崟鍗曞彿"
             sortable="custom"
             min-width="160"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.m_po">{{ row.m_po }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="wotype"
             label="鍗曟嵁绫诲瀷"
@@ -231,6 +236,7 @@
             label="鐢熶骇杞﹂棿"
             sortable="custom"
             width="120"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
@@ -320,7 +326,7 @@
                   <!--                    @click="check(row)"-->
                   <!--                  />-->
                   <i
-                    class="el-icon-tickets"
+                    class="el-icon-printer"
                     style="cursor: pointer;color: #42b983;margin-right: 15px"
                     @click="handlePrint(row.wo_code)"
                   />
@@ -414,7 +420,7 @@
               <div class="operationClass">
                 <el-tooltip class="item" effect="dark" content="鎵撳嵃宸ュ簭" placement="top">
                   <i
-                    class="el-icon-tickets"
+                    class="el-icon-printer"
                     style="cursor: pointer;color: #42b983;margin-right: 15px"
                     @click="supplementSmallClick(row)"
                   />
@@ -593,6 +599,8 @@
             v-model="dialogForm.planstartdate"
             type="date"
             :clearable="false"
+            :picker-options="pickerOptions"
+
             value-format="yyyy-MM-dd"
             style="width: 200px"
             placeholder="閫夋嫨鏃ユ湡"
@@ -603,6 +611,7 @@
             v-model="dialogForm.planenddate"
             type="date"
             :clearable="false"
+            :picker-options="pickerOptions"
             value-format="yyyy-MM-dd"
             style="width: 200px"
             placeholder="閫夋嫨鏃ユ湡"
@@ -1210,6 +1219,17 @@
             label="澶囨敞"
           />
         </el-table>
+
+        <div v-if="formApprove.m_po" style="display: flex;margin-top: 20px;align-content: center;height: 130px;line-height: 130px;">
+          <div style="font-size: 18px;font-weight: bolder">婧愬崟鍗曞彿锛�</div>
+          <div id="qrCodeSource" ref="qrCodeSource" style="width: 130px;height: 130px;overflow: hidden" />
+        </div>
+
+        <div v-if="formApprove.m_po" style="margin-top: 5px;">
+          <img src="../../assets/images/UP.png" alt="" style="margin-left: 107px;">
+          <div style="font-size: 18px;font-weight: bolder;">鏍规嵁鍗曞彿鎵爜鍏ュ簱锛岀敤PDA鎵弿姝や簩缁寸爜</div>
+        </div>
+
       </div>
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
@@ -1263,7 +1283,11 @@
                 style="display: flex;height: 96px;border-bottom:1px solid #000;
               justify-content: center;align-items: center;position: relative"
               >
-                <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+                <div
+                  id="qrCode2"
+                  ref="qrCodeDiv2"
+                  style="overflow-y: hidden;height:60px;position: absolute;left: 14px;"
+                />
               </div>
               <div
                 style="display: flex;height: 32px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
@@ -1320,7 +1344,11 @@
                 style="display: flex;height: 96px;border-bottom:1px solid #000;
               justify-content: center;align-items: center;position: relative"
               >
-                <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+                <div
+                  id="qrCode2"
+                  ref="qrCodeDiv2"
+                  style="overflow-y: hidden;height:60px;position: absolute;left: 14px;"
+                />
               </div>
               <div
                 style="display: flex;height: 32px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
@@ -1377,7 +1405,11 @@
                 style="display: flex;height: 60px;border-bottom:1px solid #000;
               justify-content: center;align-items: center;position: relative"
               >
-                <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+                <div
+                  id="qrCode2"
+                  ref="qrCodeDiv2"
+                  style="overflow-y: hidden;height:60px;position: absolute;left: 14px;"
+                />
               </div>
               <div
                 style="display: flex;height: 20px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
@@ -1786,7 +1818,12 @@
         // { code: 3, name: '50*40' },
         // { code: 4, name: '50*80' },
         // { code: 5, name: '40*30' }
-      ]
+      ],
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 8.64e7
+        }
+      }
     }
   },
   created() {
@@ -1990,9 +2027,8 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        console.log(row, 1)
         const data = {
-          souceid: row.sourceid,
+          souceid: row.sourceid ? row.sourceid : '',
           wocode: row.wo_code,
           m_po: row.m_po,
           orderqty: row.plan_qty
@@ -2203,6 +2239,7 @@
             res3.forEach(i => {
               this.bindQRCode(i.seq, i.stepqrcode, 'small')
             })
+            this.bindQRCodeSource(this.formApprove.m_po)
             // this.bindQRCode('0', this.formApprove.mesordercode, 'big')
 
             const div = document.getElementById('qrCode')
@@ -2210,9 +2247,9 @@
             // div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
             div.scrollTop = 0 // 婊氬姩鏉′綅浜庢渶椤堕儴
           })
+          this.dialogVisibleApprove = true
         }
       })
-      this.dialogVisibleApprove = true
     },
     dialogVisibleTaskClose() {
       this.dialogForm.mesordercode = ''
@@ -2265,6 +2302,18 @@
         })
       }
     },
+    // 鐢熸垚婧愬崟鍗曞彿浜岀淮鐮�
+    bindQRCodeSource(text) {
+      new QRCode(this.$refs['qrCodeSource'], {
+        text: text,
+        width: 130,
+        height: 130,
+        // colorDark: '#333333', // 浜岀淮鐮侀鑹�
+        colorDark: '#000', // 浜岀淮鐮侀鑹�
+        colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
+        correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
+      })
+    },
 
     dialogVisibleConfirmClose() {
       // this.dialogForm.mesordercode = ''
@@ -2310,6 +2359,11 @@
           this.$nextTick(() => {
             console.log(this.qrForm.qrvalue, 3333)
             this.bindQRCode2(this.qrForm.qrvalue)
+
+            const div = document.getElementById('qrCode2')
+            // 杩欎箞澶氫唬鐮佸彧闇�瑕佽繖涓�鍙ュ疄鐜版垜浠墍闇�瑕佺殑鍔熻兘锛屽畾浣峝iv婊氬姩鏉′綅缃湪搴曢儴锛宻crollHeight璁$畻鍑篸iv鐨勯珮搴︼紝鍐峴crollTop 璁剧疆婊氬姩鏉$殑楂樺害涓哄灏�
+            div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
+            // div.scrollTop = 0 // 婊氬姩鏉′綅浜庢渶椤堕儴
           })
         }
       })
@@ -2525,7 +2579,7 @@
       this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2)
     },
     //  琛岀偣鍑讳簨浠�
-    async   rowClick(row, event, column) {
+    async rowClick(row, event, column) {
       console.log(row, event, column)
       console.log(row.wo_code, event, column)
       this.radioSelected = row.wo_code
@@ -2848,16 +2902,18 @@
   //}
 }
 
-::v-deep .el-select__caret{
+::v-deep .el-select__caret {
   display: flex;
   align-items: center;
   justify-content: center;
 }
-.tableFixed{
-  ::v-deep .el-table__fixed-right{
+
+.tableFixed {
+  ::v-deep .el-table__fixed-right {
     height: 100% !important;
   }
-  ::v-deep .el-table__fixed{
+
+  ::v-deep .el-table__fixed {
     height: 100% !important;
   }
 }

--
Gitblit v1.9.3