mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-24 13:42:52 +08:00
个险业绩排行优化
This commit is contained in:
@@ -9,3 +9,21 @@ export function branchOfficeApi(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 个险业绩排行优化: 机构查询
|
||||
export function getComList(data) {
|
||||
return request({
|
||||
url: getUrl('/data/performance/getComList', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 个险业绩排行优化: 业绩查询
|
||||
export function getComPerformance(data) {
|
||||
return request({
|
||||
url: getUrl('/data/performance/getComPerformance', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -87,6 +87,9 @@ let renewalManage = [
|
||||
'/renewal/getRenewalList' //续期列表查询
|
||||
]
|
||||
|
||||
// 个险业绩排行优化
|
||||
let performanceRanking = ['/data/performance/getComList', '/data/performance/getComPerformance']
|
||||
|
||||
let whiteList = [
|
||||
'/customer/agent/getCustomersList',
|
||||
...proposal,
|
||||
@@ -97,7 +100,8 @@ let whiteList = [
|
||||
...manpower,
|
||||
...productStore,
|
||||
...preserve,
|
||||
...renewalManage
|
||||
...renewalManage,
|
||||
...performanceRanking
|
||||
]
|
||||
|
||||
// 创建axios实例
|
||||
|
||||
@@ -1,75 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<van-tabs v-model="active">
|
||||
<van-tab title="中心支公司">
|
||||
<div class="table-wrapper">
|
||||
<table class="myTable mb30" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th class="sticky">排名</th>
|
||||
<th>机构</th>
|
||||
<th>预收标保(万元)</th>
|
||||
<th>预收件数(件)</th>
|
||||
<th>承保标保(万元)</th>
|
||||
<th>承保件数(件)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sticky">1</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</van-tab>
|
||||
<van-tab title="营销服务部">
|
||||
<div class="table-wrapper">
|
||||
<table class="myTable mb30" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th class="sticky">排名</th>
|
||||
<th>机构</th>
|
||||
<th>合格人力(人)</th>
|
||||
<th>桂冠人力(人)</th>
|
||||
<th>桂冠正式会员(人)</th>
|
||||
<th>双冠人力(人)</th>
|
||||
<th>新增人力(人)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sticky">1</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</van-tab>
|
||||
<van-tab title="下辖营业区">
|
||||
<div class="table-wrapper">
|
||||
<table class="myTable mb30" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th class="sticky">排名</th>
|
||||
<th>产品</th>
|
||||
<th>总保费(万元)</th>
|
||||
<th>承保标保(万元)</th>
|
||||
<th>承保件数(件)</th>
|
||||
<th>保费占比(%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sticky">1</td>
|
||||
<td>100</td>
|
||||
<td>200</td>
|
||||
<td>300</td>
|
||||
<td>40</td>
|
||||
<td>18</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</van-tab>
|
||||
<van-tab title="中心支公司"></van-tab>
|
||||
<van-tab title="营销服务部"></van-tab>
|
||||
<van-tab title="下辖营业区"></van-tab>
|
||||
</van-tabs>
|
||||
<div class="table-wrapper">
|
||||
<table class="myTable mb30" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th class="sticky">排名</th>
|
||||
<th v-for="(column, index) in columns" :key="index">
|
||||
{{ column.name }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr v-for="(value, index) in values" :key="index">
|
||||
<td class="sticky">{{ index + 1 }}</td>
|
||||
<td v-for="(key, i) in needGettingKey" :key="i">{{ value[key] | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr v-if="values.length === 0">
|
||||
<td :colspan="columns.length + 1">暂无数据</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -81,8 +33,137 @@ export default {
|
||||
[Tab.name]: Tab,
|
||||
[Tabs.name]: Tabs
|
||||
},
|
||||
props: {
|
||||
dataType: {
|
||||
// 0: 业绩, 1: 人力, 2: 产品
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
timeType: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataTypeName() {
|
||||
switch (this.dataType) {
|
||||
case 0:
|
||||
case 1:
|
||||
return '机构'
|
||||
case 2:
|
||||
return '产品'
|
||||
default:
|
||||
return '-'
|
||||
}
|
||||
},
|
||||
// 获取需要显示的列名称
|
||||
columns() {
|
||||
if (this.dataType === 0) {
|
||||
switch (this.timeType) {
|
||||
case 0:
|
||||
return this.tableColumns[this.dataType][0]
|
||||
case 1:
|
||||
return this.tableColumns[this.dataType][1]
|
||||
case 2:
|
||||
if (this.active <= 1) {
|
||||
return this.tableColumns[this.dataType][2]
|
||||
} else {
|
||||
return this.tableColumns[this.dataType][3]
|
||||
}
|
||||
default:
|
||||
return []
|
||||
}
|
||||
} else {
|
||||
return this.tableColumns[this.dataType]
|
||||
}
|
||||
},
|
||||
needGettingKey() {
|
||||
let keys = []
|
||||
this.columns.forEach(element => {
|
||||
keys.push(element.key)
|
||||
})
|
||||
return keys
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return { active: 0 }
|
||||
return {
|
||||
active: 0,
|
||||
tableColumns: [
|
||||
[
|
||||
[
|
||||
{ name: '机构', key: 'name' },
|
||||
{ name: '预收标保', key: 'ysbb' },
|
||||
{ name: '预收件数', key: 'ysjs' },
|
||||
{ name: '承保标保', key: 'bzbf' },
|
||||
{ name: '承保件数', key: 'cbjs' }
|
||||
],
|
||||
[
|
||||
{ name: '机构', key: 'name' },
|
||||
{ name: '预收标保', key: 'ysbb' },
|
||||
{ name: '预收件数', key: 'ysjs' },
|
||||
{ name: '承保标保', key: 'bzbf' },
|
||||
{ name: '承保件数', key: 'cbjs' },
|
||||
{ name: '承保同比', key: 'cbtb' },
|
||||
{ name: '承保环比', key: 'cbhb' }
|
||||
],
|
||||
[
|
||||
{ name: '机构', key: 'name' },
|
||||
{ name: '承保标保', key: 'bzbf' },
|
||||
{ name: '标保目标', key: 'bbmb' },
|
||||
{ name: '标保目标达成率', key: 'bbmbdcl' },
|
||||
{ name: '差距', key: 'cj' }
|
||||
],
|
||||
[
|
||||
{ name: '机构', key: 'name' },
|
||||
{ name: '承保标保', key: 'bzbf' }
|
||||
]
|
||||
],
|
||||
[
|
||||
{ name: '机构', key: 'name' },
|
||||
{ name: '合格人力', key: 'hgrl' },
|
||||
{ name: '桂冠人力', key: 'ggrl' },
|
||||
{ name: '桂冠正式会员', key: 'gghy' },
|
||||
{ name: '双冠人力', key: 'sgrl' },
|
||||
{ name: '新增人力', key: 'xzrl' }
|
||||
],
|
||||
[
|
||||
{ name: '机构', key: 'name' },
|
||||
{ name: '总保费', key: 'zbf' },
|
||||
{ name: '承保标保', key: 'bzbf' },
|
||||
{ name: '承保件数', key: 'cbjs' },
|
||||
{ name: '保费占比', key: 'bfzb' }
|
||||
]
|
||||
],
|
||||
values: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setTableData(data, type) {
|
||||
switch (type) {
|
||||
case 'prem':
|
||||
this.values = data.list ? data.list : []
|
||||
break
|
||||
case 'active':
|
||||
this.values = data.listRL ? data.listRL : []
|
||||
break
|
||||
case 'product':
|
||||
this.values = data.productDTO ? data.productDTO : []
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
active: {
|
||||
handler(nv) {
|
||||
this.$emit('updateQueryCom', nv)
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
blankFilter(val) {
|
||||
return val ? val : '-'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -118,7 +199,7 @@ $white: #fff;
|
||||
|
||||
.myTable {
|
||||
text-align: center;
|
||||
min-width: 160vw;
|
||||
min-width: 180vw;
|
||||
border-top: $border;
|
||||
border-left: $border;
|
||||
border-right: $border;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="summarize">
|
||||
<div class="data-section">
|
||||
<span class="title">
|
||||
<span ref="performance" class="title">
|
||||
业绩
|
||||
</span>
|
||||
<div class="table-wrapper">
|
||||
@@ -12,25 +12,25 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>预收标保</td>
|
||||
<td>200(万元)</td>
|
||||
<td>{{ performance.ysbb | unitFilter(1) | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>预收件数</td>
|
||||
<td>200(件)</td>
|
||||
<td>{{ performance.ysjs | unitFilter(2) | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>承保标保</td>
|
||||
<td>200(万元)</td>
|
||||
<td>{{ performance.bzbf | unitFilter(1) | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>承保件数</td>
|
||||
<td>200(件)</td>
|
||||
<td>{{ performance.cbjs | unitFilter(2) | blankFilter }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-section">
|
||||
<span class="title">
|
||||
<span ref="manpower" class="title">
|
||||
人力
|
||||
</span>
|
||||
<div class="table-wrapper">
|
||||
@@ -41,44 +41,47 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>合格人力</td>
|
||||
<td>500</td>
|
||||
<td>{{ manpower.hgrl | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>桂冠人力</td>
|
||||
<td>500</td>
|
||||
<td>{{ manpower.ggrl | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>桂冠正式会员</td>
|
||||
<td>500</td>
|
||||
<td>{{ manpower.ggrl | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>双冠人力</td>
|
||||
<td>500</td>
|
||||
<td>{{ manpower.sgrl | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>新增人力</td>
|
||||
<td>500</td>
|
||||
<td>{{ manpower.xzrl | blankFilter }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-section">
|
||||
<span class="title">
|
||||
<span ref="production" class="title">
|
||||
产品
|
||||
</span>
|
||||
<div class="table-wrapper">
|
||||
<table class="myTable" style="min-width: 120vw;" cellspacing="0" cellpadding="0">
|
||||
<table class="myTable" style="min-width: 140vw;" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th class="sticky">产品名称</th>
|
||||
<th>承保标保(万元)</th>
|
||||
<th>承保件数(件)</th>
|
||||
<th>保费占比(%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sticky">瑞丽年金</td>
|
||||
<td>200</td>
|
||||
<td>200</td>
|
||||
<td>18</td>
|
||||
<tr v-for="(product, index) in products" :key="index">
|
||||
<td class="sticky">{{ product.productName }}</td>
|
||||
<td>{{ product.cbbb | blankFilter }}</td>
|
||||
<td>{{ product.cbItems | blankFilter }}</td>
|
||||
<td>{{ product.percent | blankFilter }}</td>
|
||||
</tr>
|
||||
<tr v-if="products.length === 0">
|
||||
<td colspan="4">暂无数据</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -88,7 +91,74 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Summarizing'
|
||||
name: 'Summarizing',
|
||||
props: {
|
||||
typeIndex: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
performance: {},
|
||||
manpower: {},
|
||||
products: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setManpower(data) {
|
||||
this.manpower = data
|
||||
},
|
||||
setPerformance(data) {
|
||||
this.performance = data
|
||||
},
|
||||
setProducts(data) {
|
||||
this.products = data
|
||||
let allPrice = this.products.reduce((prevVal, currVal) => {
|
||||
return prevVal + Number(currVal.cbbb)
|
||||
}, 0)
|
||||
this.products.map(product => {
|
||||
product.percent = ((product.cbbb / allPrice) * 100).toFixed(2)
|
||||
return product
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
typeIndex(nv) {
|
||||
const scroll = {
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
}
|
||||
switch (nv) {
|
||||
case 0:
|
||||
this.$refs.performance.scrollIntoView(scroll)
|
||||
break
|
||||
case 1:
|
||||
this.$refs.manpower.scrollIntoView(scroll)
|
||||
break
|
||||
case 2:
|
||||
this.$refs.production.scrollIntoView(scroll)
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
blankFilter(val) {
|
||||
return val ? val : '-'
|
||||
},
|
||||
unitFilter(val, unit) {
|
||||
if (!val) {
|
||||
return ''
|
||||
}
|
||||
// 1: 万元, 2: 件数
|
||||
switch (unit) {
|
||||
case 1:
|
||||
return `${val} (万元)`
|
||||
case 2:
|
||||
return `${val} (件)`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -140,6 +210,7 @@ $white: #fff;
|
||||
}
|
||||
|
||||
.sticky {
|
||||
width: 180px;
|
||||
position: sticky;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
</van-button>
|
||||
</div>
|
||||
<div class="header-center">
|
||||
<van-button>日</van-button>
|
||||
<van-button class="month">月</van-button>
|
||||
<van-button>年</van-button>
|
||||
<van-button class="btn-gray" :class="{ activeBtn: timeType === 0 }" @click="isDayConditionShow = true">日</van-button>
|
||||
<van-button class="btn-gray month" :class="{ activeBtn: timeType === 1 }" @click="isMonthConditionShow = true">月</van-button>
|
||||
<van-button class="btn-gray" :class="{ activeBtn: timeType === 2 }" @click="isYearConditionShow = true">年</van-button>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<van-button @click="isTimeBarShow = true">
|
||||
@@ -32,7 +32,7 @@
|
||||
<span>{{ cityName }}</span>
|
||||
<van-icon name="arrow-down" />
|
||||
</span>
|
||||
<span>
|
||||
<span @click="isAreaConditionShow = true">
|
||||
<span>{{ areaName }}</span>
|
||||
<van-icon name="arrow-down" />
|
||||
</span>
|
||||
@@ -41,15 +41,15 @@
|
||||
<div class="content">
|
||||
<van-tabs v-model="active">
|
||||
<van-tab title="汇总">
|
||||
<Summarizing />
|
||||
<Summarizing ref="summarizing" :typeIndex="typeIndex" />
|
||||
</van-tab>
|
||||
<van-tab title="分机构">
|
||||
<Organization />
|
||||
<Organization ref="organization" :dataType.sync="typeIndex" :timeType.sync="timeType" @updateQueryCom="updateQueryCom" @updateData="updateData" />
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</div>
|
||||
<!-- 侧边栏 -->
|
||||
<van-popup v-model="isSideBarShow" position="left" :style="{ width: '50vw', height: '100vh' }">
|
||||
<van-popup v-model="isSideBarShow" position="left" :style="{ width: '50vw', height: '100vh' }" @closed="dataTypeChange">
|
||||
<p class="title">指标</p>
|
||||
<span class="data-type" :class="{ 'data-active': index === typeIndex }" v-for="(type, index) in dataTypes" :key="index" @click="changeDataType(index)">{{
|
||||
type
|
||||
@@ -57,29 +57,46 @@
|
||||
</van-popup>
|
||||
<!-- 时间筛选栏 -->
|
||||
<van-popup v-model="isTimeBarShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-datetime-picker v-model="currentDate" type="datetime" @confirm="onTimeConditionConfirm" />
|
||||
<van-datetime-picker v-model="dayTimeCondition" type="datetime" :max-date="maxDate" @confirm="onDayTimeConditionConfirm" />
|
||||
</van-popup>
|
||||
<!-- 省筛选栏 -->
|
||||
<!-- 分公司筛选栏 -->
|
||||
<van-popup v-model="isProvinceConditionShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-picker show-toolbar :columns="province" @confirm="onProvinceConditionConfirm" />
|
||||
<van-picker show-toolbar :columns="province" @confirm="onProvinceConditionConfirm" @cancel="isProvinceConditionShow = false" />
|
||||
</van-popup>
|
||||
<!-- 市筛选栏 -->
|
||||
<!-- 营业部筛选栏 -->
|
||||
<van-popup v-model="isCityConditionShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-picker show-toolbar :columns="city" @confirm="onCityConditionConfirm" />
|
||||
<van-picker show-toolbar :columns="city" @confirm="onCityConditionConfirm" @cancel="isCityConditionShow = false" />
|
||||
</van-popup>
|
||||
<!-- 区筛选栏 -->
|
||||
<!-- 营业区筛选栏 -->
|
||||
<van-popup v-model="isAreaConditionShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-picker show-toolbar :columns="city" @confirm="onAreaConditionConfirm" />
|
||||
<van-picker show-toolbar :columns="area" @confirm="onAreaConditionConfirm" @cancel="isAreaConditionShow = false" />
|
||||
</van-popup>
|
||||
<!-- 日 -->
|
||||
<van-popup v-model="isDayConditionShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-datetime-picker v-model="dayCondition" type="date" :max-date="maxDate" @confirm="onDayConditionConfirm" />
|
||||
</van-popup>
|
||||
<!-- 月 -->
|
||||
<van-popup v-model="isMonthConditionShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-datetime-picker v-model="monthCondition" type="year-month" :max-date="maxDate" @confirm="onMonthConditionConfirm" />
|
||||
</van-popup>
|
||||
<!-- 年 -->
|
||||
<van-popup v-model="isYearConditionShow" position="bottom" :style="{ height: '40vh' }">
|
||||
<van-picker show-toolbar :columns="years" @confirm="onYearConditionConfirm" />
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import point from '@/assets/images/ebiz/point.png'
|
||||
import { Popup, Tab, Tabs, DatetimePicker, Picker } from 'vant'
|
||||
import { Popup, Tab, Tabs, DatetimePicker, Picker, Toast } from 'vant'
|
||||
import Summarizing from './Summarizing.vue'
|
||||
import Organization from './Organization.vue'
|
||||
import dateUtil from '@/assets/js/utils/date-utils.js'
|
||||
import { getComPerformance, getComList } from '@/api/ebiz/branchOffice/branchOffice'
|
||||
|
||||
// 当前时间
|
||||
const currentDate = new Date()
|
||||
|
||||
export default {
|
||||
name: 'UnderOffice',
|
||||
components: {
|
||||
@@ -88,42 +105,76 @@ export default {
|
||||
[Tabs.name]: Tabs,
|
||||
[DatetimePicker.name]: DatetimePicker,
|
||||
[Picker.name]: Picker,
|
||||
[Toast.name]: Toast,
|
||||
Summarizing,
|
||||
Organization
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeCondition: dateUtil.formatDate(new Date(), 'MM-dd HH:mm'),
|
||||
currentDate: new Date(),
|
||||
timeType: 0,
|
||||
// 最大查询日期
|
||||
maxDate: currentDate,
|
||||
// 日期筛选条件
|
||||
dayCondition: currentDate,
|
||||
// 月份筛选条件
|
||||
monthCondition: currentDate,
|
||||
// 年份筛选条件
|
||||
yearCondition: currentDate.getFullYear(),
|
||||
// 实时筛选时间条件
|
||||
timeCondition: dateUtil.formatDate(currentDate, 'MM-dd HH:mm'),
|
||||
dayTimeCondition: currentDate,
|
||||
// 0: 标保, 1: 人力, 2: 产品
|
||||
typeIndex: 0,
|
||||
dataTypes: ['标保', '活动人力', '产品'],
|
||||
active: 0,
|
||||
// 侧边栏是否显示
|
||||
isSideBarShow: false,
|
||||
// 日期筛选是否显示
|
||||
isTimeBarShow: false,
|
||||
// 省筛选是否显示
|
||||
isProvinceConditionShow: false,
|
||||
// 市筛选是否显示
|
||||
isCityConditionShow: false,
|
||||
// 区筛选是否显示
|
||||
isAreaConditionShow: false,
|
||||
// 日筛选是否显示
|
||||
isDayConditionShow: false,
|
||||
// 月筛选是否展示
|
||||
isMonthConditionShow: false,
|
||||
// 年筛选是否显示
|
||||
isYearConditionShow: false,
|
||||
point,
|
||||
provinceName: '全国',
|
||||
cityName: '全部',
|
||||
areaName: '全部',
|
||||
provinceCode: 0,
|
||||
provinceObjs: [
|
||||
{ id: 1, name: '全国' },
|
||||
{ id: 2, name: '北京' },
|
||||
{ id: 3, name: '天津' }
|
||||
],
|
||||
provinceObjs: [],
|
||||
cityCode: 0,
|
||||
cityObjs: [
|
||||
{
|
||||
pid: 2,
|
||||
name: '朝阳区'
|
||||
cityObjs: [],
|
||||
areaCode: 0,
|
||||
areaObjs: [],
|
||||
years: [],
|
||||
params: {
|
||||
// 86: 全国
|
||||
manageCode: '86',
|
||||
// 01: 全国, 02: 中心支公司, 03: 营销服务部, 04: 下辖营业区
|
||||
manageLv: '01',
|
||||
// 日期类型: 年/月/日/实时
|
||||
queryType: 'd',
|
||||
date: currentDate,
|
||||
// all: 汇总, prem: 保费排行, active:人力排行, product: 产品
|
||||
type: 'all',
|
||||
// 1: 中心支公司, 2: 营销服务部, 3: 下辖营业区
|
||||
queryCom: ''
|
||||
},
|
||||
{
|
||||
pid: 3,
|
||||
name: '和平区'
|
||||
}
|
||||
]
|
||||
performance: {
|
||||
pysbb: 0,
|
||||
pysjs: 0,
|
||||
pbzbf: 0,
|
||||
pcbjs: 0
|
||||
},
|
||||
manpower: {},
|
||||
products: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -131,7 +182,7 @@ export default {
|
||||
return this.provinceName !== '全国'
|
||||
},
|
||||
province() {
|
||||
const name = []
|
||||
const name = ['全国']
|
||||
this.provinceObjs.forEach(item => {
|
||||
name.push(item.name)
|
||||
})
|
||||
@@ -140,49 +191,316 @@ export default {
|
||||
city() {
|
||||
const city = ['全部']
|
||||
this.cityObjs.forEach(item => {
|
||||
if (item.pid === this.provinceCode) {
|
||||
if (item.upBranchCode === this.provinceCode) {
|
||||
city.push(item.name)
|
||||
}
|
||||
})
|
||||
return city
|
||||
},
|
||||
area() {
|
||||
const area = ['全部']
|
||||
this.areaObjs.forEach(item => {
|
||||
if (item.upBranchCode === this.cityCode) {
|
||||
area.push(item.name)
|
||||
}
|
||||
})
|
||||
return area
|
||||
},
|
||||
typeName() {
|
||||
return this.dataTypes[this.typeIndex]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
mounted() {
|
||||
this.initData()
|
||||
this.setRightBtn()
|
||||
},
|
||||
methods: {
|
||||
initData() {},
|
||||
// 筛选省份确认事件
|
||||
onProvinceConditionConfirm(data) {
|
||||
async dataTypeChange() {
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
setRightBtn() {
|
||||
this.$jump({
|
||||
flag: 'webview_right_button',
|
||||
extra: {
|
||||
btns: [
|
||||
{
|
||||
img: this.$assetsUrl + 'images/ebiz/refresh.png'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
},
|
||||
updateData() {
|
||||
this.getSummarizingData()
|
||||
},
|
||||
async initData() {
|
||||
// 初始化年份筛选数据
|
||||
const currentYear = new Date().getFullYear()
|
||||
const startYear = currentYear - 10
|
||||
for (let year = startYear; year <= currentYear; year++) {
|
||||
this.years.unshift(year)
|
||||
}
|
||||
/**
|
||||
* 查询联动数据
|
||||
* manageCode, manageLv传空查全部
|
||||
**/
|
||||
// 查询分公司
|
||||
const res = await getComList({
|
||||
manageCode: '',
|
||||
manageLv: ''
|
||||
})
|
||||
const firsts = res.content
|
||||
|
||||
this.provinceObjs.push(...firsts)
|
||||
// 查询默认数据
|
||||
let result = await this.getSummarizingData()
|
||||
if (result.result === '0') {
|
||||
const preDTO = result.content.preDTO ? result.content.preDTO : {}
|
||||
const rlDTO = result.content.rlDTO ? result.content.rlDTO : {}
|
||||
const productDTO = result.content.productDTO ? result.content.productDTO : {}
|
||||
// 汇总业绩显示
|
||||
this.$refs.summarizing.setProducts(productDTO)
|
||||
this.$refs.summarizing.setPerformance(preDTO)
|
||||
this.$refs.summarizing.setManpower(rlDTO)
|
||||
} else {
|
||||
this.$toast(result.resultMessage)
|
||||
}
|
||||
},
|
||||
async getSummarizingData() {
|
||||
let date = null
|
||||
switch (this.timeType) {
|
||||
case 0:
|
||||
date = this.dayCondition
|
||||
this.params.queryType = 'd'
|
||||
break
|
||||
case 1:
|
||||
date = this.monthCondition
|
||||
this.params.queryType = 'm'
|
||||
break
|
||||
case 2:
|
||||
date = new Date(String(this.yearCondition))
|
||||
this.params.queryType = 'y'
|
||||
break
|
||||
case 3:
|
||||
date = this.dayTimeCondition
|
||||
this.params.queryType = 'd'
|
||||
break
|
||||
}
|
||||
this.params.date = dateUtil.formatDate(date, 'yyyy-MM-dd')
|
||||
let result = await getComPerformance(this.params)
|
||||
return result
|
||||
},
|
||||
async onDayConditionConfirm() {
|
||||
this.isDayConditionShow = false
|
||||
this.timeType = 0
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
async onMonthConditionConfirm() {
|
||||
this.isMonthConditionShow = false
|
||||
this.timeType = 1
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
async onYearConditionConfirm() {
|
||||
this.isYearConditionShow = false
|
||||
this.timeType = 2
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
// 筛选分公司确认事件
|
||||
async onProvinceConditionConfirm(data) {
|
||||
this.isProvinceConditionShow = false
|
||||
let province = this.provinceObjs.find(item => item.name === data)
|
||||
this.provinceCode = province.id
|
||||
if (province) {
|
||||
this.provinceCode = province.code
|
||||
this.params.manageCode = this.provinceCode
|
||||
this.params.manageLv = '02'
|
||||
}
|
||||
if (this.data === '全国') {
|
||||
this.provinceCode = '86'
|
||||
this.params.manageLv = '01'
|
||||
}
|
||||
this.provinceName = data
|
||||
this.cityName = '全部'
|
||||
this.areaName = '全部'
|
||||
// 查询全部支公司
|
||||
const res = await getComList({
|
||||
manageCode: this.provinceCode,
|
||||
manageLv: '02'
|
||||
})
|
||||
const seconds = res.content
|
||||
this.cityObjs.push(...seconds)
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
// 筛选城市确认事件
|
||||
onCityConditionConfirm(data) {
|
||||
async onCityConditionConfirm(data) {
|
||||
this.isCityConditionShow = false
|
||||
this.cityName = data
|
||||
let city = this.cityObjs.find(item => item.name === data)
|
||||
if (city) {
|
||||
this.cityCode = city.code
|
||||
this.params.manageCode = this.cityCode
|
||||
this.params.manageLv = '03'
|
||||
}
|
||||
if (data === '全部') {
|
||||
this.params.manageCode = this.provinceCode
|
||||
this.params.manageLv = '02'
|
||||
}
|
||||
this.areaName = '全部'
|
||||
// 查询营业部
|
||||
const res = await getComList({
|
||||
manageCode: this.cityCode,
|
||||
manageLv: '03'
|
||||
})
|
||||
const thirds = res.content
|
||||
this.areaObjs.push(...thirds)
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
// 筛选地区确认事件
|
||||
onAreaConditionConfirm(data) {
|
||||
console.log(data)
|
||||
async onAreaConditionConfirm(data) {
|
||||
this.isAreaConditionShow = false
|
||||
this.areaName = data
|
||||
let area = this.areaObjs.find(item => item.name === data)
|
||||
if (area) {
|
||||
this.areaCode = area.code
|
||||
this.params.manageCode = this.areaCode
|
||||
this.params.manageLv = '04'
|
||||
}
|
||||
if (data === '全部') {
|
||||
this.params.manageCode = this.cityCode
|
||||
this.params.manageLv = '03'
|
||||
}
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
// 筛选时间确认事件
|
||||
onTimeConditionConfirm(time) {
|
||||
async onDayTimeConditionConfirm(time) {
|
||||
this.isTimeBarShow = false
|
||||
this.timeType = 3
|
||||
this.timeCondition = dateUtil.formatDate(time, 'MM-dd HH:mm')
|
||||
this.params.date = ''
|
||||
let result = await this.getSummarizingData()
|
||||
if (this.active === 0) {
|
||||
this.setSummarizingData(result)
|
||||
} else {
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
}
|
||||
},
|
||||
// 切换数据类型事件
|
||||
changeDataType(index) {
|
||||
this.typeIndex = index
|
||||
this.isSideBarShow = false
|
||||
async changeDataType(index) {
|
||||
if (this.typeIndex === index) {
|
||||
return
|
||||
}
|
||||
this.typeIndex = index
|
||||
if (this.active === 0) {
|
||||
this.params.type = 'all'
|
||||
this.isSideBarShow = false
|
||||
return
|
||||
} else {
|
||||
switch (this.typeIndex) {
|
||||
case 0:
|
||||
this.params.type = 'prem'
|
||||
break
|
||||
case 1:
|
||||
this.params.type = 'active'
|
||||
break
|
||||
case 2:
|
||||
this.params.type = 'product'
|
||||
break
|
||||
}
|
||||
}
|
||||
this.isSideBarShow = false
|
||||
},
|
||||
async updateQueryCom(val) {
|
||||
switch (val) {
|
||||
case 0:
|
||||
this.params.queryCom = 'z'
|
||||
break
|
||||
case 1:
|
||||
this.params.queryCom = 'y'
|
||||
break
|
||||
case 2:
|
||||
this.params.queryCom = 'q'
|
||||
break
|
||||
}
|
||||
switch (this.typeIndex) {
|
||||
case 0:
|
||||
this.params.type = 'prem'
|
||||
break
|
||||
case 1:
|
||||
this.params.type = 'active'
|
||||
break
|
||||
case 2:
|
||||
this.params.type = 'product'
|
||||
break
|
||||
}
|
||||
let result = await this.getSummarizingData()
|
||||
this.$refs.organization.setTableData(result.content, this.params.type)
|
||||
},
|
||||
setSummarizingData(data) {
|
||||
if (data.result === '0') {
|
||||
const preDTO = data.content.preDTO ? data.content.preDTO : {}
|
||||
const rlDTO = data.content.rlDTO ? data.content.rlDTO : {}
|
||||
const productDTO = data.content.productDTO ? data.content.productDTO : {}
|
||||
// 汇总业绩显示
|
||||
this.$refs.summarizing.setProducts(productDTO)
|
||||
this.$refs.summarizing.setPerformance(preDTO)
|
||||
this.$refs.summarizing.setManpower(rlDTO)
|
||||
} else {
|
||||
this.$toast(data.resultMessage)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
active(nv) {
|
||||
// 汇总或分机构有数据则不继续调接口
|
||||
if (nv === 0) {
|
||||
this.params.type = 'all'
|
||||
} else {
|
||||
switch (this.typeIndex) {
|
||||
case 0:
|
||||
this.params.type = 'prem'
|
||||
break
|
||||
case 1:
|
||||
this.params.type = 'active'
|
||||
break
|
||||
case 2:
|
||||
this.params.type = 'product'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,6 +563,15 @@ export default {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.btn-gray {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.activeBtn {
|
||||
color: red;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .van-tab__pane {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user