소스 검색

修改bug

chenrui 10 달 전
부모
커밋
7c6a88c029

+ 20 - 7
src/views/promotionRulesManagement/promotionManagement/detailModal.vue

@@ -30,7 +30,7 @@
               width="80"
               height="80"
               v-for="(con,i) in imageSet"
-              style="margin-right:10px;"
+              style="margin-right:10px;object-fit: cover;"
               :key="i"/>
             <div class="upload-desc">说明:单张大小小于10Mb,最多10张;建议尺寸:宽(420px)*高(230px)</div>
           </a-form-model-item>
@@ -238,7 +238,7 @@ export default {
   methods: {
     // 重置
     resetSearchForm () {
-      this.form = {
+      this.form =  {
         promoActiveSn: undefined, // 促销活动sn
         title: '', // 标题
         imageSet: '', // 图片
@@ -249,7 +249,20 @@ export default {
         ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
         publishFlag: '0',
         dealerEditFlag: '0', // 加盟商编辑 1是 0否
-        promoRule: {}
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          productRangeFlag: '', // 产品范围标记 0无  1有产品范围
+          productRangeList: [], // 产品范围列表
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          range: '1'
+        }
       }
       this.imageSet = []
     },
@@ -262,14 +275,14 @@ export default {
             this.$nextTick(() => {
               this.getTreeData()
             })
-            if (res.data.images) {
-              this.form.imageSet = res.data.images
-              this.imageSet = res.data.images.split(',')
-            }
             if (res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.productRangeList.length > 0) {
               this.form.promoRule.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
             }
           }
+          if (res.data.imageSet) {
+            this.form.imageSet = res.data.imageSet.join(',')
+            this.imageSet = res.data.imageSet
+          }
           this.form = res.data
         }
       })

+ 77 - 89
src/views/promotionRulesManagement/promotionManagement/edit.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="promotionEdit-wrap" :style="{paddingBottom: (form.contentType ==='LINK'&&form.linkType==='1')?'10px':'51px'}">
+  <div class="promotionEdit-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="promotionEdit-cont" >
         <!-- 自定义的二级文字标题 -->
@@ -62,7 +62,7 @@
                     width="80"
                     height="80"
                     v-for="(con,i) in imageSet"
-                    style="margin-right:10px;"
+                    style="margin-right:10px;object-fit: cover;"
                     :key="i" />
                 </div>
                 <span class="upload-desc">说明:单张大小小于10Mb,最多10张;建议尺寸:宽(420px)*高(230px)</span>
@@ -146,6 +146,20 @@
               </a-form-model-item>
             </a-col>
           </a-row>
+          <a-row v-if="form.contentType !='LINK' ||(form.contentType ==='LINK'&&form.linkType==='2') ">
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="是否发布" prop="publishFlag">
+                <a-radio-group button-style="solid" v-model="form.publishFlag">
+                  <a-radio-button value="1">
+                    是
+                  </a-radio-button>
+                  <a-radio-button value="0">
+                    否
+                  </a-radio-button>
+                </a-radio-group>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
         </a-form-model>
         <a-form-model
           id="setPromotion-form"
@@ -234,7 +248,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-              <a-form-model-item class="productName" label="券适用范围" prop="range">
+              <a-form-model-item class="productName" label="券适用范围" prop="ruleName">
                 全部产品
               </a-form-model-item>
             </a-col>
@@ -268,7 +282,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-              <a-form-model-item label="返券产品">
+              <a-form-model-item label="返券产品" prop="ruleName">
                 <div class="productInfo flex-center">
                   <div>
                     返券金额<a-input-number
@@ -298,7 +312,7 @@
               :lg="24"
               :xl="24">
               <a-form-model-item label="加盟商编辑" prop="dealerEditFlag">
-                <a-radio-group button-style="solid" :disabled="isDisabled" v-model="form.dealerEditFlag">
+                <a-radio-group button-style="solid" :disabled="isDisabled" v-model="sellForm.dealerEditFlag">
                   <a-radio-button value="1">
                   </a-radio-button>
