Commit e1bb3803 authored by 邓春圆's avatar 邓春圆

返回商品相关列表时筛选条件、页码未保存 bug 修复

parent 769f064a
...@@ -212,7 +212,7 @@ export const constantRoutes = [ ...@@ -212,7 +212,7 @@ export const constantRoutes = [
path: 'product-price', path: 'product-price',
component: (resolve) => require(['@/views/ecw/productPrice/index'], resolve), component: (resolve) => require(['@/views/ecw/productPrice/index'], resolve),
name: 'ProductPrice', name: 'ProductPrice',
meta: {title: '价格列表', activeMenu: '/product/product-list'} meta: {title: '价格列表', activeMenu: '/product/product-list',componentPath:'/ecw/productprice/index'}
} }
] ]
}, },
......
...@@ -437,7 +437,7 @@ export default { ...@@ -437,7 +437,7 @@ export default {
}, },
}, },
activated() { activated() {
console.log('activated', Object.assign({}, this.$route.query)) // console.log('activated', Object.assign({}, this.$route.query))
/* this.$set(this.queryParams, 'typeId', +this.$route.query.product_type || null) /* this.$set(this.queryParams, 'typeId', +this.$route.query.product_type || null)
let productId = this.product?.id let productId = this.product?.id
...@@ -450,25 +450,25 @@ export default { ...@@ -450,25 +450,25 @@ export default {
} }
this.handleQuery() this.handleQuery()
*/ */
this.getList();
}, },
watch:{ watch:{
'$route.query.product_id'(){ '$route.query.product_id'(){
console.log(this.$route.query) // if(!this.$route.query.product_id){
if(!this.$route.query.product_id){ // return this.product = null
return this.product = null // }
}
let productId = this.product?.id let productId = this.product?.id
if(this.$route.name === 'ProductPrice'){
if(this.$route.query.product_id != productId){ if(this.$route.query.product_id != productId){
this.queryParams = { this.queryParams = {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
productId: this.$route.query.product_id productId: this.$route.query.product_id,
}
} }
getProduct(this.$route.query.product_id).then(res => { getProduct(this.$route.query.product_id).then(res => {
this.product = res.data this.product = res.data
}) })
this.handleQuery() this.getList();
} }
} }
}, },
......
...@@ -79,7 +79,10 @@ ...@@ -79,7 +79,10 @@
import { createProductType, updateProductType, deleteProductType, getProductType, getProductTypePage, exportProductTypeExcel } from "@/api/ecw/productType"; import { createProductType, updateProductType, deleteProductType, getProductType, getProductTypePage, exportProductTypeExcel } from "@/api/ecw/productType";
export default { export default {
name: "ProductType", name: "EcwProducttypeIndex",
activated() {
this.getList();
},
components: { components: {
}, },
data() { data() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment