From 79b0a1a4f81ec7750e6deeb02bc9865785b6fee9 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 17 八月 2023 19:52:46 +0800
Subject: [PATCH] bug修复

---
 src/views/service/serviceContract/AddServiceContractDialog.vue |   59 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/src/views/service/serviceContract/AddServiceContractDialog.vue b/src/views/service/serviceContract/AddServiceContractDialog.vue
index e6d5459..ff2b7dc 100644
--- a/src/views/service/serviceContract/AddServiceContractDialog.vue
+++ b/src/views/service/serviceContract/AddServiceContractDialog.vue
@@ -308,7 +308,10 @@
             <CommonFormTableView
               :show-summary="showSummary"
               :product-table-list="productTableList"
+              @inputContent="inputContent"
               @addProductClick="addProductClick"
+              @emptyProductClick="emptyProductClick"
+              @recalculateProductClick="recalculateProductClick"
             />
           </div>
           <!-- 閫夋嫨瀹℃壒娴佺▼ -->
@@ -442,17 +445,13 @@
       memberOptions: [],
       contractTypeOptions: [], // 鍚堝悓绫诲瀷
       contractStatusOptions: [], // 鍚堝悓鐘舵��
-      currencyOptions: [
-        { value: "1", label: "浜烘皯甯�(楼)" },
-        { value: "2", label: "鑻遍晳(拢)" },
-        { value: "3", label: "娆у厓(鈧�)" }
-      ], // 甯佺
+      currencyOptions: [{ id: 1, name: "浜烘皯甯�" }], // 甯佺
       approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
       productTableList: {},
       showSummary: {
         show: true,
         total: true,
-        sumProp: ["other1", "other2", "other3", "other4"],
+        sumProp: ["Amount", "Unit", "total"],
         mergeNumber: 3
       },
       editSelectClientConfig: {
@@ -480,7 +479,8 @@
       saleChanceId: this.editCommonConfig.infomation.saleChanceId,
       contractId: this.editCommonConfig.infomation.salesDetailsId,
       quotationId: this.editCommonConfig.infomation.quotationId,
-      tableData: []
+      tableData: [],
+      productId: 1
     }
   },
   created() {
@@ -500,7 +500,7 @@
             this.memberOptions = res.data.member
             this.contractTypeOptions = res.data.serviceContractType
             this.contractStatusOptions = res.data.serviceContractStatus
-            this.currencyOptions = res.data.currency
+            // this.currencyOptions = res.data.currency
           }
         })
         .catch((err) => {
@@ -676,6 +676,7 @@
       if (this.editConfig.title === "鏂板缓") {
         this.tableData = [
           {
+            id: 1,
             Amount: 0,
             IsSale: true,
             MaterialMode: "",
@@ -698,15 +699,30 @@
           { label: "浜у搧缂栧彿", prop: "Number" },
           { label: "鏈嶅姟寮�濮嬫棩", prop: "other5", date: true, isRequird: true, min: 100 },
           { label: "鏈嶅姟鍒版湡鏃�", prop: "other6", date: true, isRequird: true, min: 100 },
-          { label: "鏁伴噺", prop: "amount", input: true, isRequird: true },
+          { label: "鏁伴噺", prop: "Amount", input: true, isRequird: true },
           { label: "閿�鍞崟浠�", prop: "Unit", input: true },
-          { label: "浠风◣鍚堣", prop: "other3", input: true },
+          { label: "浠风◣鍚堣", prop: "total", input: true },
           { label: "鎻忚堪", prop: "other8" }
         ]
       }
     },
+    // 浜у搧鍒楄〃杈撳叆
+    inputContent(val, prop, row) {
+      console.log("aaaaaaaa")
+      console.log(val, prop)
+      this.productId = row.id
+      this.tableData.map((item) => {
+        if (item.id === row.id) {
+          item[prop] = val
+        }
+      })
+      console.log(this.tableData)
+    },
+    // 浜у搧鏂板
     addProductClick() {
+      this.productId++
       this.tableData.push({
+        id: this.productId,
         Amount: 0,
         IsSale: true,
         MaterialMode: "",
@@ -717,7 +733,28 @@
         SalePrice: 0,
         Unit: ""
       })
-    }
+    },
+    //  浜у搧娓呯┖
+    emptyProductClick() {
+      this.productId = 1
+      this.tableData = [
+        {
+          id: 1,
+          Amount: 0,
+          IsSale: true,
+          MaterialMode: "",
+          MinInventory: 0,
+          Name: "",
+          Number: "",
+          PurchaseType: "",
+          SalePrice: 0,
+          Unit: ""
+        }
+      ]
+      this.productTableList.tableData = this.tableData
+    },
+    // 浜у搧閲嶇畻
+    recalculateProductClick() {}
   }
 }
 </script>

--
Gitblit v1.8.0