Commit 7eafa4bf authored by 陈明豪's avatar 陈明豪

数据统计-接口对接

parent 5899c566
......@@ -16,6 +16,14 @@ export function getHospitalStatistics() {
})
}
// 获取业务统计
export function getBusinessStatistics() {
return request({
url: '/business/statistics/businessStatistics',
method: 'get'
})
}
export function listHospital(query) {
return request({
url: '/system/hospital/list',
......
......@@ -36,7 +36,7 @@ export default {
show: true
},
legend: {
data: ['历史入驻量', '当前有效数量'],
data: ['年消费额', '年充值额'],
left: 'center',
textStyle: { // 图例的公用文本样式。
fontSize: 12,
......@@ -70,7 +70,7 @@ export default {
data: [
{
value: _this.yData1,
name: '历史入驻量',
name: '年消费额',
symbol: 'emptyCircle', // 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none', emptyCircle
symbolSize: 6,
itemStyle: {
......@@ -95,7 +95,7 @@ export default {
},
{
value: _this.yData2,
name: '当前有效数量',
name: '年充值额',
symbol: 'emptyCircle',
symbolSize: 6,
itemStyle: {
......
......@@ -475,7 +475,6 @@ export default {
const authorizationExpirationDate = this.addDays(row.createTime, row.dueDate)
row.authorizationExpirationDate = authorizationExpirationDate
const local = process.env.VUE_APP_WEB
console.log('local', local)
window.location.href = `${local}/hospital-management/hospital-details?detail=${row}`
localStorage.setItem('hospitalDetail', JSON.stringify(row))
}
......
......@@ -249,17 +249,23 @@
</el-col>
<el-col :span="9">
<div class="cardDiv" style="padding-bottom: 0px">
<div v-if="radarPetOwnerPlatform.yData1.length > 0 || radarPetOwnerPlatform.yData2.length > 0" style="text-align: right;position: absolute;z-index: 10;width: 34%;">
<div v-if="radarPetOwnerPlatformCurrentYear.yData1.length > 0 || radarPetOwnerPlatformCurrentYear.yData2.length > 0" style="text-align: right;position: absolute;z-index: 10;width: 34%;">
<el-radio-group v-model="radarSelect">
<el-radio-button label="lastYear" class="radioButton">去年</el-radio-button>
<el-radio-button label="currentYear" class="radioButton">今年</el-radio-button>
</el-radio-group>
</div>
<radar-chart-for-pet-owner-platform
v-if="radarPetOwnerPlatform.yData1.length > 0 || radarPetOwnerPlatform.yData2.length > 0"
:y-data1="radarPetOwnerPlatform.yData1"
:y-data2="radarPetOwnerPlatform.yData2"
:max="getArrayMax([getArrayMax(radarPetOwnerPlatform.yData1),getArrayMax(radarPetOwnerPlatform.yData2)])"
v-if="(radarPetOwnerPlatformLastYear.yData1.length > 0 || radarPetOwnerPlatformLastYear.yData2.length > 0) && radarSelect === 'lastYear'"
:y-data1="radarPetOwnerPlatformLastYear.yData1"
:y-data2="radarPetOwnerPlatformLastYear.yData2"
:max="getArrayMax([getArrayMax(radarPetOwnerPlatformLastYear.yData1),getArrayMax(radarPetOwnerPlatformLastYear.yData2)])"
/>
<radar-chart-for-pet-owner-platform
v-if="(radarPetOwnerPlatformCurrentYear.yData1.length > 0 || radarPetOwnerPlatformCurrentYear.yData2.length > 0) && radarSelect === 'currentYear'"
:y-data1="radarPetOwnerPlatformCurrentYear.yData1"
:y-data2="radarPetOwnerPlatformCurrentYear.yData2"
:max="getArrayMax([getArrayMax(radarPetOwnerPlatformCurrentYear.yData1),getArrayMax(radarPetOwnerPlatformCurrentYear.yData2)])"
/>
<div v-else style="height: 386px;">
<div class="cardTitle" style="margin-bottom: 29px">
......@@ -654,7 +660,7 @@ export default {
ColumnarChart, OverlongTool, TwoLineChart, ProgressColor },
data() {
return {
loading: true,
loading: false,
isPlatformRole: true,
crosswiseShow: false,
customerStatistics: {},
......@@ -836,7 +842,11 @@ export default {
xData: ['1家', '2~4家', '5~8家', '8家以上'],
yData: []
},
radarPetOwnerPlatform: {
radarPetOwnerPlatformCurrentYear: {
yData1: [],
yData2: []
},
radarPetOwnerPlatformLastYear: {
yData1: [],
yData2: []
},
......@@ -1136,13 +1146,14 @@ export default {
methods: {
// 获取宠主数据统计数据
getStatisticsDataForPlatFrom() {
this.loading = true
// this.loading = true
getPetDataStatistics().then(res => {
if (res.code === 200) {
console.log('res', res)
console.log('platRes', res)
// debugger
this.customerStatistics = res.data.customerStatistics
this.yData1.data = res.data.newCustomerStatistics.addNum
this.yData2.data = res.data.newCustomerStatistics.registerNum
this.yData1.data = res.data.newCustomerStatistics.map(x => { return x.addNum })
this.yData2.data = res.data.newCustomerStatistics.map(x => { return x.registerNum })
this.y1_data.data = res.data.PetNumAnalysis.dimension
this.y2_data.data = res.data.PetNumAnalysis.dimensionTwoNum
......@@ -1152,16 +1163,19 @@ export default {
this.columnarChartData.yData = res.data.HospitalNumAnalysis.dimension
this.radarPetOwnerPlatform.yData1 = res.data.PayAmountAnalysis.dimension
this.radarPetOwnerPlatform.yData2 = res.data.PayAmountAnalysis.dimensionTwoNum
this.radarPetOwnerPlatformCurrentYear.yData1 = res.data.PayAmountAnalysis.dimension
this.radarPetOwnerPlatformCurrentYear.yData2 = res.data.RechargeAmountAnalysis.dimension
this.radarPetOwnerPlatformLastYear.yData1 = (res.data.PayAmountAnalysis.dimensionTwoNum || [])
this.radarPetOwnerPlatformLastYear.yData2 = (res.data.RechargeAmountAnalysis.dimensionTwoNum || [])
this.crosswiseShow = true
this.loading = false
// this.loading = false
}
})
},
getStatisticsDataForHospital() {
this.loading = true
// this.loading = true
getPetDataStatistics().then(res => {
if (res.code === 200) {
console.log('hospitalRoleRes', res)
......@@ -1178,9 +1192,12 @@ export default {
this.topUpColumnarChartData.yData = res.data.RechargeAnalysis.dimension
this.radarPetOwnerHospital.yData1 = res.data.PetCountAnalysis.dimension
this.radarPetOwnerHospital.yData2 = res.data.PetCountAnalysis.dimensionTwoNum
this.loading = false
if (res.data.PetCountAnalysis.dimensionTwoNum !== undefined && res.data.PetCountAnalysis.dimensionTwoNum !== null) {
this.radarPetOwnerHospital.yData2 = res.data.PetCountAnalysis.dimensionTwoNum
}
// this.loading = false
}
})
},
......
......@@ -13,7 +13,7 @@
<el-col :span="6">
<div class="service_info_statistics service_info_statistics_device">
<div style="display: flex;">
<div class="numberColor">76</div>
<div class="numberColor">{{ formatNum(businessInformation.serviceEquipment) }}</div>
<div class="fontColor"></div>
</div>
<div class="bottomText">
......@@ -27,7 +27,7 @@
<el-col :span="6">
<div class="service_info_statistics service_info_statistics_project">
<div style="display: flex;">
<div class="numberColor">827</div>
<div class="numberColor">{{ formatNum(businessInformation.serviceProject) }}</div>
<div class="fontColor"></div>
</div>
<div class="bottomText">
......@@ -41,7 +41,7 @@
<el-col :span="6">
<div class="service_info_statistics service_info_statistics_order">
<div style="display: flex;">
<div class="numberColor">3,421</div>
<div class="numberColor">{{ formatNum(businessInformation.appointmentsNum) }}</div>
<div class="fontColor"></div>
</div>
<div class="bottomText">
......@@ -55,7 +55,7 @@
<el-col :span="6">
<div class="service_info_statistics service_info_statistics_income">
<div style="display: flex;">
<div class="numberColor">348,936,33</div>
<div class="numberColor">{{ formatNum(businessInformation.appointmentsAmount) }}</div>
<div class="fontColor"></div>
</div>
<div class="bottomText">
......@@ -668,6 +668,7 @@ import PercentTool from '@/views/data-statistics/other-components/percentTool.vu
import OneLineChart from '@/views/data-statistics/echars-components/oneLineChart.vue'
import PileUpChart from '@/views/data-statistics/echars-components/pileUpChart.vue'
import RadarChartOneLineBigger from '@/views/data-statistics/echars-components/radar-chart-one-line-bigger.vue'
import { getBusinessStatistics } from '@/api/business/statistics'
export default {
name: 'ServiceStatistics',
......@@ -675,6 +676,7 @@ export default {
data() {
return {
isPlatformRole: true,
businessInformation: {},
mapData: [
{
name: '北京市',
......@@ -1466,8 +1468,35 @@ export default {
}
},
created() {
console.log('store--->', this.$store.state.user.userType)
if (this.$store.state.user.userType === '00') {
this.isPlatformRole = true
this.getDataForPlatform()
} else {
this.isPlatformRole = false
}
},
methods: {
getDataForPlatform() {
getBusinessStatistics().then(res => {
if (res.code === 200) {
console.log('业务统计数据===>', res)
this.businessInformation = res.data.businessInformation
}
})
},
formatNum(value) {
return Number(value).toLocaleString()
},
getArrayMax(array = []) {
let max = 0
for (let i = 0; i < array.length; i++) {
if (array[i] > max) {
max = array[i]
}
}
return max
}
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment