This commit is contained in:
‘937886381’
2026-01-06 13:48:11 +08:00
parent 20ef2b9763
commit 5605eeab06
287 changed files with 1890 additions and 1381 deletions

View File

@@ -2,9 +2,6 @@
<div class="coreBar">
<!-- 新增行容器包裹各基地情况和barTop -->
<div class="header-row">
<div class="base-title">
各基地情况
</div>
<div class="barTop">
<!-- 关键新增右侧容器包裹图例和按钮组实现整体靠右 -->
<div class="right-container">
@@ -285,10 +282,10 @@ export default {
// 新增:头部行容器,实现一行排列
.header-row {
display: flex;
justify-content: space-between; // 左右两端对齐
align-items: center; // 垂直居中
width: 100%;
margin-bottom: 8px; // 与下方图表区保留间距(可根据需求调整)
justify-content: flex-end; // 左右两端对齐
align-items: center; // 垂直居中
// width: 100%;
margin-bottom: 8px; // 与下方图表区保留间距(可根据需求调整)
}
// 各基地情况标题样式

View File

@@ -21,7 +21,8 @@
<template v-else-if="activeTab === 'pro'">
<div class="bottom" style="display: flex; width: 100%;gap: 8px;">
<div class="left" style="width: 382px;height: 190px;background: #F9FCFF;">
<pieChart :chartData="currentPieData" style="width: 382px;height: 190px"></pieChart>
<pieChart :chartTitle="pieTitleName" :chartData="currentPieData" style="width: 382px;height: 190px">
</pieChart>
</div>
<div class="right" style="width: 1190px;height: 190px;background: #F9FCFF;">
<proDataTrendBar :title="'产品单价分析'" :chartData="currentPriceData" style="width: 1190px;height: 190px">
@@ -63,6 +64,7 @@ export default {
},
data() {
return {
pieTitleName:'客户销量分析',
activeTab: 'cus', // 客户/产品切换
bottomType: 'month' // 月度/累计切换
}
@@ -167,6 +169,7 @@ export default {
// 处理客户/产品切换
handleTabSwitch(tabType) {
this.activeTab = tabType
this.pieTitleName = this.activeTab === 'cus' ? '客户销量分析' :'产品销量分析'
}
}
}

View File

@@ -108,8 +108,8 @@ export default {
*/
getRateFlag(rate) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
return rate >= 100 ? 1 : 0;
}
return +(rate >= 100 || rate === 0); // + 号将布尔值转为数字true→1false→0
},
}
}
</script>

View File

