From 0780645266681fbfe4fd02f32ebc307eb88c6554 Mon Sep 17 00:00:00 2001
From: shj <1790240199@qq.com>
Date: 星期四, 31 三月 2022 15:07:13 +0800
Subject: [PATCH] Merge branch 'shf' of https://sinanoaq.cn:8888/r/ztqt into shf

---
 src/views/safetyproduction/new.vue |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/src/views/safetyproduction/new.vue b/src/views/safetyproduction/new.vue
index 35b0d78..9ad7b6f 100644
--- a/src/views/safetyproduction/new.vue
+++ b/src/views/safetyproduction/new.vue
@@ -112,7 +112,7 @@
         </div>
       </div>
     </div>
-    <el-dialog title="添加" :visible.sync="dialogVisible" width="30%">
+    <el-dialog title="添加" :visible.sync="dialogVisible" :close-on-click-modal="false" width="30%">
       <el-form ref="form" :model="form" label-width="100px">
         <el-form-item label="自查清单名称">
           <el-input v-model="form.inspectionName"></el-input>
@@ -220,13 +220,20 @@
           }
           this.treeList = Array.from(new Set(trees));
           var arr = this.checkSameDataA(this.list.itemList);
-          console.log("tag", arr);
           for (var i = 0; i < arr.length; i++) {
+            var capB = {
+                safetySelfInspectionId: "",
+                safetyInspectionItemId: "",
+              }
+              var cser=[]
+              for(var j=0;j<arr[i].child.length;j++){
+              capB.safetySelfInspectionId=arr[i].child[j].safetySelfInspectionId
+              capB.safetyInspectionItemId=arr[i].child[j].safetyInspectionItemId
+              cser.push(capB)
+              }
+              arr[i].id=cser
+            console.log('tag', capB)
             arr[i].child = this.checkSameData(arr[i].child);
-            arr[i].id = {
-              safetySelfInspectionId: arr[i].child.safetySelfInspectionId,
-              safetyInspectionItemId: arr[i].child.safetyInspectionItemId,
-            };
           }
           this.lists = arr;
           console.log(this.lists);
@@ -286,7 +293,6 @@
             capB.safetySelfInspectionId = this.itemId;
             atte.push(capB);
           }
-          console.log("数据", this.lists);
           capA.id = atte;
           capA.child = this.checkSameData(this.list);
           if (
@@ -339,19 +345,18 @@
       this.TreeB(currentObj.value);
     },
     handleClick(data) {
-      console.log('tag', data.id)
-      if (data.safetyInspectionItemId!=undefined) {
-          this.$router.push({
+      if (data.safetyInspectionItemId != undefined) {
+        this.$router.push({
           path: "/reviewXG",
           query: {
             id: data.safetyInspectionItemId,
           },
         });
-      } else{
-         this.$router.push({
+      } else {
+        this.$router.push({
           path: "/reviewXG",
           query: {
-            id:data.id
+            id: data.id,
           },
         });
       }
@@ -360,6 +365,7 @@
       this.dialogVisible = true;
       this.form.status = type;
       var arr = [];
+      console.log("数据", this.lists);
       for (var i = 0; i < this.lists.length; i++) {
         this.lists[i].id;
         for (var j = 0; j < this.lists[i].id.length; j++) {
@@ -384,6 +390,9 @@
               message: "新增成功",
               title: "成功",
             });
+            this.$router.push({
+              path:"/checklistself"
+            });
           }
         });
       } else if (this.id == "编辑") {
@@ -396,6 +405,9 @@
             title: "成功",
           });
         });
+         this.$router.push({
+              path:"/checklistself"
+            });
       }
     },
     btnsQX() {

--
Gitblit v1.9.2