From 8d1f60e54adb75d9c252b514174f287a2cbd7864 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 04 六月 2024 16:28:28 +0800
Subject: [PATCH] 完成检验下单、检验任务优化

---
 src/components/do/b1-ins-order/add.vue |   96 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 92 insertions(+), 4 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 1d19dd8..f712e9b 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -94,7 +94,7 @@
   <div class="ins_order_add">
     <div v-show="!configShow">
       <el-row class="title">
-        <el-col :span="6" style="padding-left: 20px;">濮旀墭鍗曚俊鎭�</el-col>
+        <el-col :span="6" style="padding-left: 20px;">濮旀墭鍗曚俊鎭�&nbsp;&nbsp;&nbsp;鎬讳环锛�<span style="color: #3A7BFA">锟{total}}</span></el-col>
         <el-col :span="18" style="text-align: right;">
           <el-select v-model="template" size="medium" placeholder="涓嬪崟妯℃澘" style="margin-right: 10px;" v-show="active==1"
             @change="selectInsOrderTemplateById">
@@ -467,7 +467,9 @@
         </el-row>
       </span>
     </el-dialog>
-    <fiberOpticConfig :currentId="currentId" v-if="configShow" :active="active" />
+    <fiberOpticConfig :currentId="currentId"
+    @saveFiberopticConfig="getTotal()"
+     v-if="configShow" :active="active" />
     <el-dialog title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨" :visible.sync="bsm1Dia" width="500px" :show-close="false" :before-close="beforeClose">
       <div class="body" style="max-height: 60vh;">
         <el-row v-if="bsm1">
@@ -627,13 +629,37 @@
         bsmRow: null,
         bsm1: false,
         bsm1Val: null,
-        bsm1Dia: false
+        bsm1Dia: false,
+        total:0,
       }
     },
     watch: {
       sampleList() {
         this.addObj.method = null
         this.productList = []
+      },
+      productList:{
+        deep:true,
+        handler(val){
+          if(val&&val.length>0){
+            let arr = [];
+            val.forEach(item => {
+              if(item.sonLaboratory&&!arr.find(a=>a.value==item.sonLaboratory)){
+                arr.push({
+                  text: item.sonLaboratory,
+                  value: item.sonLaboratory
+                })
+              }
+            })
+            this.filters = arr
+          }
+        }
+      },
+      sampleList:{
+        deep:true,
+        handler(val){
+          this.getTotal()
+        }
       }
     },
     mounted() {
@@ -645,7 +671,7 @@
       this.selectEnumByCategoryForUnit()
       this.selectStandardMethods()
       this.selectEnumByCategoryForOrderType()
-      this.selectEnumByCategoryForSonLaboratory()
+      // this.selectEnumByCategoryForSonLaboratory()
       this.selectEnumByCategoryForSampleForm()
       if (this.active != 1) {
         // 鏌ョ湅/瀹℃牳娴佺▼
@@ -1324,6 +1350,68 @@
           }
         }
         done()
+      },
+      getTotal(){
+        let arr = []
+        this.total = 0;
+        this.sampleList.forEach(item=>{
+          if(item.insProduct&&item.insProduct.length>0){
+            item.insProduct.forEach(a=>{
+              arr.push(a)
+            })
+          }
+          if(item.bushing&&item.bushing.length>0){
+            item.bushing.forEach(a=>{
+              if(a.fiber&&a.fiber.length>0){
+                a.fiber.forEach(b=>{
+                  if(b.productList&&b.productList.length>0){
+                    b.productList.forEach(c=>{
+                      arr.push(c)
+                    })
+                  }
+                })
+              }
+              if(a.fibers&&a.fibers.length>0){
+                a.fibers.forEach(b=>{
+                  if(b.productList&&b.productList.length>0){
+                    b.productList.forEach(c=>{
+                      arr.push(c)
+                    })
+                  }
+                  if(b.fiber&&b.fiber.length>0){
+                    b.fiber.forEach(c=>{
+                      if(c.productList&&c.productList.length>0){
+                        c.productList.forEach(d=>{
+                          arr.push(d)
+                        })
+                      }
+                    })
+                  }
+                })
+              }
+            })
+          }
+        })
+        let mySet = new Set();
+        let arr0 = arr.filter(item=>{
+          if(item.state == 1){
+            let num1= mySet.size
+            if(item.manHourGroup===''||!item.manHourGroup){
+              return true
+            }else{
+              mySet.add(item.manHourGroup)
+              let num2= mySet.size
+              if(num2 > num1){
+                return true
+              }else{
+                return false
+              }
+            }
+          }
+        })
+        arr0.forEach(item=>{
+          this.total += Number(item.price)
+        })
       }
     }
   }

--
Gitblit v1.9.3