From 441f8436a70c22fba6f25154f2f38a072c85b76b Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 27 二月 2024 18:45:02 +0800
Subject: [PATCH] 公共选择产品弹窗相关页面修改

---
 src/views/service/serviceContract/AddServiceContractDialog.vue |   50 +++++++++++++++++++++++++++++++++++---------------
 1 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/src/views/service/serviceContract/AddServiceContractDialog.vue b/src/views/service/serviceContract/AddServiceContractDialog.vue
index f387206..40e96db 100644
--- a/src/views/service/serviceContract/AddServiceContractDialog.vue
+++ b/src/views/service/serviceContract/AddServiceContractDialog.vue
@@ -368,9 +368,11 @@
           <div class="product-view">
             <CommonFormTableView
               :show-summary="showSummary"
+              :addTypeIdMultiple="true"
               :product-table-list="productTableList"
               @inputContent="inputContent"
               @addProductClick="addProductClick"
+              @getSelectArray="getSelectArray"
               @emptyProductClick="emptyProductClick"
               @recalculateProductClick="recalculateProductClick"
               @clearupProduct="clearupProduct"
@@ -800,8 +802,9 @@
       }
       this.productTableList = {
         tableData: this.tableData,
+        isReturn: true,
         tableColumn: [
-          { label: "#", prop: "productId", width: 40 },
+          // { label: "#", prop: "productId", width: 40 },
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
@@ -813,27 +816,44 @@
     },
     // 浜у搧鍒楄〃杈撳叆
     inputContent(val, prop, row) {
-      this.productId = row.productId
+      // this.productId = row.productId
       this.tableData.map((item) => {
-        if (item.productId === row.productId) {
+        if (item.number === row.number) {
           item[prop] = val
         }
       })
     },
     // 浜у搧鏂板
     addProductClick() {
-      this.productId++
-      this.tableData.push({
-        productId: this.productId,
-        id: 0,
-        amount: 0,
-        desc: "",
-        name: "",
-        number: "",
-        price: 0,
-        total: 0,
-        unit: ""
-      })
+      // this.productId++
+      // this.tableData.push({
+      //   productId: this.productId,
+      //   id: 0,
+      //   amount: 0,
+      //   desc: "",
+      //   name: "",
+      //   number: "",
+      //   price: 0,
+      //   total: 0,
+      //   unit: ""
+      // })
+      // this.showSummary.show = true
+    },
+    // 鏂板鏂瑰紡淇敼
+    getSelectArray(val) {
+      // if (val.length > 0) {
+      //   val.map((item, index) => {
+      //     item.productId = this.tableData.length + index + 1
+      //   })
+      // }
+      console.log(this.tableData, "ddddaaaqqq")
+      if (this.tableData.length == 1 && this.tableData[0].number.length == 0) {
+        console.log("ssss")
+        this.tableData = []
+      }
+      this.tableData = this.tableData.concat(val)
+      console.log(this.tableData, "55555ddddaaaqqq")
+      this.productTableList.tableData = this.tableData
       this.showSummary.show = true
     },
     //  浜у搧娓呯┖

--
Gitblit v1.8.0