From b8ee668eaace5d422ebb27a200c3b178b82e2a6d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 23 八月 2022 22:55:03 +0800
Subject: [PATCH] 1.提交

---
 src/views/scgl/gd.vue |  189 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 181 insertions(+), 8 deletions(-)

diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index 42658ff..e0e01c8 100644
--- a/src/views/scgl/gd.vue
+++ b/src/views/scgl/gd.vue
@@ -124,7 +124,7 @@
               <el-radio
                 v-model="radioSelected"
                 :label="row.wo_code"
-                style="color: #fff;padding-left: 10px; margin-right: -25px;"
+                style="color: transparent;padding-left: 10px; margin-right: -25px;"
                 @change.native="getCurrentRow(row.wo_code)"
               />
             </template>
@@ -173,7 +173,12 @@
             label="浜у搧瑙勬牸"
             sortable="custom"
             width="110"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.partspec">{{ row.partspec }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="plan_qty"
             label="宸ュ崟鏁�"
@@ -185,26 +190,46 @@
             label="鐢熶骇杞﹂棿"
             sortable="custom"
             width="120"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="route_name"
             label="宸ヨ壓璺嚎"
             sortable="custom"
             min-width="130"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.route_name">{{ row.route_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
 
           <el-table-column
             prop="plan_startdate"
             label="璁″垝寮�濮嬫椂闂�"
             sortable="custom"
             width="160"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.plan_startdate">{{ row.plan_startdate }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="plan_enddate"
             label="璁″垝缁撴潫鏃堕棿"
             sortable="custom"
             width="160"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.plan_enddate">{{ row.plan_enddate }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="piroque"
             label="宸ュ崟绛夌骇"
@@ -215,6 +240,7 @@
               <div v-if="row.piroque==='1'">鐗圭骇</div>
               <div v-if="row.piroque==='2'">绱ф��</div>
               <div v-if="row.piroque==='3'">姝e父</div>
+              <div v-else>/</div>
             </template>
           </el-table-column>
           <el-table-column
@@ -551,8 +577,15 @@
         <el-table-column
           prop="ng_qty"
           label="涓嶈壇鏁伴噺"
-          fixed="right"
         />
+        <el-table-column
+          label="鎿嶄綔"
+          fixed="right"
+        >
+          <template slot-scope="{row}">
+            <el-button type="text" style="padding: 0;" @click="supplementSmallClick(row)">琛ユ墦</el-button>
+          </template>
+        </el-table-column>
       </el-table>
 
       <span slot="footer" class="dialog-footer">
@@ -702,6 +735,70 @@
         </div>
       </span>
     </el-dialog>
+
+    <!--鎵撳嵃棰勮椤甸潰  灏忔爣绛�-->
+    <el-dialog
+      title="棰勮"
+      :visible.sync="dialogVisible2"
+      width="1140"
+      :close-on-click-modal="false"
+      @close="dialogVisible2Close"
+    >
+      <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
+      <div id="printMe2" style="padding: 30px;">
+        <div
+          style="display: flex;width: 250px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+        >
+
+          <div style="width: 60px;display: flex;flex-direction: column;border-right: 1px solid #000">
+            <div
+              style="display: flex;height: 75%;border-bottom:1px solid #000;
+              justify-content: center;align-items: center;position: relative"
+            >
+              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height: 50px;position: absolute;left: 4px" />
+            </div>
+            <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center">
+              <div style="margin-left: 5px;width: 40px">鏁伴噺:</div>
+              {{ qrForm.startqty }}
+            </div>
+          </div>
+
+          <div style="width:190px;display: flex;flex-direction: column">
+            <div
+              style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
+            >
+              <div style="width: 60px;margin-left: 5px;">宸ュ崟缂栧彿:</div>
+              <div>{{ qrForm.wo_code }}</div>
+            </div>
+            <div
+              style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
+            >
+              <div style="width: 60px;margin-left: 5px;">浜у搧缂栫爜:</div>
+              <div>{{ qrForm.partcode }}</div>
+            </div>
+            <div
+              style="display: flex;height: 25%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+            >
+              <div style="width:60px;margin-left: 5px;">浜у搧鍚嶇О:</div>
+              <div>{{ qrForm.partname }}</div>
+            </div>
+            <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center;text-align: left">
+              <div style="width: 60px;margin-left: 5px;">涓嬮亾宸ュ簭:</div>
+              <div>{{ qrForm.nextstepname }}</div>
+            </div>
+
+          </div>
+
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button @click="dialogVisible2 = false">鍙� 娑�</el-button>
+          <el-button v-print="printObj2" type="primary">纭� 瀹�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -864,7 +961,37 @@
         routename: '',
         lm_date: ''
       },
