收费总览页面
This commit is contained in:
@@ -58,8 +58,7 @@
|
||||
<!-- 押金余额统计 -->
|
||||
<DepositCard
|
||||
:deposit-balance="depositBalance"
|
||||
:deposit-renovation="depositRenovation"
|
||||
:deposit-rental="depositRental"
|
||||
:deposit-items="depositItems"
|
||||
/>
|
||||
|
||||
<!-- 巡检总览 -->
|
||||
@@ -77,7 +76,7 @@ import FeeOverviewCard from './components/FeeOverviewCard.vue'
|
||||
import ParkingFeeCard from './components/ParkingFeeCard.vue'
|
||||
import DepositCard from './components/DepositCard.vue'
|
||||
import InspectionOverview from './components/InspectionOverview.vue'
|
||||
import { getManagedArea, getRate, getFeeSummary, getParkingFee } from '@/api/statisticsApi.js'
|
||||
import { getManagedArea, getRate, getFeeSummary, getParkingFee, getDepositBalance, getInspection } from '@/api/statisticsApi.js'
|
||||
|
||||
|
||||
|
||||
@@ -109,16 +108,15 @@ const parkingYearReceived = ref(0)
|
||||
const parkingArcbarPercent = ref(0)
|
||||
|
||||
// 押金余额统计
|
||||
const depositBalance = ref('33322')
|
||||
const depositRenovation = ref(18)
|
||||
const depositRental = ref(23)
|
||||
const depositBalance = ref('0')
|
||||
const depositItems = ref([])
|
||||
|
||||
// 巡检总览
|
||||
const inspectionList = ref([
|
||||
{ label: '巡检任务', value: 124, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-task.png' },
|
||||
{ label: '已完成', value: 98, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-done.png' },
|
||||
{ label: '已过期', value: 12, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-expire.png' },
|
||||
{ label: '待处理', value: 14, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-pending.png' }
|
||||
{ label: '巡检任务', value: 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-task.png' },
|
||||
{ label: '已完成', value: 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-done.png' },
|
||||
{ label: '已过期', value: 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-expire.png' },
|
||||
{ label: '待处理', value: 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-pending.png' }
|
||||
])
|
||||
|
||||
const switchTab = (tab) => {
|
||||
@@ -134,6 +132,8 @@ const onProjectChange = (e) => {
|
||||
fetchRate(opt.value)
|
||||
fetchFeeSummary()
|
||||
fetchParkingFee(opt.value)
|
||||
fetchDepositBalance(opt.value)
|
||||
fetchInspection(opt.value)
|
||||
}
|
||||
|
||||
const onFeeTypeChange = (opt) => {
|
||||
@@ -169,19 +169,20 @@ const fetchRate = (villageId) => {
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
// 车位收费总览
|
||||
const fetchParkingFee = (villageId) => {
|
||||
getParkingFee({ villageId: villageId || '' }).then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
const d = res.data
|
||||
parkingCount.value = d.parkingCount || 0
|
||||
parkingYearReceivable.value = d.receivableAmount || 0
|
||||
parkingYearReceived.value = d.receivedAmount || 0
|
||||
parkingArcbarPercent.value = d.receivedPercent != null ? d.receivedPercent / 100 : 0
|
||||
parkingCount.value = Number(d.parkingCount) || 0
|
||||
parkingYearReceivable.value = Number(d.receivableAmount) || 0
|
||||
parkingYearReceived.value = Number(d.receivedAmount) || 0
|
||||
parkingArcbarPercent.value = d.receivedPercent != null ? Number(d.receivedPercent) / 100 : 0
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
// 收费总览
|
||||
const fetchFeeSummary = () => {
|
||||
getFeeSummary({
|
||||
villageId: selectedProject.value || '',
|
||||
@@ -190,19 +191,21 @@ const fetchFeeSummary = () => {
|
||||
}).then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
const d = res.data
|
||||
arcbarPercent.value = d.receivedPercent != null ? d.receivedPercent / 100 : 0
|
||||
arcbarPercent.value = Number(d.receivedPercent) || 0
|
||||
metricList.value = [
|
||||
{ label: '应收总额', value: d.receivableAmount != null ? d.receivableAmount.toFixed(2) : '0.00', yoy: formatRate(d.receivableYoyRate), mom: formatRate(d.receivableMomRate) },
|
||||
{ label: '实收总额', value: d.receivedAmount != null ? d.receivedAmount.toFixed(2) : '0.00', yoy: formatRate(d.receivedYoyRate), mom: formatRate(d.receivedMomRate) },
|
||||
{ label: '欠收总额', value: d.unpaidAmount != null ? d.unpaidAmount.toFixed(2) : '0.00', yoy: formatRate(d.unpaidYoyRate), mom: formatRate(d.unpaidMomRate) }
|
||||
{ label: '应收总额', value: (Number(d.receivableAmount) || 0).toFixed(2), yoy: formatRate(d.receivableYoyRate), mom: formatRate(d.receivableMomRate) },
|
||||
{ label: '实收总额', value: (Number(d.receivedAmount) || 0).toFixed(2), yoy: formatRate(d.receivedYoyRate), mom: formatRate(d.receivedMomRate) },
|
||||
{ label: '欠收总额', value: (Number(d.unpaidAmount) || 0).toFixed(2), yoy: formatRate(d.unpaidYoyRate), mom: formatRate(d.unpaidMomRate) }
|
||||
]
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
const formatRate = (val) => {
|
||||
if (val == null) return '-'
|
||||
return (val >= 0 ? '+' : '') + val.toFixed(2) + '%'
|
||||
if (val == null || val === '') return '-'
|
||||
const num = Number(val)
|
||||
if (isNaN(num)) return '-'
|
||||
return (num >= 0 ? '+' : '') + num.toFixed(2) + '%'
|
||||
}
|
||||
|
||||
const fetchFeeTypes = () => {
|
||||
@@ -214,6 +217,30 @@ const fetchFeeTypes = () => {
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
// 押金余额统计
|
||||
const fetchDepositBalance = (villageId) => {
|
||||
getDepositBalance({ villageId: villageId}).then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
const d = res.data
|
||||
depositBalance.value = d.totalBalance
|
||||
depositItems.value = d.items || []
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
// 巡检总览
|
||||
const fetchInspection = (villageId) => {
|
||||
getInspection({ villageId: villageId || '' }).then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
const d = res.data
|
||||
inspectionList.value = [
|
||||
{ label: '巡检任务', value: d.taskCount || 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-task.png' },
|
||||
{ label: '已完成', value: d.completedCount || 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-done.png' },
|
||||
{ label: '已过期', value: d.expiredCount || 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-expire.png' },
|
||||
{ label: '待处理', value: d.pendingCount || 0, icon: 'https://wuye.ckdzkj.com/images/imgs/inspection-pending.png' }
|
||||
]
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
Promise.all([fetchVillageList(), fetchFeeTypes()]).then(() => {
|
||||
@@ -221,6 +248,8 @@ onShow(() => {
|
||||
fetchRate(selectedProject.value)
|
||||
fetchFeeSummary()
|
||||
fetchParkingFee(selectedProject.value)
|
||||
fetchDepositBalance(selectedProject.value)
|
||||
fetchInspection(selectedProject.value)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user