From 0088d05b69bea0f7877a8ca1f1a0d850b20ee097 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 25 十二月 2024 11:15:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/projectEngineering/projectLibrary/component/investmentFunds.vue |   11 +++
 src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue      |   18 ++++++
 src/api/projectEngineering/projectInfo.js                                 |    8 ++
 src/views/projectEngineering/projectLibrary/component/BasicInfo.vue       |    2 
 src/views/projectEngineering/projectLibrary/component/legalPerson.vue     |   10 +++
 src/views/projectEngineering/projectLibrary/component/InvestInfo.vue      |   11 +++
 src/views/projectEngineering/projectLibrary/projectDetails.vue            |   48 ++++++++++++++-
 src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue   |   16 +++++
 8 files changed, 119 insertions(+), 5 deletions(-)

diff --git a/src/api/projectEngineering/projectInfo.js b/src/api/projectEngineering/projectInfo.js
index 1afcc70..c78ede9 100644
--- a/src/api/projectEngineering/projectInfo.js
+++ b/src/api/projectEngineering/projectInfo.js
@@ -65,3 +65,11 @@
   })
 }
 
+// 缂栬緫鏂板椤圭洰
+export function editProject(data) {
+  return request({
+    url: '/project/info/editProject',
+    method: 'post',
+    data: data
+  })
+}
diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
index 0dade99..b08c10f 100644
--- a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
@@ -422,6 +422,7 @@
       getProject(id).then(res => {
         this.projectForm = res.data;
         this.$emit('updateIsShow', true);
+
       });
     },
     getApprovalList() {
@@ -532,6 +533,7 @@
             this.largeCategory = labels.join(',');
           }
         }, 1000);
+        this.$emit('basicInfoForm', newVal)
       },
       deep: true
     }
diff --git a/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue b/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue
index 43b95c1..9e69851 100644
--- a/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue
@@ -76,10 +76,26 @@
     if (this.$route.query.projectId && !parsedDocumentsInfoForm) {
       this.getDocumentsInfo();
     }
+
+    this.documentsInfoForm.projectId = this.projectForm.id;
   },
   beforeDestroy() {
     if(Object.keys(this.documentsInfoForm).length !==0) localStorage.setItem("documentsInfoForm", JSON.stringify(this.documentsInfoForm));
   },
+  watch: {
+    documentsInfoForm:{
+      deep: true,
+      handler(newVal) {
+        this.$emit('documentsInfoForm', newVal)
+      }
+    },
+    fileList: {
+      deep: true,
+      handler(newVal) {
+        this.documentsInfoForm.fileList = newVal
+      }
+    }
+  }
 
 };
 </script>
diff --git a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
index d1f5d7f..7b1b6e0 100644
--- a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
@@ -219,7 +219,6 @@
     // 灏濊瘯瑙f瀽JSON鏁版嵁
     const parsedInvestmentForm = investmentForm ? JSON.parse(investmentForm) : null;
     const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
-    console.log(parsedInvestmentForm)
     // 璁剧疆investment鍜宲rojectForm瀵硅薄
     if(parsedInvestmentForm) {
       this.investmentForm = parsedInvestmentForm;
@@ -236,6 +235,8 @@
       this.investmentForm.plannedStartDate = this.projectForm.planStartTime;
       this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime;
     }
+
+    this.investmentForm.projectId = this.projectForm.id;
   },
   beforeDestroy() {
     if(Object.keys(this.investmentForm).length !==0) localStorage.setItem("investmentForm", JSON.stringify(this.investmentForm));
@@ -273,6 +274,14 @@
         }
       }
     },
+  },
+  watch: {
+    investmentForm: {
+      deep: true,
+      handler(newVal) {
+        this.$emit('investInfoForm', newVal)
+      }
+    }
   }
 
 };
diff --git a/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue b/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
index 344a6c5..b5ad508 100644
--- a/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
@@ -164,6 +164,7 @@
   editProjectInvestmentPolicyCompliance,
   getProjectInvestmentPolicyComplianceById
 } from "@/api/projectEngineering/projectInvestmentPolicyCompliance";
+import {newline} from "js-beautify/js/src/javascript/acorn";
 
 export default {
   name: 'PolicyComplianceForm',
@@ -176,6 +177,7 @@
   },
   data() {
     return {
+      projectForm: {},
       policyInfoForm: {
         // id: '',
         // projectId: '',
@@ -219,6 +221,8 @@
       this.policyInfoForm.informationIsTrue= true;
       this.policyInfoForm.notBannedOrControlledProject = true;
     }
+
+    this.policyInfoForm.projectId = this.projectForm.id;
   },
   beforeDestroy() {
     if(Object.keys(this.policyInfoForm).length !==0) localStorage.setItem("policyInfoForm", JSON.stringify(this.policyInfoForm));
@@ -259,6 +263,20 @@
       }
     }
   },
+  watch: {
+    policyInfoForm: {
+      deep: true,
+      handler(newVal) {
+        this.$emit('policyInfoForm', newVal)
+      }
+    },
+    fileList: {
+      deep: true,
+      handler(newVal) {
+        this.policyInfoForm.fileList = newVal
+      }
+    }
+  }
 };
 </script>
 
diff --git a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
index 7f6ee41..e506821 100644
--- a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
+++ b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
@@ -197,6 +197,7 @@
   editProjectInvestmentFunding,
   getProjectInvestmentFundingById
 } from "@/api/projectEngineering/projectInvestmentFunding";
