From f9adfa16fdf2012e915908ea1fed19f75d5107a4 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 30 五月 2026 17:14:02 +0800
Subject: [PATCH] 新疆马铃薯 1.报价提交问题

---
 src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue |  105 +++++++++++++++++++++++++++-------------------------
 1 files changed, 54 insertions(+), 51 deletions(-)

diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue b/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
index 40ac9da..d795f50 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
@@ -5,18 +5,6 @@
       <div class="stat-card">
         <img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
         <div class="card-content">
-          <span class="card-label">鍛樺伐鎬绘暟</span>
-          <span class="card-value">{{ totalStaff }}</span>
-          <div class="card-compare" :class="compareClass(staffYoY)">
-            <span>鍚屾瘮</span>
-            <span class="compare-value">{{ formatPercent(staffYoY) }}</span>
-            <span class="compare-icon">{{ staffYoY >= 0 ? '鈫�' : '鈫�' }}</span>
-          </div>
-        </div>
-      </div>
-      <div class="stat-card">
-        <img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
-        <div class="card-content">
           <span class="card-label">瀹㈡埛鎬绘暟</span>
           <span class="card-value">{{ totalCustomers }}</span>
           <div class="card-compare" :class="compareClass(customersYoY)">
@@ -95,7 +83,7 @@
             <div class="todo-division">寰呭姙浜嬬敱锛歿{ item.approveReason }}</div>
               <div style="display: flex;justify-content: space-between;align-items: center;"
               >
-                <div class="todo-title">鐢宠绫诲瀷锛歿{ item.approveId }}</div>
+                <div class="todo-title">鐢宠绫诲瀷锛歿{ item.approveTypeName }}</div>
                 <div class="todo-division">鐢宠閮ㄩ棬锛歿{ item.approveDeptName }}</div>
                 <div class="todo-time">{{ item.approveTime }}</div>
               </div>
@@ -110,24 +98,19 @@
 </template>
 
 <script setup>
-import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue'
-import { homeTodos } from '@/api/viewIndex.js'
-import { staffOnJobListPage } from '@/api/personnelManagement/employeeRecord.js'
-import { listCustomer } from '@/api/basicData/customerFile.js'
-import { listSupplier } from '@/api/basicData/supplierManageFile.js'
+import { ref, onMounted, onBeforeUnmount, nextTick, inject, watch } from 'vue'
+import { homeTodos, summaryStatistics } from '@/api/viewIndex.js'
 import { getLedgerPage } from '@/api/equipmentManagement/ledger.js'
 import { getRepairPage } from '@/api/equipmentManagement/repair.js'
 import { getUpkeepPage } from '@/api/equipmentManagement/upkeep.js'
 import { measuringInstrumentListPage } from '@/api/equipmentManagement/measurementEquipment.js'
 
 // 缁熻鏁版嵁
-const totalStaff = ref(0)
 const totalCustomers = ref(0)
 const totalSuppliers = ref(0)
-// 鍚屾瘮锛堝崰浣嶅�硷紝鍙帴鍏ョ湡瀹炴帴鍙o級
-const staffYoY = ref(-0.52) // 绀轰緥锛�-0.52%
-const customersYoY = ref(0.82) // 绀轰緥锛�0.82%
-const suppliersYoY = ref(0.1) // 绀轰緥锛�0.10%
+// 鍚屾瘮
+const customersYoY = ref(0)
+const suppliersYoY = ref(0)
 const equipmentNum = ref(0)
 const equipmentRepair = ref(0)
 const equipmentMaintain = ref(0)
@@ -144,20 +127,15 @@
 
 const compareClass = (val) => (val >= 0 ? 'compare-up' : 'compare-down')
 
