From b46bc2dba51a3885a68e4c58316b41a31ea16bb2 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 14 二月 2023 13:35:03 +0800
Subject: [PATCH] 1.存货档案修改

---
 src/views/zlgl/gxjy.vue |  101 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 77 insertions(+), 24 deletions(-)

diff --git a/src/views/zlgl/gxjy.vue b/src/views/zlgl/gxjy.vue
index e5ef964..1d75f7f 100644
--- a/src/views/zlgl/gxjy.vue
+++ b/src/views/zlgl/gxjy.vue
@@ -3,7 +3,7 @@
     <div class="body" :style="{height:mainHeight+'px'}">
       <div style="padding-top: 10px;display: flex;flex-direction: column">
         <div style="margin-bottom: 15px;font-size: 14px">
-          <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />鎵爜淇℃伅
+          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin-right: 5px" />鎵爜淇℃伅
         </div>
         <div style="display: flex;align-items: center">
           <div style="width: 90px;display: flex">
@@ -16,37 +16,39 @@
             style="width: 300px"
             @keyup.enter.native="val=>enterNative(val,'GXproduceCode')"
           />
+          <!--          @keyup.native="e=>judgeIsScanning(e,'GXproduceCode')"-->
+
         </div>
         <!--        鍏」淇℃伅      -->
         <div v-if="!isIpad" style="background:#f8f8fa ;display:flex;margin-top: 10px;align-items: center; line-height: 50px">
           <div style="display: flex; margin-left: 10px">
             <div style="display: flex;margin-right: 50px">
               <div style="width: 90px">宸ュ崟缂栫爜锛�</div>
-              <div style="width: 200px">{{ form.wo_code }}</div>
+              <div style="width: 150px">{{ form.wo_code }}</div>
             </div>
             <div style="display: flex;">
               <div style="width: 90px">浜у搧缂栫爜锛�</div>
-              <div style="width: 100px">{{ form.partcode }}</div>
+              <div style="width: 150px">{{ form.partcode }}</div>
             </div>
           </div>
           <div style="display: flex;margin-left: 30px;">
             <div style="display: flex;margin-right: 50px">
               <div style="width: 90px">浜у搧鍚嶇О锛�</div>
-              <div style="width: 200px">{{ form.partname }}</div>
+              <div style="width: 150px">{{ form.partname }}</div>
             </div>
             <div style="display: flex;">
               <div style="width: 90px">浜у搧瑙勬牸锛�</div>
-              <div style="width: 100px">{{ form.partspec }}</div>
+              <div style="width: 150px">{{ form.partspec }}</div>
             </div>
           </div>
           <div style=" display: flex;margin-left: 30px;">
             <div style="display: flex;margin-right: 50px">
               <div style="width: 90px">宸ュ簭缂栫爜锛�</div>
-              <div style="width: 100px">{{ form.stepcode }}</div>
+              <div style="width: 150px">{{ form.stepcode }}</div>
             </div>
             <div style="display: flex;">
               <div style="width: 90px">宸ュ簭鍚嶇О锛�</div>
-              <div style="width: 100px">{{ form.stepname }}</div>
+              <div style="width: 150px">{{ form.stepname }}</div>
             </div>
           </div>
         </div>
@@ -86,7 +88,7 @@
         </div>
 
         <div style="margin: 15px 0;font-size: 14px">
-          <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />妫�楠屾爣鍑嗕俊鎭�
+          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin-right: 5px" />妫�楠屾爣鍑嗕俊鎭�
         </div>
         <div style="display: flex;align-items: center">
           <div style="width: 90px;display: flex">
@@ -128,7 +130,7 @@
             <div style="color: red;width:10px">*</div>
             妫�楠屾暟閲忥細
           </div>
-          <el-input v-model="checkCount" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
+          <el-input v-model="checkqty" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
         </div>
 
         <!--   妫�楠岀粨鏋�   鍜�  妫�楠屽娉�      -->
@@ -161,10 +163,10 @@
         </div>
 
         <div style="margin: 15px 0;font-size: 14px">
-          <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />妫�楠岄」淇℃伅
+          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin-right: 5px" />妫�楠岄」淇℃伅
         </div>
         <div>
-          <el-button type="primary" @click="add">鏂板</el-button>
+          <el-button v-waves type="primary" @click="add">鏂板</el-button>
         </div>
         <div style="margin-top: 10px">
           <el-table
