luohairen
2024-11-28 c09e46ade0e6dc4851c286962a60e20259ccbdad
src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
@@ -212,7 +212,7 @@
      sys_administrative_divisions: []
    };
  },
  created() {
  mounted() {
    this.investmentForm.projectId = this.$route.query.projectId
    // 从Cookies中获取缓存数据
    const investmentForm = Cookies.get("investmentForm");
@@ -223,9 +223,12 @@
    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();
@@ -242,6 +245,10 @@
    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() {