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-center.vue | 223 +++++++++++++++++++++++++------------------------------
1 files changed, 101 insertions(+), 122 deletions(-)
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
index e8ed776..6b113b9 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
@@ -1,159 +1,138 @@
<template>
- <div>
- <!-- 璁惧缁熻 -->
- <div class="equipment-stats">
- <div class="equipment-header">
- <img
- src="@/assets/BI/shujutongjiicon@2x.png"
- alt="鍥炬爣"
- class="equipment-icon"
- />
- <span class="equipment-title">浜у搧鍛ㄨ浆澶╂暟</span>
- </div>
- <Echarts
- ref="chart"
- :chartStyle="chartStyle"
- :grid="grid"
- :legend="barLegend"
- :series="barSeries1"
- :tooltip="tooltip"
- :xAxis="xAxis1"
- :yAxis="yAxis1"
- :options="{ backgroundColor: 'transparent', textStyle: { color: '#B8C8E0' } }"
- style="height: 260px"
- />
- </div>
- </div>
+ <div>
+ <!-- 璁惧缁熻 -->
+ <div class="equipment-stats">
+ <div class="equipment-header">
+ <img
+ src="@/assets/BI/shujutongjiicon@2x.png"
+ alt="鍥炬爣"
+ class="equipment-icon"
+ />
+ <span class="equipment-title">浜у搧鍛ㄨ浆澶╂暟</span>
+ </div>
+ <Echarts
+ ref="chart"
+ :chartStyle="chartStyle"
+ :grid="grid"
+ :legend="barLegend"
+ :series="barSeries1"
+ :tooltip="tooltip"
+ :xAxis="xAxis1"
+ :yAxis="yAxis1"
+ :options="{ backgroundColor: 'transparent', textStyle: { color: '#B8C8E0' } }"
+ style="height: 260px"
+ />
+ </div>
+ </div>
</template>
<script setup>
-import { ref, onMounted } from 'vue'
+import { ref, onMounted, inject, watch } from 'vue'
import Echarts from '@/components/Echarts/echarts.vue'
-import { customerRevenueAnalysis } from '@/api/viewIndex.js'
-import { listCustomer } from '@/api/basicData/customerFile.js'
+import { productTurnoverDays } from '@/api/viewIndex.js'
-const dateType = ref(1)
-const customerValue = ref(null)
-const customerOptions = ref([])
+const dateRange = inject('psiDateRange', null)
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: '钀ユ敹',
- type: 'bar',
- barGap: 0,
- barWidth: 30,
- emphasis: { focus: 'series' },
- itemStyle: {
- color: {
- type: 'linear',
- x: 0, y: 1, x2: 0, y2: 0,
- colorStops: [
- { offset: 0, color: 'rgba(0,164,237,0)' },
- { offset: 1, color: '#4EE4FF' },
- ],
- },
- },
- data: [],
- },
+ {
+ name: '鍛ㄨ浆澶╂暟',
+ type: 'bar',
+ barGap: 0,
+ barWidth: 30,
+ emphasis: { focus: 'series' },
+ itemStyle: {
+ color: {
+ type: 'linear',
+ x: 0, y: 1, x2: 0, y2: 0,
+ colorStops: [
+ { offset: 0, color: 'rgba(0,164,237,0)' },
+ { offset: 1, color: '#4EE4FF' },
+ ],
+ },
+ },
+ data: [],
+ },
])
const tooltip = {
- trigger: 'axis',
- axisPointer: { type: 'shadow' },
- formatter(params) {
- let result = params[0].axisValueLabel + '<br/>'
- params.forEach((item) => {
- result += `<div style="color: #B8C8E0">${item.marker} ${item.seriesName}: ${item.value}</div>`
- })
- return result
- },
+ trigger: 'axis',
+ axisPointer: { type: 'shadow' },
+ formatter(params) {
+ let result = params[0].axisValueLabel + '<br/>'
+ params.forEach((item) => {
+ result += `<div>${item.marker} ${item.seriesName}: ${item.value} 澶�</div>`
+ })
+ return result
+ },
}
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 })
- .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)
- })
- })
- .catch((e) => console.error('鑾峰彇瀹㈡埛钀ユ敹鍒嗘瀽澶辫触:', e))
+const fetchData = () => {
+ productTurnoverDays(dateRange?.value || undefined)
+ .then((res) => {
+ 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((err) => {
+ console.error('鑾峰彇浜у搧鍛ㄨ浆澶╂暟澶辫触:', err)
+ })
}
-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: '杩滄櫙鏉愭枡' },
- ]
- }
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+ watch(dataDashboardRefreshTick, () => {
+ fetchData()
+ })
}
onMounted(() => {
- fetchCustomerOptions()
+ fetchData()
})
</script>
<style scoped>
.equipment-stats {
- border: 1px solid #1a58b0;
- padding: 0 18px 18px;
- display: flex;
- flex-direction: column;
- gap: 16px;
+ border: 1px solid #1a58b0;
+ padding: 0 18px 18px;
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
}
.equipment-header {
- font-weight: 500;
- font-size: 21px;
- display: flex;
- border-bottom: 1px solid;
- border-image: linear-gradient(
- 270deg,
- rgba(0, 126, 255, 0) 0%,
- rgba(0, 126, 255, 0.4549) 35%,
- #007eff 78%,
- #007eff 100%
- )
- 1;
- padding-bottom: 2px;
+ font-weight: 500;
+ font-size: 21px;
+ display: flex;
+ border-bottom: 1px solid;
+ border-image: linear-gradient(
+ 270deg,
+ rgba(0, 126, 255, 0) 0%,
+ rgba(0, 126, 255, 0.4549) 35%,
+ #007eff 78%,
+ #007eff 100%
+ )
+ 1;
+ padding-bottom: 2px;
}
.equipment-title {
- font-weight: 500;
- font-size: 18px;
- background: linear-gradient(360deg, #056dff 0%, #43e8fc 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- background-clip: text;
- line-height: 50px;
+ font-weight: 500;
+ font-size: 18px;
+ background: linear-gradient(360deg, #056dff 0%, #43e8fc 100%);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ background-clip: text;
+ line-height: 50px;
}
.equipment-icon {
- width: 50px;
- height: 50px;
+ width: 50px;
+ height: 50px;
}
</style>
--
Gitblit v1.9.3