From eca77cbce809165ea09fed36b12152c3acaa3db0 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 21 六月 2026 17:15:21 +0800
Subject: [PATCH] feat: 添加进销存数据分析路由跳转
---
src/views/reportAnalysis/PSIDataAnalysis/components/left-bottom.vue | 2
src/views/reportAnalysis/PSIDataAnalysis/components/left-top.vue | 2
src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue | 2
src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue | 22 +++++++
src/views/reportAnalysis/PSIDataAnalysis/components/PanelHeader.vue | 30 +++++++++
src/views/reportAnalysis/dataDashboard/components/PanelHeader.vue | 30 +++++++++
src/views/reportAnalysis/PSIDataAnalysis/psiNavigation.js | 15 +++++
src/views/reportAnalysis/dataDashboard/components/basic/right-top.vue | 9 ++
src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue | 21 ++++++
src/views/reportAnalysis/dataDashboard/components/basic/right-bottom.vue | 9 ++
src/views/reportAnalysis/PSIDataAnalysis/index.vue | 4
11 files changed, 134 insertions(+), 12 deletions(-)
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/PanelHeader.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/PanelHeader.vue
index 313f1df..fad818d 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/PanelHeader.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/PanelHeader.vue
@@ -1,17 +1,35 @@
<template>
- <div class="panel-header">
+ <div
+ class="panel-header"
+ :class="{ clickable: !!to }"
+ @click="handleClick"
+ >
<span class="panel-title">{{ title }}</span>
</div>
</template>
<script setup>
-defineProps({
+import { useRouter } from 'vue-router'
+
+const props = defineProps({
title: {
type: String,
required: true,
default: ''
+ },
+ to: {
+ type: String,
+ default: ''
}
})
+
+const router = useRouter()
+
+const handleClick = () => {
+ if (props.to) {
+ router.push(props.to)
+ }
+}
</script>
<style scoped>
@@ -30,4 +48,12 @@
padding-left: 46px;
line-height: 36px;
}
+
+.panel-header.clickable {
+ cursor: pointer;
+}
+
+.panel-header.clickable:hover .panel-title {
+ color: #43e8fc;
+}
</style>
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue
index e5a1781..b9b0d89 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <PanelHeader title="鍑哄叆搴撹秼鍔�" />
+ <PanelHeader title="鍑哄叆搴撹秼鍔�" to="/inventoryManagement/receiptManagement" />
<div class="main-panel panel-item-customers">
<div class="filters-row">
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
index 6e39eb1..068f05a 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
@@ -2,7 +2,7 @@
<div>
<!-- 璁惧缁熻 -->
<div class="equipment-stats">
- <div class="equipment-header">
+ <div class="equipment-header clickable" @click="handleNavigate">
<img
src="@/assets/BI/shujutongjiicon@2x.png"
alt="鍥炬爣"
@@ -28,8 +28,19 @@
<script setup>
import { ref, onMounted, inject, watch } from 'vue'
+import { useRouter } from 'vue-router'
import Echarts from '@/components/Echarts/echarts.vue'
import { productTurnoverDays } from '@/api/viewIndex.js'
+import { getPsiRoute } from '../psiNavigation.js'
+
+const router = useRouter()
+
+const handleNavigate = () => {
+ const path = getPsiRoute('浜у搧鍛ㄨ浆澶╂暟')
+ if (path) {
+ router.push(path)
+ }
+}
const chartStyle = { width: '100%', height: '100%' }
const grid = { left: '3%', right: '4%', bottom: '3%', top: '4%', containLabel: true }
@@ -119,6 +130,14 @@
padding-bottom: 2px;
}
+.equipment-header.clickable {
+ cursor: pointer;
+}
+
+.equipment-header.clickable:hover .equipment-title {
+ opacity: 0.85;
+}
+
.equipment-title {
font-weight: 500;
font-size: 18px;
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
index 055fb66..80657c4 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
@@ -6,6 +6,8 @@
v-for="item in statItems"
:key="item.name"
class="stat-card"
+ :class="{ clickable: !!getStatRoute(item.name) }"
+ @click="handleStatClick(item.name)"
>
<img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
<div class="card-content">
@@ -25,9 +27,21 @@
<script setup>
import { ref, onMounted, inject, watch } from 'vue'
+import { useRouter } from 'vue-router'
import { salesPurchaseStorageProductCount } from '@/api/viewIndex.js'
+import { getPsiRoute } from '../psiNavigation.js'
+const router = useRouter()
const statItems = ref([])
+
+const getStatRoute = (name) => getPsiRoute(name)
+
+const handleStatClick = (name) => {
+ const path = getStatRoute(name)
+ if (path) {
+ router.push(path)
+ }
+}
const formatPercent = (val) => {
const num = Number(val) || 0
@@ -81,6 +95,14 @@
height: 142px;
}
+.stat-card.clickable {
+ cursor: pointer;
+}
+
+.stat-card.clickable:hover .card-label {
+ color: #43e8fc;
+}
+
.card-icon {
width: 100px;
height: 100px;
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/left-bottom.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/left-bottom.vue
index 65a72fe..ee5cd9f 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/left-bottom.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/left-bottom.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <PanelHeader title="閲囪喘鍝佸垎甯�" />
+ <PanelHeader title="閲囪喘鍝佸垎甯�" to="/procurementManagement/paymentLedger" />
<div class="main-panel panel-item-customers">
<CarouselCards :items="cardItems" :visible-count="3" />
<div class="pie-chart-wrapper" ref="pieWrapperRef">
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/left-top.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/left-top.vue
index f5dac31..b5574a1 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/left-top.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/left-top.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <PanelHeader title="閿�鍞搧鍒嗗竷" />
+ <PanelHeader title="閿�鍞搧鍒嗗竷" to="/salesManagement/receiptPaymentLedger" />
<div class="main-panel panel-item-customers">
<CarouselCards :items="cardItems" :visible-count="3" />
<div class="pie-chart-wrapper" ref="pieWrapperRef">
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/index.vue b/src/views/reportAnalysis/PSIDataAnalysis/index.vue
index f81e482..3f8d3df 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/index.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/index.vue
@@ -34,8 +34,8 @@
<!-- 鍙充晶鍖哄煙 -->
<div class="right-panel">
- <RightBottom />
- <RightTop />
+ <RightBottom header-to="/salesManagement/receiptPaymentLedger" />
+ <RightTop header-to="/procurementManagement/paymentLedger" />
</div>
</div>
</div>
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/psiNavigation.js b/src/views/reportAnalysis/PSIDataAnalysis/psiNavigation.js
new file mode 100644
index 0000000..9a3a05d
--- /dev/null
+++ b/src/views/reportAnalysis/PSIDataAnalysis/psiNavigation.js
@@ -0,0 +1,15 @@
+export const PSI_ROUTE_MAP = {
+ 閿�鍞搧鍒嗗竷: '/salesManagement/receiptPaymentLedger',
+ 閲囪喘鍝佸垎甯�: '/procurementManagement/paymentLedger',
+ 閿�鍞骇鍝佹暟: '/salesManagement/salesLedger',
+ 閲囪喘浜у搧鏁�: '/procurementManagement/procurementLedger',
+ 鍌ㄥ瓨浜у搧鏁�: '/inventoryManagement/stockManagement',
+ 瀹㈡埛璐$尞鎺掑悕: '/salesManagement/receiptPaymentLedger',
+ 渚涘簲鍟嗛噰璐帓鍚�: '/procurementManagement/paymentLedger',
+ 鍑哄叆搴撹秼鍔�: '/inventoryManagement/receiptManagement',
+ 浜у搧鍛ㄨ浆澶╂暟: '/inventoryManagement/stockManagement',
+}
+
+export function getPsiRoute(name) {
+ return PSI_ROUTE_MAP[name] || ''
+}
diff --git a/src/views/reportAnalysis/dataDashboard/components/PanelHeader.vue b/src/views/reportAnalysis/dataDashboard/components/PanelHeader.vue
index 313f1df..fad818d 100644
--- a/src/views/reportAnalysis/dataDashboard/components/PanelHeader.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/PanelHeader.vue
@@ -1,17 +1,35 @@
<template>
- <div class="panel-header">
+ <div
+ class="panel-header"
+ :class="{ clickable: !!to }"
+ @click="handleClick"
+ >
<span class="panel-title">{{ title }}</span>
</div>
</template>
<script setup>
-defineProps({
+import { useRouter } from 'vue-router'
+
+const props = defineProps({
title: {
type: String,
required: true,
default: ''
+ },
+ to: {
+ type: String,
+ default: ''
}
})
+
+const router = useRouter()
+
+const handleClick = () => {
+ if (props.to) {
+ router.push(props.to)
+ }
+}
</script>
<style scoped>
@@ -30,4 +48,12 @@
padding-left: 46px;
line-height: 36px;
}
+
+.panel-header.clickable {
+ cursor: pointer;
+}
+
+.panel-header.clickable:hover .panel-title {
+ color: #43e8fc;
+}
</style>
diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/right-bottom.vue b/src/views/reportAnalysis/dataDashboard/components/basic/right-bottom.vue
index bcdba84..9c0ce9a 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/right-bottom.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/right-bottom.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <PanelHeader title="瀹㈡埛璐$尞鎺掑悕" />
+ <PanelHeader title="瀹㈡埛璐$尞鎺掑悕" :to="headerTo" />
<div class="panel-item-customers">
<div class="switch-container">
<DateTypeSwitch v-model="dateType" @change="handleDateTypeChange" />
@@ -28,6 +28,13 @@
import DateTypeSwitch from '../DateTypeSwitch.vue'
import { customerContributionRanking } from '@/api/viewIndex.js'
+defineProps({
+ headerTo: {
+ type: String,
+ default: ''
+ }
+})
+
const chartStyle = {
width: '100%',
height: '100%',
diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/right-top.vue b/src/views/reportAnalysis/dataDashboard/components/basic/right-top.vue
index 399354e..36741a9 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/right-top.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/right-top.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <PanelHeader title="渚涘簲鍟嗛噰璐帓鍚�" />
+ <PanelHeader title="渚涘簲鍟嗛噰璐帓鍚�" :to="headerTo" />
<div class="panel-item-customers">
<div class="switch-container">
<DateTypeSwitch v-model="radio1" @change="handleDateTypeChange" />
@@ -27,6 +27,13 @@
import DateTypeSwitch from '../DateTypeSwitch.vue'
import { supplierPurchaseRanking } from '@/api/viewIndex.js'
+defineProps({
+ headerTo: {
+ type: String,
+ default: ''
+ }
+})
+
const chartStyle = {
width: '100%',
height: '100%',
--
Gitblit v1.9.3