This commit is contained in:
‘937886381’
2025-12-30 19:36:05 +08:00
parent 7b3873f9ea
commit 20ef2b9763
158 changed files with 3059 additions and 462 deletions

View File

@@ -4,7 +4,7 @@
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
<div class="topItem-container" style="display: flex; gap: 8px; width: 100%;">
<!-- 累计指标1 -->
<div class="dashboard left">
<div class="dashboard left" @click="handleDashboardClick('/operatingRevenue/operatingRevenueBase')">
<div class="title">
收入·单位/万元
</div>
@@ -13,7 +13,7 @@
</div>
</div>
<!-- 累计指标2 -->
<div class="dashboard right">
<div class="dashboard right" @click="handleDashboardClick('/fullCostAnalysis/fullCostAnalysisBase')">
<div class="title">
全成本·单位/万元
</div>
@@ -39,10 +39,14 @@ export default {
type: Array,
// 正确写法:默认值通过 factory 函数返回(才能调用 default()
default: () => [
{ title: "累计收入", budget: 0, real: 0, rate: 0, diff: 0 },
{ title: "收入", budget: 0, real: 0, rate: 0, diff: 0 },
{ title: "累计全成本", budget: 0, real: 0, rate: 0, diff: 0 }
]
},
factory: {
type: [String, Number],
default: ''
},
title: {
type: String,
default: ''
@@ -50,7 +54,7 @@ export default {
},
data() {
return {
ytdIncomeData: { title: "累计收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
ytdIncomeData: { title: "收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
ytdCostData: { title: "累计全成本", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 }
}
},
@@ -67,6 +71,14 @@ export default {
this.updateChart(this.monthAnalysis)
},
methods: {
handleDashboardClick(path) {
this.$router.push({
path: path,
query: {
factory: this.$route.query.factory ? this.$route.query.factory : this.factory
}
})
},
getRateFlag(rate) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
return +(rate >= 100 || rate === 0); // + 号将布尔值转为数字true→1false→0
@@ -81,8 +93,8 @@ export default {
: this.$props.monthAnalysis; // 直接取 props 默认值
// 提取累计收入第0项、累计全成本第1项数据
const incomeItem = validData[0] || { title: "累计收入", budget: 0, real: 0, rate: 0, diff: 0 };
const costItem = validData[1] || { title: "累计全成本", budget: 0, real: 0, rate: 0, diff: 0 };
const incomeItem = validData[0] || { title: "收入", budget: 0, real: 0, rate: 0, diff: 0 };
const costItem = validData[1] || { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
// 整合flag字段
this.ytdIncomeData = {