|
@@ -250,7 +250,8 @@ export default {
|
|
openOfflineModal: false, // 下线 弹框
|
|
openOfflineModal: false, // 下线 弹框
|
|
offlineProductList: [], // 下线 当前所选数据
|
|
offlineProductList: [], // 下线 当前所选数据
|
|
productBrandList: [], // 品牌下拉数据
|
|
productBrandList: [], // 品牌下拉数据
|
|
- productTypeList: [] // 分类下拉数据
|
|
|
|
|
|
+ productTypeList: [], // 分类下拉数据
|
|
|
|
+ pageFromInfo: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -594,6 +595,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
activated () {
|
|
activated () {
|
|
|
|
+ const _this = this
|
|
// 如果是新页签打开,则重置当前页面
|
|
// 如果是新页签打开,则重置当前页面
|
|
if (this.$store.state.app.isNewTab) {
|
|
if (this.$store.state.app.isNewTab) {
|
|
this.pageInit()
|
|
this.pageInit()
|
|
@@ -602,11 +604,19 @@ export default {
|
|
// 仅刷新列表,不重置页面
|
|
// 仅刷新列表,不重置页面
|
|
if (this.$store.state.app.updateList) {
|
|
if (this.$store.state.app.updateList) {
|
|
this.pageInit()
|
|
this.pageInit()
|
|
- this.$refs.table.refresh()
|
|
|
|
|
|
+ setTimeout(() => { // 解决 编辑页 返回列表 请求先前页的数据。新增页 返回列表 请求第一页的数据。延迟是为了解决先执行activated 后执行beforeRouteEnter的问题
|
|
|
|
+ if (_this.pageFromInfo && _this.pageFromInfo.name == 'productInfoAdd') {
|
|
|
|
+ _this.resetSearchForm()
|
|
|
|
+ } else {
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ }, 100)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
- next(vm => {})
|
|
|
|
|
|
+ next(vm => {
|
|
|
|
+ vm.pageFromInfo = from
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|