chenrui 1 rok pred
rodič
commit
2c273c529f

+ 8 - 8
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -148,7 +148,7 @@ export default {
         description: '', // 活动简称
         content: '', // 活动描述
         attachmentList: '', // 附件
-        dealerSnList: [], // 参与客户
+        promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER' // 全部客户   部分客户
       },
       openDealerModal: false,
@@ -194,7 +194,7 @@ export default {
       this.openDealerModal = true
       const _this = this
       if (_this.chooseDealerList.length == 0) {
-        _this.form.dealerSnList = []
+        _this.form.promotionDealerList = []
       }
       const arr = _this.chooseDealerList.map(item => {
         return item.dealerSn
@@ -214,7 +214,7 @@ export default {
       this.chooseDealerList = list
       this.openDealerModal = false
       // 移除表单必填项
-      this.$refs.ruleForm.clearValidate('dealerSnList')
+      this.$refs.ruleForm.clearValidate('promotionDealerList')
     },
     //  新增/编辑
     handleSave () {
@@ -222,16 +222,16 @@ export default {
       if (_this.form.dealerScope === 'SOME_DEALER') {
         if (_this.chooseDealerList && _this.chooseDealerList.length > 0) {
           const newArr = this.chooseDealerList.map(item => {
-            return item.dealerSn
+            return { dealerSn: item.dealerSn, dealerScope: this.form.dealerScope }
           })
-          _this.form.dealerSnList = newArr
+          _this.form.promotionDealerList = newArr
         } else {
           _this.$message.error('请选择参与客户')
           return
         }
       } else {
         this.form.dealerList = []
-        this.form.dealerSnList = []
+        this.form.promotionDealerList = []
       }
 
       this.$refs.ruleForm.validate(valid => {
@@ -272,7 +272,7 @@ export default {
         description: '', // 活动简称
         content: '', // 活动描述
         attachmentList: '', // 附件
-        dealerSnList: [], // 参与客户
+        promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER'
       }
       this.attachList = []
@@ -288,7 +288,7 @@ export default {
         if (res.status == 200) {
           const data = res.data
           this.chooseDealerList = data.dealerList
-          data.dealerSnList = data.dealerSnList
+          data.promotionDealerList = data.promotionDealerList
           data.activeDate = [data.promotionDateStart, data.promotionDateEnd]
           if (data.attachmentList) {
             this.attachList = data.attachmentList

+ 1 - 17
src/views/promotionRulesManagement/dealerPromotions/chooseDealer.vue

@@ -67,6 +67,7 @@ import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
 import { queryAuditPageList } from '@/api/promotion'
+import { getDealerListInfo } from '@/api/dealer'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
@@ -208,23 +209,6 @@ export default {
       this.spinning = false
       this.$emit('plAdd', dealerInfoList.data)
     },
-    handleAdd (row) {
-      if (row.subareaArea) {
-        const _this = this
-        this.$confirm({
-          title: '提示',
-          content: '当前经销商已被其他区域分区绑定,确定要更新绑定关系吗?',
-          centered: true,
-          onOk () {
-            _this.spinning = true
-            _this.$emit('add', row)
-          }
-        })
-      } else {
-        this.spinning = true
-        this.$emit('add', row)
-      }
-    },
     pageInit (data) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调