فهرست منبع

禁止多次弹出页面跳转confirm

lizhenhao 2 سال پیش
والد
کامیت
27738010ef

+ 0 - 2
src/views/modules/cw/reportManagement/ReportManagementSignatureForm.vue

@@ -538,8 +538,6 @@
             // 跳转回指定页面
             // 跳转回指定页面
             if (param.num === '2') {
             if (param.num === '2') {
               this.$router.push({path: '/sys/dashboard/workBench/Pending', query: {signatureUrl: data}})
               this.$router.push({path: '/sys/dashboard/workBench/Pending', query: {signatureUrl: data}})
-            } else if (param.num === '3') {
-              this.$router.push({path: '/sys/dashboard/workBench/PendingList', query: {signatureUrl: data}})
             } else {
             } else {
               this.$router.push({path: '/flowable/task/TodoList', query: {signatureUrl: data}})
               this.$router.push({path: '/flowable/task/TodoList', query: {signatureUrl: data}})
             }
             }

+ 16 - 3
src/views/modules/flowable/task/TodoList.vue

@@ -169,15 +169,28 @@
     activated () {
     activated () {
       // 判断是否有签章页面带过来
       // 判断是否有签章页面带过来
       if (this.commonJS.isNotEmpty(this.$route.query.signatureUrl)) {
       if (this.commonJS.isNotEmpty(this.$route.query.signatureUrl)) {
+        console.log('this.$route.query', this.$route.query)
         this.$confirm(`确定要前往签章页面吗?`, '提示', {
         this.$confirm(`确定要前往签章页面吗?`, '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
           type: 'warning'
           type: 'warning'
         }).then(() => {
         }).then(() => {
-          console.log('前往签章页面')
-          window.open(this.$route.query.signatureUrl, '_blank')
+          let _this = this
+          const wait = function () {
+            return new Promise((resolve, reject) => {
+              window.open(_this.$route.query.signatureUrl, '_blank')
+              resolve()
+            })
+          }
+          wait().then(() => {
+            this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+            console.log('前往签章页面,清除本页$router.query')
+            this.$router.push({query: {}})
+          })
         }).catch(() => {
         }).catch(() => {
-          console.log('取消前往签章页面')
+          this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+          this.$router.push({query: {}})
+          console.log('取消前往签章页面,清除本页$router.query')
         })
         })
       }
       }
       this.refreshList()
       this.refreshList()

+ 15 - 3
src/views/modules/sys/dashboard/workBench/Pending.vue

@@ -355,10 +355,22 @@
           cancelButtonText: '取消',
           cancelButtonText: '取消',
           type: 'warning'
           type: 'warning'
         }).then(() => {
         }).then(() => {
-          console.log('前往签章页面')
-          window.open(this.$route.query.signatureUrl, '_blank')
+          let _this = this
+          const wait = function () {
+            return new Promise((resolve, reject) => {
+              window.open(_this.$route.query.signatureUrl, '_blank')
+              resolve()
+            })
+          }
+          wait().then(() => {
+            this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+            console.log('前往签章页面,清除本页$router.query')
+            this.$router.push({query: {}})
+          })
         }).catch(() => {
         }).catch(() => {
-          console.log('取消前往签章页面')
+          this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+          this.$router.push({query: {}})
+          console.log('取消前往签章页面,清除本页$router.query')
         })
         })
       }
       }
       this.refreshList()
       this.refreshList()