From 0e5763b1b39de488adb3bcc856a2201f87597a08 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 23 十二月 2024 15:56:40 +0800
Subject: [PATCH] 人员测试联调

---
 src/components/do/b1-ins-order/fiberoptic-config.vue |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 159 insertions(+), 20 deletions(-)

diff --git a/src/components/do/b1-ins-order/fiberoptic-config.vue b/src/components/do/b1-ins-order/fiberoptic-config.vue
index 5aece9d..d58d897 100644
--- a/src/components/do/b1-ins-order/fiberoptic-config.vue
+++ b/src/components/do/b1-ins-order/fiberoptic-config.vue
@@ -110,7 +110,7 @@
         </el-col>
       </el-row>
       <el-row :gutter="10">
-        <el-col :span="12" v-if="packageInfo.ismiers">
+        <el-col :span="12" v-if="packageInfo.ismiers && inspectionItemST != 1">
           <div class="grid-content">
             <h5>鍏夌氦甯�
               <el-button size="mini" type="primary" class="btns" @click="addFibers"
@@ -192,7 +192,7 @@
             </el-table>
           </div>
         </el-col>
-        <el-col :span="!packageInfo.ismiers?24:12">
+        <el-col :span="!packageInfo.ismiers?24:12" v-if=" inspectionItemST != 1">
           <div class="grid-content">
             <h5>鍏夌氦
               <el-button size="mini" type="primary" class="btns" @click="addFiber"
@@ -365,6 +365,10 @@
         type: Number,
         default: () => 0
       },
+      inspectionItemST: {
+        type: Number,
+        default: () => 0
+      }
     },
     data() {
       return {
@@ -449,6 +453,7 @@
       // }
     },
     mounted() {
+      console.log('inspectionItemST',this.inspectionItemST);
       this.$parent.sampleIds.forEach(a => {
         for (var i = 0; i < this.$parent.sampleList.length; i++) {
           if (this.$parent.sampleList[i].id == a) {
@@ -618,18 +623,35 @@
             }
            }
           }
-          // 濡傛灉妫�娴嬭姹傚惈鏈夆墹 < 鈮� > 绗﹀彿
+          // 濡傛灉瑕佹眰鎻忚堪鍚湁鈮� < 鈮� > 绗﹀彿
           const regex = /[鈮�<鈮�>]/
           const match = row.tell.match(regex)
           if(match) {
             // 绗﹀彿涓嶄竴鑷�
             if( row.ask.indexOf(match[0]) != 0) {
                 this.$message.error('妫�娴嬭姹備笉绗﹀悎瑕佹眰鎻忚堪')
-                row.ask = match[0]
                 return
               }else {
                 // 绗﹀彿涓�鑷�
-                const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, 'g')
+              // 濡傛灉妫�娴嬭姹傚惈鏈夋璐熷彿 骞朵笖鍚湁&鍙� 鈮�0.69&鈮�0.76 瑕佹眰鎻忚堪
+              if(row.tell.indexOf('&') != -1) {
+                if(row.ask.indexOf('&') == -1) {
+                  this.$message.error('妫�娴嬭姹備笉绗﹀悎瑕佹眰鎻忚堪')
+                row.ask = row.tell
+                return
+                }else{
+                  let left = row.tell.substring(0,row.tell.indexOf('&'))
+                  let right = row.tell.substring(row.tell.indexOf('&')+1)
+
+                  let leftAsk = row.ask.substring(0,row.ask.indexOf('&'))
+                  let rightAsk = row.ask.substring(row.ask.indexOf('&')+1)
+                  if(leftAsk != left || rightAsk != right) {
+                    this.$message.error('妫�娴嬭姹備笉绗﹀悎瑕佹眰鎻忚堪')
+                  }
+                }
+              }else {
+                // 娌℃湁&鍙�
+              const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, 'g')
                 const matchTow = row.tell.match(regex);
               let right =  Number(matchTow[0].split(match[0])[1])
               let left = row.ask.substring(row.ask.indexOf(match[0])+1)
@@ -638,7 +660,19 @@
                 row.ask = match[0] + right
               }
               }
+              
+              }
+              
+
+
             }
