Bladeren bron

修改bug

chenrui 8 maanden geleden
bovenliggende
commit
793bcb810d

+ 12 - 23
src/views/easyPassManagement/homepageCarouselImg/chooseDealer.vue

@@ -85,7 +85,16 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, subarea, AreaList, dealerType },
   props: {
-
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    chooseInfo: {// 已选经销商列表
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
   },
   data () {
     return {
@@ -106,7 +115,6 @@ export default {
           subareaAreaSn: undefined // 分区
         }
       },
-      chooseInfo: [], // 已选经销商列表
       selectedRowKeys: [], // 已选活动数据
       dealerList: [], // 经销商列表数据
       rowSelectionInfo: null,
@@ -151,7 +159,6 @@ export default {
     loadData () {
       this.spinning = true
       const params = { pageSize: 20, pageNo: 1, ...this.pagination }
-      this.queryParam.notDealerSn = this.itemSn ? this.itemSn : undefined
       dealerQueryList(Object.assign(params, this.queryParam)).then(res => {
         let data
         if (res.status == 200) {
@@ -188,7 +195,6 @@ export default {
     // 查询
     searchForm () {
       this.loadData()
-      this.spinning = false
     },
     // 区域分区
     subareaChange (val) {
@@ -228,27 +234,10 @@ export default {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
+      this.spinning = true
       const dealerInfoList = await getDealerListInfo({ dealerSnList: _this.selectedRowKeys })
       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)
-      }
+      this.$emit('ok', dealerInfoList.data)
     }
   },
   watch: {

+ 7 - 12
src/views/easyPassManagement/homepageCarouselImg/edit.vue

@@ -79,7 +79,7 @@
                   </a-col>
                   <a-col :md="24" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
                     <div class="buyerBox">
-                      <a-tag :closable="!isDisabled" v-for="con in chooseDealerList" id="promotionList-dealerSn" :key="con.dealerSn" @close="delBuyerName(con)">
+                      <a-tag :closable="!isDisabled" v-for="con in chooseDealerList" id="promotionList-dealerSn" :key="con.dealerSn" @close.stop="delBuyerName(con)">
                         {{ con.dealerName }}
                       </a-tag>
                     </div>
@@ -164,7 +164,7 @@
         style="padding: 0 60px;">保存</a-button>
     </div>
     <!-- 选择经销商 -->
-    <chooseDealer :openModal="openDealerModal" ref="dealerChoose" :disabledList="chooseSnList" @close="closeDealerModal" @ok="addDealerOk"></chooseDealer>
+    <chooseDealer :openModal="openDealerModal" :chooseInfo="chooseSnList" @close="closeDealerModal" @ok="addDealerOk"></chooseDealer>
   </div>
 </template>
 
@@ -228,13 +228,7 @@ export default {
   methods: {
     // 部分经销商  选择经销商成功
     addDealerOk (list) {
-      const dealerArr = list.map(item => {
-        return {
-          dealerName: item.dealerName,
-          dealerSn: item.dealerSn
-        }
-      })
-      this.chooseDealerList = dealerArr
+      this.chooseDealerList = list
       this.openDealerModal = false
     },
     // 禁用日期时间
@@ -251,7 +245,6 @@ export default {
     },
     // 打开 选择经销商弹窗
     handleDealerModal () {
-      console.log('111111111111:', this.chooseDealerList)
       this.chooseSnList = this.chooseDealerList.map(item => item.dealerSn)
       this.openDealerModal = true
     },
@@ -263,10 +256,9 @@ export default {
     // 部分经销商 删除
     delBuyerName (row) {
       const pos = this.chooseDealerList.findIndex(item => item.dealerSn == row.dealerSn)
-      if (pos > 0) {
+      if (pos >= 0) {
         this.chooseDealerList.splice(pos, 1)
       }
-      console.log('222222:', pos, this.chooseDealerList)
     },
     // 参与经销商 change
     changeDealerScope (val) {
@@ -355,6 +347,9 @@ export default {
     //  文本编辑器
     editorChange (html, text) {
       this.form.content = html
+      if (html) {
+        this.$refs.ruleForm.clearValidate('content')
+      }
     },
     // 重置
     resetSearchForm () {

+ 11 - 4
src/views/easyPassManagement/promotionalActivities/edit.vue

@@ -280,7 +280,7 @@
                         size="small"
                         @click="handleBatchAdd">批量设置</a-button>
                     </div>
-                    <a-button type="primary" id="promotionEdit-add-btn" @click="showProModal = true" size="small">选择产品</a-button>
+                    <a-button type="primary" id="promotionEdit-add-btn" @click="handleChooseProduct" size="small">选择产品</a-button>
                   </div>
                 </a-form-model-item>
               </a-col>
@@ -319,7 +319,7 @@
       @ok="addProductSuccess"
       @close="closeProductModal"></chooseProduct>
     <!-- 选择经销商 -->
-    <!-- <chooseDealer :openModal="openDealerModal" @close="closeDealerModal" @ok="addDealerOk"></chooseDealer> -->
+    <chooseDealer :openModal="openDealerModal" @close="closeDealerModal" @ok="addDealerOk"></chooseDealer>
   </div>
 </template>
 
@@ -447,6 +447,13 @@ export default {
       //   this.$refs.chooseProductList.pageInit()
       // }
     },
+    // 添加产品
+    handleChooseProduct () {
+      this.showProModal = true
+      // this.$nextTick(() => {
+      //   this.$refs.chooseProduct.resetSearchForm()
+      // })
+    },
     // 添加产品成功
     addProductSuccess (list) {
       const productArr = list.map(item => {
@@ -512,11 +519,11 @@ export default {
           _this.pageType = res.data.promoType
           _this.promotionName = res.data.promoName
         }
+
         _this.$nextTick(() => {
           _this.$refs.chooseProductList.pageInit()
+          _this.form.productNum = _this.$refs.chooseProductList.getChooseProductNum()
         })
-
-        _this.form.productNum = _this.$refs.chooseProductList.getChooseProductNum()
       }
     },
     // 券有效期 change