From 955081f4111c7d276bb63d3ee8dacb3e07bc53be Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 25 八月 2022 21:30:52 +0800
Subject: [PATCH] 点检标准新增功能实现

---
 src/views/scgl/sckbg.vue |  128 ++++++++++++++++++++++++------------------
 1 files changed, 73 insertions(+), 55 deletions(-)

diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index a58b000..1da7ea2 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -145,18 +145,23 @@
               <el-table-column
                 prop="plan_startdate"
                 label="璁″垝寮�宸ユ棩鏈�"
-                width="185"
+                width="150"
                 sortable="custom"
-              />
+              >
+                <template slot-scope="{row}">
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
+                  <div v-else>/</div>
+                </template>
+              </el-table-column>
               <el-table-column
                 prop="plan_enddate"
                 label="璁″垝瀹屽伐鏃ユ湡"
-                width="185"
+                width="150"
                 sortable="custom"
                 fixed="right"
               >
                 <template slot-scope="{row}">
-                  <div v-if="row.plan_startdate">{{ row.plan_startdate }}</div>
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
                   <div v-else>/</div>
                 </template>
               </el-table-column>
@@ -339,18 +344,23 @@
               <el-table-column
                 prop="plan_startdate"
                 label="璁″垝寮�宸ユ棩鏈�"
-                width="185"
+                width="150"
                 sortable="custom"
-              />
+              >
+                <template slot-scope="{row}">
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
+                  <div v-else>/</div>
+                </template>
+              </el-table-column>
               <el-table-column
                 prop="plan_enddate"
                 label="璁″垝瀹屽伐鏃ユ湡"
-                width="185"
+                width="150"
                 sortable="custom"
                 fixed="right"
               >
                 <template slot-scope="{row}">
-                  <div v-if="row.plan_startdate">{{ row.plan_startdate }}</div>
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
                   <div v-else>/</div>
                 </template>
               </el-table-column>
@@ -415,26 +425,25 @@
               <el-table-column
                 prop="wo_code"
                 label="宸ュ崟鍙�"
-                width="160"
+                min-width="160"
                 sortable="custom"
               />
               <el-table-column
                 prop="partcode"
                 label="浜у搧缂栫爜"
-                width="110"
+                min-width="110"
                 sortable="custom"
               />
               <el-table-column
                 prop="partname"
-                width="160"
+                min-width="160"
                 label="浜у搧鍚嶇О"
-                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="stepname"
                 label="宸ュ簭"
-                width="120"
+                min-width="120"
                 sortable="custom"
               />
               <el-table-column
@@ -620,6 +629,9 @@
             />
           </el-select>
         </el-form-item>
+        <!--        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜哄憳锛�">-->
+        <!--          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />-->
+        <!--        </el-form-item>-->
         <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="澶囨敞锛�">
           <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
         </el-form-item>
@@ -835,7 +847,7 @@
       </span>
     </el-dialog>
 
-    <!--鎵撳嵃棰勮椤甸潰-->
+    <!--鎵撳嵃棰勮椤甸潰  灏忔爣绛�-->
     <el-dialog
       title="棰勮"
       :visible.sync="dialogVisible2"
@@ -847,52 +859,60 @@
       <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
       <div id="printMe2" style="padding: 30px;">
         <div
-          style="display: flex;width: 300px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
         >
-          <div style="width: 80px;display: flex;flex-direction: column;border-right: 1px solid #000">
+
+          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
             <div
-              style="display: flex;height: 120px;border-bottom:1px solid #000;justify-content: center;align-items: center "
+              style="display: flex;height: 90px;border-bottom:1px solid #000;
+              justify-content: center;align-items: center;position: relative"
             >
-              <div id="qrCode2" ref="qrCodeDiv2" />
+              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+            </div>
+            <div style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center">
+              <div style="margin-left: 5px;width: 28px">鏁伴噺:</div>
+              {{ qrForm.startqty }}
             </div>
             <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
-              <div style="margin-left: 5px;width: 30px">鏁伴噺:</div>
-              10000
-              <!--              {{ qrForm.startqty }}-->
+              <div style="margin-left: 5px;width: 42px">澶勭悊浜�:</div>
+              {{ qrForm.operator }}
             </div>
           </div>
 
-          <div style="width:220px;display: flex;flex-direction: column">
+          <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"
+              style="display: flex;height: 20%;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"
+              style="display: flex;height: 20%;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"
+              style="display: flex;height: 20%;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
+              style="display: flex;height: 20%;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.nextstepname }}</div>
             </div>
