浏览代码

修改bug

chenrui 9 月之前
父节点
当前提交
859b492746
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      src/views/numsGoodsShelves/easyPassShopping/index.vue

+ 10 - 3
src/views/numsGoodsShelves/easyPassShopping/index.vue

@@ -53,6 +53,7 @@
                   :fieldNames="fieldNames"
                   :options="categoryOptions"
                   placeholder="请选择商城类目"
+                  @change="changeCategory"
                   allowClear
                   v-model="category" />
               </a-form-item>
@@ -133,7 +134,8 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         status: undefined, //  状态
-        categorySn: undefined, // 产品类目
+        categorySn1: undefined, // 产品一级类目
+        categorySn2: undefined, // 产品二级类目
         orderBy: 'createDate'
       },
       productType: [], // 产品分类
@@ -161,7 +163,6 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        this.queryParam.categorySn = (this.category && this.category.length > 1) ? this.category[1] : this.category[0]
         return shopProductList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -186,6 +187,11 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 商城类目
+    changeCategory (val, opt) {
+      this.queryParam.categorySn1 = val[0] ? val[0] : ''
+      this.queryParam.categorySn2 = val[1] ? val[1] : ''
+    },
     // 获取产品类目列表
     getCategoryList () {
       const _this = this
@@ -206,7 +212,8 @@ export default {
       this.queryParam.productTypeSn2 = undefined
       this.queryParam.productTypeSn3 = undefined
       this.queryParam.status = undefined
-      this.queryParam.categorySn = undefined
+      this.queryParam.categorySn1 = undefined
+      this.queryParam.categorySn2 = undefined
       this.productType = []
       this.category = []
       this.$refs.table.refresh(true)