From c146c0ae4e57b26e798157fe453426e9fc26db34 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 09 八月 2024 09:04:47 +0800
Subject: [PATCH] 合并冲突

---
 src/components/do/b1-ins-order/fiberoptic-config.vue |  115 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 74 insertions(+), 41 deletions(-)

diff --git a/src/components/do/b1-ins-order/fiberoptic-config.vue b/src/components/do/b1-ins-order/fiberoptic-config.vue
index ad78730..aef1696 100644
--- a/src/components/do/b1-ins-order/fiberoptic-config.vue
+++ b/src/components/do/b1-ins-order/fiberoptic-config.vue
@@ -31,16 +31,16 @@
               style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
               <div class="search-item" style="margin-right: 10px;">
                 <label>濂楃鏁扮洰</label>
-                <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @blur="addBushing" :disabled="active!=1"></el-input>
+                <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @blur="addBushing" :disabled="active!=1" ></el-input>
               </div>
               <div class="search-item" style="margin-right: 10px;">
-                <label style="width: 70px;">鏍囧噯閲�</label>
-                <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @blur="addStandNum" :disabled="active!=1"></el-input>
+                <label style="width: 100px">姣忔牴绠℃娊妫�鏍囧噯閲�</label>
+                <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @blur="addStandNum" :disabled="active!=1" style="width:100px"></el-input>
               </div>
               <div class="search-item">
-                <label style="width: 70px;">妫�娴嬮噺</label>
+                <label style="width: 100px">姣忔牴绠℃娊妫�妫�娴嬮噺</label>
                 <el-input v-model="packageInfo.testNum" placeholder="璇疯緭鍏�" size="small" @blur="addTestNum"
-                  :disabled="packageInfo.radio===0||active!=1"></el-input>
+                  :disabled="packageInfo.radio===0||active!=1" style="width:100px"></el-input>
               </div>
             </div>
             <el-table ref="table0" :data="bushing" tooltip-effect="dark" style="width: 100%" height="203px" size="small"
@@ -78,7 +78,7 @@
               @select="upProductSelect"
               >
               <el-table-column type="selection" width="55"
-              :selectable="()=>((currentDetectionItems||this.multiFiberList.length > 0)&&active==1)">
+              :selectable="()=>((currentDetectionItems||this.selectFiberList.length > 0 || this.multiFiberList.length > 0)&&active==1)">
               </el-table-column>
               <el-table-column label="瀹為獙瀹�" show-overflow-tooltip prop="sonLaboratory" ></el-table-column>
               <el-table-column prop="inspectionItem" label="妫�楠岄」" show-overflow-tooltip>
@@ -134,7 +134,7 @@
               <div class="search-item" style="width: 50%;margin-right: 16px;">
                 <label style="width: 80px;">绾ゅ甫绫诲瀷</label>
                 <el-select v-model="miresModel" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"
-                  :disabled="selectBushing.length===0||active!=1"
+
                   >
                   <el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value">
                   </el-option>