+            <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
+              <div style="width: 60px;margin-left: 5px;">澶勭悊鏃堕棿:</div>
+              <div>{{ qrForm.operatorTime }}</div>
+            </div>
 
-            <!--            {{ qrForm.operator }}-->
-            <!--            {{ qrForm.operatorTime }}-->
           </div>
 
         </div>
       </div>
-
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="dialogVisible2 = false">鍙� 娑�</el-button>
@@ -952,7 +972,7 @@
             placeholder="璇烽�夋嫨"
           >
             <el-option
-              v-for="item in badOperationArr"
+              v-for="item in OperationArr"
               :key="item.usercode"
               :label="item.username"
               :value="item.usercode"
@@ -1276,7 +1296,7 @@
         operation: getCookie('navTabId')
       },
       badTableDataDialog: [], // 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
-      badOperationArr: [] // 缁翠慨浜哄憳鏁扮粍
+      OperationArr: [] // 浜哄憳鏁扮粍
     }
   },
   // computed: {
@@ -1872,8 +1892,10 @@
     bindQRCode(text) {
       new QRCode(this.$refs.qrCodeDiv2, {
         text: text,
-        width: 50,
-        height: 50,
+        // width: 50,
+        width: 60,
+        // height: 50,
+        height: 60,
         colorDark: '#000', // 浜岀淮鐮侀鑹�
         colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
         correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
@@ -1886,12 +1908,10 @@
       this.qrForm.partcode = this.dialogForm.partcode
       this.qrForm.partname = this.dialogForm.partname
       this.qrForm.nextstepname = this.dialogForm.nextstepname
-
+      this.qrForm.operator = getCookie('username')
+      this.qrForm.operatorTime = handleDatetime2(new Date())
       this.$nextTick(() => {
         this.bindQRCode(this.qrForm.qrvalue)
-        console.log(this.$refs.qrCodeDiv2, 123)
-        // console.log(this.$refs.qrCodeDiv2.querySelectorAll('#qrCode2>img'), 1)
-        // console.log(this.$refs.qrCodeDiv2.querySelectorAll('#qrCode2>canvas'), 2)
       })
     },
     WXprint2() {
@@ -1901,6 +1921,8 @@
       this.qrForm.partcode = this.dialogForm.partcode
       this.qrForm.partname = this.dialogForm.partname
       this.qrForm.nextstepname = this.dialogForm.nextstepname
+      this.qrForm.operator = getCookie('username')
+      this.qrForm.operatorTime = handleDatetime2(new Date())
       this.$nextTick(() => {
         this.bindQRCode(this.qrForm.qrvalue)
       })
@@ -1912,7 +1934,9 @@
       this.qrForm.partcode = ''
       this.qrForm.partname = ''
       this.qrForm.nextstepname = ''
-      this.$refs.qrCodeDiv2 = ''
+      this.qrForm.operator = ''
+      this.qrForm.operatorTime = ''
+      // this.$refs.qrCodeDiv2 = ''
     },
 
     // 鑾峰彇椤甸潰楂樺害
@@ -1940,21 +1964,15 @@
       const data = {
         Data: this.badTableDataDialog
       }
-      // console.log(JSON.stringify(data), 1)
-      // console.log(this.badDialogForm.operation, 1)
-      // this.badPrintOperator =
-      this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
-      this.dialogVisible2 = true
-
-      // EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
-      //   if (res.code === '200' || res.code === '301') {
-      //     this.getBadList()
-      //     this.badDialogVisible = false
-      //     this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
-      //     this.dialogVisible2 = true
-      //     return this.$message.success('淇濆瓨鎴愬姛锛�')
-      //   }
-      // })
+      EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
+        if (res.code === '200' || res.code === '301') {
+          this.getBadList()
+          this.badDialogVisible = false
+          this.badPrint(this.OperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
+          this.dialogVisible2 = true
+          return this.$message.success('淇濆瓨鎴愬姛锛�')
+        }
+      })
     },
     badPrint(username) {
       this.qrForm.qrvalue = this.badDialogForm.wo_code + ';' + this.badDialogForm.nextstepcode
@@ -1979,7 +1997,7 @@
     // 鐐瑰嚮缁翠慨澶勭悊鎸夐挳  鎴�  鎵弿鏉$爜鐨勬壂鎻忓洖杞︿簨浠�
     async repairHandle(row) {
       const { data: res1 } = await MesOrderSelectUser({ usercode: '' })
-      this.badOperationArr = res1
+      this.OperationArr = res1
 
       console.log(row)
       let data

--
Gitblit v1.9.3