|
@@ -2,10 +2,13 @@
|
|
import {getSellerGroupStatisticsList,getSellerStatisticsList} from '@/api/financialStatistics'
|
|
import {getSellerGroupStatisticsList,getSellerStatisticsList} from '@/api/financialStatistics'
|
|
import {getSellerGroupList} from '@/api/crm'
|
|
import {getSellerGroupList} from '@/api/crm'
|
|
import {downloadByFlow} from '@/utils/common-methods'
|
|
import {downloadByFlow} from '@/utils/common-methods'
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ const moment = inject('$moment')
|
|
|
|
|
|
const sortFiledMap = new Map([['invoice_amount',1],['group_rate',2],['seller_rate',3]])
|
|
const sortFiledMap = new Map([['invoice_amount',1],['group_rate',2],['seller_rate',3]])
|
|
|
|
+ const customerTypeArray=[{label:'全部',value:0},{label:'新客户',value:1},{label:'老客户',value:2}]
|
|
|
|
+ const dateButtonData=[{text:'近1周',tabId:1,type:'week',diff:1},{text:'近1月',tabId:2,type:'month',diff:1},
|
|
|
|
+ {text:'近2月',tabId:3,type:'month',diff:2},{text:'近3月',tabId:4,type:'month',diff:3},{text:'今年以来',tabId:5,type:'year',diff:1}]
|
|
|
|
+
|
|
let groupList=ref([])
|
|
let groupList=ref([])
|
|
const tabType=ref(1)
|
|
const tabType=ref(1)
|
|
const statisticsData=reactive({
|
|
const statisticsData=reactive({
|
|
@@ -26,11 +29,16 @@
|
|
// 是否导出:0-否;1-是
|
|
// 是否导出:0-否;1-是
|
|
is_export:0,
|
|
is_export:0,
|
|
// 销售类型 1-ficc销售 2-权益销售
|
|
// 销售类型 1-ficc销售 2-权益销售
|
|
- seller_type:1
|
|
|
|
|
|
+ seller_type:1,
|
|
|
|
+ company_type:0,
|
|
|
|
+ show_resign:false
|
|
})
|
|
})
|
|
// 搜索参数-创建时间数组
|
|
// 搜索参数-创建时间数组
|
|
const createtime=ref(null)
|
|
const createtime=ref(null)
|
|
|
|
|
|
|
|
+ // 日期按钮选项
|
|
|
|
+ const currentTabId=ref(0)
|
|
|
|
+
|
|
watch(createtime,(newVal)=>{
|
|
watch(createtime,(newVal)=>{
|
|
if(newVal){
|
|
if(newVal){
|
|
searchParams.start_date=newVal[0]
|
|
searchParams.start_date=newVal[0]
|
|
@@ -56,6 +64,9 @@
|
|
searchParams.group_id=''
|
|
searchParams.group_id=''
|
|
searchParams.sort_field=''
|
|
searchParams.sort_field=''
|
|
searchParams.sort_type=''
|
|
searchParams.sort_type=''
|
|
|
|
+ searchParams.company_type=0
|
|
|
|
+ searchParams.show_resign=false
|
|
|
|
+ currentTabId.value=0
|
|
if(createtime.value===null){
|
|
if(createtime.value===null){
|
|
statisticsList()
|
|
statisticsList()
|
|
}else{
|
|
}else{
|
|
@@ -98,6 +109,19 @@
|
|
searchStatistics()
|
|
searchStatistics()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 日期选项改变
|
|
|
|
+ const changeDateType=()=>{
|
|
|
|
+ let currentTab = dateButtonData.find(it => it.tabId == currentTabId.value)
|
|
|
|
+ if(!currentTab) return
|
|
|
|
+ let {type,diff} = currentTab
|
|
|
|
+ let startOfType=type
|
|
|
|
+ if(type=='week'){
|
|
|
|
+ startOfType='isoWeek'
|
|
|
|
+ }
|
|
|
|
+ createtime.value=[moment().startOf(startOfType).subtract((diff-1), type+'s').format('YYYY-MM-DD'),
|
|
|
|
+ moment().format('YYYY-MM-DD')]
|
|
|
|
+ }
|
|
|
|
+
|
|
const searchStatistics=()=>{
|
|
const searchStatistics=()=>{
|
|
searchParams.current = 1
|
|
searchParams.current = 1
|
|
statisticsList()
|
|
statisticsList()
|
|
@@ -154,9 +178,22 @@
|
|
@change="searchStatistics" v-show="tabType==2" clearable >
|
|
@change="searchStatistics" v-show="tabType==2" clearable >
|
|
<el-option :label="item.group_name" :value="item.group_id" v-for="item in groupList"></el-option>
|
|
<el-option :label="item.group_name" :value="item.group_id" v-for="item in groupList"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-date-picker v-model="createtime" type="daterange"
|
|
|
|
- value-format="YYYY-MM-DD" style="max-width:240px;margin-bottom: 8px"
|
|
|
|
- start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
|
|
|
+ <el-checkbox v-model="searchParams.show_resign" style="margin: 0 30px 8px 0;"
|
|
|
|
+ v-show="tabType==2" @change="searchStatistics">显示离职销售</el-checkbox>
|
|
|
|
+ <el-radio-group v-model="searchParams.company_type" size="large" @change="searchStatistics"
|
|
|
|
+ style="margin: 0 30px 8px 0;">
|
|
|
|
+ <el-radio-button v-for="item in customerTypeArray" :key="item.value" class="dimension-radio"
|
|
|
|
+ :label="item.value" >{{ item.label }}</el-radio-button>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ <div class="date-box">
|
|
|
|
+ <el-date-picker v-model="createtime" type="daterange" @change="currentTabId=0"
|
|
|
|
+ value-format="YYYY-MM-DD" style="max-width:240px;margin-right: 30px"
|
|
|
|
+ start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
|
+ <el-radio-group v-model="currentTabId" size="large" @change="changeDateType">
|
|
|
|
+ <el-radio-button v-for="item in dateButtonData" :key="item.tabId" class="dimension-radio"
|
|
|
|
+ :label="item.tabId" >{{ item.text }}</el-radio-button>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="statistice-buttons-zone">
|
|
<div class="statistice-buttons-zone">
|
|
<el-button @click="statisticeExport" class="element-common-button" size="large">导出</el-button>
|
|
<el-button @click="statisticeExport" class="element-common-button" size="large">导出</el-button>
|
|
@@ -188,7 +225,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="全员占比" prop="seller_rate" align="center" sortable="custom" v-if="tabType==2">
|
|
<el-table-column label="全员占比" prop="seller_rate" align="center" sortable="custom" v-if="tabType==2">
|
|
<template #default="{row}">
|
|
<template #default="{row}">
|
|
- {{ row.seller_rate+'%' }}
|
|
|
|
|
|
+ {{ (row.seller_rate || '0.00')+'%' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<template #empty>
|
|
<template #empty>
|
|
@@ -230,13 +267,37 @@
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
- margin-right: 30px;
|
|
|
|
|
|
+ // margin-right: 30px;
|
|
.statistics-search-item{
|
|
.statistics-search-item{
|
|
width: 200px;
|
|
width: 200px;
|
|
margin-bottom: 8px;
|
|
margin-bottom: 8px;
|
|
margin-right: 30px;
|
|
margin-right: 30px;
|
|
}
|
|
}
|
|
|
|
+ .date-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 0 30px 8px 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+</style>
|
|
|
|
+<style lang="scss">
|
|
|
|
+#sales-statistics-container{
|
|
|
|
+ .el-radio-group{
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
+ }
|
|
|
|
+ .dimension-radio{
|
|
|
|
+ span{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ color: $hitTextColorTwo;
|
|
|
|
+ padding: 12px 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .is-active{
|
|
|
|
+ span{
|
|
|
|
+ color:white
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|