| | |
| | | } |
| | | }, |
| | | }, |
| | | 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(); |