From f4ed5ae8873f65c36b5cf37be264f6ec1e154647 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期三, 20 三月 2024 19:36:58 +0800
Subject: [PATCH] 合并分支冲突解决

---
 src/views/supplierManage/supplier/AddNewProduct.vue |   69 +++++++++++++++++++++-------------
 1 files changed, 42 insertions(+), 27 deletions(-)

diff --git a/src/views/supplierManage/supplier/AddNewProduct.vue b/src/views/supplierManage/supplier/AddNewProduct.vue
index 3b493de..5c73f04 100644
--- a/src/views/supplierManage/supplier/AddNewProduct.vue
+++ b/src/views/supplierManage/supplier/AddNewProduct.vue
@@ -15,10 +15,13 @@
         <div class="basic-info-view">
           <CommonFormTableView
             ref="productTable"
+            :addTypeIdMultiple="true"
             :product-table-list="productTableList"
             :detail-enter="detailEnter"
+            :isOperate="isOperate"
             @inputContent="inputContent"
             @addProductClick="addProductClick"
+            @getSelectArray="getSelectArray"
             @emptyProductClick="emptyProductClick"
             @clearupProduct="clearupProduct"
             @selCommonName="selCommonName"
@@ -63,6 +66,7 @@
       isNoProduct: true,
       supplierId: this.addCommonConfig.infomation.supplierId,
       detailEnter: true,
+      isOperate: true,
       deliveryTime: this.addCommonConfig.infomation.deliveryTime, // 渚涜揣鏃堕暱
       shippingDuration: this.addCommonConfig.infomation.shippingDuration, // 鐗╂祦鏃堕暱
       purchasePrice: this.addCommonConfig.infomation.purchasePrice // 閲囪喘浠锋牸
@@ -144,8 +148,8 @@
       }
       return params
     },
-    handleProduct(item,row){
-      this.editConfig.infomation.id=row.id
+    handleProduct(item, row) {
+      this.editConfig.infomation.id = row.id
     },
     setTableForm() {
       if (this.editConfig.title === "娣诲姞") {
@@ -160,15 +164,16 @@
             number: "",
             price: 0,
             total: 0,
-            supplierId:this.supplierId
+            supplierId: this.supplierId
           }
         ]
       } else {
-        this.tableData = [{ ...this.editConfig.infomation}]
+        this.tableData = [{ ...this.editConfig.infomation }]
         this.detailEnter = true
       }
       this.productTableList = {
         tableData: this.tableData,
+        isReturn: true,
         tableColumn: [
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, width: 250 },
           { label: "浜у搧缂栫爜", prop: "number" },
@@ -182,36 +187,46 @@
     },
     // 浜у搧鍒楄〃杈撳叆
     inputContent(val, prop, row) {
-      this.productId = row.productId
-      this.deliveryTime = row.deliveryTime
-      this.shippingDuration = row.shippingDuration
-      this.purchasePrice = row.purchasePrice
       this.tableData.map((item) => {
-        if (item.productId === row.productId) {
+        if (item.number === row.number) {
           item[prop] = val
-          item.supplierId =Number(this.supplierId)
-          item.deliveryTime = this.deliveryTime
-          item.shippingDuration = this.shippingDuration
-          item.purchasePrice = this.purchasePrice
+          item.supplierId = Number(this.supplierId)
         }
       })
     },
     // 浜у搧鏂板
     addProductClick() {
-      this.productId++
-      this.tableData.push({
-        productId: this.productId,
-        id: 0,
-        amount: 0,
-        desc: "",
-        name: "",
-        number: "",
-        purchasePrice: 0,
-        total: 0,
-        deliveryTime: 0,
-        shippingDuration: 0,
-        supplierId: this.supplierId
-      })
+      // this.productId++
+      // this.tableData.push({
+      //   productId: this.productId,
+      //   id: 0,
+      //   amount: 0,
+      //   desc: "",
+      //   name: "",
+      //   number: "",
+      //   purchasePrice: 0,
+      //   total: 0,
+      //   deliveryTime: 0,
+      //   shippingDuration: 0,
+      //   supplierId: this.supplierId
+      // })
+    },
+    // 鏂板鏂瑰紡淇敼
+    getSelectArray(val, index) {
+      console.log(val, "ddd99999")
+      if (this.tableData.length == 1 && this.tableData[0].number.length == 0) {
+        this.tableData = []
+      }
+      if (index < this.tableData.length) {
+        this.tableData.splice(index, 1)
+        val.map((item, ind) => {
+          this.tableData.splice(index + ind, 0, item)
+        })
+      } else {
+        this.tableData = this.tableData.concat(val)
+      }
+      this.productTableList.tableData = this.tableData
+      // this.showSummary.show = true
     },
     //  浜у搧娓呯┖
     emptyProductClick() {

--
Gitblit v1.8.0