From 284ae5b9ff466a9b0cd6be7eed2aefa765feee6f Mon Sep 17 00:00:00 2001
From: cqf <2252655793@qq.com>
Date: 星期四, 26 五月 2022 13:43:28 +0800
Subject: [PATCH] 隐患汇总跳转查询优化

---
 src/views/safetyproduction/new.vue |   57 ++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/src/views/safetyproduction/new.vue b/src/views/safetyproduction/new.vue
index 6d0496c..cb0e53c 100644
--- a/src/views/safetyproduction/new.vue
+++ b/src/views/safetyproduction/new.vue
@@ -17,10 +17,10 @@
       </div>
       <div class="box-right" v-if="lists == '' ? false : true">
         <div class="btns">
-          <el-button type="primary" class="btn" @click="open(0)"
+          <el-button type="primary" class="btn" @click="open(1)"
             >添加</el-button
           >
-          <el-button type="primary" class="btn" @click="open(-1)"
+          <el-button type="primary" class="btn" @click="open(0)"
             >暂存</el-button
           >
         </div>
@@ -39,7 +39,7 @@
             </el-row>
             <el-row>
               <el-col :span="22" :offset="1">
-                <el-table ref="table" border :data="item.child">
+                <el-table ref="table" border :stripe="true" :data="item.child" :header-cell-style="{background:'#eef1f6',color:'#606266'}" :cell-style="{background:'#fff',color:'#606266'}">
                   <el-table-column
                     prop="standardizationRequirements"
                     align="center"
@@ -69,7 +69,9 @@
                       type="expand"
                     >
                       <template slot-scope="scope">
-                        <el-table :data="scope.row.deductionList">
+                        <el-table border :data="scope.row.deductionList"
+                        :header-cell-style="{background:'#eef1f6',color:'#606266'}" :cell-style="{background:'#fff',color:'#606266'}"
+                        >
                           <el-table-column
                             prop="name"
                             align="center"
@@ -203,6 +205,11 @@
   },
   created() {
     this.TreeA();
+      safetyInspectionItemName().then((res) => {
+        if (res.data.code == 200) {
+          this.nameList = res.data.result;
+        }
+      });
     this.id = this.$route.query.name;
     this.itemId = this.$route.query.id;
     this.itemInfo(this.$route.query.id);
@@ -220,12 +227,14 @@
           this.treeList = Array.from(new Set(trees));
           var arr = this.checkSameDataA(this.list.itemList);
           for (var i = 0; i < arr.length; i++) {
-            var capB = {
+            var cser=[]
+              for(var j=0;j<arr[i].child.length;j++){
+             var capB = {
                 safetySelfInspectionId: "",
                 safetyInspectionItemId: "",
               }
-              var cser=[]
-              for(var j=0;j<arr[i].child.length;j++){
+              arr[i].child[j].deductionList= arr[i].child[j].selfDeductionList
+              console.log(arr[i].child[j])
               capB.safetySelfInspectionId=arr[i].child[j].safetySelfInspectionId
               capB.safetyInspectionItemId=arr[i].child[j].safetyInspectionItemId
               cser.push(capB)
@@ -246,7 +255,7 @@
     },
     TreeB(id) {
       safetyInspectionItemTreeB({ id: id }).then((res) => {
-        this.list = [];
+        // this.list = [];
         if (this.id == "添加") {
           if (res.data.code == 200) {
             this.list = res.data.result;
@@ -281,9 +290,10 @@
           if(this.list.length!=0){
           var capA = { elementAName: "", id: [], child: [] };
           var atte = [];
+
           capA.elementAName = this.list[0].elementAName;
           for (var i = 0; i < this.list.length; i++) {
-            var capB = {
+               var capB = {
               safetySelfInspectionId: "",
               safetyInspectionItemId: "",
             };
@@ -348,14 +358,18 @@
         this.$router.push({
           path: "/reviewXG",
           query: {
-            id: data.safetyInspectionItemId,
+            idX: data.safetyInspectionItemId,
+            name:this.id,
+            id:this.itemId
           },
         });
       } else {
         this.$router.push({
           path: "/reviewXG",
           query: {
-            id: data.id,
+            idX: data.id,
+            name:this.id,
+            id:this.itemId
           },
         });
       }
@@ -365,26 +379,21 @@
       this.form.status = type;
       var arr = [];
       for (var i = 0; i < this.lists.length; i++) {
-        this.lists[i].id;
+        // this.lists[i].id;
         for (var j = 0; j < this.lists[i].id.length; j++) {
           arr.push(this.lists[i].id[j]);
         }
       }
       this.form.itemList = arr;
-      safetyInspectionItemName().then((res) => {
-        if (res.data.code == 200) {
-          this.nameList = res.data.result;
-        }
-      });
     },
       closeDialog(){
         this.dialogVisible = false
-          console.log(123,this.form)
       },
     addC() {
        this.$refs["form"].validate((valid) => {
         if (valid) {
       if (this.id == "添加") {
+        console.log("添加",this.form)
         safetySelfInspectionAdd(this.form).then((res) => {
           if (res.data.code == 200) {
             this.dialogVisible = false;
@@ -395,11 +404,12 @@
               title: "成功",
             });
             this.$router.push({
-              path:"/checklistself"
+              path:"/safetyproduction/safetyproduction/checklistself"
             });
           }
         });
       } else if (this.id == "编辑") {
+        console.log('编辑',this.form)
         safetySelfInspectionMod(this.form).then((res) => {
           this.dialogVisible = false;
           this.$notify({
@@ -410,7 +420,7 @@
           });
         });
          this.$router.push({
-              path:"/checklistself"
+              path:"/safetyproduction/safetyproduction/checklistself"
             });
       }
          }
@@ -434,7 +444,7 @@
 }
 .box-left {
   width: 20%;
-  min-height: 800px;
+  min-height: 850px;
   background-color: white;
   border-radius: 5px;
 }
@@ -446,6 +456,8 @@
   width: 79%;
   background-color: white;
   border-radius: 5px;
+  height: 850px;
+  overflow-y:overlay;
 }
 .title {
   font-size: 16px;
@@ -467,4 +479,7 @@
   background-color: #034ea2;
   border: 1px solid #034ea2;
 }
+.box-right /deep/ .el-table__expanded-cell{
+  background-color: #fff !important;
+}
 </style>

--
Gitblit v1.9.2