chenrui 1 рік тому
батько
коміт
2913298557

+ 6 - 6
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -15,8 +15,8 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li v-if="goodFlag==='1'&&discountType!='0'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
-            <li v-if="goodFlag==='0'&&discountType=='0'">1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填,省级特价≤市级特价≤特约特价</li>
+            <li v-if="goodFlag==='1'&&rulesType!='0'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
+            <li v-if="goodFlag==='0'&&rulesType=='0'">1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填,省级特价≤市级特价≤特约特价</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
             <li>3)起订类型和起订数量非必填:起订类型为空则默认为“按数量设置”,起订数量为空则默认为“1”。</li>
             <li>
@@ -38,7 +38,7 @@
               :maxNums="1"
               fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
               uploadType="attach"
-              :uploadParams="goodFlag==='0'?{discountType:discountType,savePathType: 'ali'}:undefined"
+              :uploadParams="goodFlag==='0'?{discountType:rulesType,savePathType: 'ali'}:undefined"
               :action="goodFlag==='1'?attachAction:attachAction1"
               upText="选择导入文件"
               @remove="resetSearchForm"
@@ -83,11 +83,11 @@ export default {
       type: Object,
       default: null
     },
-    goodFlag: {//0  特价  1 买产品送产品  买产品送采购额
+    goodFlag: {// 0  特价  1 买产品送产品  买产品送采购额
       type: [String, Number],
       default: '0'
     },
-    discountType:{//0 手动 1折扣 2直降
+    rulesType: {// 0 手动 1折扣 2直降
       type: [String, Number],
       default: '0'
     }
@@ -112,7 +112,7 @@ export default {
     handlerNextStep () {
       if (this.paramsData) {
         this.openImportModal = true
-        this.$refs.chooseImportBox.setFlag({goodFlag:this.goodFlag,discountType:this.discountType})
+        this.$refs.chooseImportBox.setFlag({ goodFlag: this.goodFlag, discountType: this.rulesType })
       } else {
         this.$message.warning('添加文件后再进行下一步操作!')
       }

+ 17 - 0
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -393,6 +393,23 @@ export default {
           form.promotionSn = _this.promotionSn
           form.giveRuleList = _this.fullGiftRuleList
           delete form.regularUnit
+
+          if (form.gateFlag == '1') {
+            if (form.gateType === 'RATIO_AMOUNT') {
+              form.gateInfo = '购买门槛产品金额' + form.gateValue + '作为配额'
+            } else if (form.gateType === 'MIN_AMOUNT') {
+              form.gateInfo = '购买门槛产品满最低金额' + form.gateValue + '不限制配额'
+            } else {
+              form.gateInfo = '购买满' + form.gateValue + '元门槛产品,可使用' + form.quotaAmount + '元配额,采购规则中的正价商品(配额算销售额)'
+            }
+          }
+          var newInfo = `<div>${form.accrualFlag == '1' ? '数量叠加;' : ''}${form.convertExpenseFlag == '1' ? '可转费用报销单;' : ''}</div>`
+          _this.fullGiftRuleList.forEach(item => {
+            newInfo += `<div>${form.regularSameFlag == '1' ? '同款' : '不同款'}产品购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送${item.promotionValue}个促销产品</div>`
+          })
+          newInfo += form.restrictFlag == '1' ? `<div>限制正价产品${form.restrictCategory}款</div>` : ''
+          form.ruleInfo = newInfo
+
           _this.spinning = true
           promotionSave(form).then(res => {
             if (res.status == 200) {

+ 25 - 6
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -247,7 +247,9 @@ export default {
         restrictCategory: '',
         accrualFlag: '1', // 数量叠加
         regularPromotionSameFlag: '1',
-        giftProductMap: {}
+        giftProductMap: {},
+        gateInfo: undefined,
+        ruleInfo: undefined
       },
       rules: {
         description: [ { required: true, message: '请输入规则简称', trigger: 'blur' } ],
@@ -430,6 +432,21 @@ export default {
           })
           form.promotionSn = _this.promotionSn
           form.giveRuleList = _this.fullGiftRuleList
+          if (form.gateFlag == '1') {
+            if (form.gateType === 'RATIO_AMOUNT') {
+              form.gateInfo = '购买门槛产品金额' + form.gateValue + '作为配额'
+            } else if (form.gateType === 'MIN_AMOUNT') {
+              form.gateInfo = '购买门槛产品满最低金额' + form.gateValue + '不限制配额'
+            } else {
+              form.gateInfo = '购买满' + form.gateValue + '元门槛产品,可使用' + form.quotaAmount + '元配额,采购规则中的正价商品(配额算销售额)'
+            }
+          }
+          var newInfo = `<div>${form.accrualFlag == '1' ? '数量叠加;' : ''}${form.convertExpenseFlag == '1' ? '可转费用报销单;' : ''}</div>`
+          _this.fullGiftRuleList.forEach(item => {
+            newInfo += `<div>${form.regularSameFlag == '1' ? '同款' : '不同款'}产品购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送${item.promotionValue}个促销产品</div>`
+          })
+          newInfo += form.restrictFlag == '1' ? `<div>限制正价产品${form.restrictCategory}款</div>` : ''
+          form.ruleInfo = newInfo
           _this.spinning = true
           promotionSave(form).then(res => {
             if (res.status == 200) {
@@ -491,7 +508,9 @@ export default {
         regularPromotionSameFlag: '1',
         giftProductMap: {},
         gateProductList: undefined,
-        regularProductList: undefined
+        regularProductList: undefined,
+        gateInfo: undefined,
+        ruleInfo: undefined
       }
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()
@@ -516,11 +535,11 @@ export default {
           if (resultObj.gateFlag == '1') {
             resultObj.gateValue = resultObj.gateType === 'RATIO_AMOUNT' ? resultObj.gateValue * 100 : resultObj.gateValue
           }
-          if(resultObj.giveRuleList &&resultObj.giveRuleList.length>0){
+          if (resultObj.giveRuleList && resultObj.giveRuleList.length > 0) {
             _this.fullGiftRuleList = resultObj.giveRuleList
-            _this.$nextTick(()=>{
-              resultObj.giveRuleList.forEach((item,i)=>{
-                _this.$refs['offerProduct' + i][0].setTabVal(_this.newData(resultObj.giftProductMap['GIFT'+(i*1+1)]))
+            _this.$nextTick(() => {
+              resultObj.giveRuleList.forEach((item, i) => {
+                _this.$refs['offerProduct' + i][0].setTabVal(_this.newData(resultObj.giftProductMap['GIFT' + (i * 1 + 1)]))
               })
             })
           }

+ 34 - 11
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -208,7 +208,7 @@
       @close="openProductsModal=false"
       @ok="handleProductsAdd" />
     <!-- 导入产品 -->
-    <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :discountType="form.discountType" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
+    <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :rulesType="form.discountType" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
   </a-modal>
 </template>
 
@@ -533,11 +533,9 @@ export default {
             const num = 3
             for (var i = 0; i < num; i++) {
               if (item['productTypeName' + (i + 1)]) {
-                // item.title += item['productTypeName' + (i + 1)] + (item['productTypeName' + (i + 1)] ? '/' : '')
                 typeObj['productTypeSn' + (i + 1)] = item['productTypeSn' + (i + 1)] ? item['productTypeSn' + (i + 1)] : ''
               }
             }
-            // item.title = item.title.slice(0, item.title.length - 1)
             if (item.productTypeName3) {
               item.title = item.productTypeName2 + '/' + item.productTypeName3
             } else if (!item.productTypeName3 && item.productTypeName2) {
@@ -579,14 +577,39 @@ export default {
         arr.forEach(item => {
           item = { ...item, ...item.product }
           item.code = item.productCode
-          if (item.provincePrice) {
-            item.provinceDiscountRate = Math.floor(((item.provinceDiscountPriceText / item.provincePrice) * 100).toFixed(2))
-          }
-          if (item.cityPrice) {
-            item.cityDiscountRate = Math.floor(((item.cityDiscountPriceText / item.cityPrice) * 100).toFixed(2))
-          }
-          if (item.specialPrice) {
-            item.specialDiscountRate = Math.floor(((item.specialDiscountPriceText / item.specialPrice) * 100).toFixed(2))
+          if (this.form.discountType == '0') {
+            if (item.provincePrice) {
+              item.provinceDiscountRate = Math.floor(((item.provinceDiscountPriceText / item.provincePrice) * 100).toFixed(2))
+            }
+            if (item.cityPrice) {
+              item.cityDiscountRate = Math.floor(((item.cityDiscountPriceText / item.cityPrice) * 100).toFixed(2))
+            }
+            if (item.specialPrice) {
+              item.specialDiscountRate = Math.floor(((item.specialDiscountPriceText / item.specialPrice) * 100).toFixed(2))
+            }
+          } else if (this.form.discountType == '1') {
+            if (item.provincePrice) {
+              item.provinceDiscountRate = this.form.provinceValue
+              item.provinceDiscountPriceText = (item.provincePrice * this.form.provinceValue / 100).toFixed(2)
+            }
+            if (item.cityPrice) {
+              item.cityDiscountRate = this.form.cityValue
+              item.cityDiscountPriceText = (item.cityPrice * this.form.cityValue / 100).toFixed(2)
+            }
+            if (item.specialPrice) {
+              item.specialDiscountRate = this.form.specialValue
+              item.specialDiscountPriceText = (item.specialPrice * this.form.specialValue / 100).toFixed(2)
+            }
+          } else {
+            if (item.provincePrice) {
+              item.provinceSubtract = item.provincePrice - this.form.provinceValue
+            }
+            if (item.cityPrice) {
+              item.citySubtract = item.cityPrice - this.form.cityValue
+            }
+            if (item.specialPrice) {
+              item.specialSubtract = item.specialPrice - this.form.specialValue
+            }
           }
           const flag = dataList.includes(item.productSn)
           if (!flag) {