chenrui 8 miesięcy temu
rodzic
commit
da4b61dbc7

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

@@ -280,7 +280,9 @@ export default {
           _this.$refs.imageSet.setFileList(res.data.imageUrl)
           _this.form = res.data
           _this.form.time = [res.data.bannerStartDate, res.data.bannerEndDate]
-          _this.form.bizType ? _this.form.bizType != 'SHOP_PROMO' ? ['PROMO_LINK'] : [] : []
+          if (_this.form.bizType && _this.form.bizType === 'SHOP_PROMO') {
+            _this.notShowSel.splice(0, 1)
+          }
         }
       })
     },

+ 0 - 1
src/views/easyPassManagement/promotionalActivities/chooseProductsModal.vue

@@ -215,7 +215,6 @@ export default {
       }
       const resultList = JSON.parse(JSON.stringify(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows))
       this.$emit('ok', resultList)
-      this.isShow = false
     },
     //  产品分类  change
     changeProductType (val, opt) {

+ 2 - 17
src/views/easyPassManagement/promotionalActivities/detailModal.vue

@@ -107,17 +107,6 @@
                     :style="{ maxHeight: 300+'px' }"
                     :scroll="{ y:230 }"
                     bordered>
-                    <!-- 特价产品 标题 -->
-                    <template slot="titleType">
-                      {{ form.promoType==='PROMO_PROD'?form.discountType==='STRAIGHT_DOWN'?'直降金额':'折扣(%)':form.promoType==='BUY_PROD_GIVE_VALID'?'返券金额':'--' }}
-                    </template>
-                    <!-- 特价价格-->
-                    <template slot="specialOffer" slot-scope="text,record">
-                      <!-- 直降 -->
-                      <span v-if="form.discountType==='STRAIGHT_DOWN'">{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice-record.resultValue).toFixed(2):'--' }}</span>
-                      <!-- 折扣 -->
-                      <span v-else>{{ (record.resultValue&&record.shopProductPrice)? (record.shopProductPrice*record.resultValue/100).toFixed(2):'--' }}</span>
-                    </template>
                   </s-table>
                 </div>
               </a-form-model-item>
@@ -218,9 +207,6 @@ 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
-              if (this.form.promoType === 'PROMO_PROD' && this.form.discountType === 'DISCOUNT') {
-                data.list[i].resultValue = data.list[i].resultValue ? data.list[i].resultValue * 100 : ''
-              }
             }
             this.disabled = false
           }
