| | |
| | | type: Boolean, |
| | | default: false, |
| | | required: true |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | projectForm: {}, |
| | | investmentFundsForm: { |
| | | id: '', |
| | | projectId: '', |
| | | totalInvestment: '', |
| | | principal: '', |
| | | governmentInvestmentTotal: '', |
| | | centralInvestmentTotal: '', |
| | | centralBudgetInvestment: '', |
| | | centralFiscalInvestment: '', |
| | | centralSpecialBondInvestment: '', |
| | | centralSpecialFundInvestment: '', |
| | | provincialInvestmentTotal: '', |
| | | provincialBudgetInvestment: '', |
| | | provincialFiscalInvestment: '', |
| | | provincialSpecialFundInvestment: '', |
| | | cityInvestmentTotal: '', |
| | | cityBudgetInvestment: '', |
| | | cityFiscalInvestment: '', |
| | | citySpecialFundInvestment: '', |
| | | countyInvestmentTotal: '', |
| | | countyBudgetInvestment: '', |
| | | countyFiscalInvestment: '', |
| | | countySpecialFundInvestment: '', |
| | | domesticLoanTotal: '', |
| | | bankLoan: '', |
| | | foreignInvestmentTotal: '', |
| | | enterpriseSelfRaisedTotal: '', |
| | | otherInvestmentTotal: '' |
| | | // id: '', |
| | | // projectId: '', |
| | | // totalInvestment: '', |
| | | // principal: '', |
| | | // governmentInvestmentTotal: '', |
| | | // centralInvestmentTotal: '', |
| | | // centralBudgetInvestment: '', |
| | | // centralFiscalInvestment: '', |
| | | // centralSpecialBondInvestment: '', |
| | | // centralSpecialFundInvestment: '', |
| | | // provincialInvestmentTotal: '', |
| | | // provincialBudgetInvestment: '', |
| | | // provincialFiscalInvestment: '', |
| | | // provincialSpecialFundInvestment: '', |
| | | // cityInvestmentTotal: '', |
| | | // cityBudgetInvestment: '', |
| | | // cityFiscalInvestment: '', |
| | | // citySpecialFundInvestment: '', |
| | | // countyInvestmentTotal: '', |
| | | // countyBudgetInvestment: '', |
| | | // countyFiscalInvestment: '', |
| | | // countySpecialFundInvestment: '', |
| | | // domesticLoanTotal: '', |
| | | // bankLoan: '', |
| | | // foreignInvestmentTotal: '', |
| | | // enterpriseSelfRaisedTotal: '', |
| | | // otherInvestmentTotal: '' |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | getInvestmentFunds() { |
| | | getProjectInvestmentFundingById(this.investmentFundsForm.projectId ).then(res => { |
| | | getProjectInvestmentFundingById(this.$route.query.projectId).then(res => { |
| | | this.investmentFundsForm = res.data; |
| | | }); |
| | | }, |
| | |
| | | this.$message.error("请先保存投资管理基本信息") |
| | | } else { |
| | | this.investmentFundsForm.projectId = this.projectForm.id; |
| | | if (this.investmentFundsForm.id != null) { |
| | | if (this.investmentFundsForm.id) { |
| | | editProjectInvestmentFunding(this.investmentFundsForm).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | //跳转到下个组件 |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.investmentFundsForm.projectId = this.$route.query.projectId; |
| | | const investmentFundsForm = Cookies.get("investmentFundsForm"); |
| | | const projectForm = Cookies.get("projectForm"); |
| | | const investmentFundsForm = localStorage.getItem("investmentFundsForm"); |
| | | const projectForm = localStorage.getItem("projectForm"); |
| | | |
| | | const parsedInvestmentFundsForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null; |
| | | const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; |
| | | if (parsedInvestmentFundsForm) { |
| | | this.investmentFundsForm = parsedInvestmentFundsForm |
| | | } |
| | | if (parsedProjectForm){ |
| | | if (parsedProjectForm) { |
| | | this.projectForm = parsedProjectForm |
| | | } |
| | | // 如果路由存在id且没有缓存,视为编辑或查看,调用api |
| | | if (this.investmentFundsForm.projectId && !parsedInvestmentFundsForm) { |
| | | if (this.$route.query.projectId&& !parsedInvestmentFundsForm) { |
| | | this.getInvestmentFunds(); |
| | | } |
| | | }, |
| | | beforeDestroy() { |
| | | Cookies.set("investmentFundsForm", JSON.stringify(this.investmentFundsForm)); |
| | | if(Object.keys(this.investmentFundsForm).length !==0) localStorage.setItem("investmentFundsForm", JSON.stringify(this.investmentFundsForm)); |
| | | }, |
| | | } |
| | | </script> |