From 030a0935854e9f65df1cd724498b2c2fe52ea9d8 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期六, 10 八月 2024 16:46:37 +0800
Subject: [PATCH] 修改特殊值输入

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   60 +++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index a24c112..85c477c 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -358,7 +358,7 @@
                     <el-input v-if="getInspectionValueType(n.i) == 1" class="table_input" v-model="n.v.v"
                               :disabled="(getInspectionItemType(n.i) == 1 && !dataAcquisitionEidtAble )|| (n.u != userId && n.u != undefined && n.u != '')"
                               @input="handleInput(n)"
-                              @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`, n)" @mousewheel.native.prevent :key="'abc-'+'000'+index+'000'+i+'000'+j"
+                              @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`, n,'getDataType')" @mousewheel.native.prevent :key="'abc-'+'000'+index+'000'+i+'000'+j"
                               @keydown.enter="changeInput('',`${item.templateId}-${n.r}-${n.c}-${n.i}`, n)">
                       <!-- <el-button slot="append" type="primary" icon="el-icon-edit" size="mini"
                         v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button> -->
@@ -366,10 +366,10 @@
                     <el-input v-else-if="getInspectionValueType(n.i) == 2" class="table_input" type="textarea"
                       v-model="n.v.v"
                       :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
-                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)" />
+                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`,'getDataType')" />
                     <el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input" v-model="n.v.v"
                       :disabled="state>1||getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')" @visible-change="e=>getDic(e,n.i)"
-                       @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)">
+                       @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`,'getDataType')">
                       <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
                     </el-select>
                     <span :style="`font-family:${n.v.ff} !important;`"
@@ -856,7 +856,7 @@
   import file from '../../../util/file'
   import excelFunction from '../../../util/excelFountion'
   export default {
-    props: ['sonLaboratory', 'orderId', 'state'],
+    props: ['sonLaboratory', 'orderId', 'state','inspectorList'],
     components: {
       ValueTable,
     },
@@ -1057,7 +1057,8 @@
         getDataIndex:[],
         getDataIndexLoading:false,
         changeType:null,
-        getDataTypeId:''
+        getDataTypeId:'',
+        getDataType:null
       }
     },
     computed: {
@@ -1296,6 +1297,11 @@
         }
       },
       handleDataAcquisition(data){
+        if(this.dataAcquisitionEidtAble){
+          this.getDataType = 1;
+        }else{
+          this.getDataType = 2;
+        }
         this.dataAcquisitionInfo = {}
         this.getData = []
         for (let i in data){
@@ -2644,6 +2650,7 @@
           } catch (e) {}
           try {
             let equipName = JSON.parse(a.insProductResult.equipName)
+            // console.log(2222222,equipName)
             if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐑惊鐜�')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('娓╁崌璇曢獙'))){
               this.param[a.id].equipName = []
               for (let i = 0; i < equipName.length; i++) {
@@ -2655,7 +2662,8 @@
               }
             }
             for (let i = 0; i < equipName.length; i++) {
-              if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='鐑惊鐜楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='娓╁崌璇曢獙鍘熷璁板綍妯℃澘')){
+              if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐑惊鐜�')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('娓╁崌璇曢獙'))){
+                console.log(2222222,equipName)
                 // 娓╁害寰幆璧嬪��
                 this.$set(this.equipForm,`value`+i,equipName[i].v)
                 this.param[a.id].equipName[i].v.v = equipName[i].v
@@ -2671,7 +2679,10 @@
         })
         this.handleExcelMethod()
       },
-      changeInput(m, code, n) {
+      changeInput(m, code, n,getDataType) {
+        if(getDataType=='getDataType'){
+          this.getDataType = 2;
+        }
         // let str = code.split('-')
         // let pId = str[3]
         // if(!this.param[pId].equipValue||this.param[pId].equipValue.length==0||!this.param[pId].equipValue[0].v.v){
@@ -2750,14 +2761,10 @@
         } catch (error) {
           console.log(444,error);
         }
-        let getDataType = false
 
         // 鐩戝惉 Worker 杩斿洖鐨勭粨鏋�
         this.worker.onmessage = (event) => {
           this.result = JSON.parse(event.data);
-          if(this.result.value.getDataTypeId){
-            getDataType = true
-          }
           switch (this.result.method){
             case 'saveInsContext':
               this.$nextTick(()=>{
@@ -2773,13 +2780,28 @@
                     }
                   }
                 }
-                if(this.isGet&&!this.dataAcquisitionEidtAble&&!getDataType){
-                  return
-                }
-                setTimeout(()=>{
+                console.log(99999,this.result.value.getDataTypeId)
+                if(this.isGet&&!this.dataAcquisitionEidtAble){
+                  if(this.result.value.getDataTypeId==''){
+                    return
+                  }
+                  setTimeout(()=>{
+                    this.saveInsContext()
+                  },2000)
+                }else if(this.isGet&&this.dataAcquisitionEidtAble){
+                  if(this.getDataType==1){
+                    if(this.result.value.getDataTypeId==''){
+                      return
+                    }
+                    setTimeout(()=>{
+                      this.saveInsContext()
+                    },2000)
+                  }else{
+                    this.saveInsContext()
+                  }
+                }else{
                   this.saveInsContext()
-                },2000)
-                // this.saveInsContext()
+                }
               })
               break;
             case 'tableList':
@@ -3248,9 +3270,9 @@
       getAuthorizedPerson() {
         this.$axios.get(this.$api.user.getUserMenu).then(res => {
           let data = []
-          let userName = JSON.parse(localStorage.getItem("user")).name;
+          // let userName = JSON.parse(localStorage.getItem("user")).name;
           res.data.forEach(a => {
-            if(a.name !== userName) {
+            if(!this.inspectorList.includes(a.name)) {
               data.push({
               label: a.name,
               value: a.id

--
Gitblit v1.9.3