Forráskód Böngészése

修复安全检查及隐患问题跳转问题

凉纪 1 éve
szülő
commit
54050dc117

+ 14 - 2
src/views/menu/problemItem/edit.vue

@@ -272,14 +272,26 @@ export default {
       data.id = this.taskInfo.id;
       queryMethod(data).then((r) => {
         this.$toast("提交成功");
+          this.toPagesFcn();
+      }).catch(error=>{
+        if( error === '任务已完成'){
+          this.toPagesFcn();
+        }
+      })
+    },
+    //页面跳转逻辑
+    toPagesFcn(){
+      this.getRouter();
+      if(this.fromPage.name === "works"){
+        this.$router.go(-1)
+      }else {
         this.$router.replace({
           name:'problemItem',
           path:'/problemItem',
           params:{event:'refresh'}
         });
-      });
+      }
     },
-
     //初始化数据
     getData() {
       let id = this.$route.query.id;

+ 2 - 2
src/views/menu/safetyBook/detail.vue

@@ -105,9 +105,9 @@ export default {
   min-height: 40px;
   padding: 20px 0;
   >div{
-    line-height: 40px;
-    height: 40px;
+    line-height: 32px;
     padding-left: 20px;
+    margin: 10px 0;
   }
 }
 </style>

+ 22 - 25
src/views/menu/securityCheckRegister/add.vue

@@ -441,20 +441,10 @@ export default {
       this.taskInfo.isSubmit = 0;
       registerSubmit(this.taskInfo).then(res => {
         this.$toast('保存成功');
-        this.getRouter();
-        if(this.fromPage.name === "works"){
-          this.$router.go(-1)
-        }else {
-          this.$router.replace({
-            name:'securityCheckRegister',
-            path:'/securityCheckRegister',
-            params:{event:'refresh'}
-          });
-        }
+        this.toPagesFcn();
       }).catch(error=>{
-        console.log(error,'error')
-        if( error.msg === '任务已完成'){
-
+        if( error === '任务已完成'){
+          this.toPagesFcn();
         }
       })
     },
@@ -483,22 +473,29 @@ export default {
       })
       if (arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`);
       this.taskInfo.isSubmit = 1;
-      console.log(this.taskInfo,'taskInfo')
+      console.log(this.taskInfo,'taskInfo');
       registerSubmit(this.taskInfo).then(res => {
-        this.$toast('提交成功')
-        this.getRouter();
-        if(this.fromPage.name === "works"){
-          this.$router.go(-1)
-        }else {
-          this.$router.replace({
-            name:'securityCheckRegister',
-            path:'/securityCheckRegister',
-            params:{event:'refresh'}
-          });
+        this.$toast('提交成功');
+        this.toPagesFcn();
+      }).catch(error=>{
+        if( error === '任务已完成'){
+          this.toPagesFcn();
         }
       })
     },
-
+    //页面跳转逻辑
+    toPagesFcn(){
+      this.getRouter();
+      if(this.fromPage.name === "works"){
+        this.$router.go(-1)
+      }else {
+        this.$router.replace({
+          name:'securityCheckRegister',
+          path:'/securityCheckRegister',
+          params:{event:'refresh'}
+        });
+      }
+    },
     //授权
     accredit() {
       let { checkOrgId, ymdDate, planId, beCheckedOrgId, id } = this.taskInfo