chenrui 1 year ago
parent
commit
302a126bcb

+ 62 - 0
src/api/reportData.js

@@ -879,3 +879,65 @@ export const queryReportCount = (params) => {
 //     responseType: 'blob'
 //   })
 // }
+
+/*
+**   促销销售
+*/
+// 促销销售单报表  列表
+export const salesPromoReportList = (params) => {
+  const url = `/report/salesPromoReport/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 促销销售单报表  统计
+export const salesPromoReportQueryCount = (params) => {
+  const url = `/report/salesPromoReport/queryCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 促销销售单报表  导出
+export const exportSalesPromoReport = (params) => {
+  return axios({
+    url: '/report/salesPromoReport/reportExport',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 促销销售单实时报表  列表
+export const salesPromoRealReportList = (params) => {
+  const url = `/report/salesPromoRealReport/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 促销销售单实时报表  统计
+export const salesPromoRealReportCount = (params) => {
+  const url = `/report/salesPromoRealReport/queryCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 促销销售单实时报表  导出
+export const exportSalesPromoRealReport = (params) => {
+  return axios({
+    url: '/report/salesPromoRealReport/reportExport ',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 238 - 230
src/views/reportData/promotionSalesRealTimeReport/index.vue

@@ -1,137 +1,143 @@
 <template>
-  <a-card size="small" :bordered="false" class="receivedSendStorageReport-wrap">
-    <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-      <a-form-model
-        layout="inline"
-        ref="ruleForm"
-        :rules="rules"
-        :model="form">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售审核日期">
-              <rangeDate ref="rangeDate" :value="salesDate" @change="salesDateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="促销时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="促销名称">
-              <a-input id="promotionSalesOrderReport-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入促销名称"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="promotionSalesRealTimeReport-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
+        <a-form-model
+          layout="inline"
+          ref="ruleForm"
+          :rules="rules"
+          :model="queryParam">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="促销类型">
-                <v-select
-                  v-model="queryParam.printStatus"
-                  ref="printStatus"
-                  id="promotionSalesOrderReport-printStatus"
-                  code="PRINT_STATUS"
-                  placeholder="请选择促销类型"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="规则">
-                <a-input id="promotionSalesOrderReport-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入规则关键字"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="销售单号">
-                <a-input id="promotionSalesOrderReport-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入销售单号"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户级别">
-                <v-select
-                  v-model="queryParam.dealerLevel"
-                  ref="dealerLevel"
-                  id="actualSalesReportList-allocateTypeSn"
-                  code="DEALER_LEVEL"
-                  placeholder="请选择客户级别"
-                  allowClear></v-select>
+              <a-form-model-item label="销售审核日期" prop="salesDate">
+                <rangeDate ref="rangeDate" :value="queryParam.salesDate" @change="salesDateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
-                <a-input id="promotionSalesOrderReport-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入客户名称"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="所在区域">
-                <subarea ref="subarea" id="promotionSalesOrderReport-subarea" @change="subareaChange"></subarea>
+              <a-form-model-item label="促销时间">
+                <rangeDate ref="rangeTimeDate" :value="time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
-                <Area id="promotionSalesOrderReport-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+              <a-form-model-item label="促销名称">
+                <a-input id="promotionSalesRealTimeReport-title" v-model.trim="queryParam.promoRuleReport.title" allowClear placeholder="请输入促销名称"/>
               </a-form-model-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-              <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
-              <a-button
-                style="margin-left: 10px"
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                v-if="$hasPermissions('B_sales_export')"
-              >导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-    <a-tabs default-active-key="1" @change="handleChange" :style="{ height: tableHeight+84.5+'px' }">
-      <a-tab-pane key="1" tab="促销销售单报表">
-        <!-- 列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.no"
-          rowKeyName="no"
-          :columns="columns"
-          :data="loadData"
-          :scroll="{ y: tableHeight-120 }"
-          :defaultLoadData="false"
-          bordered>
-          <template slot="footer">
-            <a-row>
-              <a-col span="24">
-                <a-row>
-                  <a-col span="4">数量(非促):{{ (totalData && (totalData.beginQty || totalData.beginQty==0)) ? totalData.beginQty : '--' }}</a-col>
-                  <a-col span="4">数量(促):{{ (totalData && (totalData.beginAmount || totalData.beginAmount==0)) ? toThousands(totalData.beginAmount) : '--' }}</a-col>
-                  <a-col span="4">实售金额:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty : '--' }}</a-col>
-                  <a-col span="4">开单金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount) : '--' }}</a-col>
-                  <a-col span="4">成本金额:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }}</a-col>
-                  <a-col span="4">损失成本:{{ (totalData && (totalData.outPrice || totalData.outPrice==0)) ? toThousands(totalData.outPrice) : '--' }}</a-col>
-                  <a-col span="4">损失费用:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }}</a-col>
-                  <a-col span="4">采购额结余:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }}</a-col>
-                  <a-col span="4">采购额超出:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }}</a-col>
-                </a-row>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="促销类型">
+                  <v-select
+                    v-model="queryParam.promoRuleReport.promotionRuleType"
+                    ref="ruleType"
+                    id="promotionSalesRealTimeReport-ruleType"
+                    code="PROMO_RULE_TYPE"
+                    placeholder="请选择促销类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="规则">
+                  <a-input id="promotionSalesRealTimeReport-description" v-model.trim="queryParam.promoRuleReport.description" allowClear placeholder="请输入规则关键字"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="销售单号">
+                  <a-input id="promotionSalesRealTimeReport-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                </a-form-model-item>
               </a-col>
