chenrui 1 rok pred
rodič
commit
f8696cd222

+ 15 - 9
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -219,10 +219,16 @@ export default {
     //  新增/编辑
     handleSave () {
       const _this = this
-      const newArr = this.chooseDealerList.map(item => {
-        return item.dealerSn
-      })
-      _this.form.dealerSnList = newArr
+      if (_this.form.dealerScope === 'SOME_DEALER' && _this.chooseDealerList && _this.chooseDealerList.length > 0) {
+        const newArr = this.chooseDealerList.map(item => {
+          return item.dealerSn
+        })
+        _this.form.dealerSnList = newArr
+      } else {
+        _this.$message.error('请选择参与客户')
+        return
+      }
+
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
@@ -295,12 +301,12 @@ export default {
     },
     // 导入参与客户
     hanldeOk (arr) {
-      const list = [...this.chooseDealerList,...arr]
-      let obj={}
-      this.chooseDealerList = list.reduce((cur,next)=>{
-        obj[next.dealerSn]?"":obj[next.dealerSn] = true && cur.push(next)
+      const list = [...this.chooseDealerList, ...arr]
+      const obj = {}
+      this.chooseDealerList = list.reduce((cur, next) => {
+        obj[next.dealerSn] ? '' : obj[next.dealerSn] = true && cur.push(next)
         return cur
-      },[])
+      }, [])
     }
   },
   watch: {

+ 2 - 1
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -19,7 +19,8 @@
           <a-descriptions-item label="促销时间" v-else>--</a-descriptions-item>
           <a-descriptions-item label="审核通过时间">{{ detailData.auditDate||'--' }}</a-descriptions-item>
           <a-descriptions-item label="费用所属部门">{{ detailData.expenseDepartmentName || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="参与客户"><div @click="handleSee">共<span class="link-bule">{{ detailData.dealerQty }}</span>个</div></a-descriptions-item>
+          <a-descriptions-item label="参与客户" v-if="detailData.dealerScope!='ALL_DEALER'"><div @click="handleSee">共<span class="link-bule">{{ detailData.dealerQty }}</span>个</div></a-descriptions-item>
+          <a-descriptions-item label="参与客户" v-else>全部客户</a-descriptions-item>
           <a-descriptions-item label="促销描述" :span="2">
             <div class="descItem">{{ detailData.content || '' }}</div>
           </a-descriptions-item>