@@ -358,6 +358,7 @@
       return {
         detectionType: null,
         detectionSelect: [],
+        selectFiberList: [],
         type:1,
         saveLoad: false,
         packageInfo: {
@@ -467,9 +468,8 @@
               // 鍏夌氦甯�
               this.fibersList.push(b)
               // 鍏夌氦
-              b.fiber.forEach(c=>{
-                this.fiberList.push(c)
-              })
+              // this.fiberList = []
+              // this.fiberList = b.fiber
             })
             } else {
               a.fiber.forEach(b=>{
@@ -478,6 +478,7 @@
             }
 
           }else{
+            this.fiberList = []
             a.fiber.forEach(b=>{
               this.fiberList.push(b)
             })
@@ -492,8 +493,11 @@
     },
     methods: {
       handleSelectionChange(val) {
-        this.selectFibers = val
+        // this.selectFibers = val
         this.multiFiberList = val
+        if(val.length > 0) {
+          this.rowClickFiber(val[val.length-1],null,null,1)
+        }
       },
       handleSelectionChange1(val) {
         this.selectBushing = val
@@ -502,27 +506,47 @@
         this.detectionSelect = val
         // 璧嬪�兼娴嬮」淇℃伅 鍏夌氦甯�
         if(this.detectionItems.type == 1) {
-          for(let i= 0; i < this.fibersList.length; i++){
-            this.multiFiberList.forEach(item => {
-              if(this.fibersList[i].ident == item.ident){
+          this.multiFiberList.forEach(item => {
+            this.fibersList.forEach(a => {
+              if(a.ident == item.ident){
+                a.productList  =  []
                 this.fibersList.find(a => a.ident == item.ident).productList = this.detectionSelect
               }
             })
-        }
+          })
+
       }
       if(this.detectionItems.type == 0) {
         // 璧嬪�兼娴嬮」淇℃伅 鍏夌氦
-        this.multiFiberList.forEach(item => {
+        this.selectFiberList.forEach(item => {
             this.fiberList.forEach(a => {
               if(a.ident == item.ident){
+                a.productList  =  []
                 this.fiberList.find(a => a.ident == item.ident).productList = this.detectionSelect
               }
             })
           })
+
+          if(this.multiFiberList.length == 1) {
+            this.multiFiberList.forEach(item => {
+            this.fibersList.forEach(a => {
+              if(a.ident == item.ident){
+                a.fiber = this.fiberList
+              }
+            })
+          })
+          }else if(this.multiFiberList.length > 1) {
+            this.fibersList.forEach(item => {
+              item.fiber = this.fiberList
+            })
+          }
         }
       },
       handleSelectionChange4(val){
-        this.multiFiberList = val
+        this.selectFiberList = val
+        if(val != 0) {
+          this.rowClickFiber(val[val.length-1],null,null,0)
+        }
       },
       outConfig() {
         this.$parent.configShow = false
@@ -563,6 +587,11 @@
       },
       // 濂楃妫�娴嬮噺璧嬪��
       addTestNum() {
+
+        if(parseInt(this.packageInfo.testNum) > parseInt(this.packageInfo.standNum)) {
+          this.packageInfo.testNum = this.packageInfo.standNum
+          this.$message.error('妫�娴嬮噺涓嶈兘澶т簬鏍囧噯閲�')
+        }
         if(this.selectBushing.length > 0) {
           this.bushing.forEach(item => {
           this.selectBushing.forEach(a => {
@@ -588,7 +617,7 @@
             this.packageInfo.testNum = this.packageInfo.standNum
             this.selectBushing = this.bushing
             this.addFibers()
-            this.selectFibers = this.fibersList
+            this.multiFiberList = this.fibersList
             // 榛樿鍕鹃��
             setTimeout(() => {
               this.selectBushing.forEach(item =>{
@@ -596,7 +625,7 @@
               this.$refs.table0.toggleRowSelection(rowToSelect, true)
               })
 
-              this.selectFibers.forEach(item =>{
+              this.multiFiberList.forEach(item =>{
               let rowToSelect =  this.fibersList.find(a => a.ident == item.ident)
               this.$refs.table2.toggleRowSelection(rowToSelect, true)
               })
@@ -609,7 +638,6 @@
               this.packageInfo.testNum = this.packageInfo.standNum
               this.selectBushing = this.bushing
               this.addFiber()
-
               // 榛樿鍕鹃��
             setTimeout(() => {
               this.selectBushing.forEach(item =>{
@@ -759,11 +787,11 @@
         // })
 
           // 灏嗕笅鎷夋鍊艰祴鍊肩粰鍏夌氦  鐩戝惉鍘婚櫎
-          if(this.multiFiberList.length == 0) {
+          if(this.selectFiberList.length == 0) {
             this.$message.error('璇烽�夋嫨鏁版嵁')
             return
           }
-          this.multiFiberList.forEach(item => {
+          this.selectFiberList.forEach(item => {
             this.fiberList.forEach(a => {
               if(a.ident == item.ident){
                 a.model = this.mireModel.split(' - ')[1] // 鍏夌氦瑙勬牸
@@ -863,7 +891,6 @@
       })
       },
       addFiber() {
-
         // 鏈�鏂�
         let colors2 = []
         if (this.packageInfo.num1 / this.colors.length > 1) {
@@ -878,8 +905,8 @@
         this.fiberList = []
         // 閫夋嫨浜嗗厜绾ゅ甫
         if (this.packageInfo.ismiers) {
-          if(this.selectFibers.length != 0){
-          this.selectFibers.forEach((a,index) => {
+          if(this.multiFiberList.length != 0){
+          this.multiFiberList.forEach((a,index) => {
             a.fiber = []
             for (var i = 0; i < parseInt(a.num); i++) {
               let fiber = {
@@ -904,6 +931,7 @@
                 bushColor: a.color,
                 color: colors2[(i+(parseInt(a.testNum))*index)>colors2.length?0:i+(parseInt(a.testNum))*index].label,
                 model: null,
+                noSplitModel: null,
                 standard: null,
                 productList: []
               }
@@ -1131,6 +1159,11 @@
         //   })
         // }, 200)
         if(type == 1) {
+          this.fiberList = row.fiber
+          if((row.model == null || row.model == '') && (row.standard == null || row.standard == '')){
+            this.detectionItems = []
+            return
+          }
           if(row.model != null && row.model != ''){
           this.miresModel = row.model
           this.selectsStandardMethodByFLSSM2()
@@ -1151,28 +1184,28 @@
           // 灏嗚幏鍙栫殑妫�娴嬮」淇℃伅璧嬪��
           this.detectionItems = []
           if(res.data != null && res.data.length != 0){
-            res.data.forEach(a => {
-              a.state = 0
-            })
             this.detectionItems = res.data
             this.detectionType = 1
             this.$set(this.detectionItems,'type',1)
-
             if (row.productList != null && row.productList.length > 0) {
+              let product =  JSON.parse(JSON.stringify(row.productList))
               setTimeout(() => {
-                row.productList.forEach(product => {
-                let rowToSelect = this.detectionItems.find(item => item.id === product.id);
+                product.forEach(p => {
+                let rowToSelect = this.detectionItems.find(item => item.id === p.id);
                 if (rowToSelect) {
                   this.toggleSelection(rowToSelect);
                 }
               });
-              },200)
-
+            },200)
             }
           }
         })
         },1000)
       }else if(type == 0) {
+        if((row.noSplitModel == null || row.noSplitModel == '') && (row.standard == null || row.standard == '')){
+            this.detectionItems = []
+            return
+          }
         if(row.model != null && row.model != ''){
           this.mireModel = row.noSplitModel
           this.selectsStandardMethodByFLSSM()
@@ -1200,9 +1233,10 @@
           this.$set(this.detectionItems,'type',0)
 
           if (row.productList != null && row.productList.length > 0) {
+            let product =  JSON.parse(JSON.stringify(row.productList))
             setTimeout(() => {
-              row.productList.forEach(product => {
-                let rowToSelect = this.detectionItems.find(item => item.id === product.id);
+              product.forEach(p => {
+                let rowToSelect = this.detectionItems.find(item => item.id === p.id);
                 if (rowToSelect) {
                   this.toggleSelection(rowToSelect);
                 }
@@ -1210,7 +1244,6 @@
             },200)
             }
           }
-
         })
         },1000);
       }
@@ -1330,8 +1363,8 @@
       },
       upProductSelect(selection, row) {
         row.state = row.state == 1 ? 0 : 1
-        if(this.multiFiberList.length > 0){
-          this.multiFiberList.map(item => {
+        if(this.selectFiberList.length > 0){
+          this.selectFiberList.map(item => {
             item.productList.map(m=>{
               if(m.id == row.id){
                 m.state = row.state;
@@ -1430,9 +1463,9 @@
         this.bushing.forEach(item=>{
           // 濡傛灉鍏夌氦甯︽湁鍊�
           if(this.fibersList.length != 0) {
-              this.fibersList.forEach(a=>{
-                a.fiber = this.fiberList.filter(b=>b.fibersIdent == a.ident)
-              })
+              // this.fibersList.forEach(a=>{
+              //   a.fiber = this.fiberList
+              // })
               item.fibers = this.fibersList // 鍏夌氦甯�
               item.fiber = [] // 鍏夌氦
           }else {

--
Gitblit v1.9.3