瀏覽代碼

修改bug

chenrui 2 年之前
父節點
當前提交
d9f4a2501b

+ 3 - 1
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -169,10 +169,11 @@ export default {
     },
     // 添加经销商
     handleAddDealer (list) {
+      console.log('2222222222222222222222222222:', list)
       this.chooseDealerList = list.map(con => {
         return {
           buyerSn: con.dealerSn,
-          buyerName:con.dealerName
+          buyerName: con.dealerName
         }
       })
       const newArr = list.map(item => {
@@ -182,6 +183,7 @@ export default {
       })
       this.form.promoBuyerList = newArr
       this.openDealerModal = false
+      // 移除表单必填项
       this.$refs.ruleForm.clearValidate('promoBuyerList')
     },
     // 获取编辑详情

+ 1 - 2
src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue

@@ -145,7 +145,6 @@ export default {
                 }
               }
             }
-            console.log('22222222222222222222222222222222222:', chooseData)
             if (!this.pageFlag) {
               this.pageFlag = true
               _this.$refs.table.setTableSelected(_this.chooseInfo, chooseData) // 设置表格选中项
@@ -184,7 +183,6 @@ export default {
   methods: {
     // 表格选中项
     rowSelectionFun (obj) {
-      console.log('111111111111111111111111111:', obj)
       this.rowSelectionInfo = obj || null
     },
     areaChange (val) {
@@ -235,6 +233,7 @@ export default {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
+      console.log('111111111111111111111111:', _this.rowSelectionInfo)
       const dealerSnList = _this.rowSelectionInfo.selectedRows
       // const newDealerSnList = dealerSnList.map(con => {
       //   const obj = {

+ 17 - 5
src/views/promotionRulesManagement/promotionManagement/editModal.vue

@@ -127,12 +127,12 @@
             </div>
             <span class="upload-desc">说明:文件最大100M;视频:mp4.avi.flv</span>
           </a-form-model-item>
-          <a-form-model-item label="跳转链接" prop="content" v-show="form.contentType =='LINK'">
+          <a-form-model-item label="跳转链接" prop="contentLink" v-if="form.contentType =='LINK'">
             <a-input
               :disabled="isDisabled"
               id="promotionEdit-title"
               :maxLength="100"
-              v-model.trim="form.content"
+              v-model.trim="form.contentLink"
               placeholder="请输入跳转链接"
               allowClear />
           </a-form-model-item>
@@ -217,7 +217,8 @@ export default {
         showFlag: '0',
         content: '',
         enabledFlag: '0',
-        sort: undefined
+        sort: undefined,
+        contentLink: ''
       },
       images: [],
       openShowModal: false,
@@ -238,6 +239,9 @@ export default {
         content: [
           { required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }
         ],
+        contentLink: [
+          { required: true, message: '请输入对应内容', trigger: 'blur' }
+        ],
         enabledFlag: [
           { required: true, message: '请选择是否发布', trigger: 'change' }
         ],
@@ -271,13 +275,15 @@ export default {
           this.images = res.data.imageSet
           this.form.imageSet = res.data.images
           this.$refs.imageSet.setFileList(res.data.images)
-          this.form.content = res.data.content
           if (res.data.contentType == 'IMAGE_CONTENT') {
             this.$refs.editor.setHtml(res.data.content)
           } else if (res.data.contentType == 'VIDEO') {
-            if (res.data.state === 'CLOSE') {
+            this.form.content = res.data.content
+            if (res.data.state != 'PUBLISH') {
               this.$refs.videoSet.setFileList(res.data.content)
             }
+          } else if (res.data.contentType == 'LINK') {
+            this.form.contentLink = res.data.content
           }
         }
       })
@@ -285,12 +291,18 @@ export default {
     //  确定
     handleSave () {
       const _this = this
+      if (_this.form.contentType == 'LINK') {
+        _this.form.content = _this.form.contentLink
+      }
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
           _this.form.promoActiveSn = this.itemId
           const formData = JSON.parse(JSON.stringify(_this.form))
           formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
           formData.showFlag = formData.enabledFlag == 0 ? '0' : formData.showFlag
+          if (formData.contentType == 'LINK') {
+            delete formData.contentLink
+          }
           _this.spinning = true
           saveActive(formData).then(res => {
             if (res.status == 200) {