lilei 1 tahun lalu
induk
melakukan
20f4007149

+ 3 - 1
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -56,7 +56,8 @@ export default {
       cellSpanOption: {
         bodyCellSpan: this.bodyCellSpan
       },
-      showEmpty: true
+      showEmpty: true,
+      checkedDealerSn: []
     }
   },
   computed: {
@@ -140,6 +141,7 @@ export default {
       listData.map((item, i) => {
         const 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.map((a, j) => {
           if (j == 0) {

+ 2 - 1
src/views/dealerManagement/rebateBinding/list.vue

@@ -138,7 +138,8 @@ export default {
     // 打开关联弹框
     openGlModal () {
       this.openModal = true
-      this.$refs.priceDiffModal.setData(this.$refs.rpType.getOptionDatas(), this.$route.params.sn, this.detail)
+      const checkedDealerSn = this.$refs.categoryList.checkedDealerSn
+      this.$refs.priceDiffModal.setData(this.$refs.rpType.getOptionDatas(), this.$route.params.sn, this.detail, checkedDealerSn)
     },
     // 编辑
     handleEdit (row) {

+ 8 - 6
src/views/dealerManagement/rebateBinding/priceDiffModal.vue

@@ -141,7 +141,8 @@ export default {
       cjgsfList: [],
       zdDealearList: [],
       detailData: null,
-      superDealerName: ''
+      superDealerName: '',
+      checkedDealerSn: []
     }
   },
   computed: {
@@ -149,7 +150,7 @@ export default {
       return this.detailData && this.detailData.dealerLevel == 'SPECIAL'
     },
     notZdDealer () {
-      return this.form.rebateDealerList.concat(this.zdDealearList).concat([{ 'parentDealerSn': this.form.dealerSn }])
+      return this.form.rebateDealerList.concat(this.zdDealearList).concat([{ 'parentDealerSn': this.form.dealerSn }, ...this.checkedDealerSn])
     },
     showTable () {
       return this.form.rebateParentType.indexOf('SUPERIORS') >= 0
@@ -157,10 +158,11 @@ export default {
   },
   methods: {
     // 新增
-    setData (list, dealerSn, detail) {
+    setData (list, dealerSn, detail, checkedDealerSn) {
       this.detailData = detail
       this.form.dealerSn = dealerSn
       this.cjgsfList = list
+      this.checkedDealerSn = checkedDealerSn
       // 如果当前经销商是特约经销商
       if (this.detailData.dealerLevel == 'SPECIAL') {
         // 默认只有上级经销商
@@ -318,6 +320,9 @@ export default {
     },
     // 重置表单
     resetForm () {
+      if (!this.isSpecial && !this.form.dealerUpsSn) {
+        this.$refs.custList.resetForm()
+      }
       this.form.dealerSn = undefined
       this.form.dealerUpsSn = undefined
       this.form.rebateParentType = []
@@ -326,9 +331,6 @@ export default {
       this.zdDealearList = []
       this.hAllotRate = ''
       this.parentAllotRate = 100
-      if (this.showTable && !this.isSpecial && !this.form.dealerUpsSn) {
-        this.$refs.custList.resetForm()
-      }
     },
     // 校验数据
     validateFormData (data) {