From 7adbf0551f6a6b307e66cdd6537ab45fc5a2bf11 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 29 十一月 2024 04:00:10 +0800
Subject: [PATCH] bug修复和页面查询

---
 src/views/projectEngineering/projectLibrary/component/investmentFunds.vue |   71 +++++++++++++++++------------------
 1 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
index 6149bb8..7f6ee41 100644
--- a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
+++ b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
@@ -205,45 +205,45 @@
       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;
       });
     },
@@ -252,7 +252,7 @@
         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("淇敼鎴愬姛");
             //璺宠浆鍒颁笅涓粍浠�
@@ -270,25 +270,24 @@
     },
   },
   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>

--
Gitblit v1.8.0