@@ -244,10 +230,9 @@ export default {
         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' } })
+        arr.splice(5, 0, { title: '特价价格', dataIndex: 'conditionValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       } else {
-        arr.splice(5, 0, { slots: { title: 'titleType' }, dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(5, 0, { title: '返券金额', dataIndex: 'resultValue', width: '10%', align: 'center', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

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

@@ -243,16 +243,17 @@
                         @change="handleDiscountType"
                         placeholder="请选择"
                         allowClear></v-select>
-                      <span>{{ form.discountType==='STRAIGHT_DOWN'? '直降':'折扣' }}</span>
+                      <span v-show="form.discountType">{{ form.discountType==='STRAIGHT_DOWN'? '直降':'折扣' }}</span>
                       <a-input-number
                         v-model="resultValue"
+                        v-show="form.discountType"
                         style="width:15%;margin:0 5px;"
                         :min="0"
                         :step="1"
                         :precision="2"
                         :max="99999999"
                         id="promotionEdit-resultValue"
-                        size="small"/>{{ form.discountType==='STRAIGHT_DOWN'? '元':'%' }}
+                        size="small"/><span v-show="form.discountType">{{ form.discountType==='STRAIGHT_DOWN'? '元':'%' }}</span>
                       <a-button
                         type="primary"
                         id="promotionEdit-addSet-btn"
@@ -363,7 +364,7 @@ export default {
         dealerEditFlag: '0', // 加盟商编辑 0否 1是
         dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
         rangeList: [], // 选择产品列表
-        discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
+        discountType: '', // 特价产品 - 优惠方式'
         validName: '', // 券名称
         validTitle: '', // 券副标题
         validBaseType: 'category', // 券生成方式
@@ -608,7 +609,7 @@ export default {
         dealerEditFlag: '0', // 加盟商编辑 0否 1是
         dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
         rangeList: [], // 选择产品列表
-        discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
+        discountType: '', // 特价产品 - 优惠方式'
         validName: '', // 券名称
         validTitle: '', // 券副标题
         validBaseType: 'category', // 券生成方式

+ 20 - 15
src/views/easyPassManagement/promotionalActivities/productTable.vue

@@ -40,11 +40,7 @@
             :id="'productTable-resultValue'+record.id "
             size="small"/>
         </template>
-        <!-- 特价产品 标题 -->
-        <template slot="titleType">
-          {{ activeType==='PROMO_PROD'?discountType==='STRAIGHT_DOWN'?'直降金额':'折扣(%)':activeType==='BUY_PROD_GIVE_VALID'?'返券金额':'--' }}
-        </template>
-        <!-- 直降  打折 ||   买产品送代金券 返券金额 -->
+        <!-- 买产品送代金券 返券金额 -->
         <template slot="priceValue" slot-scope="text,record">
           <a-input-number
             :min="0.01"
@@ -59,10 +55,20 @@
         </template>
         <!-- 特价价格-->
         <template slot="specialOffer" slot-scope="text,record">
+          <a-input-number
+            :min="0.01"
+            :step="1"
+            :precision="2"
+            :max="99999999"
+            @blur="editProductVal(record,'conditionValue')"
+            placeholder="请输入"
+            v-model="record.conditionValue"
+            :id="'productTable-conditionValue'+record.id "
+            size="small"/>
           <!-- 直降 -->
-          <span v-if="discountType==='STRAIGHT_DOWN'">{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice-record.resultValue).toFixed(2):'--' }}</span>
+          <!-- <span v-if="discountType==='STRAIGHT_DOWN'">{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice-record.resultValue).toFixed(2):'--' }}</span> -->
           <!-- 折扣 -->
-          <span v-else>{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice*record.resultValue/100).toFixed(2):'--' }}</span>
+          <!-- <span v-else>{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice*record.resultValue/100).toFixed(2):'--' }}</span> -->
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text,record">
@@ -121,8 +127,8 @@ 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
-              if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
-                data.list[i].resultValue = data.list[i].resultValue ? data.list[i].resultValue * 100 : ''
+              if (this.activeType === 'PROMO_PROD') {
+                data.list[i].conditionValue = data.list[i].conditionValue ? data.list[i].conditionValue : data.list[i].shopProductPrice
               }
             }
             this.chooseProductNum = data.count
@@ -140,7 +146,7 @@ export default {
       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: 'productName', width: '20%', 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) : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
@@ -149,10 +155,9 @@ export default {
         arr.splice(4, 0, { title: '买', scopedSlots: { customRender: 'conditionValue' }, width: '10%', align: 'center' })
         arr.splice(5, 0, { title: '赠', scopedSlots: { customRender: 'resultValue' }, width: '10%', align: 'center' })
       } else if (_this.activeType === 'PROMO_PROD') {
-        arr.splice(5, 0, { slots: { title: 'titleType' }, scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
-        arr.splice(6, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
+        arr.splice(5, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
       } else {
-        arr.splice(5, 0, { slots: { title: 'titleType' }, scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
+        arr.splice(5, 0, { title: '返券金额', scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
       }
       return arr
     },
@@ -169,6 +174,7 @@ export default {
     // 批量已选产品信息
     editProductVal (row, typeName) {
       let ajaxData = []
+      row.resultValue = this.activeType === 'PROMO_PROD' ? undefined : row.resultValue
       if (typeName != 'all') {
         ajaxData.push({
           id: row.id,
@@ -202,12 +208,11 @@ export default {
         if (this.discountType === 'STRAIGHT_DOWN') {
           ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
         } else {
-          ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue / 100 } })
+          ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: (item.shopProductPrice * (objInfo.resultValue / 100)), resultValue: objInfo.resultValue / 100 } })
         }
       } else {
         ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue } })
       }
-
       this.editProductVal(ajaxArr, 'all')
     },
     // 删除