-            </a-row>
-          </template>
-        </s-table>
-      </a-tab-pane>
-      <a-tab-pane key="2" tab="促销销售单实时报表" force-render>
-        <gatherList ref="gatherBox" :tableHeight="tableHeight" :totalData="totalData" :queryParam="queryParam"></gatherList>
-      </a-tab-pane>
-    </a-tabs>
-    <!-- 导出提示框 -->
-    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户级别">
+                  <v-select
+                    v-model="queryParam.buyerLevel"
+                    ref="buyerLevel"
+                    id="promotionSalesRealTimeReport-buyerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户级别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <a-input id="promotionSalesRealTimeReport-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入客户名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea ref="subarea" id="promotionSalesRealTimeReport-subarea" @change="subareaChange"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                  <Area id="promotionSalesRealTimeReport-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="testForm('search')" >查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  class="button-warning"
+                  @click="testForm('export')"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  v-if="$hasPermissions('B_sales_export')"
+                >导出</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <a-tabs default-active-key="1" @change="handleChange" :style="{ height: tableHeight+84.5+'px' }">
+        <a-tab-pane key="1" tab="促销销售单报表">
+          <!-- 列表 -->
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.no"
+            rowKeyName="no"
+            :columns="columns"
+            :data="loadData"
+            :scroll="{ y: tableHeight-120 }"
+            :defaultLoadData="false"
+            bordered>
+            <!-- 促销时间 -->
+            <template slot="promotionTime" slot-scope="text, record">
+              <span>{{ record.promotionDateStart }}-{{ record.promotionDateEnd }}</span>
+            </template>
+            <template slot="footer">
+              <a-row>
+                <a-col span="24">
+                  <a-row>
+                    <a-col span="4">数量(非促):{{ (totalData && (totalData.notGiftQty || totalData.notGiftQty==0)) ? totalData.notGiftQty : '--' }}</a-col>
+                    <a-col span="4">数量(促):{{ (totalData && (totalData.giftQty || totalData.giftQty==0)) ? toThousands(totalData.giftQty) : '--' }}</a-col>
+                    <a-col span="4">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ?totalData.totalRealAmount : '--' }}</a-col>
+                    <a-col span="4">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
+                    <a-col span="4">成本金额:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? totalData.totalRealCost : '--' }}</a-col>
+                    <a-col span="4">损失成本:{{ (totalData && (totalData.lossCost || totalData.lossCost==0)) ? toThousands(totalData.lossCost) : '--' }}</a-col>
+                    <a-col span="4">损失费用:{{ (totalData && (totalData.lossAmount || totalData.lossAmount==0)) ? toThousands(totalData.lossAmount) : '--' }}</a-col>
+                    <a-col span="4">采购额结余:{{ (totalData && (totalData.surplusPromoGiftsAmount || totalData.surplusPromoGiftsAmount==0)) ? toThousands(totalData.surplusPromoGiftsAmount) : '--' }}</a-col>
+                    <a-col span="4">采购额超出:{{ (totalData && (totalData.outPromoGiftsAmount || totalData.outPromoGiftsAmount==0)) ? toThousands(totalData.outPromoGiftsAmount) : '--' }}</a-col>
+                  </a-row>
+                </a-col>
+              </a-row>
+            </template>
+          </s-table>
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="促销销售单实时报表" force-render>
+          <gatherList ref="gatherBox" :tableHeight="tableHeight" :queryParam="queryParam"></gatherList>
+        </a-tab-pane>
+      </a-tabs>
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-spin>
   </a-card>
 </template>
 