-// 鑾峰彇鍛樺伐銆佸鎴枫�佷緵搴斿晢鏁伴噺
+// 鑾峰彇瀹㈡埛銆佷緵搴斿晢鏁伴噺
 const getNum = () => {
-  const params = {
-    pageNum: -1,
-    pageSize: -1,
-  }
-  staffOnJobListPage({ ...params, staffState: 1 }).then((res) => {
-    totalStaff.value = res.data.total
-  })
-  listCustomer(params).then((res) => {
-    totalCustomers.value = res.total
-  })
-  listSupplier(params).then((res) => {
-    totalSuppliers.value = res.data.total
+  summaryStatistics().then((res) => {
+    totalCustomers.value = res.data.totalCustomer
+    customersYoY.value = res.data.customerGrowthRate
+    totalSuppliers.value = res.data.totalSupplier
+    suppliersYoY.value = res.data.supplierGrowthRate
+  }).catch(err => {
+    console.error('鑾峰彇鍩虹缁熻鏁版嵁澶辫触:', err)
   })
 }
 
@@ -181,8 +159,23 @@
   })
 }
 
+const destroyTodoListScroll = () => {
+  const todoListEl = refTodoList.value
+  if (todoListEl) {
+    if (todoListEl._animationFrame) {
+      cancelAnimationFrame(todoListEl._animationFrame)
+      todoListEl._animationFrame = null
+    }
+    if (todoListEl._pauseTimer) {
+      clearInterval(todoListEl._pauseTimer)
+      todoListEl._pauseTimer = null
+    }
+  }
+}
+
 // 鍒濆鍖栧緟鍔炰簨椤瑰垪琛ㄦ粴鍔ㄥ姛鑳�
 const initTodoListScroll = () => {
+  destroyTodoListScroll()
   const todoListEl = refTodoList.value
   // 寮哄埗鍚敤婊氬姩锛屼笉妫�鏌ヤ换浣曟潯浠�
   if (todoListEl) {
@@ -265,6 +258,7 @@
 
 // 寰呭姙浜嬮」
 const todoInfoS = () => {
+  destroyTodoListScroll()
   homeTodos().then((res) => {
     todoList.value = res.data
     // 鍦ㄨ幏鍙栧埌寰呭姙浜嬮」鏁版嵁鍚庯紝鍒濆鍖栨粴鍔ㄥ姛鑳�
@@ -274,25 +268,25 @@
   })
 }
 
-onMounted(() => {
+const refreshCenterTopData = () => {
   getNum()
   getLedgerNum()
   todoInfoS()
+}
+
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+  watch(dataDashboardRefreshTick, () => {
+    refreshCenterTopData()
+  })
+}
+
+onMounted(() => {
+  refreshCenterTopData()
 })
 
 onBeforeUnmount(() => {
-  // 娓呯悊寰呭姙浜嬮」鍒楄〃鐨勫姩鐢诲拰瀹氭椂鍣�
-  const todoListEl = refTodoList.value
-  if (todoListEl) {
-    if (todoListEl._animationFrame) {
-      cancelAnimationFrame(todoListEl._animationFrame)
-      todoListEl._animationFrame = null
-    }
-    if (todoListEl._pauseTimer) {
-      clearInterval(todoListEl._pauseTimer)
-      todoListEl._pauseTimer = null
-    }
-  }
+  destroyTodoListScroll()
 })
 </script>
 
@@ -348,6 +342,11 @@
   color: #d0e7ff;
 }
 
+.card-compare > span:first-child {
+  font-size: 13px;
+  opacity: 0.8;
+}
+
 .compare-value {
   font-weight: 600;
 }
@@ -372,6 +371,8 @@
   border: 1px solid #1a58b0;
   padding: 18px;
   height: 240px;
+  padding-top: 0px;
+  margin-bottom: 20px;
 }
 
 .equipment-header {
@@ -442,7 +443,9 @@
   background-position: center;
   background-repeat: no-repeat;
   padding: 20px;
-  height: 186px;
+  padding-top: 10px;
+  height: 480px;
+  flex: 1;
 }
 
 .event-header {
@@ -466,7 +469,7 @@
   list-style: none;
   padding: 0;
   margin: 0;
-  height: 120px; /* 鎸夌敤鎴疯姹傝皟鏁撮珮搴� */
+  height: 210px;
   overflow: hidden;
   font-size: 15px;
 }

--
Gitblit v1.9.3