+
+            
+
+
+
+
+
             // 濡傛灉瑕佹眰鎻忚堪鍚湁鑼冨洿
             const regexTwo = /[~-]/
             const matchTwo = row.tell.match(regexTwo)
@@ -809,14 +843,13 @@
               })
               console.log(this.bushing);
               this.selectBushing = this.bushing
-              this.addFiber()
+              this.addFiber(1)
               // 榛樿鍕鹃��
             setTimeout(() => {
               // this.selectBushing.forEach(item =>{
               // let rowToSelect =  this.bushing.find(a => a.ident == item.ident)
               // this.$refs.table0.toggleRowSelection(rowToSelect, true)
               // })
-
               this.fiberList.forEach(item =>{
                 this.$refs.table3.toggleRowSelection(item, true)
               })
@@ -1070,7 +1103,7 @@
         }
       })
       },
-      addFiber() {
+      addFiber(isInspection) {
         // 鏈�鏂�
         let colors2 = []
         if (this.packageInfo.num1 / this.colors.length > 1) {
@@ -1088,11 +1121,23 @@
           if(this.multiFiberList.length != 0){
           this.multiFiberList.forEach((a,index) => {
             a.fiber = []
-            for (var i = 0; i < parseInt(a.num); i++) {
+            console.log('****',a,index);
+
+            if(index > 0 && index < this.multiFiberList.length) {
+              if(this.multiFiberList[index].color == this.multiFiberList[index-1].color) {
+
+
+
+                console.log('****',this.multiFiberList[index-1].num);
+
+
+
+                for (var i = 0; i < parseInt(a.num); i++) {
               let fiber = {
                 ident: this.fiberList.length + 1,
                 bushColor: a.color,
-                color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
+                // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
+                color: colors2[i+parseInt(this.multiFiberList[index-1].num)].label,
                 model: null,
                 noSplitModel: null,
                 standard: null,
@@ -1100,6 +1145,38 @@
                 productList: []
               }
               this.fiberList.push(fiber)
+            }
+              }else {
+                for (var i = 0; i < parseInt(a.num); i++) {
+              let fiber = {
+                ident: this.fiberList.length + 1,
+                bushColor: a.color,
+                // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
+                color: colors2[i].label,
+                model: null,
+                noSplitModel: null,
+                standard: null,
+                fibersIdent: a.ident,
+                productList: []
+              }
+              this.fiberList.push(fiber)
+            }
+              }
+            }else{
+              for (var i = 0; i < parseInt(a.num); i++) {
+              let fiber = {
+                ident: this.fiberList.length + 1,
+                bushColor: a.color,
+                // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
+                color: colors2[i].label,
+                model: null,
+                noSplitModel: null,
+                standard: null,
+                fibersIdent: a.ident,
+                productList: []
+              }
+              this.fiberList.push(fiber)
+            }
             }
           })
         } else {
@@ -1136,7 +1213,22 @@
         // 鏍规嵁濂楃鐨勬祴璇曢噺鐢熸垚瀵瑰簲鐨勬暟閲忕殑鍏夌氦鏁版嵁
         this.selectBushing.forEach((item,index) =>{
           if(item.testNum != null && item.testNum != ''){
-            for(let i =0; i < parseInt(item.testNum); i++){
+
+            // 鍏ㄦ
+            if(isInspection == 1) { 
+              for(let i =0; i < parseInt(item.testNum); i++){
+              let fiber = {
+                ident: this.fiberList.length + 1,
+                bushColor: item.color,
+                color: colors2[i].label,
+                model:  null,
+                standard: null,
+                productList: []
+              }
+              this.fiberList.push(fiber)
+            }
+            }else {
+              for(let i =0; i < parseInt(item.testNum); i++){
               let fiber = {
                 ident: this.fiberList.length + 1,
                 bushColor: item.color,
@@ -1146,6 +1238,7 @@
                 productList: []
               }
               this.fiberList.push(fiber)
+            }
             }
           }else {
             flag = false
@@ -1664,8 +1757,15 @@
         // })
         // this.$message.success('宸蹭繚瀛�')
         // this.$emit('saveFiberopticConfig')
-
-
+        if(this.inspectionItemST == 1) {
+          console.log('this.bushing',this.bushing);
+          this.$message.success('宸蹭繚瀛�')
+          this.sample.forEach(a=>{
+          a.bushing = this.bushing
+        })
+        this.$emit('saveFiberopticConfig')
+        return
+        }
 
         let flag = true
         let flags = true
@@ -1737,13 +1837,35 @@
                 return
               }else {
                 // 绗﹀彿涓�鑷�
+
+                // 濡傛灉妫�娴嬭姹傚惈鏈夋璐熷彿 骞朵笖鍚湁&鍙� 鈮�0.69&鈮�0.76 瑕佹眰鎻忚堪
+              if(row.tell.indexOf('&') != -1) {
+                console.log(11111);
+                if(row.ask.indexOf('&') == -1) {
+                  this.$message.error('妫�娴嬭姹備笉绗﹀悎瑕佹眰鎻忚堪')
+                row.ask = row.tell
+                return
+                }else{
+                  let left = row.tell.substring(0,row.tell.indexOf('&'))
+                  let right = row.tell.substring(row.tell.indexOf('&')+1)
+
+                  let leftAsk = row.ask.substring(0,row.ask.indexOf('&'))
+                  let rightAsk = row.ask.substring(row.ask.indexOf('&')+1)
+                  console.log('&',left,right,leftAsk,rightAsk);
+                  if(leftAsk != left || rightAsk != right) {
+                    flag = false
+                  }
+                }
+              }else{
                 const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, 'g')
                 const matchTow = row.tell.match(regex);
+                console.log('matchTow',matchTow);
               let right =  Number(matchTow[0].split(match[0])[1])
               let left = row.ask.substring(row.ask.indexOf(match[0])+1)
               if(Number(left) != Number(right)) {
                 // this.$message.error('666666')
                 flag = false
+              }
               }
               }
             }
@@ -1834,6 +1956,24 @@
                 return
               }else {
                 // 绗﹀彿涓�鑷�
+                if(row.tell.indexOf('&') != -1) {
+                console.log(11111);
+                if(row.ask.indexOf('&') == -1) {
+                  this.$message.error('妫�娴嬭姹備笉绗﹀悎瑕佹眰鎻忚堪')
+                row.ask = row.tell
+                return
+                }else{
+                  let left = row.tell.substring(0,row.tell.indexOf('&'))
+                  let right = row.tell.substring(row.tell.indexOf('&')+1)
+
+                  let leftAsk = row.ask.substring(0,row.ask.indexOf('&'))
+                  let rightAsk = row.ask.substring(row.ask.indexOf('&')+1)
+                  console.log('&',left,right,leftAsk,rightAsk);
+                  if(leftAsk != left || rightAsk != right) {
+                    flags = false
+                  }
+                }
+              }else {
                 const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, 'g')
                 const matchTow = row.tell.match(regex);
               let right =  Number(matchTow[0].split(match[0])[1])
@@ -1842,6 +1982,8 @@
                 // this.$message.error('666666')
                 flags = false
               }
+              }
+                
               }
             }
             // 濡傛灉瑕佹眰鎻忚堪鍚湁鑼冨洿
@@ -1863,10 +2005,6 @@
             })
           }
         })
-
-
-
-
         if(this.bushing.length === 0){
           this.$message.error('缂哄皯濂楃鏃犳硶淇濆瓨')
           return
@@ -1885,11 +2023,12 @@
             item.fiber = this.fiberList // 鍏夌氦
           }
         })
-        this.sample.forEach(a=>{
-          a.bushing = this.bushing
-        })
+        
         if(flag && flags) {
           this.$message.success('宸蹭繚瀛�')
+          this.sample.forEach(a=>{
+          a.bushing = this.bushing
+        })
         this.$emit('saveFiberopticConfig')
         }else if(!flag) {
           this.$message.error('鍏夌氦淇濆瓨鐨勬娴嬮」涓惈鏈変笉绗﹀悎瑕佹眰鐨勬暟鎹�')

--
Gitblit v1.9.3