master
parent
011d8cf7f6
commit
5de5036c0b
@ -1,312 +1,307 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="statistics">
|
|
||||||
<el-card>
|
<div class="statistics">
|
||||||
<template v-slot:header>
|
<panel-group :totaldata="list" />
|
||||||
<i class="el-icon-data-line"></i>
|
</div>
|
||||||
<span class="statistics-title">营业统计</span>
|
|
||||||
</template>
|
<div class="chart">
|
||||||
<div class="statistics-content">
|
<div class="chartItem" style="margin-right: 1%;">
|
||||||
<div class="statistics-content-top">
|
<div class="chartItemTitle">营业与收入</div>
|
||||||
<div class="statistics-content-top__num">¥40.5万</div>
|
<div id="col-chart"></div>
|
||||||
<div class="statistics-content-top__name">服务金额</div>
|
</div>
|
||||||
</div>
|
<div class="chartItem" style="margin-left: 1%;">
|
||||||
<div class="statistics-content-bottom">
|
<div class="chartItemTitle">客户与订单</div>
|
||||||
<div class="statistics-content-bottom-left">
|
<div id="line-chart"></div>
|
||||||
<div class="statistics-content-bottom-left__num">¥26.9万</div>
|
</div>
|
||||||
<div class="statistics-content-bottom-left__name">护工金额</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="statistics-content-bottom-right">
|
</template>
|
||||||
<div class="statistics-content-bottom-right__num">¥13.6万</div>
|
|
||||||
<div class="statistics-content-bottom-right__name">留存金额</div>
|
<script>
|
||||||
</div>
|
import echarts from "echarts"
|
||||||
</div>
|
import PanelGroup from './components/PanelGroup'
|
||||||
</div>
|
import {
|
||||||
</el-card>
|
getChartsHome
|
||||||
|
} from "../../api/dashboard.js"
|
||||||
<el-card>
|
|
||||||
<template v-slot:header>
|
export default {
|
||||||
<i class="el-icon-user"></i>
|
components: {
|
||||||
<span class="statistics-title">人效统计</span>
|
PanelGroup
|
||||||
</template>
|
},
|
||||||
<div class="statistics-content">
|
data() {
|
||||||
<div class="statistics-content-top">
|
return {
|
||||||
<div class="statistics-content-top__num">120人</div>
|
col: '',
|
||||||
<div class="statistics-content-top__name">照护人员</div>
|
line: '',
|
||||||
</div>
|
business_data: [],
|
||||||
<div class="statistics-content-bottom">
|
collect_data: [],
|
||||||
<div class="statistics-content-bottom-left">
|
list: {},
|
||||||
<div class="statistics-content-bottom-left__num">8小时/天</div>
|
customerArr: [],
|
||||||
<div class="statistics-content-bottom-left__name">预期照护时长</div>
|
orderArr: [],
|
||||||
</div>
|
chartData: {},
|
||||||
<div class="statistics-content-bottom-right">
|
}
|
||||||
<div class="statistics-content-bottom-right__num">6.3小时/天</div>
|
},
|
||||||
<div class="statistics-content-bottom-right__name">人均照护时长</div>
|
watch: {
|
||||||
</div>
|
chartData(val, newval) {
|
||||||
</div>
|
if (newval){
|
||||||
</div>
|
this.init();
|
||||||
</el-card>
|
}
|
||||||
|
}
|
||||||
<el-card>
|
},
|
||||||
<template v-slot:header>
|
methods: {
|
||||||
<i class="el-icon-s-custom"></i>
|
async loadData() {
|
||||||
<span class="statistics-title">客户统计</span>
|
await getChartsHome().then((res) => {
|
||||||
</template>
|
console.log(res);
|
||||||
<div class="statistics-content">
|
this.list = res.list;
|
||||||
<div class="statistics-content-top">
|
this.chartData = res;
|
||||||
<div class="statistics-content-top__num">800人</div>
|
let _business_data = [];
|
||||||
<div class="statistics-content-top__name">活跃客户</div>
|
let _collect_data = [];
|
||||||
</div>
|
res.business_data.map(item => {
|
||||||
<div class="statistics-content-bottom">
|
_business_data.push(item.server_money_total)
|
||||||
<div class="statistics-content-bottom-left">
|
_collect_data.push(item.collect_money)
|
||||||
<div class="statistics-content-bottom-left__num">100</div>
|
})
|
||||||
<div class="statistics-content-bottom-left__name">新增</div>
|
this.business_data = _business_data;
|
||||||
</div>
|
this.collect_data = _collect_data;
|
||||||
<div class="statistics-content-bottom-right">
|
let _customerArr = [];
|
||||||
<div class="statistics-content-bottom-right__num">20</div>
|
let _orderArr = [];
|
||||||
<div class="statistics-content-bottom-right__name">流失</div>
|
|
||||||
</div>
|
res.order_data.map(item => {
|
||||||
</div>
|
_customerArr.push(item.active_customer)
|
||||||
</div>
|
_orderArr.push(item.order_total)
|
||||||
</el-card>
|
})
|
||||||
|
this.customerArr = _customerArr;
|
||||||
<el-card>
|
this.orderArr = _orderArr;
|
||||||
<template v-slot:header>
|
}).catch()
|
||||||
<i class="el-icon-document"></i>
|
},
|
||||||
<span class="statistics-title">订单统计</span>
|
init() {
|
||||||
</template>
|
this.col = echarts.init(document.getElementById('col-chart'))
|
||||||
<div class="statistics-content">
|
this.col.setOption({
|
||||||
<div class="statistics-content-top">
|
title: {
|
||||||
<div class="statistics-content-top__num">500</div>
|
text: ''
|
||||||
<div class="statistics-content-top __name">服务订单</div>
|
},
|
||||||
</div>
|
tooltip: {
|
||||||
<div class="statistics-content-bottom">
|
trigger: 'axis',
|
||||||
<div class="statistics-content-bottom-left">
|
axisPointer: {
|
||||||
<div class="statistics-content-bottom-left__num">450</div>
|
type: 'shadow'
|
||||||
<div class="statistics-content-bottom-left__name">周期性订单</div>
|
},
|
||||||
</div>
|
position: 'bottom'
|
||||||
<div class="statistics-content-bottom-right">
|
},
|
||||||
<div class="statistics-content-bottom-right__num">50</div>
|
legend: {},
|
||||||
<div class="statistics-content-bottom-right__name">单次订单</div>
|
grid: {
|
||||||
</div>
|
left: '3%',
|
||||||
</div>
|
right: '4%',
|
||||||
</div>
|
bottom: '3%',
|
||||||
</el-card>
|
containLabel: true
|
||||||
</div>
|
},
|
||||||
|
yAxis: {
|
||||||
<div class="chart">
|
type: 'value',
|
||||||
<div id="col-chart"></div>
|
boundaryGap: [0, 0.01]
|
||||||
<div id="line-chart"></div>
|
},
|
||||||
</div>
|
xAxis: {
|
||||||
</div>
|
type: 'category',
|
||||||
</template>
|
data: ['第一周', '第二周', '第三周', '第四周']
|
||||||
|
},
|
||||||
<script>
|
series: [{
|
||||||
import echarts from "echarts"
|
name: '服务金额',
|
||||||
|
type: 'bar',
|
||||||
export default {
|
data: this.business_data,
|
||||||
components: {},
|
itemStyle: {
|
||||||
data() {
|
normal: {
|
||||||
return {
|
color: 'rgb(42,182,252)'
|
||||||
col:'',
|
},
|
||||||
line:''
|
},
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
methods: {
|
name: '收款',
|
||||||
init() {
|
type: 'bar',
|
||||||
this.col = echarts.init(document.getElementById('col-chart'))
|
data: this.collect_data,
|
||||||
this.col.setOption({
|
itemStyle: {
|
||||||
title: {
|
normal: {
|
||||||
text: ''
|
color: 'rgb(34,228,255)'
|
||||||
},
|
},
|
||||||
tooltip: {
|
},
|
||||||
trigger: 'axis',
|
}
|
||||||
axisPointer: {
|
]
|
||||||
type: 'shadow'
|
})
|
||||||
},
|
|
||||||
position:'bottom'
|
this.line = echarts.init(document.getElementById('line-chart'))
|
||||||
},
|
this.line.setOption({
|
||||||
legend: {},
|
title: {
|
||||||
grid: {
|
text: ''
|
||||||
left: '3%',
|
},
|
||||||
right: '4%',
|
tooltip: {
|
||||||
bottom: '3%',
|
trigger: 'axis'
|
||||||
containLabel: true
|
},
|
||||||
},
|
legend: {
|
||||||
yAxis: {
|
data: ['活跃客户', '服务订单']
|
||||||
type: 'value',
|
},
|
||||||
boundaryGap: [0, 0.01]
|
grid: {
|
||||||
},
|
left: '3%',
|
||||||
xAxis: {
|
right: '6%',
|
||||||
type: 'category',
|
bottom: '3%',
|
||||||
data: ['第一周', '第二周', '第三周', '第四周']
|
containLabel: true
|
||||||
},
|
},
|
||||||
series: [
|
toolbox: {
|
||||||
{
|
|
||||||
name: '服务金额',
|
},
|
||||||
type: 'bar',
|
xAxis: {
|
||||||
data: [18203, 23489, 29034, 104970],
|
type: 'category',
|
||||||
itemStyle: {
|
boundaryGap: false,
|
||||||
normal: {
|
data: ['第一周', '第二周', '第三周', '第四周']
|
||||||
color: 'rgb(42,182,252)'
|
},
|
||||||
},
|
yAxis: {
|
||||||
},
|
type: 'value',
|
||||||
},
|
},
|
||||||
{
|
series: [{
|
||||||
name: '收款',
|
name: '活跃客户',
|
||||||
type: 'bar',
|
type: 'line',
|
||||||
data: [19325, 23438, 31000, 121594],
|
stack: 'Total',
|
||||||
itemStyle: {
|
data: this.customerArr,
|
||||||
normal: {
|
itemStyle: {
|
||||||
color: 'rgb(34,228,255)'
|
normal: {
|
||||||
},
|
color: 'rgb(42,182,252)'
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
]
|
},
|
||||||
})
|
{
|
||||||
|
name: '服务订单',
|
||||||
this.line = echarts.init(document.getElementById('line-chart'))
|
type: 'line',
|
||||||
this.line.setOption({
|
stack: 'Total',
|
||||||
title: {
|
data: this.orderArr,
|
||||||
text: ''
|
itemStyle: {
|
||||||
},
|
normal: {
|
||||||
tooltip: {
|
color: 'rgb(34,228,255)'
|
||||||
trigger: 'axis'
|
},
|
||||||
},
|
},
|
||||||
legend: {
|
}
|
||||||
data: ['活跃客户', '服务订单']
|
]
|
||||||
},
|
})
|
||||||
grid: {
|
}
|
||||||
left: '3%',
|
},
|
||||||
right: '6%',
|
created() {
|
||||||
bottom: '3%',
|
|
||||||
containLabel: true
|
this.loadData();
|
||||||
},
|
},
|
||||||
toolbox: {
|
mounted() {
|
||||||
|
|
||||||
},
|
|
||||||
xAxis: {
|
//this.init()
|
||||||
type: 'category',
|
|
||||||
boundaryGap: false,
|
window.onresize = () => {
|
||||||
data: ['第一周', '第二周', '第三周', '第四周']
|
this.col.resize()
|
||||||
},
|
this.line.resize()
|
||||||
yAxis: {
|
}
|
||||||
type: 'value',
|
|
||||||
},
|
},
|
||||||
series: [
|
destroyed() {
|
||||||
{
|
window.onresize = null
|
||||||
name: '活跃客户',
|
}
|
||||||
type: 'line',
|
}
|
||||||
stack: 'Total',
|
</script>
|
||||||
data: [120, 132, 101, 134],
|
|
||||||
itemStyle: {
|
<style lang="scss" scoped>
|
||||||
normal: {
|
.statistics {
|
||||||
color: 'rgb(42,182,252)'
|
display: flex;
|
||||||
},
|
|
||||||
},
|
margin-top: 20px;
|
||||||
},
|
|
||||||
{
|
&-title {
|
||||||
name: '服务订单',
|
|
||||||
type: 'line',
|
padding-left: 6px;
|
||||||
stack: 'Total',
|
}
|
||||||
data: [220, 182, 191, 234],
|
|
||||||
itemStyle: {
|
&-content {
|
||||||
normal: {
|
text-align: center;
|
||||||
color: 'rgb(34,228,255)'
|
font-size: 13px;
|
||||||
},
|
|
||||||
},
|
&-top {
|
||||||
}
|
|
||||||
]
|
&__num {
|
||||||
})
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
&__name {
|
||||||
this.init()
|
font-size: 10px;
|
||||||
|
color: rgb(140, 140, 140);
|
||||||
window.onresize = () => {
|
}
|
||||||
this.col.resize()
|
}
|
||||||
this.line.resize()
|
|
||||||
}
|
&-bottom {
|
||||||
},
|
display: flex;
|
||||||
destroyed() {
|
justify-content: space-between;
|
||||||
window.onresize = null
|
|
||||||
}
|
&-left {
|
||||||
}
|
|
||||||
</script>
|
&__num {
|
||||||
|
font-weight: 600;
|
||||||
<style lang="scss" scoped>
|
}
|
||||||
.statistics{
|
|
||||||
display: flex;
|
&__name {
|
||||||
|
font-size: 10px;
|
||||||
margin-top: 20px;
|
color: rgb(140, 140, 140);
|
||||||
&-title{
|
}
|
||||||
|
}
|
||||||
padding-left: 6px;
|
|
||||||
}
|
&-right {
|
||||||
&-content{
|
|
||||||
text-align: center;
|
&__num {
|
||||||
font-size: 13px;
|
font-weight: 600;
|
||||||
&-top{
|
}
|
||||||
|
|
||||||
&__num{
|
&__name {
|
||||||
font-weight: 600;
|
font-size: 10px;
|
||||||
}
|
color: rgb(140, 140, 140);
|
||||||
&__name{
|
}
|
||||||
font-size: 10px;
|
}
|
||||||
color: rgb(140,140,140);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
&-bottom{
|
&>div {
|
||||||
display: flex;
|
flex: 1;
|
||||||
justify-content: space-between;
|
margin-right: 20px;
|
||||||
|
|
||||||
&-left{
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
&__num{
|
}
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
}
|
||||||
&__name{
|
|
||||||
font-size: 10px;
|
.chart {
|
||||||
color: rgb(140,140,140);
|
display: flex;
|
||||||
}
|
|
||||||
}
|
margin-top: 20px;
|
||||||
&-right{
|
|
||||||
|
|
||||||
&__num{
|
.chartItem {
|
||||||
font-weight: 600;
|
|
||||||
}
|
width: 49%;
|
||||||
&__name{
|
|
||||||
font-size: 10px;
|
.chartItemTitle {
|
||||||
color: rgb(140,140,140);
|
font-size: 16px;
|
||||||
}
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
#col-chart {
|
||||||
&>div{
|
background: #fff;
|
||||||
flex: 1;
|
border-radius: 10px;
|
||||||
margin-right: 20px;
|
flex: 1;
|
||||||
|
margin-right: 20px;
|
||||||
&:last-child{
|
padding: 20px;
|
||||||
margin-right: 0;
|
box-sizing: border-box;
|
||||||
}
|
min-height: 400px;
|
||||||
}
|
width: 100%;
|
||||||
}
|
}
|
||||||
.chart{
|
|
||||||
display: flex;
|
#line-chart {
|
||||||
|
background: #fff;
|
||||||
margin-top: 50px;
|
border-radius: 10px;
|
||||||
#col-chart {
|
flex: 1;
|
||||||
background: #fff;
|
padding: 20px;
|
||||||
border-radius: 10px;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
min-height: 400px;
|
||||||
height: 300px;
|
}
|
||||||
margin-right: 30px;
|
}
|
||||||
}
|
|
||||||
#line-chart {
|
|
||||||
background: #fff;
|
}
|
||||||
border-radius: 10px;
|
|
||||||
flex: 1;
|
|
||||||
height: 300px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in new issue