+import {editProject} from "@/api/projectEngineering/projectInfo";
 
 export default {
   name: 'InvestmentFundsForm',
@@ -285,10 +286,20 @@
     if (this.$route.query.projectId&& !parsedInvestmentFundsForm) {
       this.getInvestmentFunds();
     }
+
+    this.investmentFundsForm.projectId = this.projectForm.id;
   },
   beforeDestroy() {
     if(Object.keys(this.investmentFundsForm).length !==0) localStorage.setItem("investmentFundsForm", JSON.stringify(this.investmentFundsForm));
   },
+  watch: {
+    investmentFundsForm: {
+      deep: true,
+      handler(newVal) {
+        this.$emit('investmentFundsForm', newVal)
+      }
+    }
+  }
 }
 </script>
 
diff --git a/src/views/projectEngineering/projectLibrary/component/legalPerson.vue b/src/views/projectEngineering/projectLibrary/component/legalPerson.vue
index b2ffd25..e45c2c6 100644
--- a/src/views/projectEngineering/projectLibrary/component/legalPerson.vue
+++ b/src/views/projectEngineering/projectLibrary/component/legalPerson.vue
@@ -177,6 +177,7 @@
   },
   data() {
     return {
+      projectForm: {},
       legalPersonForm: {
         // id: '',
         // totalInvestment: '',
@@ -219,6 +220,7 @@
       this.getProjectUnitRegistrationInfo();
     }
 
+    this.legalPersonForm.projectId = this.projectForm.id;
   },
   beforeDestroy() {
     if(Object.keys(this.legalPersonForm).length !==0)  localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm));
@@ -250,6 +252,14 @@
         }
       }
     },
+  },
+  watch: {
+    legalPersonForm: {
+      deep: true,
+      handler(newVal) {
+        this.$emit('legalPersonForm', newVal)
+      }
+    }
   }
 }
 </script>
diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue
index 46e1b6b..1dc8685 100644
--- a/src/views/projectEngineering/projectLibrary/projectDetails.vue
+++ b/src/views/projectEngineering/projectLibrary/projectDetails.vue
@@ -20,6 +20,12 @@
       :disabled="disabled"
       @toNext="changeTable"
       @updateIsShow="updateIsShow"
+      @basicInfoForm="basicInfoForm"
+      @investInfoForm="investInfoForm"
+      @investmentFundsForm="investmentFundsForm"
+      @legalPersonForm="legalPersonForm"
+      @policyInfoForm="policyInfoForm"
+      @documentsInfoForm="documentsInfoForm"
       :isShow="isShow"
       class="full-width custom-height"
     />
@@ -31,9 +37,10 @@
         @click="submit(0)"
         >鑽夌</el-button
       >
-      <el-button class="save-button" type="primary" @click="submit(1)"
-        >淇濆瓨</el-button
-      >
+<!--      <el-button class="save-button" type="primary" @click="submit(1)"-->
+<!--        >淇濆瓨</el-button>-->
+      <el-button class="save-button" type="primary" @click="saveProject"
+      >淇濆瓨</el-button>
       <el-button class="reset-button" @click="reset">閲嶇疆</el-button>
       <!-- <el-button v-else class="cancel-button" @click="cancel">鍙栨秷</el-button> -->
     </div>
@@ -47,6 +54,7 @@
 import LegalPerson from "@/views/projectEngineering/projectLibrary/component/legalPerson";
 import PolicyInfo from "@/views/projectEngineering/projectLibrary/component/PolicyInfo";
 import DocumentsInfo from "@/views/projectEngineering/projectLibrary/component/DocumentsInfo";
+import { editProject } from "@/api/projectEngineering/projectInfo";
 
 export default {
   name: "ProjectDetails",
@@ -57,6 +65,7 @@
       disabled: false,
       projectForm: {},
       componentName: BasicInfo,
+      projectId: null,
       TABS_DATA: [
         {
           label: "椤圭洰绠$悊鍩虹淇℃伅",
@@ -96,13 +105,38 @@
     updateIsShow(newValue) {
       this.isShow = newValue;
     },
+    basicInfoForm(data) {
+      this.projectForm.projectInfoForm = data;
+      this.projectId = data.id;
+    },
+    investInfoForm(data) {
+      this.projectForm.projectInvestmentInfoForm = data;
+      this.projectForm.projectInvestmentInfoForm.projectId = this.projectId;
+    },
+    investmentFundsForm(data) {
+      this.projectForm.projectInvestmentFundingForm = data;
+      this.projectForm.projectInvestmentFundingForm.projectId = this.projectId;
+    },
+    documentsInfoForm(data){
+      this.projectForm.documentInfoForm = data;
+      this.projectForm.documentInfoForm.projectId = this.projectId;
+    },
+    legalPersonForm(data) {
+      this.projectForm.projectUnitRegistrationInfoForm = data;
+      this.projectForm.projectUnitRegistrationInfoForm.projectId = this.projectId;
+    },
+    policyInfoForm(data) {
+      this.projectForm.projectInvestmentPolicyComplianceForm = data;
+      this.projectForm.projectInvestmentPolicyComplianceForm.projectId = this.projectId;
+    },
     handleClick(tabTarget) {
       this.componentName = this.TABS_DATA[tabTarget.index].componentName;
-      
+      console.log(this.projectForm);
     },
     changeTable(index) {
       this.componentName = this.TABS_DATA[index].componentName;
       this.currentTab = this.TABS_DATA[index].value;
+
     },
     submit(usedStatus) {
       this.$refs.childRef.submit(usedStatus);
@@ -110,6 +144,12 @@
     reset() {
       this.$refs.childRef.reset();
     },
+    saveProject() {
+      editProject(this.projectForm).then((res) => {
+        this.$message.success("淇濆瓨鎴愬姛");
+      })
+      this.$router.push('/projectEngineering/project/projectLibrary')
+    }
   },
   mounted() {
     if (this.$route.query.disabled) {

--
Gitblit v1.8.0