@@ -218,6 +220,7 @@
             <el-table-column
               prop="code"
               label="妫�楠屾爣鍑嗙紪鐮�"
+              show-tooltip-when-overflow
             >
               <template slot-scope="{row}">
                 <div v-if="row.isVisible===0">{{ row.code }}</div>
@@ -240,6 +243,7 @@
             <el-table-column
               prop="name"
               label="妫�楠屾爣鍑嗗悕绉�"
+              show-tooltip-when-overflow
             >
               <template slot-scope="{row}">
                 <div v-if="row.isVisible===0">{{ row.name }}</div>
@@ -263,6 +267,7 @@
             <el-table-column
               prop="stepcheckitem_desc"
               label="妫�楠屾爣鍑嗘弿杩�"
+              show-tooltip-when-overflow
             >
               <template slot-scope="scope">
                 <el-input
@@ -283,6 +288,7 @@
               prop="result"
               label="妫�楠岀粨鏋�"
               width="100"
+              show-tooltip-when-overflow
             >
               <template slot-scope="{row}">
                 <div v-if="row.result==='OK'">鍚堟牸</div>
@@ -323,9 +329,9 @@
             >
               <template slot-scope="{row}">
                 <div class="operationClass">
-                  <el-button v-if="row.isVisible===0" type="text" @click="del(row)">鍒犻櫎</el-button>
-                  <el-button v-if="row.isVisible===1" type="text" @click="confirm(row)">纭</el-button>
-                  <el-button v-if="row.isVisible===1" type="text" @click="cancel(row)">鍙栨秷</el-button>
+                  <el-button v-if="row.isVisible===0" v-waves type="text" @click="del(row)">鍒犻櫎</el-button>
+                  <el-button v-if="row.isVisible===1" v-waves type="text" @click="confirm(row)">纭</el-button>
+                  <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancel(row)">鍙栨秷</el-button>
                 </div>
               </template>
             </el-table-column>
@@ -333,10 +339,10 @@
         </div>
 
         <div style="display: flex;margin: 30px 0;align-items: center">
-          <el-button type="primary" @click="submitButton('FirstCheck')">棣栨淇濆瓨</el-button>
-          <el-button type="primary" style="margin-left: 50px" @click="submitButton('PatroCheck')">宸℃淇濆瓨</el-button>
-          <el-button type="primary" style="margin-left: 50px" @click="submitButton('EndCheck')">瀹屽伐妫�淇濆瓨</el-button>
-          <el-button type="info" style="margin-left: 50px" @click="submitButton('Cancel')">鍙栨秷</el-button>
+          <el-button v-waves type="primary" @click="submitButton('FirstCheck')">棣栨淇濆瓨</el-button>
+          <el-button v-waves type="primary" style="margin-left: 50px" @click="submitButton('PatroCheck')">宸℃淇濆瓨</el-button>
+          <el-button v-waves type="primary" style="margin-left: 50px" @click="submitButton('EndCheck')">瀹屽伐妫�淇濆瓨</el-button>
+          <el-button v-waves type="info" style="margin-left: 50px" @click="submitButton('Cancel')">鍙栨秷</el-button>
         </div>
       </div>
     </div>
@@ -356,12 +362,15 @@
   StepCheckItemSelect
 } from '@/api/zlgl'
 import { MesOrderSelectUser } from '@/api/scgl'
