From da498efb165dbada586396baecc71c644e46b1e8 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 23 七月 2024 14:00:41 +0800
Subject: [PATCH] 交接时选择试验室

---
 src/components/do/b1-ins-order/add.vue |   58 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index fb9622e..160ebde 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -565,8 +565,17 @@
           <el-col class="search_thing" :span="22">
             <div class="search_label"><span class="required-span" v-if="addObj.type == 2">* </span>鎸囨淳浜哄憳锛�</div>
             <div class="search_input">
-              <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" filterable style="width: 100%;">
+              <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" filterable style="width: 100%;" @change="changeUser">
                 <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </div>
+          </el-col>
+          <el-col class="search_thing" :span="22" v-if="distributeData.userId">
+            <div class="search_label"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+            <div class="search_input">
+              <el-select v-model="distributeData.sonLaboratory" placeholder="璇烽�夋嫨" size="small" filterable style="width: 100%;">
+                <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
             </div>
@@ -984,7 +993,8 @@
         issuedDialogVisible: false,
         distributeData: {
           appointed: '',
-          userId: ''
+          userId: '',
+          sonLaboratory:''
         },
         personList: [],
         upLoad: false,
@@ -1051,7 +1061,8 @@
         temperatureTitle: '',
         temperatureTestNum: '',
         isShowInput: false,
-        temId: ''
+        temId: '',
+        sonLaboratoryList:[]
       }
     },
     watch: {
@@ -1230,7 +1241,7 @@
             item.tell = ask
           }
         })
-        console.log('ask---', ask)
+        // console.log('ask---', ask)
         this.temperatureShow = false
       },
       temperatureShowClose () {
@@ -1279,7 +1290,7 @@
       },
 
       handleTemperatureTestChange (value) {
-        console.log('value---', value)
+        // console.log('value---', value)
       },
       handleSelectionChange(val) {
         this.opticalProjectList = val;
@@ -1476,7 +1487,7 @@
               isHaveBushing = false
             }
           })
-          console.log('isHaveBushing===', isHaveBushing)
+          // console.log('isHaveBushing===', isHaveBushing)
           if (productListSelected && select[2] === '鍏夌紗' && isHaveBushing === false) {
             this.$message.error('鍏夌紗娓╁害寰幆椤圭洰蹇呴』杩涜鍏夌氦閰嶇疆')
 
@@ -1802,11 +1813,16 @@
           this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
           return
         }
+        if (this.distributeData.userId&&(this.distributeData.sonLaboratory== null ||this.distributeData.sonLaboratory== '')) {
+          this.$message.error('璇曢獙瀹ゆ湭濉啓')
+          return
+        }
         this.upLoad = true;
         this.$axios.post(this.$api.insOrder.upInsOrder, {
           orderId: this.distributeData.orderId,
           appointed: this.distributeData.appointed,
-          userId: this.distributeData.userId
+          userId: this.distributeData.userId,
+          sonLaboratory:this.distributeData.sonLaboratory
         }).then(res => {
           if (res.code === 201) {
             this.upLoad = false
@@ -2070,7 +2086,7 @@
           this.circulateShow = false;
         }
         if ((row.inspectionItem === '娓╁崌璇曢獙' || row.inspectionItem === '鐑惊鐜�') && row.state === 1) {
-          console.log('row---', row)
+          // console.log('row---', row)
           this.temperatureTitle = `${row.inspectionItem}瑕佹眰濉啓`
           this.isShowInput = row.inspectionItem === '鐑惊鐜�'
           this.temId = row.id
@@ -2323,7 +2339,7 @@
         }
       },
       handleAll(e) {
-        console.log('e---', e)
+        // console.log('e---', e)
         if (e.length > 0) {
           this.productList.map(m => {
             if(e.find(a=>a.id == m.id)){
@@ -2373,7 +2389,7 @@
             this.circulateShow = false;
           }
           if ((p.inspectionItem === '娓╁崌璇曢獙' || p.inspectionItem === '鐑惊鐜�') && p.state === 1) {
-            console.log('p---', p)
+            // console.log('p---', p)
             this.temperatureTitle = `${p.inspectionItem}瑕佹眰濉啓`
             this.isShowInput = p.inspectionItem === '鐑惊鐜�'
             this.temId = p.id
@@ -2656,7 +2672,7 @@
       getTotal() {
         this.totalArr = []
         this.total = 0;
-        console.log(this.sampleList)
+        // console.log(this.sampleList)
         this.sampleList.forEach(item => {
           if (item.insProduct && item.insProduct.length > 0) {
             item.insProduct.forEach(a => {
@@ -2702,7 +2718,6 @@
             if (item.manHourGroup === '' || !item.manHourGroup) {
               return true
             } else {
-              console.log(item)
               mySet.add(item.manHourGroup)
               let num2 = mySet.size
               if (num2 > num1) {
@@ -2715,6 +2730,20 @@
         })
         arr0.forEach(item => {
           this.total += Number(item.price)
+        })
+        let arr1 = this.totalArr.filter(item => item.state == 1)
+        let mySet0 = new Set();
+        this.sonLaboratoryList = []
+        arr1.forEach(item => {
+          let num1 = mySet0.size
+          mySet0.add(item.sonLaboratory)
+          let num2 = mySet0.size
+          if(num2>num1){
+            this.sonLaboratoryList.push({
+              label:item.sonLaboratory,
+              value:item.sonLaboratory,
+            })
+          }
         })
       },
       bsm2Up(val) {
@@ -2731,6 +2760,11 @@
         for (let a of set) {
           this.bsm2Val2.push(this.HaveJson(this.bsm2Val3[a - 1]))
         }
+      },
+      changeUser(){
+        if(this.sonLaboratoryList.length>0){
+          this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+        }
       }
     }
   }

--
Gitblit v1.9.3