@@ -310,7 +324,7 @@
             </a-col>
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <a-form-model-item label="是否发布" prop="publishFlag">
-                <a-radio-group button-style="solid" v-model="form.publishFlag">
+                <a-radio-group button-style="solid" v-model="sellForm.publishFlag">
                   <a-radio-button value="1">
                   </a-radio-button>
@@ -321,21 +335,6 @@
               </a-form-model-item>
             </a-col>
           </a-row>
-          <a-row v-if="form.contentType !='LINK' ||(form.contentType ==='LINK'&&form.linkType==='2') ">
-            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-              <a-form-model-item label="是否发布" prop="publishFlag">
-                <a-radio-group button-style="solid" v-model="form.publishFlag">
-                  <a-radio-button value="1">
-                    是
-                  </a-radio-button>
-                  <a-radio-button value="0">
-                    否
-                  </a-radio-button>
-                </a-radio-group>
-              </a-form-model-item>
-            </a-col>
-          </a-row>
-        </a-form-model>
         </a-form-model>
       </a-card>
     </a-spin>
@@ -350,8 +349,6 @@
         v-if="form.contentType !='LINK'|| isShowNextStep ||(form.contentType ==='LINK'&&form.linkType ==='2')"
         style="padding: 0 60px;">保存</a-button>
     </div>
-    <!-- 预览 -->
-    <promotion-show-modal ref="showModal" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
     <!-- 添加产品 -->
     <chooseProduct
       ref="chooseProduct"
@@ -365,13 +362,15 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+// 组件
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
-import { promoActivePublish, promoActiveDetail, saveBatchEntity, promoCreateBatch, deleteByProductType } from '@/api/promoActive'
 import promotionShowModal from './promotionShowModal'
 import productTable from './productTable'
 import chooseProduct from './chooseProductsModal.vue'
+// 接口
 import { productTypeQuery } from '@/api/productType'
