| | |
| | | // 尝试解析JSON数据 |
| | | const parsedInvestmentForm = investmentForm ? JSON.parse(investmentForm) : null; |
| | | const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; |
| | | console.log(parsedInvestmentForm) |
| | | // 设置investment和projectForm对象 |
| | | if(parsedInvestmentForm) { |
| | | this.investmentForm = parsedInvestmentForm; |
| | |
| | | this.investmentForm.plannedStartDate = this.projectForm.planStartTime; |
| | | this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime; |
| | | } |
| | | |
| | | this.investmentForm.projectId = this.projectForm.id; |
| | | }, |
| | | beforeDestroy() { |
| | | if(Object.keys(this.investmentForm).length !==0) localStorage.setItem("investmentForm", JSON.stringify(this.investmentForm)); |
| | |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | watch: { |
| | | investmentForm: { |
| | | deep: true, |
| | | handler(newVal) { |
| | | this.$emit('investInfoForm', newVal) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }; |