@@ -40,7 +40,7 @@ export default {
type: Array,
// 默认值:收入、全成本两个对象,结构与原数据一致
default: () => [
- { title: "收入", budget: 0, real: 0, rate: 0, diff: 0 },
+ { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 },
{ title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 }
]
},
@@ -61,7 +61,7 @@ export default {
return {
chart: null,
// 初始化收入/全成本数据(包含flag字段)
- incomeData: { title: "收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
+ incomeData: { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 },
totalCostData: { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0, flag: 0 }
}
},
@@ -90,18 +90,18 @@ export default {
})
},
// 保留原flag判断逻辑(≥100返回1,<100返回0)
-getRateFlag(rate, real, target) {
- if (isNaN(rate) || rate === null || rate === undefined) return 0;
+ getRateFlag(rate, real, target) {
+ if (isNaN(rate) || rate === null || rate === undefined) return 0;
- // 1. 完成率 >= 100 => 达标
- if (rate >= 100) return 1;
+ // 1. 完成率 >= 100 => 达标
+ if (rate >= 100) return 1;
- // 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
- if (rate === 0 && target === 0) return 1;
+ // 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
+ if (rate === 0 && target === 0) return 1;
- // 其他情况 => 未达标
- return 0;
-},
+ // 其他情况 => 未达标
+ return 0;
+ },
updateChart(data) {
// 数据兜底:确保是数组且长度≥2
@@ -110,7 +110,7 @@ getRateFlag(rate, real, target) {
: this.$props.ytdAnalysis.default();
// 提取收入(第0项)、全成本(第1项)数据
- const incomeItem = validData[0] || { title: "收入", budget: 0, real: 0, rate: 0, diff: 0 };
+ const incomeItem = validData[0] || { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
const totalCostItem = validData[1] || { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
// 整合flag字段到收入/全成本数据中
diff --git a/src/views/home/inputOutputRatioComponents/monthlyRelatedMetrics.vue b/src/views/home/inputOutputRatioComponents/monthlyRelatedMetrics.vue
index 61262ab3..8104f8d2 100644
--- a/src/views/home/inputOutputRatioComponents/monthlyRelatedMetrics.vue
+++ b/src/views/home/inputOutputRatioComponents/monthlyRelatedMetrics.vue
@@ -6,7 +6,7 @@
- 领用量·㎡
+ 领用量·万㎡
@@ -15,7 +15,7 @@
- 加工产量·㎡
+ 加工产量·万㎡
diff --git a/src/views/home/inputOutputRatioComponents/yearRelatedMetrics.vue b/src/views/home/inputOutputRatioComponents/yearRelatedMetrics.vue
index 6cef2502..09a20860 100644
--- a/src/views/home/inputOutputRatioComponents/yearRelatedMetrics.vue
+++ b/src/views/home/inputOutputRatioComponents/yearRelatedMetrics.vue
@@ -6,7 +6,7 @@
- 领用量·㎡
+ 领用量·万㎡
@@ -15,7 +15,7 @@
- 加工产量·㎡
+ 加工产量·万㎡
diff --git a/src/views/home/netPriceAnalysisComponents/monthlyRelatedMetrics.vue b/src/views/home/netPriceAnalysisComponents/monthlyRelatedMetrics.vue
index 33fed4cf..fc8484b7 100644
--- a/src/views/home/netPriceAnalysisComponents/monthlyRelatedMetrics.vue
+++ b/src/views/home/netPriceAnalysisComponents/monthlyRelatedMetrics.vue
@@ -18,7 +18,7 @@
- 运费·万㎡
+ 运费·万元
- 运费·万㎡
+ 运费·万元
- 单价·万㎡
+ 单价·元/㎡
diff --git a/src/views/home/operatingComponents/yearRelatedMetrics.vue b/src/views/home/operatingComponents/yearRelatedMetrics.vue
index 41acb64f..5bd0ad21 100644
--- a/src/views/home/operatingComponents/yearRelatedMetrics.vue
+++ b/src/views/home/operatingComponents/yearRelatedMetrics.vue
@@ -15,7 +15,7 @@
- 单价·万㎡
+ 单价·元/㎡
diff --git a/src/views/home/operatingProfit/operatingProfitBase.vue b/src/views/home/operatingProfit/operatingProfitBase.vue
index 3dac1a67..b5fa60ed 100644
--- a/src/views/home/operatingProfit/operatingProfitBase.vue
+++ b/src/views/home/operatingProfit/operatingProfitBase.vue
@@ -37,7 +37,7 @@
gap: 12px;
grid-template-columns: 1624px;
">
-
+
diff --git a/src/views/home/operatingProfitComponents/dataTrendBar.vue b/src/views/home/operatingProfitComponents/dataTrendBar.vue
index 16c668fa..81b7d66b 100644
--- a/src/views/home/operatingProfitComponents/dataTrendBar.vue
+++ b/src/views/home/operatingProfitComponents/dataTrendBar.vue
@@ -65,7 +65,7 @@ export default {
'经营性利润',
'销量',
'单价',
- '成本',
+ '制造成本',
'管理费用',
'销售费用',
'财务费用',
diff --git a/src/views/home/operatingProfitComponents/monthlyOverview.vue b/src/views/home/operatingProfitComponents/monthlyOverview.vue
index a385093c..2306d13f 100644
--- a/src/views/home/operatingProfitComponents/monthlyOverview.vue
+++ b/src/views/home/operatingProfitComponents/monthlyOverview.vue
@@ -66,7 +66,7 @@ export default {
*/
factoryData() { // 整合原始数据 + 计算flag
return {
- completeRate: this.monData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
+ completeRate: this.monData.proportion ? Number(this.monData.proportion) : 0,
diff: this.monData.diffValue,
real: this.monData.value,
target: this.monData.targetValue,
diff --git a/src/views/home/operatingProfitComponents/operatingLineChart.vue b/src/views/home/operatingProfitComponents/operatingLineChart.vue
index d56bb9a5..b3cdb2b0 100644
--- a/src/views/home/operatingProfitComponents/operatingLineChart.vue
+++ b/src/views/home/operatingProfitComponents/operatingLineChart.vue
@@ -61,8 +61,8 @@ export default {
default: () => [],
},
dateData: {
- type: Array,
- default: () => [],
+ type: Object,
+ default: () => {},
},
},
data() {
diff --git a/src/views/home/operatingProfitComponents/operatingLineChartCumulative.vue b/src/views/home/operatingProfitComponents/operatingLineChartCumulative.vue
index 6726ba86..fec2b978 100644
--- a/src/views/home/operatingProfitComponents/operatingLineChartCumulative.vue
+++ b/src/views/home/operatingProfitComponents/operatingLineChartCumulative.vue
@@ -61,8 +61,8 @@ export default {
default: () => [],
},
dateData: {
- type: Array,
- default: () => [],
+ type: Object,
+ default: () => {},
},
},
data() {
diff --git a/src/views/home/operatingProfitComponents/operatingSingleBar.vue b/src/views/home/operatingProfitComponents/operatingSingleBar.vue
index 4bb84b68..d40214ac 100644
--- a/src/views/home/operatingProfitComponents/operatingSingleBar.vue
+++ b/src/views/home/operatingProfitComponents/operatingSingleBar.vue
@@ -23,7 +23,7 @@ export default {
chartD() {
// 背景图片路径(若不需要可注释)
// const bgImageUrl = require('@/assets/img/labelBg.png');
- const rate = this.detailData?.proportion ? Number(this.detailData?.proportion).toFixed(2) : 0
+ const rate = this.detailData?.proportion ? Number(this.detailData?.proportion) : 0
const diff = this.detailData?.diffValue || 0
console.log('diff', diff);
diff --git a/src/views/home/operatingProfitComponents/relatedIndicatorsAnalysis.vue b/src/views/home/operatingProfitComponents/relatedIndicatorsAnalysis.vue
index 0f4f69cf..ab05fded 100644
--- a/src/views/home/operatingProfitComponents/relatedIndicatorsAnalysis.vue
+++ b/src/views/home/operatingProfitComponents/relatedIndicatorsAnalysis.vue
@@ -124,7 +124,7 @@ export default {
},
// 3. 成本数据:从当前激活数据集中筛选
costData() {
- return (this.activeData.find(item => item.name === "成本")) || {
+ return (this.activeData.find(item => item.name === "制造成本")) || {
targetValue: 0,
value: 0,
completed: 0,
diff --git a/src/views/home/operatingProfitComponents/totalOverview.vue b/src/views/home/operatingProfitComponents/totalOverview.vue
index 5ba0db7b..44b36ae1 100644
--- a/src/views/home/operatingProfitComponents/totalOverview.vue
+++ b/src/views/home/operatingProfitComponents/totalOverview.vue
@@ -69,7 +69,7 @@ export default {
*/
factoryData() { // 整合原始数据 + 计算flag
return {
- completeRate: Number(this.totalData.proportion).toFixed(2),
+ completeRate: Number(this.totalData.proportion),
diff: this.totalData.diffValue,
real: this.totalData.value,
target: this.totalData.targetValue,
diff --git a/src/views/home/procurementGainAnalysisComponents/relatedIndicatorsAnalysis.vue b/src/views/home/procurementGainAnalysisComponents/relatedIndicatorsAnalysis.vue
index d65e0c67..1c68761b 100644
--- a/src/views/home/procurementGainAnalysisComponents/relatedIndicatorsAnalysis.vue
+++ b/src/views/home/procurementGainAnalysisComponents/relatedIndicatorsAnalysis.vue
@@ -6,7 +6,7 @@
- 大宗类·万㎡
+ 大宗类·万元
- 石料类·m³/㎡
+ 石料类·万元
- 材料类·m³
+ 材料类·万元
- 动力类·元m³
+ 动力类·万元
- 技术服务类·万㎡
+ 技术服务类·万元
{
- return item.name === "硅砂成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name === '原料' + this.$route.query.name;
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name === '原料硅砂';
+ }
});
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedMon: res.data.currentMonthData.filter(item => {
- return item.name !== "硅砂成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name !== '原料' + this.$route.query.name;
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name !== '原料硅砂';
+ }
}), // 兜底月度数据
relatedTotal: res.data.totalMonthData.filter(item => {
- return item.name !== "硅砂成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name !== '原料' + this.$route.query.name;
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name !== '原料硅砂';
+ }
}) // 兜底累计数据
}
diff --git a/src/views/home/productionCostAnalysis/combustible.vue b/src/views/home/productionCostAnalysis/combustible.vue
index fdae2cb9..d8be00c2 100644
--- a/src/views/home/productionCostAnalysis/combustible.vue
+++ b/src/views/home/productionCostAnalysis/combustible.vue
@@ -199,7 +199,7 @@ export default {
endTime: this.dateData.endTime,
// index: this.index,
// sort: 1,
- trendName: this.trendName,
+ trendName: this.trendName +'成本',
analysisObject: [
"原片燃料成本",
],
diff --git a/src/views/home/productionCostAnalysis/fuelCostAnalysis.vue b/src/views/home/productionCostAnalysis/fuelCostAnalysis.vue
index 77dc0fee..1bbd7622 100644
--- a/src/views/home/productionCostAnalysis/fuelCostAnalysis.vue
+++ b/src/views/home/productionCostAnalysis/fuelCostAnalysis.vue
@@ -189,7 +189,7 @@ export default {
changeItem(item) {
console.log('item', item);
- this.trendName = item
+ this.trendName = item
this.getData()
},
getData() {
diff --git a/src/views/home/productionCostAnalysis/procPackMatCost.vue b/src/views/home/productionCostAnalysis/procPackMatCost.vue
index 5b8c01b9..ca8fe405 100644
--- a/src/views/home/productionCostAnalysis/procPackMatCost.vue
+++ b/src/views/home/productionCostAnalysis/procPackMatCost.vue
@@ -96,7 +96,7 @@ export default {
totalData: {},
trend: [],
relatedData: {},
- trendName: '加工包材成本',
+ trendName: '包材成本',
};
},
@@ -186,7 +186,7 @@ export default {
// sort: 1,
trendName: this.trendName,
analysisObject: [
- '加工包材成本'
+ '包材成本'
],
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
levelId: this.factory,
diff --git a/src/views/home/productionCostAnalysis/singleCombustible.vue b/src/views/home/productionCostAnalysis/singleCombustible.vue
index 45e9b9cb..182b55ca 100644
--- a/src/views/home/productionCostAnalysis/singleCombustible.vue
+++ b/src/views/home/productionCostAnalysis/singleCombustible.vue
@@ -209,20 +209,44 @@ export default {
// 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => {
this.monData = res.data.currentMonthData.find(item => {
- return item.name === "天然气成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name === this.$route.query.name + '成本';
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name === '天然气成本';
+ }
});
console.log('this.monData', this.monData);
this.totalData = res.data.totalMonthData.find(item => {
- return item.name === "天然气成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name === this.$route.query.name + '成本';
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name === '天然气成本';
+ }
});
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedMon: res.data.currentMonthData.filter(item => {
- return item.name !== "天然气成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name !== this.$route.query.name + '成本';
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name !== '天然气成本';
+ }
}), // 兜底月度数据
relatedTotal: res.data.totalMonthData.filter(item => {
- return item.name !== "天然气成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name !== this.$route.query.name + '成本';
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name !== '天然气成本';
+ }
}) // 兜底累计数据
}
diff --git a/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue b/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue
index d9ca7279..32de2cd4 100644
--- a/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue
+++ b/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue
@@ -198,7 +198,7 @@ export default {
endTime: this.dateData.endTime,
// index: this.index,
// sort: 1,
- trendName: this.trendName,
+ trendName: this.$route.query.name ? this.$route.query.name + '成本' + this.trendName : '镀膜液成本' + this.trendName,
analysisObject: [
this.$route.query.name ? this.$route.query.name + '成本' : '镀膜液成本'
],
@@ -209,20 +209,44 @@ export default {
// 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => {
this.monData = res.data.currentMonthData.find(item => {
- return item.name === "镀膜液成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name === this.$route.query.name + '成本'
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name === '镀膜液成本';
+ }
});
console.log('this.monData', this.monData);
this.totalData = res.data.totalMonthData.find(item => {
- return item.name === "镀膜液成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name === this.$route.query.name + '成本'
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name === '镀膜液成本';
+ }
});
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedMon: res.data.currentMonthData.filter(item => {
- return item.name !== "镀膜液成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name !== this.$route.query.name + '成本'
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name === '镀膜液成本';
+ }
}), // 兜底月度数据
relatedTotal: res.data.totalMonthData.filter(item => {
- return item.name !== "镀膜液成本";
+ if (this.$route.query.name) {
+ // 如果有查询参数,查找 "原料" + 查询参数 的项
+ return item.name !== this.$route.query.name + '成本'
+ } else {
+ // 如果没有查询参数,查找 name 为 "原料硅砂" 的项
+ return item.name !== '镀膜液成本';
+ }
}) // 兜底累计数据
}
diff --git a/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue b/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue
index f30e5709..e591ffbd 100644
--- a/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue
+++ b/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue
@@ -94,7 +94,7 @@ export default {
totalData: {},
trend: [],
relatedData: {},
- trendName: '备品、机物料',
+ trendName: '备品丶机物料',
};
},
diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBar.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBar.vue
index 983f3d4b..ba254560 100644
--- a/src/views/home/productionCostAnalysisComponents/dataTrendBar.vue
+++ b/src/views/home/productionCostAnalysisComponents/dataTrendBar.vue
@@ -67,7 +67,7 @@ export default {
'燃料成本',
'电成本',
'人工成本',
- '制造成本',
+ '制造费用',
]
};
},
diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBarFactoryBurden.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBarFactoryBurden.vue
index 5b20e2b1..982022b2 100644
--- a/src/views/home/productionCostAnalysisComponents/dataTrendBarFactoryBurden.vue
+++ b/src/views/home/productionCostAnalysisComponents/dataTrendBarFactoryBurden.vue
@@ -64,7 +64,7 @@ export default {
profitOptions: [
'原片制造费用成本',
'包材',
- '备品、机物料',
+ '备品丶机物料',
'折旧',
'其他',
]
diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBarPro.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBarPro.vue
index 55dd0967..1328854a 100644
--- a/src/views/home/productionCostAnalysisComponents/dataTrendBarPro.vue
+++ b/src/views/home/productionCostAnalysisComponents/dataTrendBarPro.vue
@@ -63,7 +63,7 @@ export default {
selectedProfit: '制造费用', // 选中的名称,初始为null
profitOptions: [
'制造费用',
- '备品、机物料',
+ '备品丶机物料',
'折旧',
'其他',
]
diff --git a/src/views/home/productionCostAnalysisComponents/monthlyOverview.vue b/src/views/home/productionCostAnalysisComponents/monthlyOverview.vue
index 9c679019..53f46643 100644
--- a/src/views/home/productionCostAnalysisComponents/monthlyOverview.vue
+++ b/src/views/home/productionCostAnalysisComponents/monthlyOverview.vue
@@ -64,9 +64,11 @@ export default {
/**
* 自动提取monData中的工厂数据,并新增flag字段
*/
- factoryData() { // 整合原始数据 + 计算flag
+ factoryData() {
+ console.log(this.monData,'monData');
+ // 整合原始数据 + 计算flag
return {
- completeRate: this.monData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
+ completeRate: this.monData.proportion ? Number(this.monData.proportion) : 0,
diff: this.monData.diffValue,
real: this.monData.value,
target: this.monData.targetValue,
diff --git a/src/views/home/productionCostAnalysisComponents/monthlyThreeRelatedMetricsPro.vue b/src/views/home/productionCostAnalysisComponents/monthlyThreeRelatedMetricsPro.vue
index ff83e895..f73bac2f 100644
--- a/src/views/home/productionCostAnalysisComponents/monthlyThreeRelatedMetricsPro.vue
+++ b/src/views/home/productionCostAnalysisComponents/monthlyThreeRelatedMetricsPro.vue
@@ -5,9 +5,9 @@
-
+
- 备品、机物料·元/㎡
+ 备品丶机物料·元/㎡
@@ -76,7 +76,7 @@ export default {
computed: {
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
sparePartsData() {
- return this.relatedData.find(item => (item.name || '').includes('备品、机物料')) || {
+ return this.relatedData.find(item => (item.name || '').includes('备品丶机物料')) || {
targetValue: 0,
value: 0,
completed: 0,
diff --git a/src/views/home/productionCostAnalysisComponents/operatingSingleBar.vue b/src/views/home/productionCostAnalysisComponents/operatingSingleBar.vue
index dd5c2737..e10b8472 100644
--- a/src/views/home/productionCostAnalysisComponents/operatingSingleBar.vue
+++ b/src/views/home/productionCostAnalysisComponents/operatingSingleBar.vue
@@ -23,9 +23,11 @@ export default {
return ['预算', '实际'];
},
chartD() {
+ console.log(this.detailData,'detailData');
+
// 背景图片路径(若不需要可注释)
// const bgImageUrl = require('@/assets/img/labelBg.png');
- const rate = this.detailData?.proportion ? Number(this.detailData?.proportion).toFixed(2) : 0
+ const rate = this.detailData?.proportion ? Number(this.detailData?.proportion) : 0
const diff = this.detailData?.diffValue || 0
console.log('diff', diff);
diff --git a/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue b/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue
index c0d5422a..bea1ed9e 100644
--- a/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue
+++ b/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue
@@ -7,28 +7,28 @@
-
LNG液化天然气·元/㎡
+
LNG液化天然气·元/吨
-
水·元/㎡
+
水·元/吨
diff --git a/src/views/home/productionCostAnalysisComponents/relateFactoryBurdenCostAnalysis.vue b/src/views/home/productionCostAnalysisComponents/relateFactoryBurdenCostAnalysis.vue
index 5ecc2ef6..21b8d5c8 100644
--- a/src/views/home/productionCostAnalysisComponents/relateFactoryBurdenCostAnalysis.vue
+++ b/src/views/home/productionCostAnalysisComponents/relateFactoryBurdenCostAnalysis.vue
@@ -1,22 +1,23 @@
-
+
-
+
- 备品、机物料·元/㎡
+ 备品丶机物料·元/吨
@@ -25,7 +26,7 @@
- 折旧·元/㎡
+ 折旧·元/吨
@@ -34,7 +35,7 @@
- 其他·元/㎡
+ 其他·元/吨
@@ -58,9 +59,9 @@ export default {
components: { Container, operatingSingleBar },
// mixins: [resize],
props: {
- itemData: { // 接收父组件传递的设备数据数组
- type: Array,
- default: () => [] // 默认空数组,避免报错
+ relatedData: { // 接收父组件传递的设备数据数组
+ type: Object,
+ default: () => { } // 默认空数组,避免报错
},
dateData: {
type: Object,
@@ -82,22 +83,25 @@ export default {
data() {
return {
chart: null,
- activeMaterial: '' // 新增:记录选中物料状态,和第二个组件逻辑对齐,样式不变
+ activeData: this.relatedData.relatedMon || [], // 核心激活数据集(默认月度,与第二个组件一致)
+ activeMaterial: '' // 记录选中物料状态,与第二个组件统一
}
},
watch: {
- itemData: {
- handler(newValue, oldValue) {
- // this.updateChart()
+ // 对齐第二个组件:深度监听relatedData变化,同步更新激活数据集
+ relatedData: {
+ handler(newVal) {
+ this.activeData = newVal.relatedMon || [];
},
- deep: true // 若对象内属性变化需触发,需加 deep: true(原有逻辑保留,样式不变)
+ immediate: true, // 挂载时立即执行
+ deep: true // 深度监听对象内部变化
}
},
// 新增:4个指标对应的计算属性,精准筛选itemData中的数据(仅数据逻辑,样式不变)
computed: {
// 1. 包材数据:从itemData中筛选,兜底值统一
packagingData() {
- return this.itemData.find(item => (item.name || '').includes('包材')) || {
+ return this.activeData.find(item => (item.name || '').includes('包材')) || {
targetValue: 0,
value: 0,
completed: 0,
@@ -106,7 +110,7 @@ export default {
},
// 2. 备件丶机物料数据:精准筛选
sparePartsData() {
- return this.itemData.find(item => (item.name || '').includes('备品、机物料')) || {
+ return this.activeData.find(item => (item.name || '').includes('备品丶机物料')) || {
targetValue: 0,
value: 0,
completed: 0,
@@ -115,7 +119,7 @@ export default {
},
// 3. 折旧数据:精准筛选
depreciationData() {
- return this.itemData.find(item => (item.name || '').includes('折旧')) || {
+ return this.activeData.find(item => (item.name || '').includes('折旧')) || {
targetValue: 0,
value: 0,
completed: 0,
@@ -124,7 +128,7 @@ export default {
},
// 4. 其他数据:精准筛选
otherData() {
- return this.itemData.find(item => (item.name || '').includes('其他')) || {
+ return this.activeData.find(item => (item.name || '').includes('其他')) || {
targetValue: 0,
value: 0,
completed: 0,
@@ -137,6 +141,17 @@ export default {
// this.$nextTick(() => this.updateChart())
},
methods: {
+ handleChange(value) {
+ console.log('Tab 切换值:', value);
+ // 根据tab值更新激活数据集
+ if (value === 'month') {
+ this.activeData = this.relatedData.relatedMon || [];
+ } else {
+ this.activeData = this.relatedData.relatedTotal || [];
+ }
+ console.log('当前激活数据集:', this.activeData);
+ },
+
handleDashboardClick(material) {
// 1. 记录选中状态(新增,和第二个组件逻辑对齐,样式不变)
this.activeMaterial = material;
diff --git a/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue b/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue
index 9f0d3434..3de07e70 100644
--- a/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue
+++ b/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue
@@ -8,7 +8,7 @@
- 采购单价·元/㎡
+ 采购单价·元/m³
@@ -17,7 +17,7 @@
- 产量·万㎡
+ 产量·吨
@@ -26,7 +26,7 @@
- 单耗·m³/㎡
+ 单耗·吨/m³
diff --git a/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue b/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue
index 4e7c5db7..8a062529 100644
--- a/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue
+++ b/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue
@@ -8,7 +8,7 @@
- 采购单价·元/㎡
+ 采购单价·元/吨
@@ -16,7 +16,7 @@
- 产量·万㎡
+ 产量·吨
@@ -24,7 +24,7 @@
- 单耗·吨/m²
+ 单耗·吨/吨
@@ -87,12 +87,21 @@ export default {
computed: {
// 1. 硅砂数据:从激活数据集中筛选,兜底值与第二个组件统一
unitPriceData() {
+ console.log('');
+ console.log(this.activeData.find(item => (item.name || '').includes('采购单价')) || {
+ targetValue: 0,
+ value: 0,
+ completed: 0,
+ diffValue: 0
+ },'yyyy')
return this.activeData.find(item => (item.name || '').includes('采购单价')) || {
targetValue: 0,
value: 0,
completed: 0,
diffValue: 0
};
+
+
},
// 2. 海砂数据:精准筛选
productData() {
@@ -126,6 +135,8 @@ export default {
// 对齐第二个组件:监听物料数据变化,同步更新激活数据集
relatedData: {
handler(newVal) {
+ console.log(this.relatedData,'relatedData');
+
this.activeData = newVal.relatedMon || [];
},
immediate: true, // 组件挂载时立即执行
diff --git a/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysisDian.vue b/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysisDian.vue
index 3328292e..bdd20092 100644
--- a/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysisDian.vue
+++ b/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysisDian.vue
@@ -8,7 +8,7 @@
- 采购单价·元/㎡
+ 采购单价·元/度
@@ -16,7 +16,7 @@
- 产量·万㎡
+ 产量·吨
@@ -24,7 +24,7 @@
- 单耗·度/m²
+ 单耗·度/吨
diff --git a/src/views/home/productionCostAnalysisComponents/relatedIndicatorsAnalysis.vue b/src/views/home/productionCostAnalysisComponents/relatedIndicatorsAnalysis.vue
index f32fa1fd..41a70b16 100644
--- a/src/views/home/productionCostAnalysisComponents/relatedIndicatorsAnalysis.vue
+++ b/src/views/home/productionCostAnalysisComponents/relatedIndicatorsAnalysis.vue
@@ -45,7 +45,7 @@
- 制造成本·元/㎡
+ 制造费用·元/㎡
@@ -137,7 +137,7 @@ export default {
},
// 5. 制造成本数据:精准筛选
manufacturingCostData() {
- return this.activeData.find(item => item.name === "制造成本") || {
+ return this.activeData.find(item => item.name === "制造费用") || {
targetValue: 0,
value: 0,
completed: 0,
diff --git a/src/views/home/productionCostAnalysisComponents/yearThreeRelatedMetricsPro.vue b/src/views/home/productionCostAnalysisComponents/yearThreeRelatedMetricsPro.vue
index 4de7bedd..33bbf6af 100644
--- a/src/views/home/productionCostAnalysisComponents/yearThreeRelatedMetricsPro.vue
+++ b/src/views/home/productionCostAnalysisComponents/yearThreeRelatedMetricsPro.vue
@@ -5,9 +5,9 @@
-
+
- 备品、机物料·元/㎡
+ 备品丶机物料·元/㎡
@@ -76,7 +76,7 @@ export default {
computed: {
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
sparePartsData() {
- return this.relatedData.find(item => (item.name || '').includes('备品、机物料')) || {
+ return this.relatedData.find(item => (item.name || '').includes('备品丶机物料')) || {
targetValue: 0,
value: 0,
completed: 0,
diff --git a/src/views/home/salesVolumeAnalysisComponents/monthlyThreeRelatedMetrics.vue b/src/views/home/salesVolumeAnalysisComponents/monthlyThreeRelatedMetrics.vue
index 43f33f98..ef308aac 100644
--- a/src/views/home/salesVolumeAnalysisComponents/monthlyThreeRelatedMetrics.vue
+++ b/src/views/home/salesVolumeAnalysisComponents/monthlyThreeRelatedMetrics.vue
@@ -7,7 +7,7 @@
- 双镀成本·万㎡
+ 双镀成本·元/㎡
- 双镀均价·万㎡
+ 双镀均价·元/㎡
- 双镀毛利·万㎡
+ 双镀毛利·万元
- 双镀成本·万㎡
+ 双镀成本·元/㎡
- 双镀均价·万㎡
+ 双镀均价·元/㎡
- 双镀毛利·万㎡
+ 双镀毛利·万元
item.name === "制造成本")) || {
targetValue: 0,
value: 0,
completed: 0,
diff --git a/src/views/home/totalProfitComponents/totalOverview.vue b/src/views/home/totalProfitComponents/totalOverview.vue
index ffe9e905..fbc6f771 100644
--- a/src/views/home/totalProfitComponents/totalOverview.vue
+++ b/src/views/home/totalProfitComponents/totalOverview.vue
@@ -69,7 +69,7 @@ export default {
*/
factoryData() { // 整合原始数据 + 计算flag
return {
- completeRate: this.totalData.proportion ? Number(this.monData.proportion).toFixed(2) : 0,
+ completeRate: this.totalData.proportion ? Number(this.totalData.proportion) : 0,
diff: this.totalData.diffValue,
real: this.totalData.value,
target: this.totalData.targetValue,
diff --git a/src/views/home/unitPriceAnalysisComponents/financeCostsContainer.vue b/src/views/home/unitPriceAnalysisComponents/financeCostsContainer.vue
index 0c4b6db8..3249a0cc 100644
--- a/src/views/home/unitPriceAnalysisComponents/financeCostsContainer.vue
+++ b/src/views/home/unitPriceAnalysisComponents/financeCostsContainer.vue
@@ -6,6 +6,7 @@
:style="{ opacity: isLeftTransparent ? 1 : 0.3 }" ref="leftTitleWrapper">
{{ name }}
+ 点击切换
@@ -13,14 +14,15 @@
:style="{ opacity: isRightTransparent ? 1 : 0.3 }" ref="rightTitleWrapper">
{{ nameTwo }}
+ 点击切换
-
-
- 点击切换
-
- 点击切换
+
+
+
+
+
@@ -65,17 +67,17 @@ export default {
},
mounted() {
// 初始化定位
- this.positionChangeText();
- // 监听窗口大小变化,重新定位
- window.addEventListener('resize', this.positionChangeText);
- },
- updated() {
- // 数据更新后重新定位(如标题文字变化)
- this.positionChangeText();
+ // this.positionChangeText();
+ // // 监听窗口大小变化,重新定位
+ // window.addEventListener('resize', this.positionChangeText);
},
+ // updated() {
+ // // 数据更新后重新定位(如标题文字变化)
+ // this.positionChangeText();
+ // },
beforeDestroy() {
// 移除监听
- window.removeEventListener('resize', this.positionChangeText);
+ // window.removeEventListener('resize', this.positionChangeText);
},
methods: {
handleLeftClick() {
@@ -83,14 +85,14 @@ export default {
this.isRightTransparent = false;
this.$emit('switchTab', 'cus');
// 切换后重新定位
- this.$nextTick(() => this.positionChangeText());
+ // this.$nextTick(() => this.positionChangeText());
},
handleRightClick() {
this.isLeftTransparent = false;
this.isRightTransparent = true;
this.$emit('switchTab', 'pro');
// 切换后重新定位
- this.$nextTick(() => this.positionChangeText());
+ // this.$nextTick(() => this.positionChangeText());
},
/**
* Tab点击事件:切换状态 + 向父组件传值
@@ -301,11 +303,13 @@ export default {
// 左侧切换文字(可选:单独样式调整)
.left-change-text {
+ left: 70%;
/* 若需要可添加单独样式 */
}
// 右侧切换文字(可选:单独样式调整)
.right-change-text {
+ left: 18%;
/* 若需要可添加单独样式 */
}
diff --git a/src/views/home/unitPriceAnalysisComponents/monthlyRelatedMetrics.vue b/src/views/home/unitPriceAnalysisComponents/monthlyRelatedMetrics.vue
index 29158e71..079318fe 100644
--- a/src/views/home/unitPriceAnalysisComponents/monthlyRelatedMetrics.vue
+++ b/src/views/home/unitPriceAnalysisComponents/monthlyRelatedMetrics.vue
@@ -18,7 +18,7 @@