瀏覽代碼

修改bug

chenrui 2 年之前
父節點
當前提交
5af2c44f3e

+ 13 - 4
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -149,18 +149,27 @@ export default {
     },
     handleDealer () {
       const _this = this
+      if (_this.chooseDealerList.length == 0) {
+        _this.form.promoBuyerList = []
+      }
       const arr = _this.chooseDealerList.map(item => {
         return item.buyerSn
       })
-      _this.$nextTick(() => {
+      // 选择经销商回显
+      this.$nextTick(() => {
+        console.log('dealerChoose:', _this.$refs)
         _this.$refs.dealerChoose.pageInit(arr)
       })
     },
     // 日期  change
     dateChange (date, dateStrings) {
-      this.form.time = dateStrings
-      this.form.activeDateStart = date.length ? dateStrings[0] : ''
-      this.form.activeDateEnd = date.length ? dateStrings[1] : ''
+      if (dateStrings && dateStrings[0]) {
+        this.form.time = dateStrings
+        this.form.activeDateStart = date.length ? dateStrings[0] : ''
+        this.form.activeDateEnd = date.length ? dateStrings[1] : ''
+      } else {
+        this.form.time = []
+      }
     },
     // 添加经销商
     handleAddDealer (list) {

+ 14 - 8
src/views/promotionRulesManagement/promotionManagement/editModal.vue

@@ -22,9 +22,9 @@
           <a-form-model-item label="标题名称" prop="title">
             <a-input
               id="promotionEdit-title"
-              :maxLength="100"
+              :maxLength="30"
               v-model.trim="form.title"
-              placeholder="请输入标题名称(最多100个字符)"
+              placeholder="请输入标题名称(最多30个字符)"
               :disabled="pageType === 'edit'"
               allowClear/>
           </a-form-model-item>
@@ -87,7 +87,7 @@
               id="promotionEdit-imageSet"
               v-model="form.content"
               fileType="video/mp4"
-              ref="imageSet"
+              ref="videoSet"
               :fileSize="1024"
               :maxNums="1"
               @change="changeVideo"
@@ -186,7 +186,7 @@ export default {
         title: '',
         contentType: 'IMAGE_CONTENT',
         imageSet: '',
-        showFlag: undefined,
+        showFlag: '0',
         content: '',
         enabledFlag: '0',
         sort: undefined
@@ -259,19 +259,22 @@ export default {
         if (valid) {
           _this.form.promoActiveSn = this.itemId
           const formData = JSON.parse(JSON.stringify(_this.form))
-          formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
+          if (this.pageType === 'add') {
+            formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
+          }
           _this.spinning = true
           saveActive(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$emit('ok')
-              _this.isShow = false
               _this.spinning = false
+              _this.isShow = false
+              _this.$emit('ok')
             } else {
               _this.spinning = false
             }
           })
         } else {
+          console.log('error')
           return false
         }
       })
@@ -300,6 +303,9 @@ export default {
         this.$emit('close')
         if (this.pageType == 'add') {
           this.$refs.imageSet.setFileList('')
+          this.$refs.videoSet.setFileList('')
+        }
+        if (this.form.content) {
           this.$refs.editor.setHtml('')
         }
         this.form = {
@@ -307,7 +313,7 @@ export default {
           title: '',
           contentType: 'IMAGE_CONTENT',
           imageSet: '',
-          showFlag: undefined,
+          showFlag: '0',
           content: '',
           enabledFlag: '0',
           sort: undefined

+ 7 - 1
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -91,7 +91,13 @@
         </template>
         <!-- 促销描述 -->
         <template slot="salesDesc" slot-scope="text, record">
-          <span @click="promotionDesc(record)" class="font1">{{ record.description }}</span>
+          <a-tooltip placement="rightBottom" v-if="record.description&&record.description.length>14">
+            <template slot="title">
+              <span>{{ record.description }}</span>
+            </template>
+            <span @click="promotionDesc(record)" class="font1">{{ record.description }}</span>
+          </a-tooltip>
+          <span v-else @click="promotionDesc(record)" class="font1">{{ record.description }}</span>
         </template>
         <!-- 促销展示 -->
         <template slot="salesShow" slot-scope="text, record">