+import { getCookie } from '@/utils/auth'
+import waves from '@/directive/waves'
 
 export default {
   name: 'QXDY',
   // components: {
   //   Pagination
   // },
+  directives: { waves },
   data() {
     return {
       isIpad: false,
@@ -379,8 +388,8 @@
       },
       checkStandard: '', // 妫�楠屾爣鍑�
       checkStandardSelect: [], // 妫�楠屾爣鍑嗕笅鎷夋暟缁�
-      checkUser: '', // 妫�楠屼汉鍛�
-      checkCount: 0, // 妫�楠屾暟閲�
+      checkUser: getCookie('navTabId'), // 妫�楠屼汉鍛�
+      checkqty: 0, // 妫�楠屾暟閲�
       checkUserSelect: [], // 妫�楠屼汉鍛樹笅鎷夋暟缁�
       checkResult: '', // 妫�楠岀粨鏋�
       checkResultSelect: [
@@ -396,7 +405,8 @@
       multipleSelection: [], // 琛ㄦ牸澶氶�夋
       tabClickIndex: null, // 鐐瑰嚮鐨勫崟鍏冩牸
       tabClickLabel: '', // 褰撳墠鐐瑰嚮鐨勫垪鍚�
-      isCancel: false// 鏄惁鐐瑰嚮鍙栨秷鎸夐挳
+      isCancel: false, // 鏄惁鐐瑰嚮鍙栨秷鎸夐挳
+      judgeIsScanningArr: []// 鍒ゆ柇鏄惁鎵爜鏁扮粍
     }
   },
   created() {
@@ -499,6 +509,42 @@
       row.name = res.name
       row.stepcheckitem_desc = res.descr
     },
+    // 闃叉姈      //鎵爜鐢ㄧ殑鏄槻鎶�
+    fnThrottle(method, delay, duration, belong) {
+      var that = this
+      var timer = this.timer
+      var begin = new Date().getTime()
+      return function() {
+        var current = new Date().getTime()
+        clearTimeout(timer)
+        if (current - begin >= duration) {
+          // method()
+          // that.VALUE()
+          begin = current
+        } else {
+          that.timer = setTimeout(function() {
+            // method()
+            that.enterNative(that.form.orderstepqrcode, belong)
+          }, delay)
+        }
+      }
+    },
+    // 鍒ゆ柇鏄惁鏄壂鐮佹灙鎵爜
+    judgeIsScanning(e, belong) {
+      const timenow = e.timeStamp
+      let flag = true
+      this.judgeIsScanningArr.push(timenow)
+      let i
+      for (i in this.judgeIsScanningArr) {
+        flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+        if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+          if (flag) {
+            this.fnThrottle(this.enterNative, 500, 2000, belong)()
+            return
+          }
+        }
+      }
+    },
     // 鎵爜閿洏鍥炶溅浜嬩欢
     async enterNative(val, belong) {
       if (belong === 'GXproduceCode') {
@@ -599,13 +645,16 @@
         if (this.form.orderstepqrcode.length < 1) {
           return this.$message.info('鎵弿鏉$爜涓嶈兘涓虹┖锛�')
         }
+        if (this.form.wo_code.toString().length === 0) {
+          return this.$message.info('鏈幏寰楀伐鍗曠紪鐮侊紒')
+        }
         if (this.checkStandard.length < 1) {
           return this.$message.info('妫�楠屾爣鍑嗕笉鑳戒负绌猴紒')
         }
         if (this.checkUser.length < 1) {
           return this.$message.info('妫�楠屼汉鍛樹笉鑳戒负绌猴紒')
         }
-        if (parseFloat(this.checkCount) > 0) {
+        if (parseFloat(this.checkqty) <= 0) {
           return this.$message.info('妫�楠屾暟閲忓繀椤昏澶т簬闆讹紒')
         }
         if (this.JYTableData.length < 1) {
@@ -622,6 +671,7 @@
           type: 'warning'
         }).then(() => {
           const arr = []
+          this.JYTableData = this.JYTableData.filter(item => item.code !== '')
           this.JYTableData.forEach((item, index) => {
             arr.push({
               code: item.code,
@@ -637,6 +687,7 @@
             'stepcode': this.form.stepcode, // 宸ュ簭缂栫爜
             'checkstanedcode': this.checkStandard, // 妫�楠屾爣鍑嗙紪鐮�
             'checkusercode': this.checkUser, // 妫�楠屼汉鍛樼紪鐮�
+            'checkqty': this.checkqty, // 妫�楠屾暟閲�
             'checktypecode': val, // 妫�楠岀被鍨嬬紪鐮�
             'checkresult': this.checkResult, // 妫�楠岀粨鏋�(OK(鍚堟牸) NG(涓嶈壇))
             'checkdescr': this.checkdescr, // 妫�楠屾弿杩�
@@ -664,8 +715,8 @@
       this.JYTableData = []
       this.multipleSelection = []
       this.checkdescr = ''
-      this.checkUser = ''
-      this.checkCount = 0
+      this.checkUser = getCookie('navTabId')
+      this.checkqty = 0
       this.checkResult = ''
       this.checkStandard = ''
       this.form.orderstepqrcode = ''
@@ -676,6 +727,8 @@
       this.form.stepcode = ''
       this.form.stepname = ''
 
+      this.judgeIsScanningArr = []
+
       this.isCancel = true
     },
 

--
Gitblit v1.9.3