From 7f7bf56789689f6da5e717a1c7d03222a04094db Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 30 一月 2026 11:43:40 +0800
Subject: [PATCH] fix: 完成财务数据分析接口联调
---
src/views/reportAnalysis/financialAnalysis/components/left-bottom.vue | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/views/reportAnalysis/financialAnalysis/components/left-bottom.vue b/src/views/reportAnalysis/financialAnalysis/components/left-bottom.vue
index 7aa8c4e..4a20578 100644
--- a/src/views/reportAnalysis/financialAnalysis/components/left-bottom.vue
+++ b/src/views/reportAnalysis/financialAnalysis/components/left-bottom.vue
@@ -33,7 +33,7 @@
import Echarts from '@/components/Echarts/echarts.vue'
import PanelHeader from './PanelHeader.vue'
import ProductTypeSwitch from './ProductTypeSwitch.vue'
-import { rawMaterialPurchaseAmountRatio } from '@/api/viewIndex.js'
+import { expenseCompositionAnalysis } from '@/api/viewIndex.js'
/**
* @introduction 鎶婃暟缁勪腑key鍊肩浉鍚岀殑閭d竴椤规彁鍙栧嚭鏉ワ紝缁勬垚涓�涓璞�
@@ -53,8 +53,8 @@
const amountType = ref(1)
const amountTypeOptions = [
- { label: 1, text: '鏀嚭' },
- { label: 2, text: '鏀跺叆' },
+ { label: 1, text: '浜у搧' },
+ { label: 2, text: '瀹㈡埛' },
]
// 鏁版嵁鍒楄〃锛堟潵鑷帴鍙o級
@@ -89,7 +89,11 @@
formatter: function (name) {
const item = landObjData.value[name]
if (!item) return name
- return `{title|${name}}{value|${item.value}}{unit|鍏儅{percent|${item.rate}}{unit|%}`
+ const num = Number(item.value)
+ const isWan = num > 10000
+ const displayValue = isWan ? (num / 10000).toFixed(2) : num
+ const displayUnit = isWan ? '涓囧厓' : '鍏�'
+ return `{title|${name}}{value|${displayValue}}{unit|${displayUnit}}{percent|${item.rate}}{unit|%}`
},
textStyle: {
rich: {
@@ -182,9 +186,7 @@
}
const fetchData = () => {
- // 鐩墠鎺ュ彛鍙湁鏀嚭鏋勬垚鍗犳瘮锛屽厛蹇界暐绫诲瀷鍙傛暟
- // 棰勭暀鎵╁睍锛氬悗缁彲鏍规嵁 amountType 鍒囦笉鍚屾帴鍙�
- rawMaterialPurchaseAmountRatio()
+ expenseCompositionAnalysis({ type: amountType.value })
.then((res) => {
if (res.code === 200 && Array.isArray(res.data)) {
const items = res.data
@@ -204,7 +206,7 @@
}
})
.catch((err) => {
- console.error('鑾峰彇鍘熸潗鏂欓噰璐噾棰濆崰姣斿け璐�:', err)
+ console.error('鑾峰彇璐圭敤鏋勬垚鍒嗘瀽澶辫触:', err)
})
}
--
Gitblit v1.9.3