From 96fdf32bd5612b6c16dcbcc8352a9f54adcc8e7e Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 18 八月 2023 16:26:59 +0800
Subject: [PATCH] 產品相關及bug修復

---
 src/views/other/payment/collectionPlan/AddCollectionPlan.vue |  195 ++++++++++++++++++------------------------------
 1 files changed, 75 insertions(+), 120 deletions(-)

diff --git a/src/views/other/payment/collectionPlan/AddCollectionPlan.vue b/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
index 64b634c..bf6b7cd 100644
--- a/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
+++ b/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
@@ -13,8 +13,8 @@
         <div class="collection-view">
           <div class="label">鏀舵璁″垝绫诲瀷</div>
           <el-select v-model="editConfig.infomation.collectionType" size="mini">
-            <el-option label="璁″垝鏀舵鏃ユ湡" value="1"></el-option>
-            <el-option label="椤圭洰鐘舵��" value="2"></el-option>
+            <el-option label="璁″垝鏀舵鏃ユ湡" :value="1"></el-option>
+            <el-option label="椤圭洰鐘舵��" :value="2"></el-option>
           </el-select>
         </div>
         <div class="collection-view">
@@ -191,11 +191,13 @@
       sourceId: this.editCommonConfig.infomation.id,
       principalId: 0,
       planAmount: 0, // 璁″垝閲戦