-      number: ''
+      number: '',
+      dialogVisible2: false,
+      printObj2: {
+        id: 'printMe2',
+        popTitle: '鎵撳嵃妯℃澘',
+        preview: false,
+        extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>',
+        closeCallback(vue) { // 鍏抽棴鎵撳嵃鐨勫洖璋冧簨浠讹紙鏃犳硶纭畾鐐瑰嚮鐨勬槸纭杩樻槸鍙栨秷锛�
+          console.log('11212', vue)
+          // vue.dialogVisible = false
+          vue.dialogVisible2 = false
+          // vue.dialogVisible = false
+        },
+        beforeOpenCallback(vue) {
+          vue.printLoading = true
+          console.log('鎵撳紑涔嬪墠')
+          console.log()
+        },
+        openCallback(vue) {
+          vue.printLoading = false
+          console.log('鎵ц浜嗘墦鍗�')
+        }
+      },
+      qrForm: {
+        qrvalue: '',
+        startqty: '',
+        wo_code: '',
+        partcode: '',
+        partname: '',
+        nextstepname: ''
+      }
     }
   },
   created() {
@@ -1324,6 +1451,52 @@
     supplementClick() {
       this.dialogVisibleTask = false
       this.handlePrint()
+    },
+    // 琛ユ墦灏忔爣绛�
+    supplementSmallClick(row) {
+      // let obj = {}
+
+      this.taskTableData.forEach((item, index) => {
+        if (item.seq === row.seq) {
+          console.log(item)
+          this.qrForm = {
+            qrvalue: item.seq === this.taskTableData.length ? item.wo_code + ';' + item.stepcode : item.wo_code + ';' + this.taskTableData[item.seq].stepcode,
+            startqty: item.seq === this.taskTableData.length ? item.plan_qty : this.taskTableData[item.seq].plan_qty,
+            wo_code: item.wo_code,
+            partcode: item.partcode,
+            partname: item.partname,
+            nextstepname: item.seq === this.taskTableData.length ? item.stepname : this.taskTableData[item.seq].stepname
+          }
+          this.$nextTick(() => {
+            console.log(this.qrForm.qrvalue, 3333)
+            this.bindQRCode2(this.qrForm.qrvalue)
+          })
+        }
+      })
+
+      // this.dialogVisibleTask = false
+      this.dialogVisible2 = true
+      console.log(this.qrForm, 1111)
+    },
+    dialogVisible2Close() {
+      this.qrForm.qrvalue = ''
+      this.qrForm.startqty = ''
+      this.qrForm.wo_code = ''
+      this.qrForm.partcode = ''
+      this.qrForm.partname = ''
+      this.qrForm.nextstepname = ''
+      // this.$refs.qrCodeDiv2 = ''
+    },
+    // 鐢熸垚浜岀淮鐮�
+    bindQRCode2(text) {
+      new QRCode(this.$refs.qrCodeDiv2, {
+        text: text,
+        width: 50,
+        height: 50,
+        colorDark: '#000', // 浜岀淮鐮侀鑹�
+        colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
+        correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
+      })
     }
 
   }

--
Gitblit v1.9.3