From 1fa6ac40e2ce16e1174cec9ca538d45eeb660fdc Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 05 六月 2025 18:17:56 +0800
Subject: [PATCH] 工作台

---
 src/views/projectEngineering/projectLibrary/component/investmentFunds.vue |  325 +++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 259 insertions(+), 66 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
index c0ae3d7..97a0272 100644
--- a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
+++ b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
@@ -1,169 +1,253 @@
 <template>
   <div class="basic-info">
-    <el-form ref="demoFormRef" :disabled="disabled" :model="investmentFunds" class="dialog_form">
+    <el-form ref="demoFormRef" :disabled="disabled" :model="investmentFundsForm" :rules="rules" class="dialog_form">
       <!-- 淇濇寔鍘熸湁妯℃澘鍐呭涓嶅彉 -->
       <el-row :gutter="20">
         <el-col :span="6">
-          <el-form-item label="椤圭洰鎬绘姇璧勯" label-width="130px" prop="fundsType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.totalInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item label="椤圭洰鎬绘姇璧勯" label-width="130px" prop="totalInvestment" required style="width: 100%">
+            <el-input v-model.trim="totalInvestment" class="item" clearable disabled style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="椤圭洰鏈噾" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.principal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.principal" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="涓�銆佹斂搴滄姇璧�" label-width="130px" prop="projectType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.governmentInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.governmentInvestmentTotal" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="锛堜竴锛変腑澶姇璧�" label-width="130px" prop="projectType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.centralInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="centralInvestmentTotal" class="item" clearable disabled style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="6">
-          <el-form-item label="1.涓ぎ棰勭畻鎶曡祫" label-width="130px" prop="fundsType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.centralBudgetInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item label="1.涓ぎ棰勭畻鎶曡祫" label-width="160px" prop="fundsType" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.centralBudgetInvestment" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="2.涓ぎ璐㈡斂" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.centralFiscalInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.centralFiscalInvestment" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item class="items" label="3.涓ぎ涓撻」鍊哄埜绛归泦鐨勪笓椤瑰缓璁捐祫閲�" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.centralSpecialBondInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item class="items" label="3.涓ぎ涓撻」鍊哄埜绛归泦鐨勪笓椤瑰缓璁捐祫閲�" label-width="130px" prop="investmentType"
+                        style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.centralSpecialBondInvestment" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
-        <el-col :span="18">
-          <el-form-item label="4.涓ぎ涓撻」寤鸿鍩洪噾" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.centralSpecialFundInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+        <el-col :span="6">
+          <el-form-item label="4.涓ぎ涓撻」寤鸿鍩洪噾" label-width="180px" prop="engineering" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.centralSpecialFundInvestment" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="5.瓒呴暱鏈熺壒鍒浗鍊鸿祫閲�" label-width="150px" prop="engineering" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.nationalDebt" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="6.2023骞村鍙戝浗鍊鸿祫閲�" label-width="150px" prop="engineering" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.additionalNationalDebt" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="锛堜簩锛夌渷绾ф姇璧�" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.provincialInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="provincialInvestmentTotal" class="item" clearable disabled style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="6">
-          <el-form-item label="1.鐪侀绠楀唴鎶曡祫" label-width="130px" prop="fundsType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.provincialBudgetInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item label="1.鐪侀绠楀唴鎶曡祫" label-width="160px" prop="fundsType" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.provincialBudgetInvestment" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="2.鐪佽储鏀挎�у缓璁炬姇璧�" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.provincialFiscalInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.provincialFiscalInvestment" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="3.鐪佷笓椤瑰缓璁捐祫閲�" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.provincialSpecialFundInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.provincialSpecialFundInvestment" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="锛堜笁锛夊競(宸�)鎶曡祫" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.cityInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="cityInvestmentTotal" class="item" clearable disabled style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="6">
-          <el-form-item label="1.甯�(宸�)棰勭畻鍐呮姇璧�" label-width="130px" prop="fundsType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.cityBudgetInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item label="1.甯�(宸�)棰勭畻鍐呮姇璧�" label-width="170px" prop="fundsType" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.cityBudgetInvestment" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="2.甯�(宸�)璐㈡斂鎬ф姇璧�" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.cityFiscalInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.cityFiscalInvestment" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="3.甯�(宸�)涓撻」璧勯噾" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.citySpecialFundInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.citySpecialFundInvestment" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="锛堝洓锛夊幙(甯傘�佸尯)鎶曡祫" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.countyInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="countyInvestmentTotal" class="item" disabled style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="6">
-          <el-form-item label="1.鍖�(鍘�)棰勭畻鍐呮姇璧�" label-width="130px" prop="fundsType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.countyBudgetInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item label="1.鍖�(鍘�)棰勭畻鍐呮姇璧�" label-width="180px" prop="fundsType" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.countyBudgetInvestment" class="item" clearable style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item class="items" label="2.鍖猴紙鍘匡級璐㈡斂鎬у缓璁捐祫閲�" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.countyFiscalInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+          <el-form-item label="2.鍖猴紙鍘匡級璐㈡斂鎬у缓璁捐祫閲�" label-width="170px" prop="investmentType"
+                        style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.countyFiscalInvestment" class="item" clearable style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="3.鍖�(鍘�)涓撻」璧勯噾" label-width="130px" prop="investmentType" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.countySpecialFundInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.countySpecialFundInvestment" class="item" clearable style="width: 90%"
+                      type="number" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="6">
+          <el-form-item label="4.鍦版柟鏀垮簻涓撻」鍊哄埜" label-width="180px" prop="engineering" style="width: 100%">
+            <el-input v-model.trim="investmentFundsForm.deptBond" class="item" clearable style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="浜屻�佸浗鍐呰捶娆�" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.domesticLoanTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.domesticLoanTotal" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="閾惰璐锋" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.bankLoan" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.bankLoan" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="涓夈�佸鍟嗘姇璧�" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.foreignInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.foreignInvestmentTotal" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="鍥涖�佷紒涓氳嚜绛�" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.enterpriseSelfRaisedTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.enterpriseSelfRaisedTotal" class="item" clearable style="width: 90%"
+                      maxlength="255" placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="18">
           <el-form-item label="浜斻�佸叾浠栨姇璧�" label-width="130px" prop="engineering" style="width: 100%">
-            <el-input v-model.trim="investmentFunds.otherInvestmentTotal" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" />
+            <el-input v-model.trim="investmentFundsForm.otherInvestmentTotal" class="item" clearable maxlength="255" style="width: 90%"
+                      placeholder="璇疯緭鍏�"/>
+            <span class="money">涓囧厓</span>
           </el-form-item>
         </el-col>
       </el-row>
+
     </el-form>
   </div>
 </template>
 
 <script>
+import Cookies from "js-cookie";
+import {
+  addProjectInvestmentFunding,
+  editProjectInvestmentFunding,
+  getProjectInvestmentFundingById
+} from "@/api/projectEngineering/projectInvestmentFunding";
+import {editProject} from "@/api/projectEngineering/projectInfo";
+
 export default {
   name: 'InvestmentFundsForm',
   props: {
@@ -171,46 +255,151 @@
       type: Boolean,
       default: false,
       required: true
+    },
+  },
+  computed: {
+    totalInvestment() {
+      this.investmentFundsForm.totalInvestment =
+        parseFloat(this.investmentFundsForm.governmentInvestmentTotal ? this.investmentFundsForm.governmentInvestmentTotal : 0) +
+        this.centralInvestmentTotal +
+        this.provincialInvestmentTotal +
+        this.cityInvestmentTotal +
+        this.countyInvestmentTotal +
+        parseFloat(this.investmentFundsForm.domesticLoanTotal ? this.investmentFundsForm.domesticLoanTotal : 0) +
+        parseFloat(this.investmentFundsForm.bankLoan ? this.investmentFundsForm.bankLoan : 0) +
+        parseFloat(this.investmentFundsForm.foreignInvestmentTotal ? this.investmentFundsForm.foreignInvestmentTotal : 0) +
+        parseFloat(this.investmentFundsForm.enterpriseSelfRaisedTotal ? this.investmentFundsForm.enterpriseSelfRaisedTotal : 0) +
+        parseFloat(this.investmentFundsForm.otherInvestmentTotal ? this.investmentFundsForm.otherInvestmentTotal : 0)
+      return this.investmentFundsForm.totalInvestment;
+    },
+    centralInvestmentTotal() {
+      this.investmentFundsForm.centralInvestmentTotal =
+        parseFloat(this.investmentFundsForm.centralBudgetInvestment ? this.investmentFundsForm.centralBudgetInvestment : 0) +
+        parseFloat(this.investmentFundsForm.centralFiscalInvestment ? this.investmentFundsForm.centralFiscalInvestment : 0) +
+        parseFloat(this.investmentFundsForm.centralSpecialBondInvestment ? this.investmentFundsForm.centralSpecialBondInvestment : 0) +
+        parseFloat(this.investmentFundsForm.centralSpecialFundInvestment ? this.investmentFundsForm.centralSpecialFundInvestment : 0) +
+        parseFloat(this.investmentFundsForm.nationalDebt ? this.investmentFundsForm.nationalDebt : 0) +
+        parseFloat(this.investmentFundsForm.additionalNationalDebt ? this.investmentFundsForm.additionalNationalDebt : 0)
+      return this.investmentFundsForm.centralInvestmentTotal;
+    },
+    provincialInvestmentTotal() {
+      this.investmentFundsForm.provincialInvestmentTotal =
+        parseFloat(this.investmentFundsForm.provincialBudgetInvestment ? this.investmentFundsForm.provincialBudgetInvestment : 0) +
+        parseFloat(this.investmentFundsForm.provincialFiscalInvestment ? this.investmentFundsForm.provincialFiscalInvestment : 0) +
+        parseFloat(this.investmentFundsForm.provincialSpecialFundInvestment ? this.investmentFundsForm.provincialSpecialFundInvestment : 0)
+      return this.investmentFundsForm.provincialInvestmentTotal;
+    },
+    cityInvestmentTotal() {
+      this.investmentFundsForm.cityInvestmentTotal =
+        parseFloat(this.investmentFundsForm.cityBudgetInvestment ? this.investmentFundsForm.cityBudgetInvestment : 0) +
+        parseFloat(this.investmentFundsForm.cityFiscalInvestment ? this.investmentFundsForm.cityFiscalInvestment : 0) +
+        parseFloat(this.investmentFundsForm.citySpecialFundInvestment ? this.investmentFundsForm.citySpecialFundInvestment : 0)
+      return this.investmentFundsForm.cityInvestmentTotal;
+    },
+    countyInvestmentTotal() {
+      this.investmentFundsForm.countyInvestmentTotal =
+        parseFloat(this.investmentFundsForm.countyBudgetInvestment ? this.investmentFundsForm.countyBudgetInvestment : 0) +
+        parseFloat(this.investmentFundsForm.countyFiscalInvestment ? this.investmentFundsForm.countyFiscalInvestment : 0) +
+        parseFloat(this.investmentFundsForm.countySpecialFundInvestment ? this.investmentFundsForm.countySpecialFundInvestment : 0) +
+        parseFloat(this.investmentFundsForm.deptBond ? this.investmentFundsForm.deptBond : 0)
+      return this.investmentFundsForm.countyInvestmentTotal;
     }
   },
   data() {
     return {
-      investmentFunds: {
-        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: ''
+      projectForm: {},
+      rules: {
+
+      },
+      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: ''
       }
     };
   },
   methods: {
-
+    getInvestmentFunds() {
+      getProjectInvestmentFundingById(this.$route.query.projectId).then(res => {
+        this.investmentFundsForm = res.data;
+      });
+    },
+    submit() {
+      if (!this.projectForm.id) {
+        this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅")
+      } else {
+        this.investmentFundsForm.projectId = this.projectForm.id;
+        if (this.investmentFundsForm.id) {
+          editProjectInvestmentFunding(this.investmentFundsForm).then(response => {
+            this.$modal.msgSuccess("淇敼鎴愬姛");
+            //璺宠浆鍒颁笅涓粍浠�
+            this.$emit('toNext', 3);
+          });
+        } else {
+          addProjectInvestmentFunding(this.investmentFundsForm).then(response => {
+            this.$modal.msgSuccess("鏂板鎴愬姛");
+            this.investmentFundsForm.id = response.data
+            //璺宠浆鍒颁笅涓粍浠�
+            this.$emit('toNext', 3);
+          });
+        }
+      }
+    },
   },
-  created() {
+  mounted() {
+    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) {
+      this.projectForm = parsedProjectForm
+    }
+    // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api
+    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>
 
@@ -242,9 +431,13 @@
     width: 20px;
   }
 }
-
+.money {
+  font-size: 12px;
+  margin-left: 2px;
+  color: #909399;
+}
 .items {
-  ::v-deep  .el-form-item__label {
+  ::v-deep .el-form-item__label {
     line-height: 16px;
     text-align: right;
   }

--
Gitblit v1.8.0