|
@@ -58,7 +58,7 @@ export default {
|
|
return {
|
|
return {
|
|
itemId: null,
|
|
itemId: null,
|
|
detailsData: null, // 详情数据
|
|
detailsData: null, // 详情数据
|
|
- pageInfo: null
|
|
|
|
|
|
+ prevPageInfo: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -75,7 +75,7 @@ export default {
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
goBack () {
|
|
goBack () {
|
|
- this.$router.push({ path: this.pageInfo && this.pageInfo.path, query: { closeLastOldTab: true } })
|
|
|
|
|
|
+ this.$router.push({ path: this.prevPageInfo && this.prevPageInfo.path, query: { closeLastOldTab: true } })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
@@ -85,15 +85,15 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
activated () {
|
|
activated () {
|
|
- // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
|
|
- if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
|
|
|
|
+ // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面 (当前产品详情页的上级页分别有 上下线产品列表、箭冠产品列表和采购新增编辑页。因此处判断是否为子页是通过上级页路由路径是否有'/list',故需单独处理)
|
|
|
|
+ if ((this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) || (this.prevPageInfo && (this.prevPageInfo.name == 'purchaseOrderEdit' || this.prevPageInfo.name == 'purchaseOrderAdd'))) {
|
|
this.itemId = this.$route.params.sn
|
|
this.itemId = this.$route.params.sn
|
|
this.getDetail()
|
|
this.getDetail()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
- vm.pageInfo = from
|
|
|
|
|
|
+ vm.prevPageInfo = from
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|