chenrui 1 год назад
Родитель
Сommit
759d99d513

+ 4 - 4
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -62,7 +62,7 @@
           <template slot="cillProduct" slot-scope="text, record">
             <div v-if="record.gateFlag === '1'">
               <span v-if="record.gateType==='RATIO_AMOUNT'">
-                购买门槛产品金额{{ record.gateValue*100 }}%作为配额
+                购买门槛产品金额{{ record.gateValue?(record.gateValue*100).toFixed(2) :'0.00' }}%作为配额
               </span>
               <span v-else-if="record.gateType==='MIN_AMOUNT'">
                 购买门槛产品满最低金额{{ record.gateValue }}元,不限制配额
@@ -87,11 +87,11 @@
             </div>
             <div v-else-if="record.promotionRuleType == 'BUY_PROD_GIVE_MONEY'">
               <div v-if="record.giveRuleList&&record.giveRuleList.length>0">
-                <div v-if="record.giveRuleType==='SUM_MONEY'">金额叠加;购买满{{ record.giveRuleList[0].regularValue }}{{ record.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ record.giveRuleList[0].promotionValue }}元<span v-if="record.giveRuleList[0].regularUnit==='YUAN'">({{ record.giveRuleList[0].regularValue!=0?(record.giveRuleList[0].promotionValue/record.giveRuleList[0].regularValue).toFixed(2)*100:0 }}%促销品采购额)</span><span v-else>(促销品采购额)</span></div>
+                <div v-if="record.giveRuleType==='SUM_MONEY'">金额叠加;购买满{{ record.giveRuleList[0].regularValue }}{{ record.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ record.giveRuleList[0].promotionValue }}元<span v-if="record.giveRuleList[0].regularUnit==='YUAN'">({{ record.giveRuleList[0].regularValue!=0?((record.giveRuleList[0].promotionValue/record.giveRuleList[0].regularValue).toFixed(2)*100).toFixed(2):'0.00' }}%促销品采购额)</span><span v-else>(促销品采购额)</span></div>
                 <div v-if="record.giveRuleType==='RATIO' &&record.giveRuleList && record.giveRuleList.length>0 ">
                   <span>按比例;</span>
                   <div v-for="item in record.giveRuleList" :key="item.scopeLevel">
-                    {{ record.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue }}%为促销品采购额
+                    {{ record.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue.toFixed(2) }}%为促销品采购额
                   </div>
                 </div>
               </div>
@@ -99,7 +99,7 @@
             </div>
             <div v-else-if="record.promotionRuleType == 'PROMO_PROD'">
               <span v-if="record.discountType ==='0'">手动输入特价</span>
-              <span v-else-if="record.discountType ==='1'">各级别价打折;省级折扣{{ record.provinceValue }}%,市级折扣{{ record.cityValue }}%,特约折扣{{ record.specialValue }}%</span>
+              <span v-else-if="record.discountType ==='1'">各级别价打折;省级折扣{{ record.provinceValue.toFixed(2) }}%,市级折扣{{ record.cityValue.toFixed(2) }}%,特约折扣{{ record.specialValue.toFixed(2) }}%</span>
               <span v-else>各级别价直降;省级直降{{ record.provinceValue }},市级直降{{ record.cityValue }},特约直降{{ record.specialValue }}</span>
             </div>
             <div v-else>--</div>

+ 9 - 9
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -21,7 +21,7 @@
         <a-form-model-item label="规则门槛" v-if="form.gateFlag">
           {{ form.gateFlag==='1'?'有':'无' }}
           <div v-if="form.gateFlag==='1'">
