Bladeren bron

单据返回按钮跳转路径修改

sunlupeng 5 maanden geleden
bovenliggende
commit
89c08b0d5a

+ 1 - 9
src/views/stock/assembly/assemblyAdd.vue

@@ -281,17 +281,9 @@ export default {
             }
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
             this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+                this.$router.push({ name: 'assembly' })
             })
-            // this.$router.push({ name: 'assembly' })
         }
     }
 }

+ 2 - 10
src/views/stock/breakage/breakageAdd.vue

@@ -251,17 +251,9 @@ export default {
             }
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
-            this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+             this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
+                this.$router.push({ name: 'breakage' })
             })
-            // this.$router.push({ name: 'breakage' })
         },
     }
 }

+ 1 - 9
src/views/stock/disassembly/disassemblyAdd.vue

@@ -284,17 +284,9 @@ export default {
             }
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
             this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+                this.$router.push({ name: 'disassembly' })
             })
-            // this.$router.push({ name: 'disassembly' })
         }
     }
 }

+ 1 - 9
src/views/stock/requisition/requisitionAdd.vue

@@ -278,17 +278,9 @@ export default {
             }
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
             this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+                this.$router.push({ name: 'requisition' })
             })
-            // this.$router.push({ name: 'requisition' })
         },
         handleRemove(file, fileList) {
         console.log(file, fileList);

+ 1 - 9
src/views/stock/retrieval/retrievalAdd.vue

@@ -295,17 +295,9 @@ export default {
             }
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
             this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+                this.$router.push({ name: 'retrieval' })
             })
-            // this.$router.push({ name: 'retrieval' })
         },
     }
 }

+ 2 - 10
src/views/stock/stockCount/stockCountAdd.vue

@@ -252,17 +252,9 @@ export default {
             row.diffCount = row.createProductNumber - row.updateNumber
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
-            this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+           this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
+                this.$router.push({ name: 'stockCount' })
             })
-            // this.$router.push({ name: 'stockCount' })
         }
     }
 }

+ 2 - 10
src/views/stock/swap/swapAdd.vue

@@ -325,17 +325,9 @@ export default {
             }
         },
         roBack() {
-            // const { callback } = this.$route.params
-            // if (typeof callback === 'function') callback()
-            this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+           this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
+                this.$router.push({ name: 'swap' })
             })
-            // this.$router.push({ name: 'swap' })
         }
     }
 }

+ 10 - 8
src/views/stock/warehousing/warehousingAdd.vue

@@ -267,15 +267,17 @@ export default {
         roBack() {
             // const { callback } = this.$route.params
             // if (typeof callback === 'function') callback()
-            this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
-                const latestView = views.slice(-1)[0]
-                if (latestView) {
-                    this.$router.push(latestView.path)
-                } else {
-                    this.$router.push('/')
-                }
+            // this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
+            //     const latestView = views.slice(-1)[0]
+            //     if (latestView) {
+            //         this.$router.push(latestView.path)
+            //     } else {
+            //         this.$router.push('/')
+            //     }
+            // })
+           this.$store.dispatch('delVisitedViews', this.$route).then((views) => {
+                this.$router.push({ name: 'warehousing' })
             })
-            // this.$router.push({ name: 'warehousing' })
         },
         handleRemove(file, fileList) {
         console.log(file, fileList);