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-bottom.vue | 261 ++++++++++++++++++++++++++++-----------------------
1 files changed, 144 insertions(+), 117 deletions(-)
diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue
index 3b04ffa..43a4bbd 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/components/center-bottom.vue
@@ -1,164 +1,191 @@
<template>
- <div>
- <PanelHeader title="鍑哄叆搴撹秼鍔�" />
- <div class="main-panel panel-item-customers">
- <div class="filters-row">
-
- <ProductTypeSwitch v-model="productType" @change="handleFilterChange" />
- </div>
- <Echarts
- ref="chart"
- :chartStyle="chartStyle"
- :grid="grid"
- :legend="lineLegend"
- :series="lineSeries"
- :tooltip="tooltip"
- :xAxis="xAxis1"
- :yAxis="yAxis1"
- :options="{ backgroundColor: 'transparent', textStyle: { color: '#B8C8E0' } }"
- style="height: 260px"
- />
- </div>
- </div>
+ <div>
+ <PanelHeader title="鍑哄叆搴撹秼鍔�" />
+ <div class="main-panel panel-item-customers">
+ <div class="filters-row">
+
+ <ProductTypeSwitch v-model="productType" @change="handleFilterChange" />
+ </div>
+ <Echarts
+ ref="chart"
+ :chartStyle="chartStyle"
+ :grid="grid"
+ :legend="lineLegend"
+ :series="lineSeries"
+ :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 * as echarts from 'echarts'
import Echarts from '@/components/Echarts/echarts.vue'
import PanelHeader from './PanelHeader.vue'
import ProductTypeSwitch from './ProductTypeSwitch.vue'
+import { productInOutAnalysis } from '@/api/viewIndex.js'
const productType = ref(1) // 1=鍘熸潗鏂� 2=鍗婃垚鍝� 3=鎴愬搧
const chartStyle = { width: '100%', height: '130%' }
const grid = {
- left: '3%',
- right: '4%',
- bottom: '3%',
- top: '16%',
- containLabel: true,
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ top: '16%',
+ containLabel: true,
}
const lineLegend = {
- show: true,
- top: '2%',
- left: 'center',
- itemGap: 24,
- itemWidth: 12,
- itemHeight: 12,
- textStyle: { color: '#B8C8E0', fontSize: 14 },
- data: [
- { name: '鍑哄簱', itemStyle: { color: '#4EE4FF' } },
- { name: '鍏ュ簱', itemStyle: { color: '#00D68F' } },
- ],
+ show: true,
+ top: '2%',
+ left: 'center',
+ itemGap: 24,
+ itemWidth: 12,
+ itemHeight: 12,
+ textStyle: { color: '#B8C8E0', fontSize: 14 },
+ data: [
+ { name: '鍑哄簱', itemStyle: { color: 'rgba(11, 137, 254, 1)' } },
+ { name: '鍏ュ簱', itemStyle: { color: 'rgba(11, 249, 254, 1)' } },
+ ],
}
const xAxis1 = ref([
- {
- type: 'category',
- data: ['6/9', '6/10', '6/11', '6/12', '6/13', '6/14', '6/15'],
- axisTick: { show: false },
- axisLine: { show: false,lineStyle: { color: 'rgba(184, 200, 224, 0.3)' } },
- axisLabel: { color: '#B8C8E0', fontSize: 12 },
- splitLine: { show: false, lineStyle: { type: 'dashed', color: 'rgba(184, 200, 224, 0.2)' } },
- },
+ {
+ type: 'category',
+ data: [],
+ axisTick: { show: false },
+ axisLine: { show: false, lineStyle: { color: 'rgba(184, 200, 224, 0.3)' } },
+ axisLabel: { color: '#B8C8E0', fontSize: 12 },
+ splitLine: { show: false, lineStyle: { type: 'dashed', color: 'rgba(184, 200, 224, 0.2)' } },
+ },
])
const yAxis1 = [
- {
- type: 'value',
- name: '鍗曚綅: 浠�',
- nameTextStyle: { color: '#B8C8E0', fontSize: 12, padding: [0, 0, 0, 0] },
- axisLine: { show: false },
- axisTick: { show: false },
- axisLabel: { color: '#B8C8E0', fontSize: 12 },
- splitLine: { lineStyle: { color: '#B8C8E0' } },
- },
+ {
+ type: 'value',
+ name: '鍗曚綅: 浠�',
+ nameTextStyle: { color: '#B8C8E0', fontSize: 12, padding: [0, 0, 0, 0] },
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { color: '#B8C8E0', fontSize: 12 },
+ splitLine: { lineStyle: { color: '#B8C8E0' } },
+ },
]
const lineSeries = ref([
- {
- name: '鍑哄簱',
- type: 'line',
- smooth: false,
- showSymbol: true,
- symbol: 'circle',
- symbolSize: 8,
- lineStyle: { color: 'rgba(11, 137, 254,1', width: 2 },
- itemStyle: { color: 'rgba(11, 137, 254, 1)', borderWidth: 0 },
- areaStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: 'rgba(11, 137, 254, 0.40)' },
- { offset: 1, color: 'rgba(11, 137, 254, 0.05)' },
- ]),
- },
- data: [80, 100, 140, 160, 120, 150, 180],
- emphasis: { focus: 'series' },
- },
- {
- name: '鍏ュ簱',
- type: 'line',
- smooth: false,
- showSymbol: true,
- symbol: 'circle',
- symbolSize: 8,
-
- lineStyle: { color: 'rgba(11, 249, 254, 1)', width: 2 },
- itemStyle: { color: 'rgba(11, 249, 254, 1)', borderWidth: 0 },
- areaStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: 'rgba(11, 249, 254, 0.5)' },
- { offset: 1, color: 'rgba(11, 249, 254, 0.05)' },
- ]),
- },
- data: [160, 200, 200, 200, 170, 200, 200],
- emphasis: { focus: 'series' },
- },
+ {
+ name: '鍑哄簱',
+ type: 'line',
+ smooth: false,
+ showSymbol: true,
+ symbol: 'circle',
+ symbolSize: 8,
+ lineStyle: { color: 'rgba(11, 137, 254, 1)', width: 2 },
+ itemStyle: { color: 'rgba(11, 137, 254, 1)', borderWidth: 0 },
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: 'rgba(11, 137, 254, 0.40)' },
+ { offset: 1, color: 'rgba(11, 137, 254, 0.05)' },
+ ]),
+ },
+ data: [],
+ emphasis: { focus: 'series' },
+ },
+ {
+ name: '鍏ュ簱',
+ type: 'line',
+ smooth: false,
+ showSymbol: true,
+ symbol: 'circle',
+ symbolSize: 8,
+ lineStyle: { color: 'rgba(11, 249, 254, 1)', width: 2 },
+ itemStyle: { color: 'rgba(11, 249, 254, 1)', borderWidth: 0 },
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: 'rgba(11, 249, 254, 0.5)' },
+ { offset: 1, color: 'rgba(11, 249, 254, 0.05)' },
+ ]),
+ },
+ data: [],
+ emphasis: { focus: 'series' },
+ },
])
const tooltip = {
- trigger: 'axis',
- axisPointer: { type: 'line' },
- borderWidth: 1,
- textStyle: { fontSize: 12 },
- formatter(params) {
- let result = params[0].axisValue + '<br/>'
- params.forEach((item) => {
- result += `${item.marker} ${item.seriesName}: ${item.value} 浠�<br/>`
- })
- return result
- },
+ trigger: 'axis',
+ axisPointer: { type: 'line' },
+ borderWidth: 1,
+ textStyle: { fontSize: 12 },
+ formatter(params) {
+ let result = params[0].axisValue + '<br/>'
+ params.forEach((item) => {
+ result += `${item.marker} ${item.seriesName}: ${item.value} 浠�<br/>`
+ })
+ return result
+ },
+}
+
+const dateRange = inject('psiDateRange', null)
+
+const fetchData = () => {
+ const params = { type: productType.value, ...(dateRange?.value || {}) }
+ productInOutAnalysis(params)
+ .then((res) => {
+ if (res.code === 200 && Array.isArray(res.data)) {
+ const list = res.data
+ xAxis1.value[0].data = list.map((d) => d.date)
+ lineSeries.value[0].data = list.map((d) => Number(d.outCount) || 0)
+ lineSeries.value[1].data = list.map((d) => Number(d.inCount) || 0)
+ }
+ })
+ .catch((err) => {
+ console.error('鑾峰彇浜у搧鍑哄叆搴撳垎鏋愬け璐�:', err)
+ })
}
const handleFilterChange = () => {
- // 鍙寜 productType 鍒囨崲鍚庤姹傚嚭鍏ュ簱鎺ュ彛锛屾澶勪粎棰勭暀
+ fetchData()
}
-onMounted(() => {})
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+ watch(dataDashboardRefreshTick, () => {
+ fetchData()
+ })
+}
+
+onMounted(() => {
+ fetchData()
+})
</script>
<style scoped>
.main-panel {
- display: flex;
- flex-direction: column;
- gap: 20px;
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
}
.filters-row {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- gap: 12px;
- margin-bottom: 10px;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ gap: 12px;
+ margin-bottom: 10px;
}
.panel-item-customers {
- border: 1px solid #1a58b0;
- padding: 18px;
- width: 100%;
- height: 428px;
+ border: 1px solid #1a58b0;
+ padding: 18px;
+ width: 100%;
+ height: 428px;
}
</style>
--
Gitblit v1.9.3