From 306ae855bbd938d6f77ed451848c392e848d0034 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 13 八月 2026 13:13:34 +0800
Subject: [PATCH] 采购台账页面去掉销售合同号字段展示

---
 src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue |  161 +++++++++++++++++++++++++++--------------------------
 1 files changed, 82 insertions(+), 79 deletions(-)

diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
index 055fb66..f211418 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
@@ -1,26 +1,26 @@
 <template>
-  <div>
-    <!-- 椤堕儴缁熻鍗$墖 -->
-    <div class="stats-cards">
-      <div
-        v-for="item in statItems"
-        :key="item.name"
-        class="stat-card"
-      >
-        <img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
-        <div class="card-content">
-          <span class="card-label">{{ item.name }}</span>
-          <span class="card-value">{{ item.value }}</span>
-          <div class="card-compare" :class="compareClass(Number(item.rate))">
-            <span>鍚屾瘮</span>
-            <span class="compare-value">{{ formatPercent(item.rate) }}</span>
-            <span class="compare-icon">{{ Number(item.rate) >= 0 ? '鈫�' : '鈫�' }}</span>
-          </div>
-        </div>
-      </div>
-    </div>
-
-  </div>
+	<div>
+		<!-- 椤堕儴缁熻鍗$墖 -->
+		<div class="stats-cards">
+			<div
+				v-for="item in statItems"
+				:key="item.name"
+				class="stat-card"
+			>
+				<img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
+				<div class="card-content">
+					<span class="card-label">{{ item.name }}</span>
+					<span class="card-value">{{ item.value }}</span>
+					<div class="card-compare" :class="compareClass(Number(item.rate))">
+						<span>鍚屾瘮</span>
+						<span class="compare-value">{{ formatPercent(item.rate) }}</span>
+						<span class="compare-icon">{{ Number(item.rate) >= 0 ? '鈫�' : '鈫�' }}</span>
+					</div>
+				</div>
+			</div>
+		</div>
+	
+	</div>
 </template>
 
 <script setup>
@@ -30,115 +30,118 @@
 const statItems = ref([])
 
 const formatPercent = (val) => {
-  const num = Number(val) || 0
-  return `${num.toFixed(2)}%`
+	const num = Number(val) || 0
+	return `${num.toFixed(2)}%`
 }
 
 const compareClass = (val) => (val >= 0 ? 'compare-up' : 'compare-down')
 
+const dateRange = inject('psiDateRange', null)
+
 const fetchData = () => {
-  salesPurchaseStorageProductCount()
-    .then((res) => {
-      if (res.code === 200 && Array.isArray(res.data)) {
-        statItems.value = res.data.map((item) => ({
-          name: item.name,
-          value: item.value,
-          rate: item.rate,
-        }))
-      }
-    })
-    .catch((err) => {
-      console.error('鑾峰彇閿�鍞�/閲囪喘/鍌ㄥ瓨浜у搧鏁板け璐�:', err)
-    })
+	const params = dateRange?.value || {}
+	salesPurchaseStorageProductCount(params.startDate, params.endDate)
+		.then((res) => {
+			if (res.code === 200 && Array.isArray(res.data)) {
+				statItems.value = res.data.map((item) => ({
+					name: item.name === '閿�鍞骇鍝佹暟' ? '閿�鍞鍗曟暟' : item.name,
+					value: item.value,
+					rate: item.rate,
+				}))
+			}
+		})
+		.catch((err) => {
+			console.error('鑾峰彇閿�鍞�/閲囪喘/鍌ㄥ瓨浜у搧鏁板け璐�:', err)
+		})
 }
 
 const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
 if (dataDashboardRefreshTick) {
-  watch(dataDashboardRefreshTick, () => {
-    fetchData()
-  })
+	watch(dataDashboardRefreshTick, () => {
+		fetchData()
+	})
 }
 
 onMounted(() => {
-  fetchData()
+	fetchData()
 })
 </script>
 
 <style scoped>
 .stats-cards {
-  display: flex;
-  gap: 30px;
+	display: flex;
+	gap: 30px;
 }
 
 .stat-card {
-  flex: 1;
-  display: flex;
-  align-items: center;
-  background-image: url('@/assets/BI/border@2x.png');
-  background-size: 100% 100%;
-  background-position: center;
-  background-repeat: no-repeat;
-  height: 142px;
+	flex: 1;
+	display: flex;
+	align-items: center;
+	background-image: url('@/assets/BI/border@2x.png');
+	background-size: 100% 100%;
+	background-position: center;
+	background-repeat: no-repeat;
+	height: 142px;
 }
 
 .card-icon {
-  width: 100px;
-  height: 100px;
-  margin: 20px 20px 0 10px;
+	width: 100px;
+	height: 100px;
+	margin: 20px 20px 0 10px;
 }
 
 .card-content {
-  display: flex;
-  flex-direction: column;
-  gap: 10px;
+	display: flex;
+	flex-direction: column;
+	gap: 10px;
 }
 
 .card-value {
-  font-weight: 500;
-  font-size: 40px;
-  background: linear-gradient(360deg, #008bfd 0%, #ffffff 100%);
-  -webkit-background-clip: text;
-  -webkit-text-fill-color: transparent;
-  background-clip: text;
+	font-weight: 500;
+	font-size: 40px;
+	background: linear-gradient(360deg, #008bfd 0%, #ffffff 100%);
+	-webkit-background-clip: text;
+	-webkit-text-fill-color: transparent;
+	background-clip: text;
 }
 
 .card-label {
-  font-weight: 400;
-  font-size: 19px;
-  color: rgba(208, 231, 255, 0.7);
+	font-weight: 400;
+	font-size: 19px;
+	color: rgba(208, 231, 255, 0.7);
 }
 
 .card-compare {
-  display: flex;
-  align-items: center;
-  gap: 6px;
-  font-size: 15px;
-  color: #d0e7ff;
+	display: flex;
+	align-items: center;
+	gap: 6px;
+	font-size: 15px;
+	color: #d0e7ff;
 }
 
 .card-compare > span:first-child {
-  font-size: 13px;
-  opacity: 0.8;
+	font-size: 13px;
+	opacity: 0.8;
 }
 
 .compare-value {
-  font-weight: 600;
+	font-weight: 600;
 }
 
 .compare-icon {
-  font-size: 14px;
-  position: relative;
-  top: -1px; /* 杞诲井涓婄Щ锛岃绠ご涓庢枃瀛楀瀭鐩村眳涓榻� */
+	font-size: 14px;
+	position: relative;
+	top: -1px; /* 杞诲井涓婄Щ锛岃绠ご涓庢枃瀛楀瀭鐩村眳涓榻� */
 }
 
 .compare-up .compare-value,
 .compare-up .compare-icon {
-  color: #00c853;
+	color: #00c853;
 }
 
 .compare-down .compare-value,
 .compare-down .compare-icon {
-  color: #ff5252;
+	color: #ff5252;
 }
 
 </style>

--
Gitblit v1.9.3