Explorar el Código

全部参与客户回显

chenrui hace 1 año
padre
commit
d8aa18303e

+ 9 - 0
src/api/promotion.js

@@ -205,6 +205,7 @@ export const dealerMidwayUpdate = (params) => {
     method: 'post'
   })
 }
+// 参与客户 审核通过  审核不通过
 export const dealerMidwayAudit = (params) => {
   return axios({
     url: '/promotion/dealer/midwayAudit',
@@ -212,3 +213,11 @@ export const dealerMidwayAudit = (params) => {
     method: 'post'
   })
 }
+// 获取所有经销商sn   全部客户回显
+export const allDealerSnList = (params) => {
+  return axios({
+    url: '/promotion/dealer/allDealerSnList',
+    data: params,
+    method: 'post'
+  })
+}

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

@@ -221,8 +221,8 @@ export default {
       const _this = this
       if (_this.form.dealerScope === 'SOME_DEALER') {
         if (_this.chooseDealerList && _this.chooseDealerList.length > 0) {
-          const newArr = this.chooseDealerList.map(item => {
-            return { dealerSn: item.dealerSn, dealerScope: this.form.dealerScope }
+          const newArr = _this.chooseDealerList.map(item => {
+            return { dealerSn: item.dealerSn, dealerScope: _this.form.dealerScope }
           })
           _this.form.promotionDealerList = newArr
         } else {
@@ -230,8 +230,8 @@ export default {
           return
         }
       } else {
-        this.form.dealerList = []
-        this.form.promotionDealerList = []
+        _this.form.promotionDealerList = [{ dealerScope: _this.form.dealerScope }]
+        _this.form.dealerList = []
       }
 
       this.$refs.ruleForm.validate(valid => {

+ 12 - 3
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -156,7 +156,7 @@
             <a-button
               size="small"
               type="link"
-              v-if="record.state != 'AUDIT_REJECT'"
+              v-if="record.state != 'AUDIT_REJECT' &&$hasPermissions('B_dealerPromotionCopy')"
               @click="handleCopyModal(record)"
               class="button-info"
               id="promotionList-edit-btn">复制</a-button>
@@ -169,6 +169,7 @@
         :showType="itemStatusType"
         ref="lookUpCustomers"
         :openModal="openCustomerModal"
+        :chooseDealerList="chooseDealerArr"
         @submitAudit="editCustomerOk"
         @handleAudit="auditCustomerOk"
         @close="closeCustomer"></lookUp-customers-modal>
@@ -247,7 +248,7 @@ import creatorList from '@/views/common/creatorList.vue'
 import editActiveEndTime from './editActiveEndTime.vue'
 import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, midwaySubmit, dealerMidwayAudit } from '@/api/promotion'
+import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, midwaySubmit, dealerMidwayAudit, allDealerSnList } from '@/api/promotion'
 export default {
   name: 'PromotionManagementList',
   mixins: [commonMixin],
@@ -305,7 +306,8 @@ export default {
       openAuditModal: false, // 审核弹窗,
       openCopyModal: false, // 复制弹窗
       itemPromotionSn: '',
-      itemStatusType: false
+      itemStatusType: '',
+      chooseDealerArr: [] // 所选择经销商列表
     }
   },
   methods: {
@@ -339,10 +341,16 @@ export default {
       }
       if (row.dealerScope != 'ALL_DEALER') {
         this.itemPromotionSn = row.promotionSn
+        this.chooseDealerArr = row.dealerSnList
       } else {
         this.itemPromotionSn = ''
+        this.getAllDealerSnList()
       }
     },
+    async getAllDealerSnList () {
+      const dealerSnArr = await allDealerSnList({})
+      this.chooseDealerArr = dealerSnArr.data
+    },
     //  基本信息  保存
     handleOk () {
       this.itemSn = null
@@ -511,6 +519,7 @@ export default {
     closeCustomer () {
       this.openCustomerModal = false
       this.itemPromotionSn = ''
+      this.chooseDealerArr = []
     },
     //  重置
     resetSearchForm () {

+ 10 - 6
src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue

@@ -114,13 +114,19 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 促销sn
       type: String,
       default: ''
     },
     showType: {
       type: String,
       default: ''
+    },
+    chooseDealerList: {
+      type: Array,
+      default: () => {
+        return []
+      }
     }
   },
   data () {
@@ -177,12 +183,10 @@ export default {
     editDealerModal () {
       const _this = this
       _this.openDealerModal = true
-      // const arr = _this.chooseDealerList.map(item => {
-      //   return item.dealerSn
-      // })
-      // // 选择参与客户回显
+      const arr = _this.chooseDealerList
+      // 选择参与客户回显
       _this.$nextTick(() => {
-        _this.$refs.dealerChoose.pageInit()
+        _this.$refs.dealerChoose.pageInit(arr)
       })
     },
     // 添加经销商