|
@@ -0,0 +1,382 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <div class="table-page-search-wrapper newTableSearchName">
|
|
|
+ <a-form-model
|
|
|
+ id="billingBackReportList-form"
|
|
|
+ ref="ruleForm"
|
|
|
+ class="form-model-con"
|
|
|
+ layout="inline"
|
|
|
+ :rules="rules"
|
|
|
+ :model="queryParam"
|
|
|
+ @keyup.enter.native="handleSearch">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="退货完成时间" prop="time">
|
|
|
+ <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="5" :sm="24">
|
|
|
+ <a-form-model-item label="供应商名称" prop="salesStatusType">
|
|
|
+ <a-input id="billingBackReport-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="所在区域/分区">
|
|
|
+ <subarea id="billingBackReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="7" :sm="24">
|
|
|
+ <a-form-model-item label="地区">
|
|
|
+ <div style="display:flex;algin-item:center;">
|
|
|
+ <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
|
|
|
+ <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="24" :sm="24" style="margin-bottom: 10px;display:flex;algin-item:center;justify-content: center;">
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="billingBackReportList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="billingBackReportList-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 5px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ v-if="$hasPermissions('B_regionTypeSalesReportExport')"
|
|
|
+ id="billingBackReportList-export">导出</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form-model>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :showPagination="false"
|
|
|
+ :scroll="{ x: 1550 }"
|
|
|
+ bordered>
|
|
|
+ <template slot="footer">
|
|
|
+ <a-row>
|
|
|
+ <a-col span="2">合计:</a-col>
|
|
|
+ <a-col span="22">
|
|
|
+ <a-row>
|
|
|
+ <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? toThousands(totalData.jpLqqAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">箭牌变速箱滤清器:{{ (totalData && (totalData.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? toThousands(totalData.jpBsxLqqAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">滤清器合计:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">箭牌雨燕雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">雨刮片合计:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? toThousands(totalData.jpLbAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? toThousands(totalData.jpScpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">TBU+箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? toThousands(totalData.jpGyxAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? toThousands(totalData.gpScpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">TBU刹车片:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">TBU刹车油:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">刹车片合计:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">TBU-P刹车盘:{{ (totalData && (totalData.tbupAmount || totalData.tbupAmount==0)) ? toThousands(totalData.tbupAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">汇箭蓄电池:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? toThousands(totalData.hjAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">布瑞斯蓄电池:{{ (totalData && (totalData.brsAmount || totalData.brsAmount==0)) ? toThousands(totalData.brsAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">德路斯机油:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">德路斯变速箱油:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">德路斯刹车油:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">德路斯合计:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">稳升点火线圈:{{ (totalData && (totalData.wsDhxqAmount || totalData.wsDhxqAmount==0)) ? toThousands(totalData.wsDhxqAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">稳升LED灯:{{ (totalData && (totalData.wsDpAmount || totalData.wsDpAmount==0)) ? toThousands(totalData.wsDpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">稳升合计:{{ (totalData && (totalData.wsDpAmount || totalData.wsDpAmount==0)) ? toThousands(totalData.wsDpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">NGK火花塞:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? toThousands(totalData.ngkAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? toThousands(totalData.flpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">车仆防冻液:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? toThousands(totalData.cpAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? toThousands(totalData.wetAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? toThousands(totalData.lbstAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? toThousands(totalData.defAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? toThousands(totalData.bndAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? toThousands(totalData.bndAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="12">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? toThousands(totalData.bndAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4" style="margin-top:20px;">品牌合计:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4" style="margin-top:20px;">代理品牌合计:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4" style="margin-top:20px;">开单采退金额合计:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
|
|
|
+
|
|
|
+ </a-row>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ <!-- 导出提示框 -->
|
|
|
+ <reportModal :visible="showExport" @close="showExport=false"></reportModal>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import { getArea } from '@/api/data'
|
|
|
+import subarea from '@/views/common/subarea.js'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+import reportModal from '@/views/common/reportModal.vue'
|
|
|
+import { realReportSalesByProvince, realReportSalesByProvinceExport, realReportSalesBySubArea, realReportSalesBySubAreaExport } from '@/api/reportData.js'
|
|
|
+export default {
|
|
|
+ name: 'RegionTypeSalesReportList',
|
|
|
+ mixins: [commonMixin],
|
|
|
+ components: { STable, VSelect, rangeDate, subarea, reportModal },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ tabsList: [{ id: 0, name: '各省品类实售明细' }, { id: 1, name: '各区品类实售明细' }],
|
|
|
+ salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实售退货' }, { code: 'REAL_SALES', name: '实际销售' }],
|
|
|
+ activeKey: 0,
|
|
|
+ showExport: false,
|
|
|
+ queryParam: {
|
|
|
+ time: [],
|
|
|
+ beginDate: '',
|
|
|
+ endDate: '',
|
|
|
+ dealer: {
|
|
|
+ 'dealerSn': undefined,
|
|
|
+ 'provinceSn': undefined,
|
|
|
+ 'citySn': undefined,
|
|
|
+ 'districtSn': undefined,
|
|
|
+ 'subareaSn': undefined,
|
|
|
+ 'dealerLevel': undefined
|
|
|
+ },
|
|
|
+ dealerProvinceSn: undefined,
|
|
|
+ subareaSn: undefined,
|
|
|
+ salesStatusType: 'REAL_SALES'
|
|
|
+ },
|
|
|
+ addrProvinceList: [], // 省下拉
|
|
|
+ addrCityList: [], // 市下拉
|
|
|
+ addrDistrictList: [], // 区下拉
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false,
|
|
|
+ rules: {
|
|
|
+ 'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }],
|
|
|
+ 'salesStatusType': [{ required: true, message: '请选择销售状态', trigger: 'change' }]
|
|
|
+ },
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ const paramsPage = Object.assign(this.queryParam) // 无分页
|
|
|
+ const jkUrl = this.activeKey == 0 ? realReportSalesByProvince : realReportSalesBySubArea
|
|
|
+ return jkUrl(paramsPage).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ }
|
|
|
+ this.disabled = false
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ columns () {
|
|
|
+ const _this = this
|
|
|
+ const arr = [
|
|
|
+ { title: '区域', dataIndex: 'subareaNames', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '分区', dataIndex: 'subareaNames', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '供应商名称', dataIndex: 'subareaNames', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '箭牌滤清器', dataIndex: 'jpLqqAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '箭牌变速箱滤清器', dataIndex: 'jpLqqAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '冠牌滤清器', dataIndex: 'gpLqqAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '滤清器合计', dataIndex: 'lqqAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '箭牌雨刮片', dataIndex: 'jpYgpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '箭牌雨燕雨刮片', dataIndex: 'jpYgpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '冠牌雨刮片', dataIndex: 'gpYgpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '雨刮片合计', dataIndex: 'ygpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '箭牌喇叭', dataIndex: 'jpLbAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '箭牌刹车片', dataIndex: 'jpScpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: 'TBU+箭牌感应线', dataIndex: 'jpGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '冠牌刹车片', dataIndex: 'gpScpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: 'TBU刹车片', dataIndex: 'tbuScpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: 'TBU刹车油', dataIndex: 'tbuScyAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '刹车片合计', dataIndex: 'scpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: 'TBU-P刹车盘', dataIndex: 'tbupAmount', align: 'right', width: 50, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '汇箭蓄电池', dataIndex: 'hjAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '布瑞斯蓄电池', dataIndex: 'brsAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '德路斯机油', dataIndex: 'dlsJyAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '德路斯变速箱油', dataIndex: 'dlsBsxyAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '德路斯刹车油', dataIndex: 'dlsScyAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+
|
|
|
+ // { title: '德路斯汽车养护产品', dataIndex: 'dlsQcyhAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '德路斯合计', dataIndex: 'dlsAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '稳升点火线圈', dataIndex: 'wsDhxqAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '稳升LED灯', dataIndex: 'wsDpAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '稳升合计', dataIndex: 'wsAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+
|
|
|
+ // { title: 'TBU感应线', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '品牌合计', dataIndex: 'ppAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: 'NGK火花塞', dataIndex: 'ngkAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '飞利浦', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '车仆防冻液', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '瓦尔塔', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '雷贝斯托', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '德尔福', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '巴诺德', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '代理品牌合计', dataIndex: 'ppAndNgkAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '开单采退金额合计', dataIndex: 'tbuGyxAmount', width: 50, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
|
|
|
+ ]
|
|
|
+ // if (this.activeKey == 0) {
|
|
|
+ // arr.splice(1, 0, { title: '省份', dataIndex: 'dealerProvinceName', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
+ // }
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ callback (key) {
|
|
|
+ this.activeKey = key
|
|
|
+ this.resetSearchForm()
|
|
|
+ // this.queryParam.time = []
|
|
|
+ // this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
+ // this.$refs.ruleForm.resetFields()
|
|
|
+ // this.$refs.table.clearTable()
|
|
|
+ console.log(key, this.activeKey)
|
|
|
+ },
|
|
|
+ // 获取城市列表
|
|
|
+ getCityList (val) {
|
|
|
+ this.addrCityList = []
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.dealerCitySn = undefined
|
|
|
+ this.queryParam.dealerCountySn = undefined
|
|
|
+ if (val) {
|
|
|
+ this.getArea('city', val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取区县列表
|
|
|
+ getAreaList (val) {
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.dealerCountySn = undefined
|
|
|
+ if (val) {
|
|
|
+ this.getArea('district', val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取区县列表
|
|
|
+ getAreaList (val) {
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.dealerCountySn = undefined
|
|
|
+ if (val) {
|
|
|
+ this.getArea('district', val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 省/市/区
|
|
|
+ getArea (leve, sn) {
|
|
|
+ let params
|
|
|
+ if (leve == 'province') {
|
|
|
+ params = { type: '2' }
|
|
|
+ } else {
|
|
|
+ params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
|
|
|
+ }
|
|
|
+ getArea(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ if (leve == 'province') {
|
|
|
+ this.addrProvinceList = res.data || []
|
|
|
+ } else if (leve == 'city') {
|
|
|
+ this.addrCityList = res.data || []
|
|
|
+ } else if (leve == 'district') {
|
|
|
+ this.addrDistrictList = res.data || []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (leve == 'province') {
|
|
|
+ this.addrProvinceList = []
|
|
|
+ } else if (leve == 'city') {
|
|
|
+ this.addrCityList = []
|
|
|
+ } else if (leve == 'district') {
|
|
|
+ this.addrDistrictList = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 创建时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ if (date[0] && date[1]) {
|
|
|
+ this.queryParam.time = date
|
|
|
+ } else {
|
|
|
+ this.queryParam.time = []
|
|
|
+ }
|
|
|
+ this.queryParam.beginDate = date[0] || ''
|
|
|
+ this.queryParam.endDate = date[1] || ''
|
|
|
+ },
|
|
|
+ // 查询
|
|
|
+ handleSearch () {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$refs.table.refresh(true)
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
+ this.queryParam.time = []
|
|
|
+ this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
+ this.queryParam.endDate = ''
|
|
|
+ this.queryParam.dealerProvinceSn = undefined
|
|
|
+ this.queryParam.subareaSn = undefined
|
|
|
+ this.queryParam.salesStatusType = 'REAL_SALES'
|
|
|
+ this.$refs.table.clearTable()
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const _this = this
|
|
|
+ const jkUrl = _this.activeKey == 0 ? realReportSalesByProvinceExport : realReportSalesBySubAreaExport
|
|
|
+ const excelTitle = _this.activeKey == 0 ? '各省品类实售明细报表' : '各区品类实售明细报表'
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const params = _this.queryParam
|
|
|
+ _this.showExport = true
|
|
|
+ _this.exportLoading = true
|
|
|
+ _this.spinning = true
|
|
|
+ hdExportExcel(jkUrl, params, excelTitle, function () {
|
|
|
+ _this.exportLoading = false
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ this.activeKey = 0
|
|
|
+ this.getArea('province')
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.pageInit()
|
|
|
+ // this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.pageInit()
|
|
|
+ // this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {})
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|