From 1abb22825fe46266bc2634a753164f0878c08e67 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 28 三月 2024 11:16:45 +0800
Subject: [PATCH] 销售明细单新建的表头配置功能问题修改+可编辑表格组件的样式调整+可配置表头之后小计功能的显示逻辑修改

---
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |   56 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 3422c40..72ed3b9 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -584,12 +584,17 @@
       wechatOrderStatusOptions: [], // 寰俊璁㈠崟鐘舵��
       currencyOptions: [{ id: 1, name: "浜烘皯甯�" }], // 甯佺
       approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
-      productTableList: {},
+      productTableList: {
+        allcol: [],
+        showcol:  ["浜у搧鍚嶇О", "瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "閿�鍞崟浠�", "鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","鏁伴噺","浠风◣鍚堣"],
+        tableData: [],
+        tableColumn: []
+      },
       showSummary: {
         show: true,
         total: true,
         sumProp: ["Amount", "total"],
-        mergeNumber: 7
+        mergeNumber: "鎴愭湰鍗曚环"
       },
       editSelectClientConfig: {
         editVisible: false,
@@ -643,20 +648,19 @@
       isBjdRequird : false,
       tableColumn: [
         // { label: "#", prop: "productId", width: 40 },
-        { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, min: 110 },
-        { label: "瑙勬牸", prop: "specs" , },
-        { label: "鍨嬪彿", prop: "type" },
-        { label: "浜у搧缂栧彿", prop: "number" },
-        { label: "鍗曚綅", prop: "unit" },
-        { label: "閿�鍞崟浠�", prop: "price", inputFloat: !this.isBjdRequird, },
-        { label: "鎴愭湰鍗曚环", prop: "cost", input: !this.isBjdRequird },
-        { label: "姣涘埄", prop: "profit" },
-        { label: "姣涘埄鐜�(%)", prop: "margin", min: 90 },
-        { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
-        { label: "浠风◣鍚堣", prop: "total" }
+        { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, min: 110,},
+        { label: "瑙勬牸", prop: "specs" ,  },
+        { label: "鍨嬪彿", prop: "type",  },
+        { label: "浜у搧缂栧彿", prop: "number", },
+        { label: "鍗曚綅", prop: "unit" ,},
+        { label: "閿�鍞崟浠�", prop: "price", inputFloat: !this.isBjdRequird,},
+        { label: "鎴愭湰鍗曚环", prop: "cost", input: !this.isBjdRequird, },
+        { label: "姣涘埄", prop: "profit", },
+        { label: "姣涘埄鐜�(%)", prop: "margin", min: 90,},
+        { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true,},
+        { label: "浠风◣鍚堣", prop: "total", }
       ],
-      showCol: ["浜у搧鍚嶇О", "瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "閿�鍞崟浠�", "鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","鏁伴噺","浠风◣鍚堣"],
-    }
+     }
   },
   mounted(){
     this.getSaleChanceList()
@@ -696,6 +700,7 @@
   watch: {
     "editClientManageConfig.visible"(val) {
       if (val) {
+        this.setTableForm()
         this.formInfo()
       }
     }
@@ -726,8 +731,8 @@
       })
     },
     selTableCol(val) {
-      this.showcol = val
-      this.productTableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+      this.productTableList.showcol = val
+      this.productTableList.tableColumn = this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
     },
     checkValueById(data, id) {  
       for (const key in data) {  
@@ -1152,8 +1157,6 @@
       this.productTableList = {
         tableData: this.tableData,
         isReturn: true,
-        allcol: [],
-        showcol: this.showCol,
         // tableColumn: [
         //   // { label: "#", prop: "productId", width: 40 },
         //   { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, min: 110 },
@@ -1168,16 +1171,19 @@
         //   { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
         //   { label: "浠风◣鍚堣", prop: "total" }
         // ],
-        tableColumn: this.setColumnVisible(this.showCol, this.tableColumn)
+        tableColumn: []
       }
       this.setTableList(this.productTableList)
+      this.productTableList.showcol= ["浜у搧鍚嶇О", "瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "閿�鍞崟浠�", "鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","鏁伴噺","浠风◣鍚堣"],
+      this.productTableList.tableColumn = this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
+      this.productTableList.allcol=["瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "姣涘埄",] 
     },
-    setTableList(productTableList) {
-      productTableList.allcol = productTableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+    setTableList(tableList) {
+      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
       this.searchOptions = []
-      for (let i = 0; i < productTableList.tableColumn.length; i++) {
-        const label = productTableList.tableColumn[i].label
-        const value = productTableList.tableColumn[i].prop
+      for (let i = 0; i < tableList.tableColumn.length; i++) {
+        const label = tableList.tableColumn[i].label
+        const value = tableList.tableColumn[i].prop
         this.searchOptions.push({ value: value, label: label })
       }
     },

--
Gitblit v1.8.0