|
@@ -13,15 +13,7 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="4" :sm="24">
|
|
|
<a-form-model-item label="月份" required>
|
|
|
- <a-range-picker
|
|
|
- id="customerCountList-monthBox"
|
|
|
- class="monthBox"
|
|
|
- :placeholder="['开始月份', '结束月份']"
|
|
|
- format="YYYY-MM"
|
|
|
- v-model="monthVal"
|
|
|
- :mode="mode"
|
|
|
- @panelChange="handlePanelChange"
|
|
|
- />
|
|
|
+ <month ref="monthDate" id="customerCountList-monthBox" v-model="monthVal"></month>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="4" :sm="24">
|
|
@@ -39,6 +31,14 @@
|
|
|
<BizUser id="provinceCountList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-model-item label="新/老客户">
|
|
|
+ <a-select id="customerCountList-dealerNewFlag" v-model="queryParam.dealerNewFlag" placeholder="请选择" allowClear>
|
|
|
+ <a-select-option value="1">新客户</a-select-option>
|
|
|
+ <a-select-option value="0">老客户</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
<a-col :md="4" :sm="24" v-if="removeReportFlag==1">
|
|
|
<a-form-item label="业务类型">
|
|
|
<v-select
|
|
@@ -50,7 +50,7 @@
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="4" :sm="24">
|
|
|
+ <a-col :md="removeReportFlag==1 ? 24 : 4" :style="{textAlign: removeReportFlag==1 ? 'center': ''}" :sm="24">
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
@click="handleSearch"
|
|
@@ -110,18 +110,18 @@
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
-import moment from 'moment'
|
|
|
// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
import Area from '@/views/common/area.js'
|
|
|
import BizUser from '@/views/common/bizUser.js'
|
|
|
+import month from '@/views/common/month.vue'
|
|
|
// 接口
|
|
|
import { salesStatsProvinceList, salesStatsProvinceCount, salesStatsProvinceExport } from '@/api/reportData'
|
|
|
export default {
|
|
|
name: 'ProvinceCountList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, subarea, Area, BizUser },
|
|
|
+ components: { STable, VSelect, subarea, Area, BizUser, month },
|
|
|
props: {
|
|
|
removeReportFlag: {
|
|
|
type: [String, Number],
|
|
@@ -138,8 +138,7 @@ export default {
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
tableHeight: 0, // 表格高度
|
|
|
exportLoading: false, // 导出按钮加载状态
|
|
|
- monthVal: [moment().format('YYYY-MM'), moment().format('YYYY-MM')], // 初始化月份值
|
|
|
- mode: ['month', 'month'],
|
|
|
+ monthVal: [], // 初始化月份值
|
|
|
// 查询条件
|
|
|
queryParam: {
|
|
|
beginDate: '', // 月份开始时间
|
|
@@ -150,7 +149,8 @@ export default {
|
|
|
subareaAreaSn: '', // 分区
|
|
|
bizUserSn: undefined// 区域负责人
|
|
|
},
|
|
|
- bizType: undefined // 业务类型
|
|
|
+ bizType: undefined, // 业务类型
|
|
|
+ dealerNewFlag: undefined // 新老客户
|
|
|
},
|
|
|
columns: [], // 表格列
|
|
|
countLabel: null, // 统计名称合集
|
|
@@ -163,8 +163,8 @@ export default {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
if (this.monthVal) {
|
|
|
- this.queryParam.beginDate = this.getMonthRange(this.monthVal[0]).firstDay
|
|
|
- this.queryParam.endDate = this.getMonthRange(this.monthVal[1]).lastDay
|
|
|
+ this.queryParam.beginDate = this.$refs.monthDate.getMonthRange(this.monthVal[0]).firstDay
|
|
|
+ this.queryParam.endDate = this.$refs.monthDate.getMonthRange(this.monthVal[1]).lastDay
|
|
|
} else {
|
|
|
this.queryParam.beginDate = undefined
|
|
|
this.queryParam.endDate = undefined
|
|
@@ -196,18 +196,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handlePanelChange (value, mode) {
|
|
|
- this.monthVal = value
|
|
|
- this.mode = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]]
|
|
|
- },
|
|
|
- // 获取指定月份 第一天和最后一天
|
|
|
- getMonthRange (targetMonth) {
|
|
|
- // 获取指定月第一天(格式化为 YYYY-MM-DD)
|
|
|
- const firstDay = moment(targetMonth).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
|
- // 获取指定月最后一天(格式化为 YYYY-MM-DD)
|
|
|
- const lastDay = moment(targetMonth).endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
|
|
- return { firstDay, lastDay }
|
|
|
- },
|
|
|
// 获取表头
|
|
|
async getTableTitle () {
|
|
|
const _this = this
|
|
@@ -267,12 +255,13 @@ export default {
|
|
|
resetSearchForm () {
|
|
|
this.queryParam.beginDate = ''
|
|
|
this.queryParam.endDate = ''
|
|
|
- this.monthVal = [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
|
|
|
+ this.$refs.monthDate.resetDate()
|
|
|
this.queryParam.provinceSn = undefined
|
|
|
this.queryParam.subareaArea.subareaSn = ''
|
|
|
this.queryParam.subareaArea.subareaAreaSn = ''
|
|
|
this.queryParam.subareaArea.bizUserSn = undefined
|
|
|
this.queryParam.bizType = undefined
|
|
|
+ this.queryParam.dealerNewFlag = undefined
|
|
|
this.$refs.subarea.clearData()
|
|
|
this.totalData = null
|
|
|
this.$refs.table.clearTable()
|