123
This commit is contained in:
@ -1,34 +1,15 @@
|
||||
<template>
|
||||
<div class="centerPage">
|
||||
<div>
|
||||
<div style="height: 147px;width: 100%;display: flex;justify-content: space-between;">
|
||||
<!-- <div class="top_box">
|
||||
<div class="top_box_title">收入合同</div>
|
||||
<div>
|
||||
<span class="top_box_number">205,805.17</span>
|
||||
<span>万元</span>
|
||||
</div>
|
||||
<div class="top_box_bottom">
|
||||
<div>
|
||||
<img class="up_img" src="@/assets/large/up.png" alt=""></img>
|
||||
<span class="top_box_title"> 3.2% 较上月</span>
|
||||
</div>
|
||||
<img class="top_img" src="@/assets/large/top1.png" alt=""></img>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <RevenueContractCard title="收入合同" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
|
||||
badgeIcon="top1" period="较上月" />
|
||||
<RevenueContractCard title="支出合同" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
|
||||
badgeIcon="top2" period="较上月" />
|
||||
<RevenueContractCard title="合同利润" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="down"
|
||||
badgeIcon="top3" period="较上月" />
|
||||
<RevenueContractCard title="工程变更" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
|
||||
badgeIcon="top4" period="较上月" /> -->
|
||||
<RevenueContractCard title="收入合同" :value="bigDataObj.incomeTotalAmount" />
|
||||
<RevenueContractCard title="支出合同" :value="bigDataObj.expensesTotalAmount" />
|
||||
|
||||
<RevenueContractCard title="合同利润" :value="bigDataObj.profitAmount" />
|
||||
<RevenueContractCard title="工程变更" :value="bigDataObj.changeAmount" unit="%" />
|
||||
<div style="height: 147px; width: 100%; display: flex; justify-content: space-between">
|
||||
<!-- 收入合同:保持万元显示 -->
|
||||
<RevenueContractCard title="收入合同" :value="formatToTenThousand(data.incomeTotalAmount, 'tenThousand')" />
|
||||
<!-- 支出合同:保持万元显示 -->
|
||||
<RevenueContractCard title="支出合同" :value="formatToTenThousand(data.expensesTotalAmount, 'tenThousand')" />
|
||||
<!-- 合同利润:保持万元显示 -->
|
||||
<RevenueContractCard title="合同利润" :value="formatToTenThousand(data.profitAmount, 'tenThousand')" />
|
||||
<!-- 工程变更:改为百分比显示 -->
|
||||
<RevenueContractCard title="工程变更" :value="formatToTenThousand(data.changeAmount, 'percentage')" unit="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="centerPage_map">
|
||||
@ -238,4 +219,4 @@ onUnmounted(() => {
|
||||
height: 60%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -2,41 +2,34 @@
|
||||
<div class="leftPage">
|
||||
<div class="kpi_box">
|
||||
<TitleComponent :title="'支付KPI'" style="margin-bottom: 20px" />
|
||||
<ProgressComponent
|
||||
title="应收账款"
|
||||
:value="formatCurrency(incomeData.planAmount)"
|
||||
<ProgressComponent title="应收账款" :value="formatCurrency(incomeData.planAmount)"
|
||||
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
|
||||
progressColor="rgba(255, 77, 79, 1)"
|
||||
/>
|
||||
<ProgressComponent
|
||||
title="应付账款"
|
||||
:value="formatCurrency(expensesData.planAmount)"
|
||||
progressColor="rgba(255, 77, 79, 1)" />
|
||||
<ProgressComponent title="应付账款" :value="formatCurrency(expensesData.planAmount)"
|
||||
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
|
||||
progressColor="rgba(29, 214, 255, 1)"
|
||||
/>
|
||||
<ProgressComponent
|
||||
title="本月付款"
|
||||
:value="formatCurrency(expensesData.actualAmount)"
|
||||
progressColor="rgba(29, 214, 255, 1)" />
|
||||
<ProgressComponent title="本月付款" :value="formatCurrency(expensesData.actualAmount)"
|
||||
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
|
||||
progressColor="rgba(0, 227, 150, 1)"
|
||||
/>
|
||||
<ProgressComponent
|
||||
title="本月收款"
|
||||
:value="formatCurrency(incomeData.actualAmount)"
|
||||
progressColor="rgba(0, 227, 150, 1)" />
|
||||
<ProgressComponent title="本月收款" :value="formatCurrency(incomeData.actualAmount)"
|
||||
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
|
||||
progressColor="rgba(255, 147, 42, 1)"
|
||||
/>
|
||||
progressColor="rgba(255, 147, 42, 1)" />
|
||||
</div>
|
||||
<div class="contract_box">
|
||||
<div style="height: 60px;">
|
||||
<TitleComponent :title="'收支合同分析'" style="margin-bottom: 20px" />
|
||||
</div>
|
||||
<!-- 切换按钮 -->
|
||||
<TitleComponent :title="'收支合同分析'" style="margin-bottom: 20px" />
|
||||
|
||||
<div style="margin-bottom: 10px; text-align: center">
|
||||
<button @click="switchChart('income')" :style="activeChart === 'income' ? activeBtnStyle : defaultBtnStyle">收入合同</button>
|
||||
<button @click="switchChart('expenses')" :style="activeChart === 'expenses' ? activeBtnStyle : defaultBtnStyle" style="margin-left: 15px">
|
||||
<button @click="switchChart('income')"
|
||||
:style="activeChart === 'income' ? activeBtnStyle : defaultBtnStyle">收入合同</button>
|
||||
<button @click="switchChart('expenses')" :style="activeChart === 'expenses' ? activeBtnStyle : defaultBtnStyle"
|
||||
style="margin-left: 15px">
|
||||
支出合同
|
||||
</button>
|
||||
</div>
|
||||
@ -56,7 +49,7 @@ import EchartBox from '@/components/EchartBox/index.vue';
|
||||
import { incomePay, expensesPay, incomeAnalyze, expensesAnalyze } from '@/api/largeScreen/index';
|
||||
|
||||
// 初始化数据容器
|
||||
const incomeData = ref({ planAmount: '0.00', actualAmount: '0.00' }); // 收入相关数据(应收/收款)
|
||||
const incomeData = ref({ planAmount: '0.00', actualAmount: '0.00' }); // 收入相关数据(应收/收款)
|
||||
const expensesData = ref({ planAmount: '0.00', actualAmount: '0.00' }); // 支出相关数据(应付/付款)
|
||||
const pieOption = ref({}); // 环形图配置
|
||||
const activeChart = ref('income'); // 当前激活的图表类型:income-收入合同,expenses-支出合同
|
||||
@ -202,8 +195,8 @@ const generatePieOption = (data) => {
|
||||
{
|
||||
name: '合同数量',
|
||||
type: 'pie',
|
||||
radius: ['45%', '65%'],
|
||||
center: ['50%', '60%'],
|
||||
radius: ['30%', '60%'],
|
||||
center: ['50%', '80%'],
|
||||
data: [], // 空数据,避免显示圆环
|
||||
itemStyle: { borderColor: '#000', borderWidth: 1 },
|
||||
// 中心显示“加载中”提示
|
||||
@ -309,18 +302,21 @@ onMounted(async () => {
|
||||
.leftPage {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.kpi_box {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.contract_box {
|
||||
height: 35vh;
|
||||
height: 33vh;
|
||||
display: flex;
|
||||
flex-direction: column; // 按钮区和图表区垂直排列
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
flex: 1; // 占满剩余高度,确保图表容器足够大
|
||||
min-height: 200px; // 最小高度,避免容器过矮
|
||||
height: 28vh;
|
||||
}
|
||||
|
||||
.kpi_box,
|
||||
.contract_box {
|
||||
padding: 10px;
|
||||
|
@ -696,6 +696,7 @@ export const getInventoryOption = () => {
|
||||
};
|
||||
export const getBarOptions = (data: any) => {
|
||||
const option = {
|
||||
|
||||
legend: {
|
||||
show: true,
|
||||
top: '50%',
|
||||
@ -714,6 +715,9 @@ export const getBarOptions = (data: any) => {
|
||||
formatter: '{b0}:{c0}万元',
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow',
|
||||
}
|
||||
// borderColor: 'rgba(252, 217, 18, 1)'
|
||||
},
|
||||
|
@ -45,7 +45,7 @@ import TitleComponent from './TitleComponent.vue';
|
||||
import EchartBox from '@/components/EchartBox/index.vue';
|
||||
import { getLineOption, getBarOptions } from './optionList';
|
||||
import ProgressComponent from './ProgressComponent.vue';
|
||||
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen';
|
||||
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen/index';
|
||||
|
||||
const lineOption = ref();
|
||||
const barOption = ref();
|
||||
@ -90,6 +90,8 @@ const getTurnoverList = async () => {
|
||||
expenses
|
||||
]
|
||||
};
|
||||
console.log(barData);
|
||||
|
||||
barOption.value = getBarOptions(barData);
|
||||
};
|
||||
const getTotalAmonunt = async () => {
|
||||
|
Reference in New Issue
Block a user