浏览代码

清除定时器

achao 3 年之前
父节点
当前提交
629cab3da2

+ 5 - 0
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -489,6 +489,11 @@
         printSeparately: false,
       }
     },
+    beforeDestroy() {
+      if (this.timer) { //如果定时器还在运行 或者直接关闭,不用判断
+        clearInterval(this.timer); //关闭
+      }
+    },
     activated() {
       // if (!this.$route.query.grossWeight) {
       //   this.$route.query.grossWeight = 0

+ 5 - 0
src/views/outboundManagement/newQualityInspectionManagement.vue

@@ -236,6 +236,11 @@
         success: 0
       }
     },
+    beforeDestroy() {
+      if (this.timer) { //如果定时器还在运行 或者直接关闭,不用判断
+        clearInterval(this.timer); //关闭
+      }
+    },
     activated() {
       //   this.cangid = this.$route.query.cangid
       //   this.warehouseName = this.$route.query.warehouseName

+ 5 - 0
src/views/outboundManagement/weighingManagementNew.vue

@@ -423,6 +423,11 @@
         ],
       }
     },
+    beforeDestroy() {
+      if (this.timer) { //如果定时器还在运行 或者直接关闭,不用判断
+        clearInterval(this.timer); //关闭
+      }
+    },
     mounted() {
       this.selectWarehouse()
       this.showType = this.isShow