|
@@ -1,137 +1,143 @@
|
|
<template>
|
|
<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-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-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<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-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<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-form-model-item>
|
|
</a-col>
|
|
</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-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>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -139,7 +145,7 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
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 { hdExportExcel } from '@/libs/exportExcel'
|
|
import gatherList from './list'
|
|
import gatherList from './list'
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
@@ -154,70 +160,75 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
|
+ time: [],
|
|
|
|
+ spinning: false,
|
|
queryParam: {
|
|
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: {
|
|
subareaArea: {
|
|
- subareaSn: undefined,
|
|
|
|
- subareaAreaSn: undefined
|
|
|
|
|
|
+ subareaSn: '',
|
|
|
|
+ subareaAreaSn: ''
|
|
},
|
|
},
|
|
- shippingAddrProvinceSn: undefined,
|
|
|
|
- warehouseSn: undefined
|
|
|
|
|
|
+ dealerProvinceSn: undefined, // 省份编码
|
|
|
|
+ dealerCitySn: undefined, // 城市编码
|
|
|
|
+ dealerDistrictSn: undefined // 区域编码
|
|
},
|
|
},
|
|
- form: {
|
|
|
|
- time: []
|
|
|
|
- },
|
|
|
|
- totalData: null,
|
|
|
|
- tabVal: 1,
|
|
|
|
rules: {
|
|
rules: {
|
|
- time: [{ required: true, message: '请选择月份', trigger: 'change' }]
|
|
|
|
|
|
+ salesDate: [{ required: true, message: '请选择销售审核日期', trigger: 'change' }]
|
|
},
|
|
},
|
|
- productType: [],
|
|
|
|
|
|
+ tabVal: 1,
|
|
disabled: false,
|
|
disabled: false,
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
- endOpen: false,
|
|
|
|
|
|
+ totalData: null, // 合计
|
|
|
|
+ exportLoading: false,
|
|
showExport: false,
|
|
showExport: false,
|
|
- startValue: null,
|
|
|
|
- endValue: null,
|
|
|
|
columns: [
|
|
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: '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: '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 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
|
|
+ const newParams = JSON.parse(JSON.stringify(params))
|
|
|
|
+ delete newParams.salesDate
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- return queryDetailReportPage(params).then(res => {
|
|
|
|
|
|
+ return salesPromoReportList(newParams).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
@@ -234,8 +245,21 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
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) {
|
|
getCount (params) {
|
|
- queryReportCount(params).then(res => {
|
|
|
|
|
|
+ salesPromoReportQueryCount(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.totalData = res.data
|
|
this.totalData = res.data
|
|
} else {
|
|
} 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) {
|
|
handleChange (val) {
|
|
this.tabVal = val
|
|
this.tabVal = val
|
|
},
|
|
},
|
|
@@ -292,17 +281,19 @@ export default {
|
|
const params = this.queryParam
|
|
const params = this.queryParam
|
|
_this.exportLoading = true
|
|
_this.exportLoading = true
|
|
_this.spinning = 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.exportLoading = false
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
|
|
+ _this.showExport = true
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 验证表单 type值 search查询 export导出
|
|
// 验证表单 type值 search查询 export导出
|
|
testForm (type) {
|
|
testForm (type) {
|
|
const _this = this
|
|
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
|
|
return
|
|
}
|
|
}
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
@@ -313,7 +304,7 @@ export default {
|
|
_this.handleExport()
|
|
_this.handleExport()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- _this.$message.error('请选择月份')
|
|
|
|
|
|
+ _this.$message.error('请选择销售审核日期')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -322,29 +313,46 @@ export default {
|
|
handleSearch () {
|
|
handleSearch () {
|
|
const _this = this
|
|
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.table.refresh(true)
|
|
_this.$refs.gatherBox.resetCurForm()
|
|
_this.$refs.gatherBox.resetCurForm()
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.$refs.ruleForm.resetFields()
|
|
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.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.$refs.table.clearTable()
|
|
- this.productType = []
|
|
|
|
- this.totalData = null
|
|
|
|
- this.$refs.gatherBox.resetTable()
|
|
|
|
|
|
+ this.$refs.gatherBox.resetCurForm()
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|