-            <span v-if="form.gateType==='RATIO_AMOUNT'">购买门槛产品金额 {{ form.gateValue*100 }}% 作为配额 </span>
+            <span v-if="form.gateType==='RATIO_AMOUNT'">购买门槛产品金额 {{ form.gateValue?(form.gateValue*100).toFixed(2):'0.00' }}% 作为配额 </span>
             <span v-if="form.gateType==='MIN_AMOUNT'">购买门槛产品满最低金额 {{ form.gateValue }} 元,不限制配额。</span>
             <span v-if="form.gateType==='FIXED_AMOUNT'&&form.promotionRuleType !='PROMO_PROD'">购买满 {{ form.gateValue }} 元门槛产品,可使用 {{ form.quotaAmount }} 元配额,采购规则中的正价商品(配额算销售额)</span>
             <span v-if="form.gateType==='FIXED_AMOUNT'&&form.promotionRuleType ==='PROMO_PROD'">购买每满 {{ form.gateValue }} {{ form.gateUnit==='YUAN'?'元':'个' }}门槛产品,可采购 {{ form.quotaAmount }} 个特价产品(配额算销售额)</span>
@@ -43,7 +43,7 @@
             <div v-if="form.giveRuleType==='SUM_MONEY'">购买满{{ form.giveRuleList[0].regularValue }}{{ form.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ form.giveRuleList[0].promotionValue }}元<span>({{ form.giveRuleList[0].regularUnit==='YUAN'?perCentNum+'%':'' }}促销品采购额)</span></div>
             <div v-if="form.giveRuleType==='RATIO' &&form.giveRuleList && form.giveRuleList.length>0 ">
               <div v-for="item in form.giveRuleList" :key="item.scopeLevel">
-                {{ form.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue }}%为促销品采购额
+                {{ form.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue?item.promotionValue.toFixed(2):'0.00' }}%为促销品采购额
               </div>
             </div>
           </div>
