luohairen
2024-11-28 41a73f66d30a9bdd854d3998f8975bb3685feeab
src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
@@ -243,7 +243,7 @@
  },
  methods: {
    getInvestmentFunds() {
      getProjectInvestmentFundingById(this.investmentForm.projectId ).then(res => {
      getProjectInvestmentFundingById(this.investmentFundsForm.projectId ).then(res => {
        this.investmentFundsForm = res.data;
      });
    },
@@ -270,20 +270,20 @@
    },
  },
  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();
    }
  },