@@ -139,7 +145,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import reportModal from '@/views/common/reportModal.vue'
-import { queryDetailReportPage, exportDetailReport, queryReportCount } from '@/api/reportData'
+import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport, exportSalesPromoRealReport } from '@/api/reportData'
 import { hdExportExcel } from '@/libs/exportExcel'
 import gatherList from './list'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
@@ -154,70 +160,75 @@ export default {
   data () {
     return {
       advanced: true, // 高级搜索 展开/关闭
+      time: [],
+      spinning: false,
       queryParam: {
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        buyerSn: undefined, //  客户名称
-        salesBillNo: '', //  销售单号
-        purchaseBillNo: '',
-        printStatus: undefined,
-        billStatus: undefined, //  业务状态
-        financialStatus: undefined, //  财务状态
-        salesBillSource: undefined,
-        dealerLevel: undefined,
+        salesDate: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
+        endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
+        promoRuleReport: {
+          promotionDateStart: undefined, // 促销时间-开始
+          promotionDateEnd: undefined, // 促销时间-结束
+          title: '', // 促销名称
+          promotionRuleType: undefined, // 促销类型
+          description: ''// 规则
+        },
+        salesBillNo: '', // 销售单号
+        buyerLevel: undefined, // 客户级别
+        buyerName: '', // 客户名称
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: '',
+          subareaAreaSn: ''
         },
-        shippingAddrProvinceSn: undefined,
-        warehouseSn: undefined
+        dealerProvinceSn: undefined, // 省份编码
+        dealerCitySn: undefined, // 城市编码
+        dealerDistrictSn: undefined // 区域编码
       },
-      form: {
-        time: []
-      },
-      totalData: null,
-      tabVal: 1,
       rules: {
-        time: [{ required: true, message: '请选择月份', trigger: 'change' }]
+        salesDate: [{ required: true, message: '请选择销售审核日期', trigger: 'change' }]
       },
-      productType: [],
+      tabVal: 1,
       disabled: false,
       tableHeight: 0,
-      endOpen: false,
+      totalData: null, //  合计
+      exportLoading: false,
       showExport: false,
-      startValue: null,
-      endValue: null,
       columns: [
-        { title: '促销名称', dataIndex: 'buyerName', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
-        { title: '促销时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '费用所属部门', dataIndex: 'submitDate', width: '180px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
-        { title: '促销类型', dataIndex: 'auditDate', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '规则', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '销售单号', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '区域', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '地区', dataIndex: 'buyerName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
+        { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '100px', align: 'center', fixed: 'left' },
+        { title: '费用所属部门', dataIndex: 'departmentName', width: '180px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '促销类型', dataIndex: 'promotionRule.promotionRuleTypeDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '规则', dataIndex: 'description', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '80px', 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: '120px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售审核日期', dataIndex: 'buyerName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量(非促)', dataIndex: 'totalPushedQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量(促)', dataIndex: 'totalPushedQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { 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 : '--') } },
+        { title: '数量(促)', dataIndex: 'giftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实售金额', dataIndex: 'totalRealAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '开单金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '成本金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '损失成本', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '损失费用', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '采购额结余', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '采购额超出', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '促销品费用归属品牌', dataIndex: 'billStatusDictValue', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销品费用归属分类', dataIndex: 'financialStatusDictValue', width: '120px', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '成本金额', dataIndex: 'totalRealCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '损失成本', dataIndex: 'lossCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '损失费用', dataIndex: 'lossAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '采购额结余', dataIndex: 'surplusPromoGiftsAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '采购额超出', dataIndex: 'outPromoGiftsAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '促销品费用归属品牌', dataIndex: 'promoProductBrandName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销品费用归属分类', dataIndex: 'promoProductTypeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
+        const newParams = JSON.parse(JSON.stringify(params))
+        delete newParams.salesDate
         this.spinning = true
-        return queryDetailReportPage(params).then(res => {
+        return salesPromoReportList(newParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -234,8 +245,21 @@ export default {
     }
   },
   methods: {
+    salesDateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.salesDate = date
+      } else {
+        this.queryParam.salesDate = []
+      }
+      this.queryParam.beginAuditDate = date[0] || ''
+      this.queryParam.endAuditDate = date[1] || ''
+    },
+    dateChange (date) {
+      this.queryParam.promoRuleReport.promotionDateStart = date[0]
+      this.queryParam.promoRuleReport.promotionDateEnd = date[1]
+    },
     getCount (params) {
-      queryReportCount(params).then(res => {
+      salesPromoReportQueryCount(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -243,46 +267,11 @@ export default {
         }
       })
     },
-    // 选择月份限制
-    disabledStartDate (startValue) {
-      const endValue = this.endValue
-      if (!startValue || !endValue) {
-        return startValue.valueOf() > this.moment().month(this.moment().month() - 1).valueOf()
-      }
-      return startValue.valueOf() >= endValue.valueOf()
-    },
-    disabledEndDate (endValue) {
-      const startValue = this.startValue
-      if (!startValue) {
-        return endValue.valueOf() > this.moment().month(this.moment().month() - 1).valueOf()
-      }
-      return endValue.valueOf() < startValue.valueOf() || endValue.valueOf() > this.moment().month(this.moment().month() - 1).valueOf()
-    },
-    // 开始时间
-    handleStartOpenChange (open) {
-      if (!open) {
-        this.endOpen = true
-      }
-    },
-    getStartDate (date, dateString) {
-      this.form.time[0] = dateString
-      this.queryParam.beginDate = date ? this.moment(dateString).startOf('month').format('YYYY-MM-DD') + ' 00:00:00' : ''
-    },
-    // 结束时间
-    handleEndOpenChange (open) {
-      this.endOpen = open
-    },
-    getEndDate (date, dateString) {
-      this.form.time[1] = dateString
-      this.queryParam.endDate = date ? this.moment(dateString).endOf('month').format('YYYY-MM-DD') + ' 23:59:59' : ''
-    },
-
-    //  产品分类  change
-    changeProductType (val, opt) {
-      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
-      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
+    // tab
     handleChange (val) {
       this.tabVal = val
     },
@@ -292,17 +281,19 @@ export default {
       const params = this.queryParam
       _this.exportLoading = true
       _this.spinning = true
-      _this.showExport = true
-      hdExportExcel(exportDetailReport, params, '收发存报表', function () {
+      const ajaxUrl = _this.tabVal == 1 ? exportSalesPromoReport : exportSalesPromoRealReport
+      const ajaxName = _this.tabVal == 1 ? '促销销售单报表导出' : '促销销售单实时报表导出'
+      hdExportExcel(ajaxUrl, params, ajaxName, function () {
         _this.exportLoading = false
         _this.spinning = false
+        _this.showExport = true
       })
     },
     // 验证表单 type值  search查询 export导出
     testForm (type) {
       const _this = this
-      if (!_this.form.time[0] || !_this.form.time[1]) {
-        _this.$message.error('请选择月份')
+      if (!_this.queryParam.salesDate[0] || !_this.queryParam.salesDate[1]) {
+        _this.$message.error('请选择销售审核日期')
         return
       }
       _this.$refs.ruleForm.validate(valid => {
@@ -313,7 +304,7 @@ export default {
             _this.handleExport()
           }
         } else {
-          _this.$message.error('请选择月份')
+          _this.$message.error('请选择销售审核日期')
           return false
         }
       })
@@ -322,29 +313,46 @@ export default {
     handleSearch () {
       const _this = this
       // 总计
-      _this.getCount(this.queryParam)
+      const paramData = JSON.parse(JSON.stringify(this.queryParam))
+      delete paramData.salesDate
+      _this.getCount(paramData)
       _this.$refs.table.refresh(true)
       _this.$refs.gatherBox.resetCurForm()
     },
     // 重置
     resetSearchForm () {
       this.$refs.ruleForm.resetFields()
-      this.startValue = null
-      this.endValue = null
+      this.queryParam = {
+        salesDate: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
+        endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
+        promoRuleReport: {
+          promotionDateStart: undefined, // 促销时间-开始
+          promotionDateEnd: undefined, // 促销时间-结束
+          title: '', // 促销名称
+          promotionRuleType: undefined, // 促销类型
+          description: ''// 规则
+        },
+        salesBillNo: '', // 销售单号
+        buyerLevel: undefined, // 客户级别
+        buyerName: '', // 客户名称
+        subareaArea: {
+          subareaSn: '',
+          subareaAreaSn: ''
+        },
+        dealerProvinceSn: undefined, // 省份编码
+        dealerCitySn: undefined, // 城市编码
+        dealerDistrictSn: undefined // 区域编码
+      }
       this.time = []
-      this.queryParam.beginDate = undefined
-      this.queryParam.endDate = undefined
-      this.queryParam.product.code = ''
-      this.queryParam.product.name = ''
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = undefined
-      this.queryParam.productTypeSn2 = undefined
-      this.queryParam.productTypeSn3 = undefined
-      this.queryParam.warehouseSn = undefined
+      this.$refs.subarea.clearData()
+      this.$refs.rangeDate.resetDate(this.queryParam.salesDate)
+      this.$refs.rangeTimeDate.resetDate(this.time)
       this.$refs.table.clearTable()
-      this.productType = []
-      this.totalData = null
-      this.$refs.gatherBox.resetTable()
+      this.$refs.gatherBox.resetCurForm()
     },
     pageInit () {
       const _this = this

+ 73 - 67
src/views/reportData/promotionSalesRealTimeReport/list.vue

@@ -1,47 +1,48 @@
 <template>
-  <div class="productInfoList-wrap">
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.no"
-      rowKeyName="no"
-      :columns="columns"
-      :data="loadData"
-      :showPagination="false"
-      :scroll="{ y: tableHeight-120 }"
-      :defaultLoadData="false"
-      bordered>
-      <template slot="footer">
-        <a-row>
-          <a-col span="24">
-            <a-row>
-              <a-col span="3">实时数量(非促):{{ (totalData && (totalData.beginQty || totalData.beginQty==0)) ? totalData.beginQty : '--' }}</a-col>
-              <a-col span="3">实时数量(促):{{ (totalData && (totalData.beginAmount || totalData.beginAmount==0)) ? toThousands(totalData.beginAmount) : '--' }}</a-col>
-              <a-col span="3">实时实售金额:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty : '--' }}</a-col>
-              <a-col span="3">实时开单金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount) : '--' }}</a-col>
-              <a-col span="3">实时成本金额:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }}</a-col>
-              <a-col span="4">实时损失费用(成本):{{ (totalData && (totalData.outPrice || totalData.outPrice==0)) ? toThousands(totalData.outPrice) : '--' }}</a-col>
-              <a-col span="5">实时损失费用(开单):{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }}</a-col>
-            </a-row>
-          </a-col>
-        </a-row>
-      </template>
-    </s-table>
-  </div>
+  <a-spin :spinning="spinning" tip="Loading...">
+    <div class="productInfoList-wrap">
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.no"
+        rowKeyName="no"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        :scroll="{ y: tableHeight-120 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="24">
+              <a-row>
+                <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>
+                <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>
+                <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>
+              </a-row>
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </div>
+  </a-spin>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryGroupByprodTypeReportPage } from '@/api/reportData'
+import { salesPromoRealReportList, salesPromoRealReportCount } from '@/api/reportData'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
   mixins: [commonMixin],
   components: { STable, VSelect },
   props: {
-    newLoading: Boolean,
     queryParam: {
       type: Object,
       default: function () {
@@ -51,50 +52,45 @@ export default {
     tableHeight: {
       type: Number,
       default: 0
-    },
-    totalData: {
-      type: Object,
-      default: function () {
-        return null
-      }
     }
   },
   data () {
     return {
+      spinning: false,
+      newQueryParam: {}, // 查询条件
+      totalData: null, //  合计
       columns: [
-        { title: '促销名称', dataIndex: 'buyerName', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
-        { title: '促销时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '费用所属部门', dataIndex: 'submitDate', width: '180px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
-        { title: '促销类型', dataIndex: 'auditDate', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '规则', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '销售单号', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '区域', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '地区', dataIndex: 'buyerName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
+        { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '100px', align: 'center', fixed: 'left' },
+        { title: '费用所属部门', dataIndex: 'departmentName', width: '180px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '促销类型', dataIndex: 'promotionRule.promotionRuleTypeDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '规则', dataIndex: 'description', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '80px', 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: '120px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'buyerName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售审核日期', dataIndex: 'buyerName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '实时数量(非促)', dataIndex: 'totalPushedQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实时数量(促)', dataIndex: 'totalPushedQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实时实售金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { 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 : '--') } },
+        { title: '实时数量(促)', dataIndex: 'giftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实时实售金额', dataIndex: 'totalRealAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '实时开单金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '实时成本金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '实时损失成本', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '实时损失费用', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '实时成本金额', dataIndex: 'totalRealCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '实时损失成本', dataIndex: 'lossCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '实时损失费用', dataIndex: 'lossAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ],
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true
-        const params = Object.assign(parameter, this.queryParam)
-        return queryGroupByprodTypeReportPage(params).then(res => {
+        this.spinning = true
+        const params = Object.assign(parameter, this.newQueryParam)
+        return salesPromoRealReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
             }
-            this.disabled = false
           }
           this.spinning = false
           return data
@@ -103,15 +99,25 @@ export default {
     }
   },
   methods: {
-    pageInit (buyerSn) {
-      this.resetCurForm()
+    // 统计
+    getCount (params) {
+      salesPromoRealReportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
     },
     // 刷新当前页面
     resetCurForm () {
-      this.$refs.table.refresh()
-    },
-    resetTable () {
-      this.$refs.table.clearTable()
+      const params = JSON.parse(JSON.stringify(this.queryParam))
+      delete params.salesDate
+      this.newQueryParam = params
+      this.$nextTick(() => {
+        this.getCount(this.newQueryParam)
+        this.$refs.table.refresh()
+      })
     }
   }
 }

+ 1 - 1
src/views/reportData/salesDetails/list.vue

@@ -265,7 +265,7 @@ export default {
       if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { //  售价权限
         arr.push({ title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.push({ title: '优惠金额', dataIndex: 'indirectRebateAmount', width: 140, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '优惠金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         // arr.push({ title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         // arr.push({ title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }

+ 3 - 3
src/views/reportData/salesOrderTotal/list.vue

@@ -110,7 +110,7 @@
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_costPrice')">成本:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_costPrice')&&$hasPermissions('M_salesOrderTotalList_salesPrice')">毛利:{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? toThousands(totalData.grossProfit) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">返利:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? toThousands(totalData.rebateAmount) : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">优惠金额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? toThousands(totalData.rebateAmount) : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">优惠金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
             <!-- <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">折扣金额:{{ (totalData && (totalData.totalDiscountAmount || totalData.totalDiscountAmount==0)) ? toThousands(totalData.totalDiscountAmount) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">折后金额:{{ (totalData && (totalData.totalDiscountedAmount || totalData.totalDiscountedAmount==0)) ? toThousands(totalData.totalDiscountedAmount) : '--' }}</a-col> -->
           </a-row>
@@ -203,7 +203,7 @@ export default {
         { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量(促)', dataIndex: 'totalQty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '数量(促)', dataIndex: 'giftQty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -241,7 +241,7 @@ export default {
         arr.push({ title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.push({ title: '优惠金额', dataIndex: 'rebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '优惠金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         // arr.push({ title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         // arr.push({ title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }

+ 2 - 2
src/views/reportData/salesReturnDetailReport/list.vue

@@ -153,7 +153,7 @@
             <a-col :md="4" :sm="24">良品数量:{{ (totalData && (totalData.goodQty || totalData.goodQty==0)) ? totalData.goodQty : '--' }}</a-col>
             <a-col :md="4" :sm="24">返库数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}</a-col>
             <a-col :md="4" :sm="24">正常退货数量:{{ (totalData && (totalData.totalNormalQty || totalData.totalNormalQty==0)) ? totalData.totalNormalQty : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">成本金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? toThousands(totalData.totalNormalPrice) : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">正常退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? toThousands(totalData.totalNormalPrice) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">正常再入库金额:{{ (totalData && (totalData.totalNormalCost || totalData.totalNormalCost==0)) ? toThousands(totalData.totalNormalCost) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">正常退货入库差额:{{ (totalData && (totalData.totalNormalBalance || totalData.totalNormalBalance==0)) ? toThousands(totalData.totalNormalBalance) : '--' }}</a-col>
@@ -270,7 +270,7 @@ export default {
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本金额', dataIndex: 'price', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '成本金额', dataIndex: 'totalCost', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货原因', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'initialQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },