From 26bbf3648b29c0f855b53b3ee44c3d66b11818b2 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期五, 10 十一月 2023 17:00:30 +0800
Subject: [PATCH] s

---
 src/views/quality/rawMaterial/rawMaterial-form.vue |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue
index 3535b6d..398a3e0 100644
--- a/src/views/quality/rawMaterial/rawMaterial-form.vue
+++ b/src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -7,7 +7,7 @@
         <h2 v-else>缂栬緫-鍘熸潗鏂欐楠�</h2>
       </div>
       <div class="btn-group header-right">
-        <el-button @click="save()" v-if="this.dataForm.id==null">淇濆瓨</el-button>
+        <el-button type="primary" @click="save()" v-if="this.dataForm.id==null">淇濆瓨</el-button>
       </div>
     </div>
     <div class="page-main">
@@ -200,7 +200,7 @@
                   </el-table-column>
                   <el-table-column fixed="right" style="background-color: white;" v-if="dataForm.id == null" label="鎿嶄綔" width="150">
                     <template slot-scope="scope">
-                      <div v-if="scope.row.father!=null">
+                      <div v-if="scope.row.fId!=null">
                           <el-button type="text"  @click="addChildren(scope.row)">娣诲姞椤圭洰</el-button>
                           <el-button type="text" @click="delChildren(scope.row,scope.$index,true)">鍒犻櫎琛�</el-button>
                       </div>
@@ -358,7 +358,6 @@
       },
       // 纭鍥炶皟
       selectPart(param, nodePart, index) {
-        console.log(param)
         if (typeof param !== 'undefined') {
           this.dataForm.code = param.code
           this.dataForm.name = param.name
@@ -442,13 +441,14 @@
       },
       // 娣诲姞琛�
       clickAddLine(row) {
-        console.log(row);
         let ele = {
-            father: row.father?row.father:null,
+            fId: Math.random(),
+            father: null,
             iid: Math.random(),
             children:[]
         }
         if(row){
+          ele.father = row.father?row.father:null
           row.children.forEach(item => {
               ele.children.push({
                 deviceId: null,
@@ -472,7 +472,7 @@
             this.list.push(ele)
           })
         }else{
-          ele.push({
+          ele.children.push({
               deviceId: null,
               deviceName: null,
               iid: Math.random(),
@@ -572,6 +572,7 @@
                       }
                       ele.children.push(o)
                     })
+                    console.log("----------",ele);
                     this.list.push(ele)
                 }
             })         
@@ -625,7 +626,22 @@
         row.children.push(obj)
       },
       save(){
+
         let data = this.dataForm
+        console.log('--------',data);
+        console.log("-----",this.list);
+        this.list.forEach(item=>{
+          item.children.forEach(c=>{
+            let arr=c.testValueList
+            let val=''
+            arr.forEach(a=>{
+              val+=a+","
+              // val += '"' + a + "," 
+            })
+            let end=val.substring(0,val.length-1)
+            c.testValue=end
+          })
+        })  
         data.rawInsProducts = this.list
         addRawInspects(data).then(res=>{
             this.$message.success("淇濆瓨鎴愬姛")

--
Gitblit v1.9.3