@@ -280,7 +280,7 @@ export default {
   },
   computed: {
     perCentNum () {
-      const val = (this.form.giveRuleList[0].regularValue && this.form.giveRuleList[0].regularValue != 0) ? Math.floor(((this.form.giveRuleList[0].promotionValue / this.form.giveRuleList[0].regularValue) * 100).toFixed(2)) : 0
+      const val = (this.form.giveRuleList[0].regularValue && this.form.giveRuleList[0].regularValue != 0) ? ((this.form.giveRuleList[0].promotionValue / this.form.giveRuleList[0].regularValue) * 100).toFixed(2) : '0.00'
       return val
     },
     setColumns () {
@@ -288,9 +288,9 @@ export default {
       var arr = []
       if (_this.form.discountType === '1') {
         arr = [
-          { title: '省价折扣', dataIndex: 'provinceValue', width: '33%', align: 'center', customRender: function (text) { return (text + '%') || '--' } },
-          { title: '市价折扣', dataIndex: 'cityValue', width: '33%', align: 'center', customRender: function (text) { return (text + '%') || '--' } },
-          { title: '特约折扣', dataIndex: 'specialValue', width: '33%', align: 'center', customRender: function (text) { return (text + '%') || '--' } }
+          { title: '省价折扣', dataIndex: 'provinceValue', width: '33%', align: 'center', customRender: function (text) { return (text ? (text.toFixed(2) + '%') : '--') } },
+          { title: '市价折扣', dataIndex: 'cityValue', width: '33%', align: 'center', customRender: function (text) { return (text ? (text.toFixed(2) + '%') : '--') } },
+          { title: '特约折扣', dataIndex: 'specialValue', width: '33%', align: 'center', customRender: function (text) { return (text ? (text.toFixed(2) + '%') : '--') } }
         ]
       } else if (_this.form.discountType === '2') {
         arr = [
@@ -319,9 +319,9 @@ export default {
         { title: '设置起订量', width: '7%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
       ]
       if (_this.form.discountType == '0' || _this.form.discountType == '1') {
-        arr.splice(5, 0, { title: '省级折扣', dataIndex: 'provinceDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } })
-        arr.splice(8, 0, { title: '市级折扣', dataIndex: 'cityDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } })
-        arr.splice(11, 0, { title: '特约折扣', dataIndex: 'specialDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } })
+        arr.splice(5, 0, { title: '省级折扣', dataIndex: 'provinceDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text.toFixed(2) + '%') : '--') } })
+        arr.splice(8, 0, { title: '市级折扣', dataIndex: 'cityDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text.toFixed(2) + '%') : '--') } })
+        arr.splice(11, 0, { title: '特约折扣', dataIndex: 'specialDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text.toFixed(2) + '%') : '--') } })
       } else {
         arr.splice(5, 0, { title: '省价直降金额', dataIndex: 'provinceSubtract', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? ('-' + text) : '--') } })
         arr.splice(8, 0, { title: '市价直降金额', dataIndex: 'citySubtract', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? ('-' + text) : '--') } })

+ 2 - 2
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -441,7 +441,7 @@ export default {
           form.giveRuleList = _this.fullGiftRuleList
           if (form.gateFlag == '1') {
             if (form.gateType === 'RATIO_AMOUNT') {
-              form.gateInfo = '购买门槛产品金额' + form.gateValue + '作为配额'
+              form.gateInfo = '购买门槛产品金额' + (form.gateValue * 100).toFixed(2) + '%作为配额'
             } else if (form.gateType === 'MIN_AMOUNT') {
               form.gateInfo = '购买门槛产品满最低金额' + form.gateValue + '不限制配额'
             } else {
@@ -459,7 +459,7 @@ export default {
           } else {
             newInfo = '按比例;'
             _this.fullGiftRuleList.forEach((item, i) => {
-              newInfo += `<div>${i > 0 ? (i * 1 + 1) + '、' : ''}购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送正价产品总金额的${item.promotionValue}%为促销品采购额</div>`
+              newInfo += `<div>${_this.fullGiftRuleList.length > 1 ? (i * 1 + 1) + '、' : ''}购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送正价产品总金额的${item.promotionValue}%为促销品采购额</div>`
             })
           }
           form.ruleInfo = newInfo

+ 2 - 2
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -481,7 +481,7 @@ export default {
           form.giveRuleList = _this.fullGiftRuleList
           if (form.gateFlag == '1') {
             if (form.gateType === 'RATIO_AMOUNT') {
-              form.gateInfo = '购买门槛产品金额' + form.gateValue + '作为配额'
+              form.gateInfo = '购买门槛产品金额' + (form.gateValue * 100).toFixed(2) + '%作为配额'
             } else if (form.gateType === 'MIN_AMOUNT') {
               form.gateInfo = '购买门槛产品满最低金额' + form.gateValue + '不限制配额'
             } else {
@@ -490,7 +490,7 @@ export default {
           }
           var newInfo = `<div>${form.accrualFlag == '1' ? '数量叠加;' : ''}${form.convertExpenseFlag == '1' ? '可转费用报销单;' : ''}</div>`
           _this.fullGiftRuleList.forEach((item, i) => {
-            newInfo += `<div>${i > 0 ? (i * 1 + 1) + '、' : ''}${form.regularSameFlag == '1' ? '同款' : '不同款'}产品购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送${item.promotionValue}个促销产品</div>`
+            newInfo += `<div>${_this.fullGiftRuleList.length > 1 ? (i * 1 + 1) + '、' : ''}${form.regularSameFlag == '1' ? '同款' : '不同款'}产品购买满${item.regularValue}${form.regularUnit == 'YUAN' ? '元' : '个'}正价产品,送${item.promotionValue}个促销产品</div>`
           })
           newInfo += form.restrictFlag == '1' ? `<div>限制正价产品${form.restrictCategory}款</div>` : ''
           form.ruleInfo = newInfo

+ 1 - 1
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -440,7 +440,7 @@ export default {
           form.promotionSn = _this.promotionSn
           if (form.gateFlag == '1') {
             if (form.gateType === 'RATIO_AMOUNT') {
-              form.gateInfo = '购买门槛产品金额' + form.gateValue + '作为配额'
+              form.gateInfo = '购买门槛产品金额' + (form.gateValue * 100).toFixed(2) + '%作为配额'
             } else if (form.gateType === 'MIN_AMOUNT') {
               form.gateInfo = '购买门槛产品满最低金额' + form.gateValue + '不限制配额'
             } else {

+ 21 - 15
src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

@@ -123,7 +123,7 @@
           <span v-else>{{ (record.provinceDiscountRate||record.provinceDiscountRate==0)?record.provinceDiscountRate+'%':'--' }}</span>
         </div>
         <div v-else>
-          <span v-if="rulesType=='1'">{{ (setData[0].provinceValue||setData[0].provinceValue==0)?setData[0].provinceValue+'%':'--' }}</span>
+          <span v-if="rulesType=='1'">{{ (setData[0].provinceValue||setData[0].provinceValue==0)?setData[0].provinceValue.toFixed(2)+'%':'--' }}</span>
           <span v-else>{{ setData[0].provinceValue?'-'+(setData[0].provinceValue).toFixed(2):setData[0].provinceValue==0?'0.00':'--' }}</span>
         </div>
       </template>
@@ -170,7 +170,7 @@
           <span v-else>{{ (record.cityDiscountRate||record.cityDiscountRate==0)?record.cityDiscountRate+'%':'--' }}</span>
         </div>
         <div v-else>
-          <span v-if="rulesType=='1'">{{ (setData[0].cityValue||setData[0].cityValue==0)?setData[0].cityValue+'%':'--' }}</span>
+          <span v-if="rulesType=='1'">{{ (setData[0].cityValue||setData[0].cityValue==0)?setData[0].cityValue.toFixed(2)+'%':'--' }}</span>
           <span v-else>{{ setData[0].cityValue?'-'+(setData[0].cityValue).toFixed(2):setData[0].cityValue==0?'0.00':'--' }}</span>
         </div>
       </template>
@@ -217,15 +217,21 @@
           <span v-else>{{ (record.specialDiscountRate||record.specialDiscountRate==0) ? record.specialDiscountRate+'%':'--' }}</span>
         </div>
         <div v-else>
-          <span v-if="rulesType=='1'">{{ (setData[0].specialValue||setData[0].specialValue==0)?setData[0].specialValue+'%':'--' }}</span>
+          <span v-if="rulesType=='1'">{{ (setData[0].specialValue||setData[0].specialValue==0)?setData[0].specialValue.toFixed(2)+'%':'--' }}</span>
           <span v-else>{{ setData[0].specialValue?'-'+(setData[0].specialValue).toFixed(2):setData[0].specialValue==0?'0.00':'--' }}</span>
         </div>
       </template>
       <!-- 设置起订量 -->
       <template slot="setNum" slot-scope="text, record">
-        <a-select default-value="SL" v-model="record.unitType" size="small" style="width:100%;"  placeholder="请选择" allowClear>
+        <a-select
+          default-value="SL"
+          v-model="record.unitType"
+          size="small"
+          style="width:100%;"
+          placeholder="请选择"
+          allowClear>
           <a-select-option :value="con.code" v-for="con in unitTypeList" :key="con.id">
-            {{con.dispName}}
+            {{ con.dispName }}
           </a-select-option>
         </a-select>
         <a-input-number
@@ -293,7 +299,7 @@ export default {
       type: Array,
       default: () => []
     },
-    unitTypeList:{
+    unitTypeList: {
       type: Array,
       default: () => []
     }
@@ -363,18 +369,18 @@ export default {
       this.dataSource = this.dataSource.concat(list)
     },
     // 生成随机数
-     generateUniqueRandomNumber() {
-        const timestamp = new Date().getTime();
-        const randomNumber = Math.floor(Math.random() * 1e5).toString().padStart(5, '0');
-        const uniqueRandomNumber = timestamp + randomNumber;
-       return uniqueRandomNumber
-      },
+    generateUniqueRandomNumber () {
+      const timestamp = new Date().getTime()
+      const randomNumber = Math.floor(Math.random() * 1e5).toString().padStart(5, '0')
+      const uniqueRandomNumber = timestamp + randomNumber
+      return uniqueRandomNumber
+    },
     // 新增一行
     handleAddRow () {
       const _this = this
-      let newSn = _this.generateUniqueRandomNumber()
-      if(newSn){
-        let newData = {
+      const newSn = _this.generateUniqueRandomNumber()
+      if (newSn) {
+        const newData = {
           productScopeSn: newSn,
           dataSourceOrigin: '0',
           productTypeArr: [],