lilei 1 rok pred
rodič
commit
07fc4f50c1

+ 20 - 2
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -14,7 +14,7 @@
         row-key-field-name="id"
         :cell-span-option="cellSpanOption"
       />
-      <div v-show="showEmpty" class="empty-data"><a-empty description="暂无品类" :image="simpleImage"/></div>
+      <div v-show="showEmpty" class="empty-data" :style="{height:maxHeight+'px'}"><a-empty description="暂无数据" :image="simpleImage"/></div>
     </a-spin>
 
   </div>
@@ -139,10 +139,28 @@ export default {
       let ret = []
       let no = 0
       listData.map((item, i) => {
-        const sub = item.rebateScopeList || [{ productBrandName: null, productTypeName1: null, productTypeName2: null, productTypeName3: null }]
+        let sub = item.rebateScopeList || [{ productBrandName: null, productTypeName1: null, productTypeName2: null, productTypeName3: null }]
         const sup = item.rebateDealerList.find(b => b.rebateParentType == 'SUPERIORS')
         this.checkedDealerSn.push(sup)
         const rebateDealerList = item.rebateDealerList
+        // 筛选条件
+        sub = sub.filter(s => {
+          let cs = true
+          let bs = true
+          const plen = Object.keys(queryParam).length
+          const xi = queryParam.productBrandSn ? 3 : 2
+          bs = queryParam.productBrandSn ? s.productBrandSn == queryParam.productBrandSn : true
+          if (plen == xi) {
+            cs = queryParam.productTypeSn1 == s.productTypeSn1
+          } else if (plen == xi + 1) {
+            cs = queryParam.productTypeSn1 == s.productTypeSn1 && queryParam.productTypeSn2 == s.productTypeSn2
+          } else if (plen == xi + 2) {
+            cs = queryParam.productTypeSn1 == s.productTypeSn1 && queryParam.productTypeSn2 == s.productTypeSn2 && queryParam.productTypeSn3 == s.productTypeSn3
+          }
+          console.log(queryParam, bs, cs, xi, plen)
+          return queryParam.productBrandSn ? bs && cs : cs
+        })
+        // 组织展开数据
         sub.map((a, j) => {
           if (j == 0) {
             a.rowspan = sub.length

+ 13 - 7
src/views/dealerManagement/rebateBinding/list.vue

@@ -29,7 +29,7 @@
                   <ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24" v-if="!isTeyue">
+              <!-- <a-col :md="6" :sm="24" v-if="!isTeyue">
                 <a-form-model-item label="价格级别">
                   <v-select code="PRICE_LEVEL" :notIn="['SPECIAL']" v-model="queryParam.priceLevel" allowClear placeholder="请选择价格级别"></v-select>
                 </a-form-model-item>
@@ -38,8 +38,8 @@
                 <a-form-model-item label="经销商">
                   <a-input v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
                 </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
+              </a-col> -->
+              <a-col :md="6" :sm="24" v-show="false">
                 <a-form-model-item label="差价归属方">
                   <v-select code="REBATE_PARENT_TYPE" ref="rpType" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属方"></v-select>
                 </a-form-model-item>
@@ -114,13 +114,19 @@ export default {
     // 查询
     handleSearch () {
       this.queryParam.dealerSn = this.$route.params.sn
-      this.$refs.categoryList.pageInit(this.queryParam)
+      const params = {}
+      for (const k in this.queryParam) {
+        if (this.queryParam[k]) {
+          params[k] = this.queryParam[k]
+        }
+      }
+      this.$refs.categoryList.pageInit(params)
     },
     //  产品分类  change
     changeProductType (val, opt) {
-      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
-      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : undefined
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : undefined
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : undefined
     },
     // 重置表单
     resetSearchForm () {

+ 9 - 7
src/views/dealerManagement/rebateBinding/priceDiffModal.vue

@@ -142,7 +142,8 @@ export default {
       zdDealearList: [],
       detailData: null,
       superDealerName: '',
-      checkedDealerSn: []
+      checkedDealerSn: [],
+      showTable: false
     }
   },
   computed: {
@@ -150,10 +151,8 @@ export default {
       return this.detailData && this.detailData.dealerLevel == 'SPECIAL'
     },
     notZdDealer () {
-      return this.form.rebateDealerList.concat(this.zdDealearList).concat([{ 'parentDealerSn': this.form.dealerSn }, ...this.checkedDealerSn])
-    },
-    showTable () {
-      return this.form.rebateParentType.indexOf('SUPERIORS') >= 0
+      // ...this.checkedDealerSn
+      return this.form.rebateDealerList.concat(this.zdDealearList).concat([{ 'parentDealerSn': this.form.dealerSn }])
     }
   },
   methods: {
@@ -228,8 +227,11 @@ export default {
     custSupChange (val, row) {
       console.log(val, row)
       this.form.rebateDealerList[0]['parentDealerSn'] = val.key
+      this.showTable = !!val.key
       if (!this.isSpecial) {
-        this.getCategoryList()
+        this.$nextTick(() => {
+          this.getCategoryList()
+        })
       }
     },
     rateSupChange (val) {
@@ -382,7 +384,7 @@ export default {
               return
             }
 
-            if (this.showTable && !this.isSpecial && !this.form.dealerUpsSn) {
+            if (!this.isSpecial && !this.form.dealerUpsSn) {
               formData.rebateScopeList = this.$refs.categoryTree.getResult()
               if (formData.rebateScopeList.length == 0) {
                 _this.$message.error('请选择品类')