| | |
| | | }, |
| | | methods: { |
| | | getInvestmentFunds() { |
| | | getProjectInvestmentFundingById(this.investmentForm.projectId ).then(res => { |
| | | getProjectInvestmentFundingById(this.investmentFundsForm.projectId ).then(res => { |
| | | this.investmentFundsForm = res.data; |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.investmentFundsForm.id = this.$route.query.projectId; |
| | | this.investmentFundsForm.projectId = this.$route.query.projectId; |
| | | const investmentFundsForm = Cookies.get("investmentFundsForm"); |
| | | const projectForm = Cookies.get("projectForm"); |
| | | |
| | | const parsedInvestmentForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null; |
| | | const parsedInvestmentFundsForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null; |
| | | const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; |
| | | if (parsedInvestmentForm) { |
| | | this.investmentFundsForm = parsedInvestmentForm |
| | | if (parsedInvestmentFundsForm) { |
| | | this.investmentFundsForm = parsedInvestmentFundsForm |
| | | } |
| | | if (parsedProjectForm){ |
| | | this.projectForm = parsedProjectForm |
| | | } |
| | | // 如果路由存在id且没有缓存,视为编辑或查看,调用api |
| | | if (this.investmentFundsForm.projectId && !parsedInvestmentForm) { |
| | | if (this.investmentFundsForm.projectId && !parsedInvestmentFundsForm) { |
| | | this.getInvestmentFunds(); |
| | | } |
| | | }, |