| | |
| | | sys_administrative_divisions: [] |
| | | }; |
| | | }, |
| | | created() { |
| | | mounted() { |
| | | this.investmentForm.projectId = this.$route.query.projectId |
| | | // 从Cookies中获取缓存数据 |
| | | const investmentForm = Cookies.get("investmentForm"); |
| | |
| | | const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; |
| | | |
| | | // 设置investment和projectForm对象 |
| | | 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(); |
| | |
| | | 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() { |