瀏覽代碼

修改bug

chenrui 9 月之前
父節點
當前提交
4a634312ac

+ 3 - 3
src/views/easyPassManagement/homepageCarouselImg/edit.vue

@@ -139,7 +139,7 @@
               <a-form-model-item label="跳转链接" prop="contentLink" v-if="form.contentType =='LINK'">
                 <a-input
                   style="width:50%;"
-                  :disabled="true"
+                  :disabled="$route.params.sn"
                   id="promotionEdit-contentLink"
                   :maxLength="100"
                   v-model.trim="form.contentLink"
@@ -205,7 +205,7 @@ export default {
         imageUrl: '', // 图片
         contentType: 'LINK', // 内容类型
         content: '', // 内容
-        contentLink: '/pagesB/promoDetail',
+        contentLink: '',
         state: 'UNPUBLISH'
       },
 
@@ -363,7 +363,7 @@ export default {
         imageUrl: '', // 图片
         contentType: 'LINK', // 内容类型
         content: '', // 内容
-        contentLink: '/pagesB/promoDetail',
+        contentLink: '',
         state: 'UNPUBLISH'
       }
       this.isShowNextStep = false

+ 95 - 42
src/views/easyPassManagement/promotionalActivities/detailModal.vue

@@ -18,52 +18,83 @@
           :label-col="formItemLayout.labelCol"
           :wrapper-col="formItemLayout.wrapperCol" >
           <a-row>
-            <a-col :xs="12" :sm="24">
-              <a-form-model-item label="促销名称" prop="title">
-                {{ form.title }}
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="促销名称" prop="promoName" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.promoName }}
               </a-form-model-item>
             </a-col>
-            <a-col :xs="12" :sm="24">
-              <a-form-model-item label="促销时间" prop="sort">
-                {{ form.sort }}
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="促销时间" prop="promoName" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.promoStartDate }}~{{ form.promoEndDate }}
               </a-form-model-item>
             </a-col>
-            <a-col :xs="12" :sm="24">
-              <a-form-model-item label="排序" prop="sort">
-                {{ form.sort }}
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="排序" prop="sort" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.sort ||'--' }}
               </a-form-model-item>
             </a-col>
-            <a-col :xs="24" :sm="24">
-              <a-form-model-item label="参与经销商" prop="sort">
-                {{ form.sort }}
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="参与经销商" prop="allDealerFlag" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.allDealerFlag=='1'?'全部经销商':'部分经销商' }}
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24">
-              <a-form-model-item label="封面图片" prop="imageSet">
+              <a-form-model-item label="封面图片" prop="imageUrl">
                 <img
-                  :src="con"
+                  :src="form.imageUrl"
                   alt="图片走丢了"
                   width="80"
                   height="80"
-                  v-for="(con,i) in imageSet"
-                  style="margin-right:10px;object-fit: cover;"
-                  :key="i"/>
+                  style="margin-right:10px;object-fit: cover;"/>
                 <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
               </a-form-model-item>
             </a-col>
-
             <a-col :xs="24" :sm="24">
-              <a-form-model-item label="促销描述" prop="ruleExplain" >
-                {{ form.promoRule&&form.promoRule.ruleExplain?form.promoRule.ruleExplain:'--' }}
+              <a-form-model-item label="促销描述" prop="description" >
+                {{ form.description||'--' }}
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24">
-              <a-form-model-item label="加盟商编辑" prop="dealerEditFlag" >
-                {{ form.dealerEditFlag?form.dealerEditFlag==='1'?'是':'否':'--' }}
+              <a-form-model-item label="加盟商开关权限:" prop="dealerOpenFlag" >
+                {{ form.dealerOpenFlag?form.dealerOpenFlag==='1'?'是':'否':'--' }}
               </a-form-model-item>
             </a-col>
