haoxuan
2023-09-25 08c73d53086d37af29070035f6211cce07199bfe
产品类别 弹框里的产品根据产品类别的id跳转 产品
2个文件已修改
22 ■■■■ 已修改文件
src/views/productManage/product/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/productCategory/AddProductCategoryDialog.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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) => {
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},
          });
        }
      })
    },
  },
};