+import { promoActivePublish, promoActiveDetail, saveBatchEntity, promoCreateBatch, deleteByProductType } from '@/api/promoActive'
 export default {
   name: 'ProductBrandEditModal',
   mixins: [commonMixin],
@@ -379,10 +378,12 @@ export default {
   data () {
     return {
       spinning: false,
+      // 第一个表单 label 设置
       formItemLayout: {
         labelCol: { span: 2 },
         wrapperCol: { span: 20 }
       },
+      // 第二个表单 label 设置
       sellFormItemLayout: {
         labelCol: { span: 2 }, // 文字前距离设置
         wrapperCol: { span: 20 }// 表单后距离设置  数字越大距离越小
@@ -393,18 +394,16 @@ export default {
         imageSet: '', // 图片
         contentType: 'IMAGE_CONTENT', // 内容类型
         content: '', // 内容
+        ruleEnableFlag: '1', // 参属配置  1 是  0否
         contentLink: '', // 链接内容
         sort: undefined, // 排序
-        ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
-        publishFlag: '0',
+        publishFlag: '0', // 是否发布
         dealerEditFlag: '0', // 加盟商编辑 1是 0否
-        promoRule: {},
-        publishState: 'UNPUBLISH'
+        promoRule: {} // 链接配置内容
       },
       // 参数配置数据
       sellForm: {
         ruleType: 'ticket', // 基本规则类型
-        productRangeFlag: '', // 产品范围标记 0无  1有产品范围
         productRangeList: [], // 产品范围列表
         ruleName: '', // 券名称
         ruleTitle: '', // 副标题
@@ -414,55 +413,35 @@ export default {
         validStartDate: undefined, // 券生效时间
         validEndDate: undefined, // 券失效时间
         validDays: undefined, // 券有效期天数
-        range: '1',
-        // 券内容
-        ruleDetailList: []
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        publishFlag: '0' // 是否发布
       },
       time: [], // 有效期
-      promotionName: '',
-      dateFormat: 'YYYY-MM-DD',
+      dateFormat: 'YYYY-MM-DD', // 有效期时间格式
+      promotionName: '', // 促销名称
       pageType: undefined, // 页面类型
-      showProModal: false,
-      isShowNextStep: false, // 是否显示下一步 配置产品
-      openShowModal: false,
-      isDisabled: false, // 控制是否能编辑
-      chooseTypeList: [],
-      chooseProductList: [],
+      showProModal: false, // 打开产品弹窗
+      isShowNextStep: false, // 是否显示下一步 并提交一半配置产品
+      isDisabled: false, // 控制页面是否能编辑
+      chooseTypeList: [], // 已选中产品范围
       imageSet: [], // 回显显示图片数据
-      productTypeList: [],
+      productTypeList: [], // 产品范围    列表数据
       rules: {
-        title: [
-          { required: true, message: '请输入标题名称', trigger: 'blur' }
-        ],
-        imageSet: [
-          { required: true, message: '请选择要上传的封面图片', trigger: 'change' }
-        ],
-        sort: [
-          { required: true, message: '请输入排序数字', trigger: 'blur' }
-        ],
-        contentType: [
-          { required: true, message: '请选择内容类型', trigger: 'change' }
-        ],
-        content: [
-          { required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }
-        ],
-        contentLink: [
-          { required: true, message: '请输入对应内容', trigger: 'blur' }
-        ],
-        publishFlag: [
-          { required: true, message: '请选择是否发布', trigger: 'change' }
-        ],
-        range: [
-          { required: true, message: '请选择券适用范围', trigger: 'change' }
-        ]
+        title: [{ required: true, message: '请输入标题名称', trigger: 'blur' }],
+        imageSet: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
+        contentLink: [{ required: true, message: '请输入对应内容', trigger: 'blur' }],
+        publishFlag: [{ required: true, message: '请选择是否发布', trigger: 'change' }]
       },
       sellRules: {
         ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
         ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
         ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
         validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
-        ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }]
-        // dealerEditFlag: [{ required: true, message: '请选择加盟商是否可编辑', trigger: 'change' }]
+        publishFlag: [{ required: true, message: '请选择是否发布', trigger: 'change' }],
+        dealerEditFlag: [{ required: true, message: '请选择加盟商是否可编辑', trigger: 'change' }]
       }
     }
   },
@@ -503,8 +482,11 @@ export default {
           // 编辑按钮时,publishState 已发布,只能编辑是否发布;publishState已关闭,都可以编辑
           if (_this.pageType === 'edit') {
             _this.isDisabled = res.data.publishState === 'PUBLISH'
-            _this.form.publishFlag = res.data.publishFlag
+            _this.sellForm.publishFlag = res.data.publishFlag
+            _this.sellForm.dealerEditFlag = res.data.dealerEditFlag
           }
+          _this.form.publishFlag = res.data.publishFlag
+          _this.form.dealerEditFlag = res.data.dealerEditFlag
           _this.form.promoActiveSn = res.data.promoActiveSn
           _this.form.title = res.data.title
           _this.form.contentType = res.data.contentType
@@ -513,7 +495,7 @@ export default {
           if (res.data.imageSet) {
             const images = res.data.imageSet.join(',')
             _this.form.imageSet = images
-            if (this.pageType === 'add') {
+            if (this.pageType === 'add' || (this.pageType === 'edit' && res.data.publishState != 'PUBLISH')) {
               _this.$refs.imageSet.setFileList(images)
             }
           }
@@ -603,16 +585,18 @@ export default {
         if (this.form.linkType === '1') {
           if (this.sellForm.validType === 'FIXED') {
             if (!this.sellForm.validStartDate || this.sellForm.validStartDate.validEndDate) {
-              this.$message.warning('请选择固定日期!')
+              this.$message.warning('请输入券有效期!')
               return false
             }
           } else {
             if (!this.sellForm.validDays) {
-              this.$message.warning('请输入有效天数!')
+              this.$message.warning('请输入券有效期!')
               return false
             }
           }
         }
+        formData.dealerEditFlag = this.sellForm.dealerEditFlag
+        formData.publishFlag = this.sellForm.publishFlag
       }
       _this.spinning = true
       promoActivePublish(formData).then(res => {
@@ -666,25 +650,25 @@ export default {
         content: '', // 内容
         contentLink: '', // 链接内容
         sort: undefined, // 排序
-        ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
-        publishState: 'UNPUBLISH', // 是否发布
+        publishFlag: '0', // 是否发布
         dealerEditFlag: '0', // 加盟商编辑 1是 0否
-        // 参数配置数据
-        promoRule: {
-          ruleType: 'ticket', // 基本规则类型
-          productRangeFlag: '', // 产品范围标记 0无  1有产品范围
-          productRangeList: [], // 产品范围列表
-          ruleName: '', // 券名称
-          ruleTitle: '', // 副标题
-          ruleBaseType: 'category', // 券生成方式
-          ruleExplain: '', // 使用说明
-          validType: undefined, // 券有效期类型
-          validStartDate: undefined, // 券生效时间
-          validEndDate: undefined, // 券失效时间
-          validDays: undefined, // 券有效期天数
-          // 券内容
-          ruleDetailList: []
-        }
+        ruleEnableFlag: '1',
+        promoRule: {} // 链接配置内容
+      }
+      // 参数配置数据
+      this.sellForm = {
+        ruleType: 'ticket', // 基本规则类型
+        productRangeList: [], // 产品范围列表
+        ruleName: '', // 券名称
+        ruleTitle: '', // 副标题
+        ruleBaseType: 'category', // 券生成方式
+        ruleExplain: '', // 使用说明
+        validType: undefined, // 券有效期类型
+        validStartDate: undefined, // 券生效时间
+        validEndDate: undefined, // 券失效时间
+        validDays: undefined, // 券有效期天数
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        publishFlag: '0' // 是否发布
       }
       this.isShowNextStep = false
       this.isDisabled = false
@@ -694,6 +678,9 @@ export default {
       if (this.$refs.ruleForm) {
         this.$refs.ruleForm.resetFields()
       }
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields()
+      }
     },
     // 获取产品范围数据
     getTreeData () {
@@ -816,6 +803,7 @@ export default {
     position: relative;
     height: 100%;
     box-sizing: border-box;
+    padding-bottom:51px;
     >.ant-spin-nested-loading{
       overflow-y: scroll;
       height: 100%;

+ 12 - 8
src/views/promotionRulesManagement/promotionManagement/productTable.vue

@@ -44,7 +44,6 @@
             size="small"
             type="link"
             class="button-error"
-            :disabled="disabledVal"
             :id="'productTable-del-btn'+record.id "
             @click="handleDel(record)"
           >删除</a-button>
@@ -62,10 +61,6 @@ export default {
   mixins: [commonMixin],
   components: { STable },
   props: {
-    disabledVal: {
-      type: Boolean,
-      default: false
-    },
     promoActiveSn: {
       type: String,
       default: ''
@@ -77,7 +72,7 @@ export default {
       rowSelectionInfo: null,
       queryParam: {},
       columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -99,7 +94,11 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-              data.list[i].price = data.list[i].terminalPrice
+              if (!data.list[i].price) {
+                data.list[i].price = data.list[i].terminalPrice
+              } else {
+                data.list[i].price = data.list[i].price
+              }
             }
             this.disabled = false
           }
@@ -120,7 +119,8 @@ export default {
       if (typeName != 'all') {
         ajaxData.push({
           id: row.id,
-          ruleValue: typeName === 'ruleValue' ? row.ruleValue : row.price
+          price: typeName === 'price' ? row.price : undefined,
+          ruleValue: typeName === 'ruleValue' ? row.ruleValue : undefined
         })
       } else {
         ajaxData = row || []
@@ -182,4 +182,8 @@ export default {
 </script>
 
 <style>
+ /* form input[type='radio'], form input[type='checkbox'] {
+      width: 15px;
+      height: 14px;
+  } */
 </style>

+ 0 - 501
src/views/promotionRulesManagement/promotionManagement/setPromotion.vue

@@ -1,501 +0,0 @@
-<template>
-  <a-spin :spinning="spinning" tip="Loading...">
-    <a-form-model
-      id="setPromotion-form"
-      ref="sellRuleForm"
-      :model="sellForm"
-      :rules="sellRules"
-      class="setPromotion-form"
-      :label-col="sellFormItemLayout.labelCol"
-      :wrapper-col="sellFormItemLayout.wrapperCol">
-      <a-row>
-        <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <a-form-model-item label="基本规则" prop="ruleType">
-            <v-select
-              v-model="sellForm.ruleType"
-              placeholder="请选择基本规则"
-              id="setPromotion-ruleType"
-              code="PROMO_ACTIVE_RULE_TYPE"
-              :disabled="disabledVal"
-              allowClear></v-select>
-          </a-form-model-item>
-        </a-col>
-        <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-          <a-form-model-item label="券名称" :label-col="{span:4}" :wrapper-col="{span:16}" prop="ruleName">
-            <a-input
-              :disabled="disabledVal"
-              id="setPromotion-ruleName"
-              :maxLength="20"
-              v-model.trim="sellForm.ruleName"
-              placeholder="请输入券名称(最多20个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-        <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-          <a-form-model-item label="券副标题" :label-col="{span:4}" :wrapper-col="{span:16}">
-            <a-input
-              :disabled="disabledVal"
-              id="setPromotion-ruleTitle"
-              :maxLength="20"
-              v-model.trim="sellForm.ruleTitle"
-              placeholder="请输入券副标题(最多20个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-        <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <a-form-model-item label="产品范围">
-            <div id="setPromotion-productRange" style="position:relative;">
-              <a-tree-select
-                v-model="sellForm.productRangeList"
-                style="width: 100%"
-                :maxTagCount="12"
-                :tree-data="productTypeList"
-                tree-checkable
-                :disabled="disabledVal"
-                :getPopupContainer="triggerNode => triggerNode.parentNode"
-                :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
-                @blur="onChangeTree"
-                placeholder="请选择产品范围" />
-            </div>
-          </a-form-model-item>
-        </a-col>
-        <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <a-form-model-item label="生成方式" prop="ruleBaseType">
-            <v-select
-              v-model="sellForm.ruleBaseType"
-              ref="ruleBaseType"
-              id="setPromotion-ruleBaseType"
-              code="PROMO_RULE_BASE_TYPE"
-              showType="radio"
-              :disabled="disabledVal"
-              @change="handleRuleBaseType"
-              allowClear></v-select>
-          </a-form-model-item>
-        </a-col>
-        <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <a-form-model-item label="券内容" prop="ruleDetailList">
-            <div class="couponCon" v-if="couponList&&couponList.length>0">
-              <a-row v-for="(item,i) in couponList" :key="item.id">
-                <a-col :md="22" :sm="24">
-                  <div class="couponList">
-                    <!-- 具体内容 -->
-                    <a-form-model ref="couponRuleForm" :model="item" :label-col="couponFormLayout.labelCol" :wrapper-col="couponFormLayout.wrapperCol">
-                      <a-form-model-item style="margin-left:26px;">
-                        <span style="color:#ed1c24;font-size:15px;">*</span>
-                        购买<a-input-number
-                          style="margin:0 5px;"
-                          v-model="item.productQty"
-                          :step="1"
-                          :max="99999999"
-                          :precision="0"
-                          :disabled="true"
-                          size="small"/>
-                        <a-select
-                          default-value="GE"
-                          v-model="item.unit"
-                          style="width: 60px;"
-                          size="small"
-                          :disabled="true">
-                          <a-select-option value="GE">
-                            个
-                          </a-select-option>
-                          <a-select-option value="YUAN">
-                            元
-                          </a-select-option>
-                        </a-select>
-                        活动产品,送<a-input-number
-                          v-model="item.ruleValue"
-                          style="margin:0 5px;"
-                          :min="0"
-                          :step="1"
-                          :precision="2"
-                          :max="99999999"
-                          :disabled="disabledVal"
-                          size="small"/> 元
-                      </a-form-model-item>
-                      <a-form-model-item class="productName" label="活动产品" prop="ruleProductList">
-                        <a-button type="primary" :disabled="disabledVal" @click="handleAddProduct(item)" size="small">添加产品</a-button>
-                        <div class="productCon" v-if="item.ruleProductList && item.ruleProductList.length>0">
-                          <a-tag :closable="!disabledVal" @close="delBuyerName(item,con)" v-for="con in item.ruleProductList" :key="con.productSn">
-                            {{ con.productCode }}
-                          </a-tag>
-                          <!-- <productTable></productTable> -->
-                        </div>
-                      </a-form-model-item>
-                      <a-form-model-item class="productName" label="券适用范围" prop="range">
-                        全部产品
-                      </a-form-model-item>
-                      <a-form-model-item label="使用说明" prop="detailExplain" v-show="sellForm.ruleBaseType==='category'">
-                        <a-input
-                          v-model="item.detailExplain"
-                          :disabled="disabledVal"
-                          style="width:80%;"
-                          type="textarea"
-                          placeholder="请输入使用说明(最多50个字符)"
-                          :maxLength="200" />
-                      </a-form-model-item>
-                    </a-form-model>
-                  </div>
-                </a-col>
-                <a-col :md="2" :sm="24">
-                  <a-button type="link" v-show="i===0&&couponList.length<10" class="button-info" @click="addCouponCon" :disabled="disabledVal">+新增</a-button>
-                  <a-button type="link" v-show="i!=0" @click="delCouponCon(item.id)" :disabled="disabledVal">删除</a-button>
-                </a-col>
-              </a-row>
-            </div>
-          </a-form-model-item>
-        </a-col>
-        <a-col
-          :xs="24"
-          :sm="24"
-          :md="12"
-          :lg="24"
-          :xl="24"
-          v-if="sellForm.ruleBaseType!='category'">
-          <a-form-model-item label="使用说明" prop="ruleExplain">
-            <a-input v-model="sellForm.ruleExplain" type="textarea" placeholder="请输入使用说明(最多50个字符)" :disabled="disabledVal" :maxLength="200" />
-          </a-form-model-item>
-        </a-col>
-        <a-col :xs="24" :sm="24" :md="12" :lg="24" :xl="24">
-          <a-form-model-item label="券有效期" prop="validType">
-            <a-radio-group v-model="sellForm.validType" :disabled="disabledVal" @change="handleValidType">
-              <a-radio :style="radioStyle" value="FIXED">
-                <span>固定日期</span>
-                <a-range-picker
-                  style="width:100%;margin-left:5px;"
-                  v-model="time"
-                  :format="dateFormat"
-                  @change="dateChange"
-                  :disabled="disabledVal"
-                  :disabled-date="disabledDate"
-                  :placeholder="['开始时间', '结束时间']" />
-              </a-radio>
-              <a-radio :style="radioStyle" value="LIMIT">
-                <span>领取后,当天生效,有效期</span><a-input-number
-                  style="margin:0 5px;"
-                  v-model="sellForm.validDays"
-                  :step="1"
-                  :max="99999999"
-                  :min="1"
-                  :disabled="disabledVal"
-                  :precision="0"/>天
-              </a-radio>
-            </a-radio-group>
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-    </a-form-model>
-  </a-spin>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import moment from 'moment'
-import { VSelect } from '@/components'
-import productTable from './productTable'
-import { productTypeQuery } from '@/api/productType'
-import { getNewScopeSn } from '@/api/promotion'
-export default {
-  name: 'PromotionAddModal',
-  mixins: [commonMixin],
-  components: { VSelect, productTable },
-  props: {
-    disabledVal: {
-      type: Boolean,
-      default: false
-    },
-    pageType: {
-      type: String,
-      default: 'edit'
-    }
-  },
-  data () {
-    return {
-      spinning: false,
-      // form 表单label布局设置
-      sellFormItemLayout: {
-        labelCol: { span: 2 }, // 文字前距离设置
-        wrapperCol: { span: 20 }// 表单后距离设置  数字越大距离越小
-      },
-      // 卷内容 form 表单label布局设置
-      couponFormLayout: {
-        labelCol: { span: 3 },
-        wrapperCol: { span: 18 }
-      },
-      // 单选按钮样式
-      radioStyle: {
-        display: 'block',
-        height: '50px',
-        lineHeight: '40px'
-      },
-      // 主要内容 提交数据
-      sellForm: {
-        ruleType: 'ticket', // 基本规则类型
-        productRangeFlag: '', // 产品范围标记 0无  1有产品范围
-        productRangeList: [], // 产品范围列表
-        ruleName: '', // 券名称
-        ruleTitle: '', // 副标题
-        ruleBaseType: 'category', // 券生成方式
-        ruleExplain: '', // 使用说明
-        validType: undefined, // 券有效期类型
-        validStartDate: undefined, // 券生效时间
-        validEndDate: undefined, // 券失效时间
-        validDays: undefined, // 券有效期天数
-        // 券内容
-        ruleDetailList: []
-      },
-      // 券内容 提交数据
-      couponList: [],
-      // 按产品款数生成券 数据
-      dateFormat: 'YYYY-MM-DD',
-      posNum: null, // 选择产品位置
-      sellRules: {
-        ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
-        ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
-        ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
-        ruleExplain: [{ required: true, message: '请输入使用说明', trigger: ['change', 'blur'] }],
-        validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
-        ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }]
-      },
-      productTypeList: [],
-      time: []
-    }
-  },
-  methods: {
-    // 禁用日期时间
-    disabledDate (current) {
-      return current && current < moment().startOf('day')
-    },
-    // 删除产品
-    delBuyerName (row, conRow) {
-      const ind = this.couponList.findIndex(item => item.id === row.id)
-      const pos = this.couponList[ind].ruleProductList.findIndex(con => con.productSn === conRow.productSn)
-      this.couponList[ind].ruleProductList.splice(pos, 1)
-    },
-    dateChange (date, dateString) {
-      this.time = date
-      if (dateString[0] != '' && dateString[1] != '') {
-        this.sellForm.validStartDate = dateString[0] + ' 00:00:00'
-        this.sellForm.validEndDate = dateString[1] + ' 23:59:59'
-      }
-    },
-    // 重置
-    clearContent () {
-      this.couponList = []
-      this.productTypeList = []
-      this.time = []
-      this.sellForm = {
-        ruleType: 'ticket', // 基本规则类型
-        productRangeFlag: '', // 产品范围标记 0无  1有产品范围
-        productRangeList: [], // 产品范围列表
-        ruleName: '', // 券名称
-        ruleTitle: '', // 副标题
-        ruleBaseType: 'category', // 券生成方式
-        ruleExplain: '', // 使用说明
-        validType: undefined, // 券有效期类型
-        validStartDate: undefined, // 券生效时间
-        validEndDate: undefined, // 券失效时间
-        validDays: undefined, // 券有效期天数
-        // 券内容
-        ruleDetailList: []
-      }
-    },
-    // 添加产品
-    handleAddProduct (row) {
-      const pos = this.couponList.findIndex(item => item.id === row.id)
-      this.posNum = pos
-      const typeArr = this.sellForm.productRangeList || []
-      let productArr = []
-      let chooseProductArr = []
-      this.couponList.forEach(item => {
-        if (item.ruleProductList && item.ruleProductList.length > 0) {
-          if (item.id != row.id) {
-            const arr = item.ruleProductList.map(con => { return con.productSn })
-            productArr = productArr.concat(arr)
-          } else {
-            const arr = item.ruleProductList.map(con => { return con.productSn })
-            chooseProductArr = chooseProductArr.concat(arr)
-          }
-        }
-      })
-      this.$emit('addProduct', { typeArr, productArr, chooseProductArr })
-    },
-    onChangeTree () {
-      this.couponList = []
-      this.addCouponCon()
-    },
-    // 新增券内容
-    async addCouponCon () {
-      if (this.couponList.length >= 10) {
-        this.$message.warning('最多只能新增10个!')
-        return
-      }
-      const result = await getNewScopeSn({})
-      const obj = {
-        id: result.data,
-        productQty: 1, // 产品数量
-        ruleValue: undefined, // 返利金额
-        detailExplain: undefined, // 使用说明
-        unit: 'GE',
-        range: '1',
-        ruleProductList: []
-      }
-      this.couponList.push(obj)
-    },
-    // 删除券内容
-    delCouponCon (id) {
-      const pos = this.couponList.findIndex(item => item.id === id)
-      this.couponList.splice(pos, 1)
-    },
-    // 获取产品范围数据
-    getTreeData () {
-      productTypeQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
-    // 券生成方式 change
-    handleRuleBaseType () {
-      const _this = this
-      _this.$confirm({
-        title: '提示',
-        content: '改变生成方式,券内容也会改变,确认改变吗?',
-        centered: true,
-        onOk () {
-          _this.couponList.map(item => {
-            item.detailExplain = undefined
-            return item
-          })
-        }
-      })
-    },
-    // 券有效期 change
-    handleValidType (con) {
-      this.sellForm.validType = con.target.value
-      if (con.target.value === 'FIXED') {
-        this.sellForm.validDays = undefined
-      } else {
-        this.time = []
-        this.sellForm.validStartDate = undefined
-        this.sellForm.validEndDate = undefined
-      }
-    },
-    setProductSn (list) {
-      this.couponList[this.posNum].ruleProductList = list
-    },
-    // 验证必填项
-    testAndVerify (callBack) {
-      if (this.couponList && this.couponList.length > 0) {
-        this.sellForm.ruleDetailList = this.couponList
-        this.$refs.sellRuleForm.validateField('ruleDetailList')
-        const moneyFlag = this.couponList.some(con => !con.ruleValue)
-        const productFlag = this.couponList.some(con => con.ruleProductList && con.ruleProductList.length == 0)
-        if (moneyFlag) {
-          this.$message.warning('请输入返利金额!')
-          return false
-        }
-        if (productFlag) {
-          this.$message.warning('请选择活动产品!')
-          return false
-        }
-      }
-      if (this.sellForm.validType === 'FIXED') {
-        if (!this.sellForm.validStartDate || this.sellForm.validStartDate.validEndDate) {
-          this.$message.warning('请选择固定日期!')
-          return false
-        }
-      } else {
-        if (!this.sellForm.validDays) {
-          this.$message.warning('请输入有效天数!')
-          return false
-        }
-      }
-      this.$refs.sellRuleForm.validate(valid => {
-        if (valid) {
-          callBack(valid)
-        } else {
-          return false
-        }
-      })
-    },
-    // 返回组件值
-    getPromotionVal () {
-      this.sellForm.productRangeFlag = (this.sellForm.productRangeList && this.sellForm.productRangeList.length > 0) ? '1' : '0'
-      const newData = JSON.parse(JSON.stringify(this.sellForm))
-      newData.productRangeList = newData.productRangeList.map(item => {
-        return { productTypeSn: item }
-      })
-      return newData
-    },
-    // 详情赋值
-    setDetailData (info, arr) {
-      if (info.productRangeList && info.productRangeList.length > 0) {
-        info.productRangeList = info.productRangeList.map(item => item.productTypeSn)
-      }
-      if (info.validType === 'FIXED') {
-        this.time = [info.validStartDate, info.validEndDate]
-      }
-      this.sellForm = { ...this.sellForm, ...info }
-      this.couponList = arr
-    },
-    pageInit () {
-      const _this = this
-      _this.getTreeData()
-      if (_this.pageType === 'add') {
-        _this.addCouponCon()
-      }
-    }
-  },
-  mounted () {
-    this.pageInit()
-  },
-  activated () {
-    this.pageInit()
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
-  }
-}
-</script>
-
-<style lang="less" scoped>
-  .setPromotion-form{
-    .couponList{
-      background: #EFEFEF;
-      border-radius:5px;
-      padding:15px 15px 2px;
-      margin-bottom:5px;
-      .ant-form-item{
-        margin-bottom:12px;
-      }
-    }
-    .productCon{
-      width: 80%;
-      margin-left:12.3%;
-      max-height: 150px;
-      overflow-y: scroll;
-      background: #fff;
-      border-radius: 5px;
-      padding: 10px 15px;
-    }
-    .productCon::-webkit-scrollbar {
-      display: none;
-    }
-    #setPromotion-productRange{
-      /deep/.ant-select-dropdown{
-        max-height:30vh !important;
-      }
-    }
-    .productName{
-      /deep/.ant-form-item-label > label::before {
-          content: '*';
-          color:#ed1c24;
-          font-size:15px;
-          margin-right:3px;
-      }
-    }
-  }
-</style>