+            <div v-if="form.promoType==='BUY_PROD_GIVE_VALID'">
+              <a-col :xs="12" :sm="12">
+                <a-form-model-item label="券名称" prop="validName" :label-col="{span:8}" :wrapper-col="{span:14}">
+                  {{ form.validName }}
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="12" :sm="12">
+                <a-form-model-item label="券副标题" :label-col="{span:8}" :wrapper-col="{span:14}">
+                  {{ form.validTitle ||'--' }}
+                </a-form-model-item>
+              </a-col>
+              <!-- <a-col :xs="24" :sm="24">
+                <a-form-model-item label="生成方式" prop="validBaseType">
+                  {{ form.validBaseTypeDictValue||'--' }}
+                </a-form-model-item>
+              </a-col> -->
+              <a-col :xs="24" :sm="24">
+                <a-form-model-item label="券有效期" prop="validType">
+                  <span>{{ form.validType==='FIXED'?'固定日期':'领取后,立即生效' }}</span>
+                  <span style="margin-left:10px;" v-if="form.validType==='FIXED'">{{ form.validStartDate }}~{{ form.validEndDate }}</span>
+                  <span style="margin-left:10px;" v-else>有效期{{ form.validDays }}天</span>
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24">
+                <a-form-model-item label="券适用范围" prop="validScope">
+                  {{ form.validScope=='1'?'全部产品':'--' }}
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24">
+                <a-form-model-item label="使用说明">
+                  {{ form.validInfo||'--' }}
+                </a-form-model-item>
+              </a-col>
+            </div>
             <a-col :xs="24" :sm="24">
-              <a-form-model-item label="返券产品" prop="publishFlag" >
+              <a-form-model-item :label="form.promoType==='BUY_PROD_GIVE_PROD'?'满赠规则': form.promoType==='PROMO_PROD'?'优惠方式':'返券产品'" prop="promoName" >
                 <div class="productTable">
                   <s-table
                     class="sTable"
@@ -76,6 +107,17 @@
                     :style="{ maxHeight: 300+'px' }"
                     :scroll="{ y:230 }"
                     bordered>
+                    <!-- 特价产品 标题 -->
+                    <template slot="titleType">
+                      {{ form.promoType==='PROMO_PROD'?form.promoType==='STRAIGHT_DOWN'?'直降金额':'折扣(%)':form.promoType==='BUY_PROD_GIVE_VALID'?'返券金额':'--' }}
+                    </template>
+                    <!-- 特价价格-->
+                    <template slot="specialOffer" slot-scope="text,record">
+                      <!-- 直降 -->
+                      <span v-if="form.discountType==='STRAIGHT_DOWN'">{{ (record.shopProductPrice-record.resultValue).toFixed(2) }}</span>
+                      <!-- 折扣 -->
+                      <span v-else>{{ (record.shopProductPrice*record.resultValue/100).toFixed(2) }}</span>
+                    </template>
                   </s-table>
                 </div>
               </a-form-model-item>
@@ -144,20 +186,11 @@ export default {
         validEndDate: undefined, // 券失效时间
         validDays: undefined, // 券有效期天数
         validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
-        validInfo: '', // 使用说明
-        productNum: undefined
+        validInfo: '' // 使用说明
       },
