|
@@ -1,12 +1,57 @@
|
|
|
<template>
|
|
|
- <div class="white pa-3">
|
|
|
- <StatisticsCard :api="getCustomerClaimStatistics" :assignFn="assignFn"></StatisticsCard>
|
|
|
+ <div class="pa-3 white">
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
+ <el-tab-pane label="分布图" name="first">
|
|
|
+ <StatisticsCard
|
|
|
+ :api="getCustomerClaimStatistics"
|
|
|
+ :assignFn="assignFn"
|
|
|
+ :default-values="{
|
|
|
+ month: dateFormat('YYYY-mm', new Date())
|
|
|
+ }"
|
|
|
+ :search-items="[
|
|
|
+ {
|
|
|
+ label: '月份',
|
|
|
+ prop: 'month',
|
|
|
+ type: 'datePicker',
|
|
|
+ options: {
|
|
|
+ placeholder: '请选择月份',
|
|
|
+ clearable: false,
|
|
|
+ type: 'month',
|
|
|
+ valueFormat: 'yyyy-MM',
|
|
|
+ format: 'yyyy 年 MM 月'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]"
|
|
|
+ ></StatisticsCard>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="趋势图" name="second">
|
|
|
+ <StatisticsCard
|
|
|
+ :api="getSalaryProductStatistics"
|
|
|
+ :height="400"
|
|
|
+ :assign-values="assignValues"
|
|
|
+ :search-items="[{
|
|
|
+ label: '时间范围',
|
|
|
+ type: 'datePicker',
|
|
|
+ prop: 'month',
|
|
|
+ options: {
|
|
|
+ rangeSeparator: '至',
|
|
|
+ startPlaceholder: '开始时间',
|
|
|
+ endPlaceholder: '结束时间',
|
|
|
+ valueFormat: 'yyyy-MM-dd',
|
|
|
+ type: 'daterange'
|
|
|
+ }
|
|
|
+ }]"
|
|
|
+ @click="onClick"
|
|
|
+ ></StatisticsCard>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import StatisticsCard from '../components/StatisticsCard.vue'
|
|
|
-import { getCustomerClaimStatistics } from '@/api/salary'
|
|
|
+import { getCustomerClaimStatistics, getSalaryProductStatistics } from '@/api/salary'
|
|
|
+import { dateFormat } from '@/utils/date'
|
|
|
export default {
|
|
|
name: 'claimStatistics',
|
|
|
components: {
|
|
@@ -14,10 +59,26 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- getCustomerClaimStatistics
|
|
|
+ dateFormat,
|
|
|
+ activeName: 'first',
|
|
|
+ getCustomerClaimStatistics,
|
|
|
+ getSalaryProductStatistics
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onClick (e) {
|
|
|
+ console.log(e)
|
|
|
+ },
|
|
|
+ assignValues (data) {
|
|
|
+ const { month } = data
|
|
|
+ if (!month || !month.length) {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ startDate: month[0],
|
|
|
+ endDate: month[1]
|
|
|
+ }
|
|
|
+ },
|
|
|
assignFn (data) {
|
|
|
data.series.forEach((item) => {
|
|
|
Object.assign(item, {
|