@@ -6,7 +6,7 @@
<!-- 销量图表传递销量数据 + 完成率flag -->
<div class="dashboard left" @click="handleDashboardClick('/salesVolumeAnalysis/salesVolumeAnalysisBase')">
<div class="title">
销量·单位/万元
销量·
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
@@ -16,9 +16,9 @@
</div>
</div>
<!-- 成本图表传递全成本数据 + 完成率flag -->
<div class="dashboard right" @click="handleDashboardClick('/salesVolumeAnalysis/salesVolumeAnalysisBase')">
<div class="dashboard right" @click="handleDashboardClick('/fullCostAnalysis/fullCostAnalysisBase')">
<div class="title">
成本·单位/万元
成本·
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
@@ -29,9 +29,9 @@
</div>
<!-- 运费图表传递单价数据 + 完成率flag -->
<div class="dashboard right" >
<div class="dashboard right">
<div class="title">
运费·单位/万元
运费·
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
@@ -61,6 +61,10 @@ export default {
销量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 }
})
},
dateData: {
type: Object,
default: () => ({ })
},
factory: {
type: [String, Number],
default: ''
@@ -101,7 +105,8 @@ export default {
this.$router.push({
path: path,
query: {
factory: this.$route.query.factory ? this.$route.query.factory : this.factory
factory: this.$route.query.factory ? this.$route.query.factory : this.factory,
dateData: this.dateData
}
})
},

View File

@@ -39,7 +39,7 @@
</div>
</div>
<div class="lineBottom" style="height: 100%; width: 100%">
<operatingLineBar :chartData="chartD" style="height: 99%; width: 100%" />
<operatingLineBar :dateData="dateData" :chartData="chartD" style="height: 99%; width: 100%" />
</div>
</div>
</template>
@@ -51,7 +51,7 @@ import * as echarts from 'echarts';
export default {
name: "Container",
components: { operatingLineBar },
props: ["chartData"],
props: ["chartData",'dateData'],
emits: ['sort-change'], // 声明事件Vue3 推荐)
data() {
return {

View File

@@ -120,7 +120,7 @@ export default {
},
// min: 0,
// max: (value) => Math.ceil((value.max || 0) * 1.1),
scale: true,
axisTick: { show: false },
axisLabel: {
color: 'rgba(0, 0, 0, 0.45)',

View File

@@ -117,7 +117,7 @@ export default {
fontSize: 12,
align: 'right'
},
scale: true,
splitNumber: 4,
axisTick: { show: false },
axisLabel: {

View File

@@ -28,7 +28,11 @@ export default {
chartData: {
type: Object,
default: () => ({}),
}
},
dateData: {
type: Object,
default: () => ({}),
},
},
mounted() {
this.$nextTick(() => {
@@ -44,7 +48,7 @@ export default {
},
deep: true,
immediate: true
}
},
},
beforeDestroy() {
// 组件销毁时清理资源
@@ -80,7 +84,8 @@ export default {
path: 'unitPriceAnalysisBase',
query: { // 使用query传递参数推荐也可使用params
// baseName: itemName,
factory: baseIndex
factory: baseIndex,
dateData: this.dateData
}
// 若仍需用base作为参数
// base: itemName,
@@ -116,11 +121,11 @@ export default {
}
}
},
grid: {
grid: {
top: 30,
bottom: 30,
right: 70,
left: 40
left: 60
},
xAxis: [
{
@@ -148,13 +153,13 @@ export default {
yAxis: [
{
type: 'value',
name: '万元',
name: '单位/万㎡',
nameTextStyle: {
color: 'rgba(0, 0, 0, 0.45)',
fontSize: 12,
align: 'right'
},
scale: true,
splitNumber: 4,
axisTick: { show: false },
axisLabel: {

View File

@@ -117,7 +117,7 @@ export default {
fontSize: 12,
align: 'right'
},
scale: true,
splitNumber: 4,
axisTick: { show: false },
axisLabel: {
@@ -146,7 +146,7 @@ export default {
},
splitLine: { show: false },
axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
// scale: true,
//
splitNumber: 4,
}
],

View File

@@ -85,15 +85,15 @@ export default {
},
grid: {
top: 20,
bottom: 40,
right:10,
left: 30,
bottom: 60,
right:30,
left: 40,
},
xAxis: [
{
type: 'category',
boundaryGap: true,
// offset: 10
// offset: 10
// boundaryGap: ['50%', '50%'],
axisTick: { show: false },
axisLine: {
@@ -125,7 +125,7 @@ export default {
type: 'solid' // 实线可选dashed虚线、dotted点线
}
},
scale: true,
splitNumber: 2,
axisTick: { show: false },
axisLabel: {

View File

@@ -30,7 +30,7 @@
background-color: rgba(249, 252, 255, 1);
">
<!-- <top-item /> -->
<operatingBar :chartData="chartData" @sort-change="sortChange" />
<operatingBar :dateData="dateData" :chartData="chartData" @sort-change="sortChange" />
</div>
</div>
</Container>
@@ -51,6 +51,10 @@ export default {
default: () => ({}),
required: true, // 标记为必填,避免空数据导致异常
},
dateData: {
type: Object,
default: () => ({}),
},
},
data() {
return {

View File

@@ -30,7 +30,7 @@
background-color: rgba(249, 252, 255, 1);
">
<!-- <top-item /> -->
<operatingBar :chartData="chartData" @sort-change="sortChange" />
<operatingBar :dateData="dateData" :chartData="chartData" @sort-change="sortChange" />
</div>
</div>
</Container>
@@ -51,6 +51,10 @@ export default {
default: () => ({}),
required: true, // 标记为必填,避免空数据导致异常
},
dateData: {
type: Object,
default: () => ({}),
},
},
data() {
return {

View File

@@ -242,90 +242,8 @@ export default {
]
};
// 毛利率场景数据
const grossProfitData = {
series: [
// 1. 完成率(折线图)
{
name: '完成率',
type: 'line',
yAxisIndex: 1,
lineStyle: { color: 'rgba(40, 138, 255, .5)', width: 2 },
itemStyle: {
color: 'rgba(40, 138, 255, 1)',
borderColor: 'rgba(40, 138, 255, 1)',
borderWidth: 2,
radius: 4
},
areaStyle: {
opacity: 0.2,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(40, 138, 255, .9)' },
{ offset: 1, color: 'rgba(40, 138, 255, 0)' }
])
},
data: [106.7, 96.9, 106.5, 106.1, 93.8, 105.9], // 毛利率完成率(%
symbol: 'circle',
symbolSize: 6
},
// 2. 目标(柱状图)
{
name: '目标',
type: 'bar',
yAxisIndex: 0,
barWidth: 14,
itemStyle: {
color: {
type: 'linear',
x: 0, y: 0, x2: 0, y2: 1,
colorStops: [
{ offset: 0, color: 'rgba(130, 204, 255, 1)' },
{ offset: 1, color: 'rgba(75, 157, 255, 1)' }
]
},
borderRadius: [4, 4, 0, 0],
borderWidth: 0
},
data: [30, 32, 31, 33, 32, 34] // 目标毛利率(万元)
},
// 3. 实际(柱状图)
{
name: '实际',
type: 'bar',
yAxisIndex: 0,
barWidth: 14,
itemStyle: {
color: (params) => {
const safeFlag = [1, 0, 1, 1, 0, 1]; // 达标状态
const currentFlag = safeFlag[params.dataIndex] || 0;
return currentFlag === 1
? {
type: 'linear',
x: 0, y: 0, x2: 0, y2: 1,
colorStops: [
{ offset: 0, color: 'rgba(174, 239, 224, 1)' },
{ offset: 1, color: 'rgba(118, 218, 190, 1)' }
]
}
: {
type: 'linear',
x: 0, y: 0, x2: 0, y2: 1,
colorStops: [
{ offset: 0, color: 'rgba(253, 209, 129, 1)' },
{ offset: 1, color: 'rgba(249, 164, 74, 1)' }
]
};
},
borderRadius: [4, 4, 0, 0],
borderWidth: 0
},
data: [32, 31, 33, 35, 30, 36] // 实际毛利率(万元)
}
]
};
// 根据按钮状态返回对应数据
return this.activeButton === 0 ? salesData : grossProfitData;
return salesData
}
},
methods: {},

View File

@@ -14,7 +14,7 @@
{{ formatRate(factoryData?.completeRate) }}%
</div>
<div class="mom">
{{ formatRate(factoryData?.thb) }}%
{{ formatRate(factoryData?.thb) }}%
<img v-if="factoryData?.thb >= 0" class="arrow" src="../../../assets/img/topArrow.png" alt="">
<img v-else class="arrow" src="../../../assets/img/downArrow.png" alt="">
</div>
@@ -111,8 +111,8 @@ export default {
*/
getRateFlag(rate) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
return rate >= 100 ? 1 : 0;
}
return +(rate >= 100 || rate === 0); // + 号将布尔值转为数字true→1false→0
},
}
}
</script>

View File

@@ -6,7 +6,7 @@
<!-- 销量图表传递销量数据 + 完成率flag -->
<div class="dashboard left" @click="handleDashboardClick('/salesVolumeAnalysis/salesVolumeAnalysisBase')">
<div class="title">
销量·单位/万元
销量·
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
@@ -16,9 +16,9 @@
</div>
</div>
<!-- 成本图表传递全成本数据 + 完成率flag -->
<div class="dashboard right" @click="handleDashboardClick('/salesVolumeAnalysis/salesVolumeAnalysisBase')">
<div class="dashboard right" @click="handleDashboardClick('/fullCostAnalysis/fullCostAnalysisBase')">
<div class="title">
成本·单位/万元
成本·
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
@@ -30,7 +30,7 @@
<!-- 运费图表传递单价数据 + 完成率flag -->
<div class="dashboard right">
<div class="title">
运费·单位/万元
运费·
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
@@ -62,6 +62,10 @@ export default {
销量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 }
})
},
dateData: {
type: Object,
default: () => ({})
},
factory: {
type: [String, Number],
default: ''
@@ -102,7 +106,8 @@ export default {
this.$router.push({
path: path,
query: {
factory: this.$route.query.factory ? this.$route.query.factory : this.factory
factory: this.$route.query.factory ? this.$route.query.factory : this.factory,
dateData: this.dateData
}
})
},