From 64c13167e17fd04aec02a93c2bc1803050a097d1 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 28 十一月 2024 03:04:52 +0800 Subject: [PATCH] 改用mounted --- src/views/projectEngineering/projectLibrary/component/investmentFunds.vue | 11 +++++++---- src/views/projectEngineering/projectLibrary/component/BasicInfo.vue | 2 +- src/views/projectEngineering/projectLibrary/component/InvestInfo.vue | 15 +++++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue index 11e6cbf..1319e34 100644 --- a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue @@ -390,7 +390,7 @@ }]; }, }, - created() { + mounted() { this.projectForm.id = this.$route.query.projectId; const projectForm = Cookies.get("projectForm"); if (projectForm) { diff --git a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue index 0e7abec..beda437 100644 --- a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue @@ -212,7 +212,7 @@ sys_administrative_divisions: [] }; }, - created() { + mounted() { this.investmentForm.projectId = this.$route.query.projectId // 浠嶤ookies涓幏鍙栫紦瀛樻暟鎹� const investmentForm = Cookies.get("investmentForm"); @@ -223,9 +223,12 @@ const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; // 璁剧疆investment鍜宲rojectForm瀵硅薄 - if(parsedInvestmentForm) this.investmentForm = parsedInvestmentForm; - if(parsedProjectForm) this.projectForm = parsedProjectForm; - + if(parsedInvestmentForm) { + this.investmentForm = parsedInvestmentForm; + } + if(parsedProjectForm) { + this.projectForm = parsedProjectForm; + } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛橈紝瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api if (this.investmentForm.projectId && !investmentForm) { this.getInvestment(); @@ -242,6 +245,10 @@ getInvestment() { getProjectInvestmentInfoById(this.investmentForm.projectId ).then(res => { this.investmentForm = res.data; + this.investmentForm.constructionLocation = this.projectForm.area; + this.investmentForm.detailedAddress = this.projectForm.projectAddress; + this.investmentForm.plannedStartDate = this.projectForm.planStartTime; + this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime; }); }, submit() { diff --git a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue index f8caabf..9896aa8 100644 --- a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue +++ b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue @@ -269,16 +269,19 @@ } }, }, - created() { + mounted() { this.investmentFundsForm.id = this.$route.query.projectId; const investmentFundsForm = Cookies.get("investmentFundsForm"); const projectForm = Cookies.get("projectForm"); const parsedInvestmentForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null; const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; - - this.investmentFundsForm = parsedInvestmentForm || {}; - this.projectForm = parsedProjectForm || {}; + if (parsedInvestmentForm) { + this.investmentFundsForm = parsedInvestmentForm + } + if (parsedProjectForm){ + this.projectForm = parsedProjectForm + } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api if (this.investmentFundsForm.projectId && !parsedInvestmentForm) { this.getInvestmentFunds(); -- Gitblit v1.8.0