修改
This commit is contained in:
@@ -73,6 +73,10 @@ export default {
|
||||
relatedTotal: [] // 成本累计数据(数组格式,存储各成本项)
|
||||
})
|
||||
},
|
||||
factory: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -151,6 +155,7 @@ export default {
|
||||
console.log('成本组件挂载时的激活数据:', this.activeData);
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleChange(value) {
|
||||
console.log('Tab 切换值:', value);
|
||||
// 根据 Tab 值更新当前激活的数据集
|
||||
@@ -167,15 +172,16 @@ export default {
|
||||
handleDashboardClick(material,path) {
|
||||
// 1. 记录选中状态
|
||||
this.activeMaterial = material;
|
||||
|
||||
console.log(`点击了【${material}】,月份:${this.month}`, '成本数据:', this.activeData);
|
||||
// alert(this.$route.query.factory)
|
||||
console.log(`点击了【${material}】,月份:${this.month}`, '成本数据:', this.activeData, this.$route.query.factory);
|
||||
|
||||
// 2. 优化路由跳转:month放入query中(修复原代码参数错误)
|
||||
this.$router.push({
|
||||
path: path,
|
||||
query: {
|
||||
name: material,
|
||||
month: this.month
|
||||
month: this.month,
|
||||
factory: this.$route.query.factory ? this.$route.query.factory : this.factory
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user