From 6004e47724ae7e1a36c194ba6160a474a55e0038 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期四, 28 九月 2023 10:20:50 +0800
Subject: [PATCH] feat: 报价单页列表配置列显隐控制

---
 src/views/sales/quotation/index.vue |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue
index 0dd853d..4ef0aae 100644
--- a/src/views/sales/quotation/index.vue
+++ b/src/views/sales/quotation/index.vue
@@ -33,6 +33,7 @@
               @selContactsClick="selContactsClick"
               @selCommonClick="selCommonClick"
               @getSelectArray="getSelectArray"
+              @selTableCol="selTableCol"
           >
             <template slot="tableButton">
               <el-table-column label="鎿嶄綔" width="90">
@@ -131,7 +132,20 @@
       searchSel: {
         value: "number",
         label: "鎶ヤ环鍗曞彿"
-      }
+      },
+      tableColumn: [
+        { label: "鎶ヤ环鍗曞彿", prop: "number", min: 90, isCommonClick: true ,default:true}, // 鎶ヤ环鍗曞彿
+        { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120, isClientClick: true }, // 瀹㈡埛鍚嶇О
+        { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90, isContactClick: true }, // 鑱旂郴浜哄鍚�
+        { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
+        { label: "鏈夋晥鏈�", prop: "validity_date", min: 100 }, // 淇敼鏃堕棿
+        // { label: "灏忚", prop: "subTotal" }, // 灏忚
+        // { label: "鍚堣", prop: "total" }, // 鍚堣
+        { label: "浜у搧鍚嶇О", prop: "productName", isProductName: true },
+        { label: "鏁伴噺", prop: "productNumber", isProductAmount: true },
+        { label: "浠风◣鍚堣", prop: "priceTax", isProductTotal: true }
+      ],
+      showCol:["鎶ヤ环鍗曞彿", "瀹㈡埛鍚嶇О", "鑱旂郴浜哄鍚�", "閿�鍞礋璐d汉", "鏈夋晥鏈�", "浜у搧鍚嶇О", "鏁伴噺", "浠风◣鍚堣"]
     }
   },
   created() {
@@ -149,19 +163,11 @@
     setTable() {
       this.tableList = {
         tableInfomation: [],
-        tableColumn: [
-          { label: "鎶ヤ环鍗曞彿", prop: "number", min: 90, isCommonClick: true }, // 鎶ヤ环鍗曞彿
-          { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120, isClientClick: true }, // 瀹㈡埛鍚嶇О
-          { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90, isContactClick: true }, // 鑱旂郴浜哄鍚�
-          { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
-          { label: "鏈夋晥鏈�", prop: "validity_date", min: 100 }, // 淇敼鏃堕棿
-          // { label: "灏忚", prop: "subTotal" }, // 灏忚
-          // { label: "鍚堣", prop: "total" }, // 鍚堣
-          { label: "浜у搧鍚嶇О", prop: "productName", isProductName: true },
-          { label: "鏁伴噺", prop: "productNumber", isProductAmount: true },
-          { label: "浠风◣鍚堣", prop: "priceTax", isProductTotal: true }
-        ]
+        allcol: [],
+        showcol: this.showCol,
+        tableColumn:this.setColumnVisible(this.showCol)
       }
+      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
       this.searchOptions = []
       for (let i = 0; i < this.tableList.tableColumn.length; i++) {
         const label = this.tableList.tableColumn[i].label
@@ -169,6 +175,18 @@
         this.searchOptions.push({ value: value, label: label })
       }
     },
+    setColumnVisible(showCol){
+      return  this.tableColumn.map(ele=>{
+        return {
+          ...ele,
+          isShowColumn:showCol.includes(ele.label)
+        }
+      })
+    },
+    selTableCol(val) {
+      this.showcol = val;
+      this.tableList.tableColumn = this.setColumnVisible(val);
+    },
     // 璇锋眰鏁版嵁
     async getData() {
       this.loading = true

--
Gitblit v1.8.0