From 08c73d53086d37af29070035f6211cce07199bfe Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 25 九月 2023 17:53:10 +0800
Subject: [PATCH] 产品类别 弹框里的产品根据产品类别的id跳转 产品
---
src/views/productManage/product/index.vue | 9 ++++++++-
src/views/productManage/productCategory/AddProductCategoryDialog.vue | 13 +++++++++----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue
index 57820ce..f364068 100644
--- a/src/views/productManage/product/index.vue
+++ b/src/views/productManage/product/index.vue
@@ -106,11 +106,17 @@
isIconIndex: "1", // 1 鍥炬爣 2 鍒楄〃
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
pageSizes: [15, 30],
- keyWord: ""
+ keyWord: "",
+ categoryId:null,
}
},
created() {
this.setTable()
+ let query = this.$route.query;
+ if (query) {
+ this.categoryId = query.id ? Number(query.id) : null;
+ this.pagerOptions.currPage=1
+ }
this.getData()
},
methods: {
@@ -221,6 +227,7 @@
async getData() {
await getProductList({
keyWord: this.keyWord,
+ categoryId:this.categoryId?this.categoryId:null,
page: this.pagerOptions.currPage,
pageSize: this.pagerOptions.pageSize
}).then((res) => {
diff --git a/src/views/productManage/productCategory/AddProductCategoryDialog.vue b/src/views/productManage/productCategory/AddProductCategoryDialog.vue
index a0bab7a..ef39125 100644
--- a/src/views/productManage/productCategory/AddProductCategoryDialog.vue
+++ b/src/views/productManage/productCategory/AddProductCategoryDialog.vue
@@ -326,10 +326,15 @@
delClick() {},
// 浜у搧
productClick() {
- this.$router.push({
- path: "/productManage/productList",
- query: { name: "浜у搧" },
- });
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ this.$router.push({
+ path: "/productManage/product",
+ query: { categoryName:this.editConfig.infomation.name, id: this.editConfig.title === "鏂板缓"?'':this.editConfig.infomation.id},
+ });
+ }
+ })
+
},
},
};
--
Gitblit v1.8.0