chenrui 1 سال پیش
والد
کامیت
5a82f5b406

+ 13 - 4
src/views/reportData/promotionSalesRealTimeReport/index.vue

@@ -17,7 +17,7 @@
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <!-- :disabledDate="disabledDate" -->
-                  <a-form-model-item label="促销时间">
+                  <a-form-model-item label="促销开始时间">
                     <a-range-picker
                       style="width:100%"
                       v-model="time"
@@ -119,6 +119,12 @@
             <template slot="promotionTime" slot-scope="text, record">
               <span>{{ record.promotion.promotionDateStart }}-{{ record.promotion.promotionDateEnd }}</span>
             </template>
+            <!-- 规则 -->
+            <template slot="promotionDesc" slot-scope="text, record">
+              <span v-if="record.promotionRule.promotionRuleType=='PROMO_PROD'">{{ record.promotionRule.promotionRuleTypeDictValue }}</span>
+              <span v-else-if="record.promotionRule.promotionRuleType=='RATIO_AMOUNT'">{{ record.promotionRule.regularSameFlag==1?'同款':'不同款' }}产品购买满{{ record.promotionRule.regularQty }}个正价产品,送{{ record.promotionQty }}个促销产品</span>
+              <span v-else>购买满{{ record.promotionRule.regularAmount }}元正价产品,送{{ record.promotionRule.giveAmount }}元促销品采购额{{ record.promotionRule.accrualFlag&&record.promotionRule.accrualFlag==1?'(金额叠加)':'(金额不叠加)' }}</span>
+            </template>
             <!-- 地区 -->
             <template slot="addressInfo" slot-scope="text, record">
               <span>{{ record.provinceName }}{{ record.cityName?'/'+record.cityName:'' }}{{ record.districtName?'/'+record.districtName :'' }}</span>
@@ -212,14 +218,14 @@ export default {
       columns: [
         { title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '130px', align: 'center', fixed: 'left' },
-        { title: '费用所属部门', dataIndex: 'departmentName', width: '180px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '费用所属部门', dataIndex: 'departmentName', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
         { title: '促销类型', dataIndex: 'promotionRule.promotionRuleTypeDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '规则', dataIndex: 'promotionRule.description', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '规则', dataIndex: 'promotionRule.description', width: '180px', align: 'center', scopedSlots: { customRender: 'promotionDesc' }, fixed: 'left' },
         { title: '销售单号', dataIndex: 'salesBillNo', width: '120px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '地区', dataIndex: 'provinceName', width: '160px', align: 'center', scopedSlots: { customRender: 'addressInfo' } },
-        { title: '客户名称', dataIndex: 'buyerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '140px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'buyerLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售审核日期', dataIndex: 'auditDate', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量(非促)', dataIndex: 'notGiftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -272,6 +278,9 @@ export default {
       if (dateString[0] != '' && dateString[1] != '') {
         this.queryParam.promoRuleReport.promotionDateStart = dateString[0] + ' 00:00:00'
         this.queryParam.promoRuleReport.promotionDateEnd = dateString[1] + ' 23:59:59'
+      } else {
+        this.$set(this.queryParam.promoRuleReport, 'promotionDateStart', undefined)
+        this.$set(this.queryParam.promoRuleReport, 'promotionDateEnd', undefined)
       }
     },
     // // 不可选日期

+ 16 - 16
src/views/reportData/promotionSalesRealTimeReport/list.vue

@@ -128,6 +128,12 @@
         <template slot="promotionTime" slot-scope="text, record">
           <span>{{ record.promotion.promotionDateStart }}-{{ record.promotion.promotionDateEnd }}</span>
         </template>
+        <!-- 规则 -->
+        <template slot="promotionDesc" slot-scope="text, record">
+          <span v-if="record.promotionRule.promotionRuleType=='PROMO_PROD'">{{ record.promotionRule.promotionRuleTypeDictValue }}</span>
+          <span v-else-if="record.promotionRule.promotionRuleType=='RATIO_AMOUNT'">{{ record.promotionRule.regularSameFlag==1?'同款':'不同款' }}产品购买满{{ record.promotionRule.regularQty }}个正价产品,送{{ record.promotionQty }}个促销产品</span>
+          <span v-else>购买满{{ record.promotionRule.regularAmount }}元正价产品,送{{ record.promotionRule.giveAmount }}元促销品采购额{{ record.promotionRule.accrualFlag&&record.promotionRule.accrualFlag==1?'(金额叠加)':'(金额不叠加)' }}</span>
+        </template>
         <!-- 地区 -->
         <template slot="addressInfo" slot-scope="text, record">
           <span>{{ record.provinceName }}{{ record.cityName?'/'+record.cityName:'' }}{{ record.districtName?'/'+record.districtName :'' }}</span>
@@ -139,17 +145,17 @@
                 <a-col
                   span="3">实时数量(非促):{{ (totalData && (totalData.notGiftQty || totalData.notGiftQty==0)) ? totalData.notGiftQty : '--' }}</a-col>
                 <a-col
-                  span="3">实时数量(促):{{ (totalData && (totalData.giftQty || totalData.giftQty==0)) ? toThousands(totalData.giftQty) : '--' }}</a-col>
+                  span="3">实时数量(促):{{ (totalData && (totalData.giftQty || totalData.giftQty==0)) ? totalData.giftQty : '--' }}</a-col>
                 <a-col
                   span="3">实时实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ?totalData.totalRealAmount : '--' }}</a-col>
                 <a-col
                   span="3">实时开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
                 <a-col
-                  span="3">实时成本金额:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? totalData.totalRealCost : '--' }}</a-col>
+                  span="3">实时成本金额:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? toThousands(totalData.totalRealCost) : '--' }}</a-col>
                 <a-col
