Browse Source

Merge branch 'develop_cuxiao' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_cuxiao

lilei 1 year ago
parent
commit
fd1b208b3a

+ 25 - 0
src/config/router.config.js

@@ -2460,6 +2460,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/reportData/promotionSalesRealTimeReport',
+            redirect: '/reportData/promotionSalesRealTimeReport/index',
+            name: 'promotionSalesRealTimeReport',
+            component: BlankLayout,
+            meta: {
+              title: '促销销售单实时报表',
+              icon: 'profile'
+              // permission: 'M_promotionSalesRealTimeReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'promotionSalesRealTimeReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesRealTimeReport/index.vue'),
+                meta: {
+                  title: '促销销售单实时报表',
+                  icon: 'profile',
+                  hidden: true
+                  // permission: 'M_promotionSalesRealTimeReportList'
+                }
+              }
+            ]
           }
           // {
           //   path: '/reportData/allCountryCostReport',

+ 12 - 10
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -344,16 +344,7 @@ export default {
             form.quotaAmount = ''
             form.gateType = undefined
           }
-          if (form.scopeFlag == '0') {
-            form.giftProductList = this.$refs.offerProduct.getResultVal()
-            if (form.giftProductList.length == 0) {
-              _this.$message.warning('请添加促销产品!')
-              return
-            }
-            rowFlag2 = _this.isJudge(form.giftProductList)
-          } else {
-            form.giftProductList = []
-          }
+
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
           // 判断表格必填
           if (form.regularProductList.length == 0) {
@@ -368,6 +359,17 @@ export default {
             rowFlag3 = _this.isJudge(form.regularProductList)
           }
 
+          if (form.scopeFlag == '0') {
+            form.giftProductList = this.$refs.offerProduct.getResultVal()
+            if (form.giftProductList.length == 0) {
+              _this.$message.warning('请添加促销产品!')
+              return
+            }
+            rowFlag2 = _this.isJudge(form.giftProductList)
+          } else {
+            form.giftProductList = []
+          }
+
           if (rowFlag1 || rowFlag2 || rowFlag3) {
             _this.$message.warning('请选择产品分类、品牌或产品!')
             return

+ 12 - 10
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -378,16 +378,7 @@ export default {
             form.quotaAmount = ''
             form.gateType = undefined
           }
-          if (form.regularPromotionSameFlag == '0') {
-            form.giftProductList = this.$refs.offerProduct.getResultVal()
-            if (form.giftProductList.length == 0) {
-              _this.$message.warning('请添加促销产品!')
-              return
-            }
-            rowFlag2 = _this.isJudge(form.giftProductList)
-          } else {
-            form.giftProductList = []
-          }
+
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
           // 判断表格必填
           if (form.regularProductList.length == 0) {
@@ -401,6 +392,17 @@ export default {
             }
             rowFlag3 = _this.isJudge(form.regularProductList)
           }
+          if (form.regularPromotionSameFlag == '0') {
+            form.giftProductList = this.$refs.offerProduct.getResultVal()
+            if (form.giftProductList.length == 0) {
+              _this.$message.warning('请添加促销产品!')
+              return
+            }
+            rowFlag2 = _this.isJudge(form.giftProductList)
+          } else {
+            form.giftProductList = []
+          }
+
           if (rowFlag1 || rowFlag2 || rowFlag3) {
             _this.$message.warning('请选择产品分类、品牌或产品!')
             return

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

@@ -295,7 +295,7 @@ export default {
             const isCountEmpty = _this.isNumEmpty(form.specialProductList)
             const isMoneyEmpty = _this.isNumEmpty(form.specialProductList)
             if (isCountEmpty.flag) {
-              _this.$message.warning('促销比例不能为空!')
+              _this.$message.warning('折扣不能为空!')
               return
             }
             if (isCountEmpty.flag1) {

+ 5 - 3
src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

@@ -104,7 +104,7 @@
             v-model="record.provinceDiscountRate"
             style="width:80%;"
             type="number"
-            @input="record.provinceDiscountRate=record.provinceDiscountRate.length>6?record.provinceDiscountRate.slice(0,6):record.provinceDiscountRate"
+            @input="record.provinceDiscountRate=record.provinceDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g) ? record.provinceDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g)[0] : ''"
             :min="0"
             placeholder="请输入"
             size="small"/>%
@@ -135,7 +135,7 @@
             style="width:80%;"
             type="number"
             placeholder="请输入"
-            @input="record.cityDiscountRate=record.cityDiscountRate.length>6?record.cityDiscountRate.slice(0,6):record.cityDiscountRate"
+            @input="record.cityDiscountRate=record.cityDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g) ? record.cityDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g)[0] : ''"
             :min="0"
             size="small"/>%
         </div>
@@ -164,9 +164,10 @@
             v-model="record.specialDiscountRate"
             style="width:80%;"
             type="number"
-            @input="record.specialDiscountRate=record.specialDiscountRate.length>6?record.specialDiscountRate.slice(0,6):record.specialDiscountRate"
+            @input="record.specialDiscountRate=record.specialDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g) ? record.specialDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g)[0] : ''"
             :min="0"
             placeholder="请输入"
+            step="0.01"
             size="small"/>%
         </div>
         <span v-else>{{ (record.specialDiscountRate||record.specialDiscountRate==0) ? record.specialDiscountRate+'%':'--' }}</span>
@@ -265,6 +266,7 @@ export default {
       openTypeModal: false,
       chooseBrand: [],
       chooseType: [],
+      val: '',
       brandTagIndex: null, // 所选品牌位置
       classifyTagIndex: null, // 所选分类位置
       dataSourceOrigin: 0 // 数据来源  1  选择产品  0 新增一行品类

+ 384 - 0
src/views/reportData/promotionSalesRealTimeReport/index.vue

@@ -0,0 +1,384 @@
+<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-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>
+            </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>
+            </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>
+            </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>
+              </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-card>
+</template>
+
+<script>
+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 { hdExportExcel } from '@/libs/exportExcel'
+import gatherList from './list'
+import chooseWarehouse from '@/views/common/chooseWarehouse'
+import rangeDate from '@/views/common/rangeDate.vue'
+import getDate from '@/libs/getDate.js'
+import subarea from '@/views/common/subarea.js'
+import Area from '@/views/common/area.js'
+export default {
+  name: 'PriceDifferenceDetailReportList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, gatherList, reportModal, chooseWarehouse, Area, rangeDate, subarea },
+  data () {
+    return {
+      advanced: true, // 高级搜索 展开/关闭
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        buyerSn: undefined, //  客户名称
+        salesBillNo: '', //  销售单号
+        purchaseBillNo: '',
+        printStatus: undefined,
+        billStatus: undefined, //  业务状态
+        financialStatus: undefined, //  财务状态
+        salesBillSource: undefined,
+        dealerLevel: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        shippingAddrProvinceSn: undefined,
+        warehouseSn: undefined
+      },
+      form: {
+        time: []
+      },
+      totalData: null,
+      tabVal: 1,
+      rules: {
+        time: [{ required: true, message: '请选择月份', trigger: 'change' }]
+      },
+      productType: [],
+      disabled: false,
+      tableHeight: 0,
+      endOpen: 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: '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: '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 || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        return queryDetailReportPage(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    getCount (params) {
+      queryReportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    // 选择月份限制
+    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] : ''
+    },
+    handleChange (val) {
+      this.tabVal = val
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      _this.exportLoading = true
+      _this.spinning = true
+      _this.showExport = true
+      hdExportExcel(exportDetailReport, params, '收发存报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    // 验证表单 type值  search查询 export导出
+    testForm (type) {
+      const _this = this
+      if (!_this.form.time[0] || !_this.form.time[1]) {
+        _this.$message.error('请选择月份')
+        return
+      }
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          if (type == 'search') {
+            _this.handleSearch()
+          } else {
+            _this.handleExport()
+          }
+        } else {
+          _this.$message.error('请选择月份')
+          return false
+        }
+      })
+    },
+    // 查询
+    handleSearch () {
+      const _this = this
+      // 总计
+      _this.getCount(this.queryParam)
+      _this.$refs.table.refresh(true)
+      _this.$refs.gatherBox.resetCurForm()
+    },
+    // 重置
+    resetSearchForm () {
+      this.$refs.ruleForm.resetFields()
+      this.startValue = null
+      this.endValue = null
+      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.table.clearTable()
+      this.productType = []
+      this.totalData = null
+      this.$refs.gatherBox.resetTable()
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 200
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  }
+}
+
+</script>
+
+<style lang="less" scoped>
+  .monthBox{
+    /deep/.ant-calendar-picker-icon{
+      display:none !important;
+    }
+    /deep/.ant-calendar-picker input{
+      text-align:center;
+    }
+  }
+</style>

+ 136 - 0
src/views/reportData/promotionSalesRealTimeReport/list.vue

@@ -0,0 +1,136 @@
+<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>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { queryGroupByprodTypeReportPage } 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 () {
+        return {}
+      }
+    },
+    tableHeight: {
+      type: Number,
+      default: 0
+    },
+    totalData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      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: '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: '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) : '--') } }
+      ],
+      disabled: false, //  查询、重置按钮是否可操作
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        return queryGroupByprodTypeReportPage(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
+        })
+      }
+    }
+  },
+  methods: {
+    pageInit (buyerSn) {
+      this.resetCurForm()
+    },
+    // 刷新当前页面
+    resetCurForm () {
+      this.$refs.table.refresh()
+    },
+    resetTable () {
+      this.$refs.table.clearTable()
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .productInfoList-wrap{
+    .ellipsisCon{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      .ellipsisText{
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: box;
+        display: -webkit-box;
+        -webkit-line-clamp: 1;
+        -webkit-box-orient: vertical;
+      }
+    }
+  }
+</style>

+ 35 - 34
src/views/reportData/salesDetails/list.vue

@@ -28,26 +28,26 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品名称">
-                  <a-input id="salesDetailsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户名称">
-                  <a-input id="salesDetailsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户级别">
-                  <v-select
-                    v-model="queryParam.dealerLevel"
-                    ref="dealerLevel"
-                    id="salesDetailsList-dealerLevel"
-                    code="DEALER_LEVEL"
-                    placeholder="请选择客户级别"
-                    allowClear></v-select>
-                </a-form-model-item>
-              </a-col>
+              <a-form-model-item label="产品名称">
+                <a-input id="salesDetailsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <a-input id="salesDetailsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户级别">
+                <v-select
+                  v-model="queryParam.dealerLevel"
+                  ref="dealerLevel"
+                  id="salesDetailsList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户级别"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="品牌分类">
@@ -76,12 +76,12 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                    <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                    <AreaList id="salesDetailsList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="salesDetailsList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -129,8 +129,8 @@
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">实售价:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? toThousands(totalData.totalRealSaleAmount) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">开单价:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')">成本:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? toThousands(totalData.totalRealCost) : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
+          <!--  <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col> -->
           </a-row>
         </template>
       </s-table>
@@ -182,7 +182,7 @@ export default {
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined,
           bizUserSn: undefined
@@ -242,7 +242,7 @@ export default {
         { title: '产品名称', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '成本价', dataIndex: 'totalRealCost', 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 : '--') } },
@@ -258,15 +258,16 @@ export default {
       if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { //  售价权限
         arr.push({ title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      } 
+      }
       if (this.$hasPermissions('M_salesDetailsList_cityPrice')) { //  市级价权限
         arr.push({ title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { //  售价权限  
+      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: '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) : '--') } })
+        arr.push({ title: '优惠金额', dataIndex: 'indirectRebateAmount', width: 140, 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) : '--') } })
       }
       arr.push({ title: '操作员', dataIndex: 'operatorName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       return arr
@@ -293,7 +294,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          _this.$message.error("请选择销售日期")
+          _this.$message.error('请选择销售日期')
           return false
         }
       })
@@ -311,7 +312,7 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -341,7 +342,7 @@ export default {
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
       this.queryParam.warehouseSn = undefined
-      if(this.advanced){
+      if (this.advanced) {
         this.$refs.subarea.clearData()
         this.$refs.areaList.clearData()
       }
@@ -376,7 +377,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    areaChange(val){
+    areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
       this.queryParam.dealerCountySn = val[2] ? val[2] : ''

+ 22 - 19
src/views/reportData/salesOrderTotal/list.vue

@@ -110,8 +110,9 @@
             <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.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-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.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>
         </template>
       </s-table>
@@ -129,7 +130,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import Area  from '@/views/common/area.js'
+import Area from '@/views/common/area.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { userQueryList } from '@/api/power-user'
 import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
@@ -154,7 +155,7 @@ export default {
         dealerName: '',
         dealerLevel: undefined,
         operatorSn: undefined,
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
@@ -202,6 +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: '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 : '--') } },
@@ -214,33 +216,34 @@ export default {
         // { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        
+
       ]
-      if(this.$hasPermissions('M_salesOrderTotalList_salesPrice')){
-          arr.push({ title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-          arr.push({ title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
+        arr.push({ title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_salesOrderTotalList_costPrice')) { //  成本价权限
         arr.push({ title: '成本价', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        if(this.$hasPermissions('M_salesOrderTotalList_salesPrice')){
-           arr.push({ title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
+          arr.push({ title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       }
-      if(this.$hasPermissions('M_salesOrderTotalList_provincePrice')){
+      if (this.$hasPermissions('M_salesOrderTotalList_provincePrice')) {
         arr.push({ title: '省级价', dataIndex: 'totalProvinceAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      if(this.$hasPermissions('M_salesOrderTotalList_cityPrice')){
+      if (this.$hasPermissions('M_salesOrderTotalList_cityPrice')) {
         arr.push({ title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      if(this.$hasPermissions('M_salesOrderTotalList_specialPrice')){
+      if (this.$hasPermissions('M_salesOrderTotalList_specialPrice')) {
         arr.push({ title: '特约加盟店价', dataIndex: 'totalSpecialAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      if(this.$hasPermissions('M_salesOrderTotalList_salesPrice')){
+      if (this.$hasPermissions('M_salesOrderTotalList_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: 'rebateAmount', 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) : '--') } })
+        arr.push({ title: '优惠金额', dataIndex: 'rebateAmount', 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) : '--') } })
       }
       arr.push({ title: '操作员', dataIndex: 'operatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       return arr
@@ -267,7 +270,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          _this.$message.error("请选择销售日期")
+          _this.$message.error('请选择销售日期')
           return false
         }
       })
@@ -285,7 +288,7 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -306,7 +309,7 @@ export default {
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.dealerProvinceSn = undefined
       this.totalData = null
-      if(this.advanced){
+      if (this.advanced) {
         this.$refs.subarea.clearData()
       }
       this.$refs.ruleForm.resetFields()

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

@@ -153,6 +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.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>
@@ -269,6 +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: '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 : '--') } },