From 620880da2e11fe0a56d24662f4736332bf08e9e5 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期五, 31 五月 2024 15:48:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/components/do/b1-ins-order/fiberoptic-config.vue |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 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 aaa8bcb..6dc61c9 100644
--- a/src/components/do/b1-ins-order/fiberoptic-config.vue
+++ b/src/components/do/b1-ins-order/fiberoptic-config.vue
@@ -35,11 +35,11 @@
               </div>
               <div class="search-item" style="margin-right: 10px;">
                 <label style="width: 70px;">鏍囧噯閲�</label>
-                <el-input v-model="packageInfo.num2" placeholder="璇疯緭鍏�" size="small" @change="upNum"></el-input>
+                <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @change="upNum"></el-input>
               </div>
               <div class="search-item">
                 <label style="width: 70px;">妫�娴嬮噺</label>
-                <el-input v-model="packageInfo.num3" placeholder="璇疯緭鍏�" size="small" @change="upNum"
+                <el-input v-model="packageInfo.testNum" placeholder="璇疯緭鍏�" size="small" @change="upNum"
                   :disabled="packageInfo.radio===0"></el-input>
               </div>
             </div>
@@ -55,9 +55,9 @@
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column prop="num2" label="鏍囬噺" show-overflow-tooltip align="center">
+              <el-table-column prop="standNum" label="鏍囬噺" show-overflow-tooltip align="center">
               </el-table-column>
-              <el-table-column prop="num3" label="娴嬭瘯閲�" show-overflow-tooltip align="center">
+              <el-table-column prop="testNum" label="娴嬭瘯閲�" show-overflow-tooltip align="center">
               </el-table-column>
             </el-table>
           </div>
@@ -200,8 +200,8 @@
         packageInfo: {
           radio: 1,
           num1: null,
-          num2: null,
-          num3: null,
+          standNum: null,
+          testNum: null,
           ismiers: false
         },
         tableData: [],
@@ -275,9 +275,11 @@
       }else{
         this.bushing = this.HaveJson(this.sample[0].bushing)
         this.packageInfo.num1 = this.sample[0].bushing.length
-        this.packageInfo.num2 = this.sample[0].bushing[0].num2
-        this.packageInfo.num3 = this.sample[0].bushing[0].num3
+        this.packageInfo.standNum = this.sample[0].bushing[0].standNum
+        this.packageInfo.testNum = this.sample[0].bushing[0].testNum
         this.bushing.forEach(a=>{
+          if(a.fibers===null)a.fibers=[]
+          if(a.fiber===null)a.fiber=[]
           if(this.packageInfo.ismiers){
             a.fibers.forEach(b=>{
               this.fibersList.push(b)
@@ -323,14 +325,14 @@
         this.fibersList = []
         this.detectionItems = []
         if (this.packageInfo.radio === 0) {
-          this.packageInfo.num3 = this.packageInfo.num2
+          this.packageInfo.testNum = this.packageInfo.standNum
         }
-        if (parseInt(this.packageInfo.num2) < parseInt(this.packageInfo.num3)) {
-          this.packageInfo.num3 = this.packageInfo.num2
+        if (parseInt(this.packageInfo.standNum) < parseInt(this.packageInfo.testNum)) {
+          this.packageInfo.testNum = this.packageInfo.standNum
         }
         if (this.packageInfo.num1 !== null && this.packageInfo.num1 !== '' &&
-          this.packageInfo.num2 !== null && this.packageInfo.num2 !== '' &&
-          this.packageInfo.num3 != null && this.packageInfo.num3 !== '') {
+          this.packageInfo.standNum !== null && this.packageInfo.standNum !== '' &&
+          this.packageInfo.testNum != null && this.packageInfo.testNum !== '') {
           let colors2 = []
           if (this.packageInfo.num1 / this.colors.length > 1) {
             let num = this.packageInfo.num1 / this.colors.length
@@ -345,8 +347,8 @@
           for (var i = 0; i < this.packageInfo.num1; i++) {
             let bushing = {
               color: colors2[i].label,
-              num2: this.packageInfo.num2,
-              num3: this.packageInfo.num3,
+              standNum: this.packageInfo.standNum,
+              testNum: this.packageInfo.testNum,
               fibers: [],
               fiber: []
             }
@@ -355,7 +357,6 @@
         } else {
           this.bushing = []
         }
-        console.log(1111111,this.bushing)
       },
       getStandTreeBySampleType() {
         this.$axios.post(this.$api.standardTree.getStandTreeBySampleType, {
@@ -483,7 +484,7 @@
         } else {
           this.selectBushing.forEach(a => {
             a.fiber = []
-            for (var i = 0; i < parseInt(a.num3); i++) {
+            for (var i = 0; i < parseInt(a.testNum); i++) {
               let fiber = {
                 bushColor: a.color,
                 color: colors2[i].label,
@@ -509,13 +510,13 @@
         this.selectBushing.forEach(a => {
           a.fiber = []
           a.fibers = []
-          for (var i = 0; i < parseInt(a.num3); i++) {
+          for (var i = 0; i < parseInt(a.testNum); i++) {
             let fibers = {
               code: null,
               color: a.color,
               model: this.miresModel,
               standard: standard,
-              num: a.num3,
+              num: a.testNum,
               productList: this.HaveJson(this.productList2),
               fiber: []
             }
@@ -527,6 +528,7 @@
       rowClickFiber(row, column, event){
         this.currentDetectionItems = row
         this.detectionItems = row.productList
+        if(this.detectionItems === null) return
         setTimeout(() => {
           this.detectionItems.forEach(a => {
             if (a.state == 1) this.toggleSelection(a)
@@ -626,6 +628,10 @@
         })
       },
       save(){
+        if(this.bushing.length === 0){
+          this.$message.error('缂哄皯閰嶇疆鏃犳硶淇濆瓨')
+          return
+        }
         for(let a in this.bushing){
           if(this.bushing[a].fibers.length===0&&this.bushing[a].fiber.length===0){
             this.$message.error(this.bushing[a].color+'绠¤壊鏍囧绠$己灏戦厤缃棤娉曚繚瀛�')
@@ -636,7 +642,7 @@
           a.bushing = this.bushing
         })
         this.$message.success('宸蹭繚瀛�')
-        console.log(11111111,this.bushing)
+        console.log(this.bushing);
       }
     }
   }

--
Gitblit v1.9.3