From 90ef20e23e11803d967582f93f58f0b52cddb3a1 Mon Sep 17 00:00:00 2001
From: gaoluyang <gaoluyang@rengu.cc>
Date: 星期二, 23 七月 2024 13:44:36 +0800
Subject: [PATCH] 装备电缆-下单时样品型号根据×位置拼接

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   89 +++++++++++++++++++++++++++++++++++---------
 1 files changed, 70 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 b27d4eb..cb67224 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -296,7 +296,7 @@
             </el-form-item>
           </el-form>
           <el-button type="primary" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='妫�娴嬩腑蹇�'" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">鏁版嵁閲囬泦</el-button>
-          <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='妫�娴嬩腑蹇�'" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'鍏抽棴缂栬緫':'缂栬緫鏁伴噰'}}</el-button>
+          <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='妫�娴嬩腑蹇�'&&collected" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'鍏抽棴缂栬緫':'缂栬緫鏁伴噰'}}</el-button>
         </div>
       </div>
       <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||tableLists.find(m=>m.templateId==currentTable).templateName!='娓╁害寰幆妫�楠屽師濮嬭褰�'">
@@ -844,7 +844,8 @@
         dataAcquisitionInfo:{},
         dataAcquisitionEidt:0,
         dataAcquisitionEidtAble:false,
-        dataAcquisitionLoading:false
+        dataAcquisitionLoading:false,
+        collected:false
       }
     },
     computed: {
@@ -1026,7 +1027,8 @@
                   })
                   list[index].forEach((n,i)=>{
                     if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){
-                      if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)&&!n.v.ps.value.includes(this.dataAcquisitionInfo.frequency+'0')){
+                      let arr = n.v.ps.value.split('鍊�')
+                      if(arr[1] ==this.dataAcquisitionInfo.frequency){
                         setTimeout(()=>{
                           this.$delete(n.v,'v')
                           this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m])
@@ -1283,6 +1285,7 @@
         let power = JSON.parse(sessionStorage.getItem('power'))
         let fileDel = false
         let fileAdd = false
+        let collected = false
         for (var i = 0; i < power.length; i++) {
 					if (power[i].menuMethod == 'uploadFile') {
 						fileAdd = true
@@ -1290,11 +1293,15 @@
 					if (power[i].menuMethod == 'delfile') {
 						fileDel = true
 					}
+          if (power[i].menuMethod == 'isItAllowedToModifyTheCollectedValues') {
+						collected = true
+					}
 				}
         if (!fileDel) {
 					this.componentData0.do.splice(1, 1)
 				}
         this.fileAdd = fileAdd
+        this.collected = collected
       },
       async getCurrentProduct(id,type){
         this.tableLoading = true;
@@ -1604,31 +1611,63 @@
             if (size1 < size2) {
               let str = ''
               let count4 = 0
+              let isThree = 0
               a.template.forEach(c => {
                 if (b.r === c.r) {
-                  if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」') {
-                    if (count4 === 0) {
-                      str += c.v.v
-                      count4 += 1
+                  if(c.v.ps != undefined && c.v.ps.value === '妫�楠岄」鍒嗙被'&&count4 === 0){
+                    // 涓夌骇鍒嗙被
+                    isThree = 1
+                  }else if(c.v.ps != undefined && c.v.ps.value === '妫�楠岄」'&&count4 === 0){
+                    // 浜岀骇鍒嗙被
+                    isThree = 0
+                  }
+                  if(isThree==0){
+                    if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」') {
+                      if (count4 === 0) {
+                        str += c.v.v
+                        count4 += 1
+                      }
+                    } else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙椤�') {
+                      if (count4 === 1) {
+                        str += c.v.v
+                        count4 += 1
+                      }
                     }
-                  } else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙椤�') {
-                    if (count4 === 1) {
-                      str += c.v.v
-                      count4 += 1
-                    }
-                  }else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙瀛愰」'&&this.PROJECT=='瑁呭鐢电紗') {
-                    if (count4 === 2) {
-                      str += c.v.v
-                      count4 += 1
+                  }else if(isThree==1){
+                    if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」鍒嗙被') {
+                      if (count4 === 0) {
+                        str += c.v.v
+                        count4 += 1
+                      }
+                    }else if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」') {
+                      if (count4 === 1) {
+                        str += c.v.v
+                        count4 += 1
+                      }
+                    } else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙椤�') {
+                      if (count4 === 2) {
+                        str += c.v.v
+                        count4 += 1
+                      }
                     }
                   }
                 }
               })
+              console.log(1111,str)
               if (str != '') {
                 let count2 = 0
                 for (let i in this.currentSample.insProduct) {
-                  if (this.currentSample.insProduct[i].templateId === a.templateId && this.currentSample
-                  .insProduct[i].inspectionItem +(this.currentSample.insProduct[i].inspectionItemSubclass == null ? '' : this.currentSample.insProduct[i].inspectionItemSubclass)+(this.currentSample.insProduct[i].inspectionItemClass==null||this.PROJECT!='瑁呭鐢电紗'?'':this.currentSample.insProduct[i].inspectionItemClass) ===
+                  let inspectionItemClass = this.currentSample.insProduct[i].inspectionItemClass==null||this.currentSample.insProduct[i].inspectionItemClass==undefined?'':this.currentSample.insProduct[i].inspectionItemClass
+                  let inspectionItem = this.currentSample
+                  .insProduct[i].inspectionItem==null||this.currentSample
+                  .insProduct[i].inspectionItem==undefined?'':this.currentSample
+                  .insProduct[i].inspectionItem
+                  let inspectionItemSubclass = this.currentSample
+                  .insProduct[i].inspectionItemSubclass==null||this.currentSample
+                  .insProduct[i].inspectionItemSubclass==undefined?'':this.currentSample
+                  .insProduct[i].inspectionItemSubclass
+                  console.log(inspectionItemClass, inspectionItem, inspectionItemSubclass)
+                  if (this.currentSample.insProduct[i].templateId === a.templateId && inspectionItemClass +inspectionItem+inspectionItemSubclass ===
                     str) {
                     ids.push({
                       r: b.r,
@@ -1863,7 +1902,7 @@
           switch (this.result.method){
             case 'saveInsContext':
               this.$nextTick(()=>{
-                this.$delete(this.tableList[0],'arr')
+                // this.$delete(this.tableList[0],'arr')
                 this.$set(this.tableList[0],'arr',this.result.value.tableList[0].arr)
                 this.param = this.result.value.param
                 for (var i in this.param){
@@ -1875,6 +1914,18 @@
                     }
                   }
                 }
+                // let obj = this.param[code.split('-')[3]]
+                // this.tableList[0].arr.forEach(item=>{
+                //   item.forEach(m=>{
+                //     if(obj&&obj.insResult&&m.c==obj.insResult.c&&m.r==obj.insResult.r){
+                //       m.v.v = obj.insResult.v.v
+                //     }
+                //     if(obj&&obj.resValue&&m.c==obj.resValue.c&&m.r==obj.resValue.r){
+                //       m.v.v = obj.resValue.v.v
+                //     }
+                //   })
+                // })
+                // console.log(this.tableList,this.param)
                 this.saveInsContext()
               })
               break;

--
Gitblit v1.9.3