Parcourir la source

Merge branch 'develop_yh39' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh39

chenrui il y a 1 an
Parent
commit
e417c64d0a

+ 21 - 3
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>
@@ -69,7 +69,7 @@ export default {
         return (
           data.sort((a, b) => b.rebateParentType.localeCompare(a.rebateParentType)).map(item => {
             return (
-              <a-tag style="margin:5px;" color={colors[item.rebateParentType]}>{item.parentDealer.dealerName}{Number(item.allotRate * 100).toFixed(2) + '%'}</a-tag>
+              <a-tag style="margin:5px;" color={colors[item.rebateParentType]}>{item.parentDealer.dealerName}({Number(item.allotRate * 100).toFixed(2) + '%'})</a-tag>
             )
           })
         )
@@ -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

+ 16 - 8
src/views/dealerManagement/rebateBinding/list.vue

@@ -13,6 +13,7 @@
         <div ref="tableSearch" class="table-page-search-wrapper">
           <a-form-model
             id="rebateBinding-form"
+            v-show="!isTeyue"
             ref="ruleForm"
             class="form-model-con"
             layout="inline"
@@ -29,7 +30,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 +39,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>
@@ -109,18 +110,25 @@ export default {
       this.$router.push({ name: 'merchantInfoManagementList', query: { closeLastOldTab: true } })
     },
     loadList (list) {
+      console.log(list.length == 0)
       this.showBtns = this.isTeyue ? list.length == 0 : true
     },
     // 查询
     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 () {
@@ -170,7 +178,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - (!this.showBtns ? 140 : 205)
+      this.tableHeight = window.innerHeight - tableSearchH - (!this.showBtns ? 50 : 205)
     }
   },
   watch: {

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

@@ -26,7 +26,7 @@
             <a-row :gutter="10">
               <a-col :span="17">
                 <custList
-                  v-if="!form.dealerUpsSn"
+                  v-if="!form.dealerUpsSn || isSpecial"
                   ref="custList"
                   :notDealerSn="notZdDealer"
                   :notDealerType="['special']"
@@ -129,6 +129,7 @@ export default {
       },
       form: {
         dealerSn: undefined,
+        dealerUpsSn: undefined,
         rebateParentType: [], // 差价归属
         rebateDealerList: [], // 经销商列表
         rebateScopeList: [] // 品类列表
@@ -142,7 +143,8 @@ export default {
       zdDealearList: [],
       detailData: null,
       superDealerName: '',
-      checkedDealerSn: []
+      checkedDealerSn: [],
+      showTable: false
     }
   },
   computed: {
@@ -150,10 +152,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 +228,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) {
@@ -320,7 +323,7 @@ export default {
     },
     // 重置表单
     resetForm () {
-      if (!this.isSpecial && !this.form.dealerUpsSn) {
+      if (this.isSpecial || !this.form.dealerUpsSn) {
         this.$refs.custList.resetForm()
       }
       this.form.dealerSn = undefined
@@ -382,7 +385,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('请选择品类')