From 1156fbe1fa77e4a6b7d890604d25e98edf8a7059 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 28 一月 2026 17:40:09 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New

---
 src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue |   60 +++++++++++++++---------------------------------------------
 1 files changed, 15 insertions(+), 45 deletions(-)

diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
index a0c892a..0f3ec84 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
@@ -29,19 +29,14 @@
 <script setup>
 import { ref, onMounted } from 'vue'
 import Echarts from '@/components/Echarts/echarts.vue'
-import { customerRevenueAnalysis } from '@/api/viewIndex.js'
-import { listCustomer } from '@/api/basicData/customerFile.js'
-
-const dateType = ref(1)
-const customerValue = ref(null)
-const customerOptions = ref([])
+import { productTurnoverDays } from '@/api/viewIndex.js'
 
 const chartStyle = { width: '100%', height: '100%' }
 const grid = { left: '3%', right: '4%', bottom: '3%', top: '4%', containLabel: true }
-const barLegend = { show: false, textStyle: { color: '#B8C8E0' }, data: ['钀ユ敹'] }
+const barLegend = { show: false, textStyle: { color: '#B8C8E0' }, data: ['鍛ㄨ浆澶╂暟'] }
 const barSeries1 = ref([
   {
-    name: '钀ユ敹',
+    name: '鍛ㄨ浆澶╂暟',
     type: 'bar',
     barGap: 0,
     barWidth: 30,
@@ -65,7 +60,7 @@
   formatter(params) {
     let result = params[0].axisValueLabel + '<br/>'
     params.forEach((item) => {
-      result += `<div>${item.marker} ${item.seriesName}: ${item.value}</div>`
+      result += `<div>${item.marker} ${item.seriesName}: ${item.value} 澶�</div>`
     })
     return result
   },
@@ -73,47 +68,22 @@
 const xAxis1 = ref([{ type: 'category', axisTick: { show: false }, axisLabel: { color: '#B8C8E0' }, data: [] }])
 const yAxis1 = [{ type: 'value', axisLabel: { color: '#B8C8E0' } }]
 
-const getCustomerRevenueAnalysis = () => {
-  if (customerOptions.value.length > 0 && !customerValue.value) customerValue.value = customerOptions.value[0].value
-  if (!customerValue.value) return
-  customerRevenueAnalysis({ customerId: customerValue.value, type: dateType.value })
+const fetchData = () => {
+  productTurnoverDays()
     .then((res) => {
-      xAxis1.value[0].data = []
-      barSeries1.value[0].data = []
-      const items = res.data?.items || []
-      items.forEach((item) => {
-        xAxis1.value[0].data.push(item.name)
-        barSeries1.value[0].data.push(item.value)
-      })
+      if (res.code === 200 && Array.isArray(res.data)) {
+        const list = res.data
+        xAxis1.value[0].data = list.map((d) => d.name)
+        barSeries1.value[0].data = list.map((d) => Number(d.value) || 0)
+      }
     })
-    .catch((e) => console.error('鑾峰彇瀹㈡埛钀ユ敹鍒嗘瀽澶辫触:', e))
-}
-
-const fetchCustomerOptions = async () => {
-  try {
-    const res = await listCustomer({ pageNum: 1, pageSize: 200 })
-    const records = res?.records || res?.data?.records || res?.rows || []
-    customerOptions.value = records.map((r) => ({
-      label: r.customerName || r.name || r.customer || '-',
-      value: r.id ?? r.customerId ?? r.customerCode ?? r.customerName,
-    }))
-    if (customerOptions.value.length > 0 && !customerValue.value) {
-      customerValue.value = customerOptions.value[0].value
-      getCustomerRevenueAnalysis()
-    }
-  } catch (e) {
-    customerOptions.value = [
-      { label: '鍗庝笢绮惧瘑', value: '鍗庝笢绮惧瘑' },
-      { label: '鏄熻景鐢靛瓙', value: '鏄熻景鐢靛瓙' },
-      { label: '鍚埅绉戞妧', value: '鍚埅绉戞妧' },
-      { label: '閾瘹鍒堕��', value: '閾瘹鍒堕��' },
-      { label: '杩滄櫙鏉愭枡', value: '杩滄櫙鏉愭枡' },
-    ]
-  }
+    .catch((err) => {
+      console.error('鑾峰彇浜у搧鍛ㄨ浆澶╂暟澶辫触:', err)
+    })
 }
 
 onMounted(() => {
-  fetchCustomerOptions()
+  fetchData()
 })
 </script>
 

--
Gitblit v1.9.3