From 30198d2cac12b753b1bc3a4bb6e696cf57f5f39c Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 17 八月 2023 18:46:59 +0800
Subject: [PATCH] 收款计划、收款单、销售发票列表及新增页面

---
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |  100 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 84 insertions(+), 16 deletions(-)

diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index df5a517..8dcd74b 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -256,7 +256,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 v-if="editConfig.title === '鏂板缓'" class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div>
@@ -369,11 +376,7 @@
       memberOptions: [],
       selSourceOrderOptions: [],
       wechatOrderStatusOptions: [], // 寰俊璁㈠崟鐘舵��
-      currencyOptions: [
-        { value: "1", label: "浜烘皯甯�(楼)" },
-        { value: "2", label: "鑻遍晳(拢)" },
-        { value: "3", label: "娆у厓(鈧�)" }
-      ], // 甯佺
+      currencyOptions: [{ id: 1, name: "浜烘皯甯�" }], // 甯佺
       approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
       productTableList: {},
       showSummary: {
@@ -554,21 +557,86 @@
     // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡
     setFormatClick() {},
     setTableForm() {
+      if (this.editConfig.title === "鏂板缓") {
+        this.tableData = [
+          {
+            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: [],
+        tableData: this.tableData,
         tableColumn: [
           { label: "#", prop: "id", width: 40 },
-          { label: "浜у搧鍚嶇О", prop: "productName", input: true, isRequird: true },
-          { label: "浜у搧缂栧彿", prop: "other0" },
-          { label: "鏁伴噺", prop: "other1", input: true, isRequird: true },
-          { label: "鍚◣鍗曚环", prop: "other6", input: true },
-          { label: "浠风◣鍚堣", prop: "other7", input: true },
-          { label: "鎻忚堪", prop: "other8" },
-          { label: "婧愬崟绫诲瀷", prop: "other2" },
-          { label: "婧愬崟", prop: "other3" }
+          { label: "浜у搧鍚嶇О", prop: "Name", input: true, isRequird: true },
+          { label: "浜у搧缂栧彿", prop: "Number" },
+          { 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