From 46e29a50eccda9f92fb2feeb18fa8a0ea4092587 Mon Sep 17 00:00:00 2001 From: luohairen <3399054449@qq.com> Date: 星期四, 28 十一月 2024 22:31:38 +0800 Subject: [PATCH] 页面传参bug --- src/views/projectManage/plan/planRecord.vue | 39 ++++++++++++++++++++------------------- 1 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/views/projectManage/plan/planRecord.vue b/src/views/projectManage/plan/planRecord.vue index f2022b1..a28215b 100644 --- a/src/views/projectManage/plan/planRecord.vue +++ b/src/views/projectManage/plan/planRecord.vue @@ -1,8 +1,8 @@ <template> <div class="app-container"> <el-container> - <el-header v-show="planRecordData && planRecordData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planRecordData.projectName }}</el-header> - <h4 v-show="planRecordData && planRecordData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ planRecordData.projectCode }}</h4> + <el-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ projectInfoData.projectName }}</el-header> + <h4 v-show="projectInfoData && projectInfoData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ projectInfoData.projectCode }}</h4> <el-main> <el-card shadow="hover"> <el-row :gutter="20"> @@ -102,7 +102,7 @@ data() { return { // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁 - planRecordData: {}, + projectInfoData: {}, // 鏈堝害璁″垝鏁版嵁 monthRecords: [], // 瀛e害璁″垝鏁版嵁 @@ -114,13 +114,13 @@ methods: { // 椤甸潰鍔犺浇 search() { - this.getPlanRecordData(this.planRecordData.id); + this.getPlanRecordData(this.projectInfoData.id); }, // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏 - getPlanInfoData() { + getProjectInfoData() { // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁 - this.planRecordData = this.$route.query.data - this.getPlanRecordData(this.planRecordData.id); + this.projectInfoData = this.$route.query.data + this.getPlanRecordData(this.projectInfoData.id); }, // 鑾峰彇椤圭洰璁″垝璁板綍鏁版嵁 getPlanRecordData(id) { @@ -136,13 +136,13 @@ handleAddMonthPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planRecordData.id, + projectInfoId: this.projectInfoData.id, planTimeFlag: 0 } // 鍒ゆ柇鏈堝害璁″垝鏄惁涓虹┖ - if (this.monthRecords.length === 0){ + if (this.monthRecords.length === 0) { planRecordData.id = 0; - }else { + } else { planRecordData.id = this.monthRecords[this.monthRecords.length - 1].id; } // 鏂板涓�琛岃褰� @@ -154,13 +154,13 @@ handleAddSeasonPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planRecordData.id, + projectInfoId: this.projectInfoData.id, planTimeFlag: 1 } // 鍒ゆ柇瀛e害璁″垝鏄惁涓虹┖ - if (this.seasonRecords.length === 0){ + if (this.seasonRecords.length === 0) { planRecordData.id = 0; - }else { + } else { planRecordData.id = this.seasonRecords[this.seasonRecords.length - 1].id; } // 鏂板涓�琛岃褰� @@ -172,13 +172,13 @@ handleAddYearPlan() { let planRecordData = { id: undefined, - projectInfoId: this.planRecordData.id, + projectInfoId: this.projectInfoData.id, planTimeFlag: 2 } // 鍒ゆ柇骞村害璁″垝鏄惁涓虹┖ - if (this.yearRecords.length === 0){ + if (this.yearRecords.length === 0) { planRecordData.id = 0; - }else { + } else { planRecordData.id = this.yearRecords[this.yearRecords.length - 1].id; } // 鏂板涓�琛岃褰� @@ -192,7 +192,7 @@ path: '/projectManage/planInfo', query: { data: row, - planRecordData: this.planRecordData + projectInfoData: this.projectInfoData } }) }, @@ -204,17 +204,18 @@ }, // 鏌ョ湅椤圭洰璁″垝椤� handleCheckPlanInfo(row) { + console.log(this.projectInfoData); this.$router.push({ path: '/projectManage/planInfoCheck', query: { data: row, - planRecordData: this.planRecordData + projectInfoData: this.projectInfoData } }) } }, created() { - this.getPlanInfoData(); + this.getProjectInfoData(); }, }; </script> -- Gitblit v1.8.0