-      columns: [// 表头
-        { title: '序号', dataIndex: 'no', width: '4%', 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: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '活动价', dataIndex: 'price', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
-        { title: '返券金额', dataIndex: 'ruleValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
-        { title: '参考终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } }
-      ],
       // 表单验证规则
       rules: {
+        promoName: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
         time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
         sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
         allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
@@ -168,15 +201,14 @@ export default {
         validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
         validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
         validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
-        validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }],
-        productNum: [{ required: true, message: '选择产品不能为空', trigger: ['change', 'blur'] }]
+        validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }]
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        params.promoActiveSn = this.itemSn
+        params.promoSn = this.itemSn
         // 获取详情  已选参与活动产品数据
         return chooseProductList(params).then(res => {
           let data
@@ -195,6 +227,28 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { 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: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商城售价', dataIndex: 'shopProductPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ]
+      if (_this.form.promoType === 'BUY_PROD_GIVE_PROD') {
+        arr.splice(4, 0, { title: '买', dataIndex: 'conditionValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(5, 0, { title: '赠', dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
+      } else if (_this.form.promoType === 'PROMO_PROD') {
+        arr.splice(5, 0, { slots: { title: 'titleType' }, dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(6, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
+      } else {
+        arr.splice(5, 0, { slots: { title: 'titleType' }, dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 重置
     resetSearchForm () {
@@ -220,8 +274,7 @@ export default {
         validEndDate: undefined, // 券失效时间
         validDays: undefined, // 券有效期天数
         validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
-        validInfo: '', // 使用说明
-        productNum: undefined
+        validInfo: '' // 使用说明
       }
     },
     // 获取列表详情
@@ -229,6 +282,9 @@ export default {
       shopPromoDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.form = res.data
+          this.$nextTick(() => {
+            this.$refs.table.refresh(true)
+          })
         }
       })
     }
@@ -245,9 +301,6 @@ export default {
         this.resetSearchForm()
       } else {
         this.getDetail()
-        this.$nextTick(() => {
-          this.$refs.table.refresh(true)
-        })
       }
     }
   }

+ 13 - 9
src/views/easyPassManagement/promotionalActivities/edit.vue

@@ -144,7 +144,7 @@
                     allowClear />
                 </a-form-model-item>
               </a-col>
-              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <!-- <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                 <a-form-model-item label="生成方式" prop="validBaseType">
                   <v-select
                     style="width:40%;"
@@ -154,7 +154,7 @@
                     placeholder="请选择生成方式"
                     allowClear></v-select>
                 </a-form-model-item>
-              </a-col>
+              </a-col> -->
               <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                 <a-form-model-item label="券有效期" prop="validType">
                   <v-select
@@ -372,14 +372,14 @@ export default {
         discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
         validName: '', // 券名称
         validTitle: '', // 券副标题
-        validBaseType: undefined, // 券生成方式
+        validBaseType: 'category', // 券生成方式
         validType: undefined, // 券有效期类型
         validStartDate: undefined, // 券生效时间
         validEndDate: undefined, // 券失效时间
         validDays: undefined, // 券有效期天数
         validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
         validInfo: '', // 使用说明
-        productNum: undefined
+        productNum: 0
       },
       conditionValue: undefined, // 买产品送产品 买
       resultValue: undefined, // 买产品送产品  赠  返券金额
@@ -405,8 +405,8 @@ export default {
         validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
         validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
         validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
-        validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }]
-        // productNum: [{ required: true, message: '选择产品不能为空', trigger: ['change', 'blur'] }]
+        validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }],
+        productNum: [{ required: true, message: '选择产品不能为空', trigger: 'blur' }]
       }
     }
   },
@@ -478,6 +478,7 @@ export default {
           _this.$refs.imageSet.setFileList(res.data.imageUrl)
         }
         _this.form = res.data
+        _this.form.productNum = 0
         _this.isShowNextStep = true
         if (_this.$route.params.pageType === 'edit') {
           _this.pageType = res.data.promoType
@@ -486,6 +487,8 @@ export default {
         _this.$nextTick(() => {
           _this.$refs.chooseProductList.pageInit()
         })
+
+        _this.form.productNum = _this.$refs.chooseProductList.getChooseProductNum()
       }
     },
     // 券有效期 change
@@ -503,6 +506,7 @@ export default {
     handleSave (type) {
       const _this = this
       // 验证组件必填项
+      console.log('_this.form.productNum ', _this.form.productNum)
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
           _this.savePartInfo(type)
@@ -516,7 +520,7 @@ export default {
       var formData = JSON.parse(JSON.stringify(_this.form))
       if (type === 'all') {
         formData.productNum = _this.$refs.chooseProductList.getChooseProductNum()
-        if (!formData.productNum) {
+        if (formData.productNum && formData.productNum == 0) {
           _this.$message.warning('请选择返券产品!')
           return
         }
@@ -606,14 +610,14 @@ export default {
         discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
         validName: '', // 券名称
         validTitle: '', // 券副标题
-        validBaseType: undefined, // 券生成方式
+        validBaseType: 'category', // 券生成方式
         validType: undefined, // 券有效期类型
         validStartDate: undefined, // 券生效时间
         validEndDate: undefined, // 券失效时间
         validDays: undefined, // 券有效期天数
         validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
         validInfo: '', // 使用说明
-        productNum: undefined
+        productNum: 0
       }
       this.isShowNextStep = false
       this.isDisabled = false

+ 1 - 1
src/views/easyPassManagement/promotionalActivities/list.vue

@@ -358,7 +358,7 @@ export default {
     // 打开详情
     handleDetail (row) {
       this.openDetailModal = true
-      this.itemId = row.promoActiveSn
+      this.itemId = row.promoSn
     },
     // 关闭详情
     closeDetailModal () {