-                  span="4">实时损失费用(成本:{{ (totalData && (totalData.lossCost || totalData.lossCost==0)) ? toThousands(totalData.lossCost) : '--' }}</a-col>
+                  span="4">实时损失成本:{{ (totalData && (totalData.lossCost || totalData.lossCost==0)) ? toThousands(totalData.lossCost) : '--' }}</a-col>
                 <a-col
-                  span="5">实时损失费用(开单):{{ (totalData && (totalData.lossAmount || totalData.lossAmount==0)) ? toThousands(totalData.lossAmount) : '--' }}</a-col>
+                  span="5">实时损失费用:{{ (totalData && (totalData.lossAmount || totalData.lossAmount==0)) ? toThousands(totalData.lossAmount) : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -258,7 +264,7 @@ export default {
       {
         title: '费用所属部门',
         dataIndex: 'departmentName',
-        width: '180px',
+        width: '160px',
         align: 'center',
         customRender: function (text) {
           return text || '--'
@@ -276,16 +282,7 @@ export default {
         },
         fixed: 'left'
       },
-      {
-        title: '规则',
-        dataIndex: 'promotionRule.description',
-        width: '160px',
-        align: 'center',
-        customRender: function (text) {
-          return text || '--'
-        },
-        fixed: 'left'
-      },
+      { title: '规则', dataIndex: 'promotionRule.description', width: '180px', align: 'center', scopedSlots: { customRender: 'promotionDesc' }, fixed: 'left' },
       {
         title: '销售单号',
         dataIndex: 'salesBillNo',
@@ -324,7 +321,7 @@ export default {
       {
         title: '客户名称',
         dataIndex: 'buyerName',
-        width: '100px',
+        width: '140px',
         align: 'center',
         customRender: function (text) {
           return text || '--'
@@ -464,6 +461,9 @@ export default {
       if (dateString[0] != '' && dateString[1] != '') {
         this.newQueryParam.promoRuleReport.promotionDateStart = dateString[0] + ' 00:00:00'
         this.newQueryParam.promoRuleReport.promotionDateEnd = dateString[1] + ' 23:59:59'
+      } else {
+        this.$set(this.newQueryParam.promoRuleReport, 'promotionDateStart', undefined)
+        this.$set(this.newQueryParam.promoRuleReport, 'promotionDateEnd', undefined)
       }
     },
     subareaChange (val) {