|
@@ -1,14 +1,16 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <!-- 选项卡切换 -->
|
|
|
<a-tabs v-model="activeKey" @change="callback" :tabBarStyle="{'background':'#fff'}">
|
|
|
<a-tab-pane :key="item.id" :tab="item.name" v-for="item in tabsList">
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
<a-card size="small">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
<div class="table-page-search-wrapper newTableSearchName" ref="tableSearch">
|
|
|
<a-form-model
|
|
|
- id="returnGoodsPresentationList-form"
|
|
|
+ id="regionTypeSalesList-form"
|
|
|
ref="ruleForm"
|
|
|
class="form-model-con"
|
|
|
layout="inline"
|
|
@@ -18,12 +20,13 @@
|
|
|
<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"/>
|
|
|
+ <rangeDate id="regionTypeSalesList-time" ref="rangeDate" :value="queryParam.time" @change="dateChange"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="销售状态" prop="salesStatusType">
|
|
|
<v-select
|
|
|
+ id="regionTypeSalesList-salesStatusType"
|
|
|
v-model="queryParam.salesStatusType"
|
|
|
code="SALES_STATUS"
|
|
|
placeholder="请选择销售状态"
|
|
@@ -32,29 +35,22 @@
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" v-if="activeKey==0">
|
|
|
<a-form-model-item label="所在区域">
|
|
|
- <subarea id="returnGoodsPresentationList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
|
|
|
+ <subarea id="regionTypeSalesList-subarea" ref="subarea" @change="subareaChange"></subarea>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="区域负责人">
|
|
|
- <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
|
|
|
+ <BizUser id="regionTypeSalesList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
|
|
|
- <a-form-item label="客服">
|
|
|
- <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <!-- <template v-if="advanced && activeKey==0">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item prop="dealerProvinceSn" style="margin: 0;" label="地区">
|
|
|
- <Area id="returnGoodsPresentationList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
|
|
|
+ <a-form-model-item label="客服">
|
|
|
+ <customerService id="regionTypeSalesList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
- </template> -->
|
|
|
<a-col :md="(activeKey==0&&!isShowCustomerSearch)?24:activeKey==1&&isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign:(activeKey==0&&!isShowCustomerSearch)?'center':(activeKey==1&&isShowCustomerSearch)?'center':'left'}">
|
|
|
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="regionTypeSalesList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="regionTypeSalesList-reset">重置</a-button>
|
|
|
<a-button
|
|
|
style="margin-left: 5px"
|
|
|
type="primary"
|
|
@@ -63,7 +59,7 @@
|
|
|
:disabled="disabled"
|
|
|
:loading="exportLoading"
|
|
|
v-if="$hasPermissions('B_regionTypeSalesReportExport')"
|
|
|
- id="returnGoodsPresentationList-export">导出</a-button>
|
|
|
+ id="regionTypeSalesList-export">导出</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form-model>
|
|
@@ -82,7 +78,7 @@
|
|
|
:data="loadData"
|
|
|
:showPagination="false"
|
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
|
- :scroll="{ x:1550,y: tableHeight}"
|
|
|
+ :scroll="{ x:1550,y: tableHeight +30}"
|
|
|
bordered>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
@@ -94,45 +90,46 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
-import Area from '@/views/common/area.js'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
import BizUser from '@/views/common/bizUser.js'
|
|
|
-import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
import customerService from '@/views/common/customerService.vue'
|
|
|
+// 接口
|
|
|
import { realReportSalesByProvince, realReportSalesByProvinceExport, subareaAreaReportTitle, subareaReportTitle, realReportSalesBySubArea, realReportSalesBySubAreaExport } from '@/api/reportData.js'
|
|
|
export default {
|
|
|
name: 'RegionTypeSalesReportList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, rangeDate, subarea, Area, reportModal, BizUser, customerService },
|
|
|
+ components: { STable, VSelect, rangeDate, subarea, reportModal, BizUser, customerService },
|
|
|
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,
|
|
|
+ activeKey: 0, // 切换显示页面值 0 各分区品类实售明细 1各区域品类实售明细
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
- showExport: false,
|
|
|
- columns: [],
|
|
|
- totalData: null,
|
|
|
+ showExport: false, // 导出弹窗
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false, // 导出按钮加载状态
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
+ tabsList: [{ id: 0, name: '各分区品类实售明细' }, { id: 1, name: '各区域品类实售明细' }], // tab切换data
|
|
|
+ salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实售退货' }, { code: 'REAL_SALES', name: '实际销售' }],
|
|
|
+ columns: [], // 表头数据
|
|
|
+ totalData: null, // 统计
|
|
|
+ // 查询参数
|
|
|
queryParam: {
|
|
|
- time: [],
|
|
|
- beginDate: '',
|
|
|
- endDate: '',
|
|
|
- dealerProvinceSn: undefined,
|
|
|
+ time: [], // 默认时间
|
|
|
+ beginDate: '', // 开始时间
|
|
|
+ endDate: '', // 结束时间
|
|
|
subareaArea: {
|
|
|
- subareaSn: undefined,
|
|
|
- subareaAreaSn: undefined,
|
|
|
- bizUserSn: undefined
|
|
|
+ subareaSn: undefined, // 区域
|
|
|
+ subareaAreaSn: undefined, // 分区
|
|
|
+ bizUserSn: undefined// 区域负责人
|
|
|
},
|
|
|
- salesStatusType: 'REAL_SALES',
|
|
|
- bizUserSn: undefined
|
|
|
+ salesStatusType: 'REAL_SALES', // 销售状态
|
|
|
+ bizUserSn: undefined// 客服
|
|
|
},
|
|
|
- disabled: false, // 查询、重置按钮是否可操作
|
|
|
- exportLoading: false,
|
|
|
- tableHeight: 0,
|
|
|
rules: {
|
|
|
'time': [{ required: true, message: '请选择时间', trigger: 'change' }],
|
|
|
'salesStatusType': [{ required: true, message: '请选择销售状态', trigger: 'change' }]
|
|
@@ -141,8 +138,9 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- const paramsPage = Object.assign(this.queryParam) // 无分页
|
|
|
+ const paramsPage = Object.assign(this.queryParam)
|
|
|
const jkUrl = this.activeKey == 0 ? realReportSalesByProvince : realReportSalesBySubArea
|
|
|
+ // 获取列表数据 无分页 0各分区品类实售明细列表 1各区域品类实售明细列表
|
|
|
return jkUrl(paramsPage).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
@@ -159,6 +157,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // tabs切换 change时间
|
|
|
callback (key) {
|
|
|
this.activeKey = key
|
|
|
const _this = this
|
|
@@ -189,6 +188,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 区域分区
|
|
|
subareaChange (val) {
|
|
|
this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
@@ -200,7 +200,6 @@ export default {
|
|
|
this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
this.queryParam.beginDate = ''
|
|
|
this.queryParam.endDate = ''
|
|
|
- this.queryParam.dealerProvinceSn = undefined
|
|
|
this.queryParam.subareaArea.subareaSn = undefined
|
|
|
this.queryParam.subareaArea.subareaAreaSn = undefined
|
|
|
this.queryParam.subareaArea.bizUserSn = undefined
|
|
@@ -254,11 +253,13 @@ export default {
|
|
|
})
|
|
|
this.resetSearchForm()
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
this.activeKey = 0
|
|
|
this.getTableTitle()
|
|
|
this.setTableH()
|
|
|
},
|
|
|
+ // 计算表格高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 250
|