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 |  120 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 87 insertions(+), 33 deletions(-)

diff --git a/src/views/service/serviceContract/AddServiceContractDialog.vue b/src/views/service/serviceContract/AddServiceContractDialog.vue
index cebf667..ff2b7dc 100644
--- a/src/views/service/serviceContract/AddServiceContractDialog.vue
+++ b/src/views/service/serviceContract/AddServiceContractDialog.vue
@@ -305,7 +305,14 @@
             </div>
           </div>
           <div class="product-view">
-            <CommonFormTableView :show-summary="showSummary" :product-table-list="productTableList" />
+            <CommonFormTableView
+              :show-summary="showSummary"
+              :product-table-list="productTableList"
+              @inputContent="inputContent"
+              @addProductClick="addProductClick"
+              @emptyProductClick="emptyProductClick"
+              @recalculateProductClick="recalculateProductClick"
+            />
           </div>
           <!-- 閫夋嫨瀹℃壒娴佺▼ -->
           <!-- <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div>
@@ -438,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: {
@@ -475,7 +478,9 @@
       contactId: this.editCommonConfig.infomation.contactId,
       saleChanceId: this.editCommonConfig.infomation.saleChanceId,
       contractId: this.editCommonConfig.infomation.salesDetailsId,
-      quotationId: this.editCommonConfig.infomation.quotationId
+      quotationId: this.editCommonConfig.infomation.quotationId,
+      tableData: [],
+      productId: 1
     }
   },
   created() {
@@ -495,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) => {
@@ -620,11 +625,9 @@
       } else if (value === "contract") {
         this.editSelCommonConfig.title = "閿�鍞槑缁嗗崟"
         this.editSelCommonConfig.editVisible = true
-        this.editSelCommonConfig.tableInfomation = [...this.salesDetailsList]
       } else if (value === "quotation") {
         this.editSelCommonConfig.title = "鎶ヤ环鍗�"
         this.editSelCommonConfig.editVisible = true
-        this.editSelCommonConfig.tableInfomation = [...this.quotationList]
       }
     },
     selClient(row, value) {
@@ -670,37 +673,88 @@
     // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡
     setFormatClick() {},
     setTableForm() {
-      this.productTableList = {
-        tableData: [
+      if (this.editConfig.title === "鏂板缓") {
+        this.tableData = [
           {
-            id: "1",
-            productName: "涓婃捣鏈夐檺鍏徃",
-            other0: "ZDYBD03-1",
-            other1: "12",
-            other2: "5.00",
-            other4: "3.00",
-            other3: "2.00"
+            id: 1,
+            Amount: 0,
+            IsSale: true,
+            MaterialMode: "",
+            MinInventory: 0,
+            Name: "",
+            Number: "",
+            PurchaseType: "",
+            SalePrice: 0,
+            Unit: ""
           }
-        ],
+        ]
+      } else {
+        this.tableData = this.editConfig.infomation.products
+      }
+      this.productTableList = {
+        tableData: this.tableData,
         tableColumn: [
           { label: "#", prop: "id", width: 40 },
-          { label: "浜у搧鍚嶇О", prop: "productName", input: true, isRequird: true },
-          { label: "浜у搧缂栧彿", prop: "other0" },
+          { label: "浜у搧鍚嶇О", prop: "Name", input: true, isRequird: true },
+          { label: "浜у搧缂栧彿", prop: "Number" },
           { label: "鏈嶅姟寮�濮嬫棩", prop: "other5", date: true, isRequird: true, min: 100 },
           { label: "鏈嶅姟鍒版湡鏃�", prop: "other6", date: true, isRequird: true, min: 100 },
-          { label: "鏁伴噺", prop: "other1", input: true, isRequird: true },
-          { label: "鍚◣鍗曚环", prop: "other9", input: true },
-          { label: "涓嶅惈绋庡崟浠�", prop: "other7", input: true },
-          { label: "鎶樻墸鐜�(%)", prop: "other6", input: true },
-          { label: "鎶樻墸棰�", prop: "other2" },
-          { label: "绋�(閿�鍞�)", prop: "other7", input: true },
-          { label: "瀹為檯鍚◣鍗曚环", prop: "other3" },
-          { label: "涓嶅惈绋庨噾棰�", prop: "other4" },
-          { label: "浠风◣鍚堣", prop: "other3", input: true },
+          { label: "鏁伴噺", prop: "Amount", input: true, isRequird: true },
+          { label: "閿�鍞崟浠�", prop: "Unit", 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: "",
+        MinInventory: 0,
+        Name: "",
+        Number: "",
+        PurchaseType: "",
+        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