From 7a2039181be3ad03efb28acf141b0654247f47d4 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 10 十二月 2024 17:34:55 +0800
Subject: [PATCH] 电路试验退出保存优化

---
 src/components/do/b1-inspect-order-plan/circuit-parameters1.vue |   56 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue b/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
index 6c61c11..b1a94cc 100644
--- a/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
+++ b/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
@@ -36,9 +36,8 @@
       <el-col :span="7">
         <div style="display: flex;align-items: center;justify-content: flex-end;flex-wrap: wrap;" class="btns" v-if="!isLook">
           <el-button type="primary" size="small" @click="addList(allBandList,'棰戞')" :disabled="state>1" style="margin: 4px;">娣诲姞棰戞</el-button>
-          <el-button size="small" @click="deleteList(allBandList.length-1,allBandList,'鍒犻櫎棰戞')" :disabled="state>1" style="margin: 4px;">鍒犻櫎棰戞</el-button>
-          <el-button type="primary" size="small" @click="addList(angleList)" :disabled="state>1" style="margin: 4px;">娣诲姞瑙掑害</el-button>
-          <el-button size="small" @click="deleteList(angleList.length-1,angleList)" :disabled="state>1" style="margin: 4px;">鍒犻櫎瑙掑害</el-button>
+          <el-button type="success" size="small" @click="addList(angleList)" :disabled="state>1" style="margin: 4px;">娣诲姞瑙掑害</el-button>
+          <el-button size="small" @click="deleteList(angleList.length-1,angleList)" :disabled="state>1" style="margin: 4px;" type="danger">鍒犻櫎瑙掑害</el-button>
         </div>
       </el-col>
     </el-row>
@@ -70,8 +69,9 @@
             :value="item.value">
           </el-option>
         </el-select>
+        <el-button size="small" @click="deleteList(y,allBandList,'鍒犻櫎棰戞')" :disabled="state>1" style="margin-left: 16px;" type="danger">鍒犻櫎棰戞</el-button>
         <el-button type="primary" size="small" @click="addList(h.projectList,'浜掕皟')" style="margin-left: 16px;" :disabled="state>1" v-show="!isLook&&intermodulationNum>0">娣诲姞浜掕皟</el-button>
-        <el-button size="small" @click="deleteList(0,h.projectList,'浜掕皟')" :disabled="state>1" v-show="!isLook&&intermodulationNum>0">鍒犻櫎浜掕皟</el-button>
+        <!-- <el-button size="small" @click="deleteList(0,h.projectList,'浜掕皟')" :disabled="state>1" v-show="!isLook&&intermodulationNum>0">鍒犻櫎浜掕皟</el-button> -->
         <el-button type="primary" size="small" @click="save(h,y)" :disabled="state>1" :loading="loading[y]" v-show="!isLook">淇� 瀛�</el-button>
       </div>
       <el-divider></el-divider>
@@ -145,6 +145,7 @@
                             :value="item.value">
                           </el-option>
                         </el-select>
+                        <el-button type="danger" icon="el-icon-delete" circle size="small" @click="deleteList(j,h.projectList,'浜掕皟')" :disabled="state>1" v-show="!isLook&&intermodulationNum>0" style="margin-left: 20px;"></el-button>
                       </div>
                     </td>
                   </tr>
@@ -581,11 +582,11 @@
       this.upTemplateState = false;
       if(list.length>1){
         if(type=='浜掕皟'){
-          let index = null;
+          // let index = null;
           let num = 0;
           list.forEach((m,i)=>{
             if(m.inspectionItemSubclass.includes('浜掕皟')){
-              index = i;
+              // index = i;
               num++
             }
           })
@@ -797,15 +798,52 @@
         console.log(err)
       })
     },
-    saveAll(){
+    async saveAll(){
       if(this.allBandList.find(m=>!m.band)){
         this.$message.error('璇峰厛濉啓棰戞')
         return false
       }else{
+        let arr0 = []
         this.allBandList.forEach((h,j)=>{
-          this.save(h,j)
+          // this.save(h,j)
+          let arr = h.projectList.map(item=>{
+            if(item.portList&&item.portList.length>0){
+              item.value.forEach(m=>{
+                m = m.splice(item.portList.length)
+              })
+            }
+            let obj = {
+              insProductId:item.id,
+              equipValue:this.insProductNew.find(m=>m.id==item.id).equipValue,
+              equipName:this.insProductNew.find(m=>m.id==item.id).equipName,
+              port:item.portList.map(m=>m.value).join(','),
+              angle:item.angleList.map(m=>m.value).join(','),
+              value:JSON.stringify(item.value),
+              often:item.often
+            }
+            return obj
+          })
+          let obj0 = {
+            sampleId:this.orderId,
+            sonLaboratory:h.projectList[0].sonLaboratory,
+            frequency:h.band,
+            insProductResult2s:arr
+          }
+          arr0.push(obj0)
         })
-        return true
+        let res = await this.$axios.post(this.$api.insOrderPlan.saveInsContext2s, {insProductResultDtos:arr0
+        }, {
+        headers: {
+          'Content-Type': 'application/json'
+        },
+        noQs:true})
+        if(res.code===201){
+          this.$message.error('淇濆瓨澶辫触')
+          return false
+        }else{
+          this.$message.success('宸蹭繚瀛�')
+          return true
+        }
       }
     },
     // 鏇存柊妯℃澘

--
Gitblit v1.9.3