fuliqi
2024-11-28 64c13167e17fd04aec02a93c2bc1803050a097d1
改用mounted
3个文件已修改
28 ■■■■■ 已修改文件
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/InvestInfo.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/investmentFunds.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
@@ -390,7 +390,7 @@
      }];
    },
  },
  created() {
  mounted() {
    this.projectForm.id = this.$route.query.projectId;
    const projectForm = Cookies.get("projectForm");
    if (projectForm) {
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() {
src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
@@ -269,16 +269,19 @@
      }
    },
  },
  created() {
  mounted() {
    this.investmentFundsForm.id = this.$route.query.projectId;
    const investmentFundsForm = Cookies.get("investmentFundsForm");
    const projectForm = Cookies.get("projectForm");
    const parsedInvestmentForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null;
    const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
    this.investmentFundsForm = parsedInvestmentForm || {};
    this.projectForm = parsedProjectForm || {};
    if (parsedInvestmentForm) {
      this.investmentFundsForm = parsedInvestmentForm
    }
    if (parsedProjectForm){
      this.projectForm = parsedProjectForm
    }
    // 如果路由存在id且没有缓存,视为编辑或查看,调用api
    if (this.investmentFundsForm.projectId && !parsedInvestmentForm) {
      this.getInvestmentFunds();