-      firstDate: this.getCurrentDate(1)
+      firstDate: this.getCurrentDate(1),
+      collectionType: 1,
+      tableInfomation: []
     }
   },
   created() {
-    console.log(this.editCommonConfig.sourceType)
+    console.log(this.editCommonConfig)
     this.setData()
     this.setTableForm()
     this.getCommonData()
@@ -204,7 +206,7 @@
     // 璁剧疆鍒濆鍊�
     setData() {
       this.editConfig.infomation = {
-        collectionType: "1",
+        collectionType: this.collectionType,
         moneyType: "浜烘皯甯�",
         amount: this.amount.toFixed(2)
       }
@@ -261,63 +263,9 @@
       this.editConfig.visible = false
     },
     setTableForm() {
+      this.setTableInfomation(this.firstDate)
       this.tableData = {
-        tableInfomation: [
-          {
-            amount: this.amount,
-            amountReceivable: this.amount * 0.3,
-            amountReceived: 0,
-            amountTotal: 0,
-            collectionDate: this.getCurrentDate(1),
-            collectionType: 0,
-            fileId: 0,
-            id: 0,
-            moneyType: "浜烘皯甯�",
-            percent: 30,
-            principalId: this.principalId,
-            remark: "",
-            sourceId: this.sourceId,
-            sourceType: this.sourceType,
-            status: 1,
-            term: 1
-          },
-          {
-            amount: this.amount,
-            amountReceivable: this.amount * 0.5,
-            amountReceived: 0,
-            amountTotal: 0,
-            collectionDate: this.getCurrentDate(2),
-            collectionType: 0,
-            fileId: 0,
-            id: 0,
-            moneyType: "浜烘皯甯�",
-            percent: 50,
-            principalId: this.principalId,
-            remark: "",
-            sourceId: this.sourceId,
-            sourceType: this.sourceType,
-            status: 1,
-            term: 2
-          },
-          {
-            amount: this.amount,
-            amountReceivable: this.amount * 0.2,
-            amountReceived: 0,
-            amountTotal: 0,
-            collectionDate: this.getCurrentDate(3),
-            collectionType: 0,
-            fileId: 0,
-            id: 0,
-            moneyType: "浜烘皯甯�",
-            percent: 20,
-            principalId: this.principalId,
-            remark: "",
-            sourceId: this.sourceId,
-            sourceType: this.sourceType,
-            status: 1,
-            term: 3
-          }
-        ],
+        tableInfomation: this.tableInfomation,
         tableColumn: [
           { label: "鎿嶄綔", prop: "operate", width: 60 },
           { label: "鏈熸", prop: "term", inputNumber: true, width: 90 },
@@ -327,6 +275,65 @@
           { label: "澶囨敞", prop: "remark", input: true }
         ]
       }
+    },
+    setTableInfomation(date) {
+      console.log(this.sourceId)
+      this.tableInfomation = [
+        {
+          amount: this.amount,
+          amountReceivable: this.amount * 0.3,
+          amountReceived: 0,
+          amountTotal: 0,
+          collectionDate: this.setDate(date, 0),
+          collectionType: this.editConfig.infomation.collectionType,
+          fileId: 0,
+          id: 0,
+          moneyType: "浜烘皯甯�",
+          percent: 30,
+          principalId: this.principalId,
+          remark: "",
+          sourceId: this.sourceId,
+          sourceType: this.sourceType,
+          status: 1,
+          term: 1
+        },
+        {
+          amount: this.amount,
+          amountReceivable: this.amount * 0.5,
+          amountReceived: 0,
+          amountTotal: 0,
+          collectionDate: this.setDate(date, 1),
+          collectionType: this.editConfig.infomation.collectionType,
+          fileId: 0,
+          id: 0,
+          moneyType: "浜烘皯甯�",
+          percent: 50,
+          principalId: this.principalId,
+          remark: "",
+          sourceId: this.sourceId,
+          sourceType: this.sourceType,
+          status: 1,
+          term: 2
+        },
+        {
+          amount: this.amount,
+          amountReceivable: this.amount * 0.2,
+          amountReceived: 0,
+          amountTotal: 0,
+          collectionDate: this.setDate(date, 2),
+          collectionType: this.editConfig.infomation.collectionType,
+          fileId: 0,
+          id: 0,
+          moneyType: "浜烘皯甯�",
+          percent: 20,
+          principalId: this.principalId,
+          remark: "",
+          sourceId: this.sourceId,
+          sourceType: this.sourceType,
+          status: 1,
+          term: 3
+        }
+      ]
     },
     // 閲嶇畻
     recalculateClick() {
@@ -341,7 +348,7 @@
             amountReceived: 0,
             amountTotal: 0,
             collectionDate: this.setDate(this.firstDate, 0),
-            collectionType: 0,
+            collectionType: this.editConfig.infomation.collectionType,
             fileId: 0,
             id: 0,
             moneyType: "浜烘皯甯�",
@@ -362,7 +369,7 @@
             amountReceived: 0,
             amountTotal: 0,
             collectionDate: this.setDate(this.firstDate, 0),
-            collectionType: 0,
+            collectionType: this.editConfig.infomation.collectionType,
             fileId: 0,
             id: 0,
             moneyType: "浜烘皯甯�",
@@ -380,7 +387,7 @@
             amountReceived: 0,
             amountTotal: 0,
             collectionDate: this.setDate(this.firstDate, 1),
-            collectionType: 0,
+            collectionType: this.editConfig.infomation.collectionType,
             fileId: 0,
             id: 0,
             moneyType: "浜烘皯甯�",
@@ -394,62 +401,8 @@
           }
         ]
       } else if (this.allTerms === 3) {
-        this.tableData.tableInfomation = [
-          {
-            amount: this.amount,
-            amountReceivable: this.amount * 0.3,
-            amountReceived: 0,
-            amountTotal: 0,
-            collectionDate: this.setDate(this.firstDate, 0),
-            collectionType: 0,
-            fileId: 0,
-            id: 0,
-            moneyType: "浜烘皯甯�",
-            percent: 30,
-            principalId: this.principalId,
-            remark: "",
-            sourceId: this.sourceId,
-            sourceType: this.sourceType,
-            status: 1,
-            term: 1
-          },
-          {
-            amount: this.amount,
-            amountReceivable: this.amount * 0.5,
-            amountReceived: 0,
-            amountTotal: 0,
-            collectionDate: this.setDate(this.firstDate, 1),
-            collectionType: 0,
-            fileId: 0,
-            id: 0,
-            moneyType: "浜烘皯甯�",
-            percent: 50,
-            principalId: this.principalId,
-            remark: "",
-            sourceId: this.sourceId,
-            sourceType: this.sourceType,
-            status: 1,
-            term: 2
-          },
-          {
-            amount: this.amount,
-            amountReceivable: this.amount * 0.2,
-            amountReceived: 0,
-            amountTotal: 0,
-            collectionDate: this.setDate(this.firstDate, 2),
-            collectionType: 0,
-            fileId: 0,
-            id: 0,
-            moneyType: "浜烘皯甯�",
-            percent: 20,
-            principalId: this.principalId,
-            remark: "",
-            sourceId: this.sourceId,
-            sourceType: this.sourceType,
-            status: 1,
-            term: 3
-          }
-        ]
+        this.setTableInfomation(this.firstDate)
+        this.tableData.tableInfomation = this.tableInfomation
       }
     },
     delClick(row) {
@@ -482,6 +435,8 @@
     },
     principalClick(val) {
       this.principalId = val
+      this.setTableInfomation(this.firstDate)
+      this.tableData.tableInfomation = this.tableInfomation
     }
   }
 }

--
Gitblit v1.8.0