From c3b53e3dd1923e851e8c618b13e428422376bc60 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期四, 28 九月 2023 13:42:39 +0800
Subject: [PATCH] feat: 服务回访单列表配置列显隐控制

---
 src/views/service/serviceFollowup/index.vue |   38 ++++++++++++++++++++++++++++----------
 1 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/src/views/service/serviceFollowup/index.vue b/src/views/service/serviceFollowup/index.vue
index 1dcf881..59f60ca 100644
--- a/src/views/service/serviceFollowup/index.vue
+++ b/src/views/service/serviceFollowup/index.vue
@@ -32,6 +32,7 @@
             @selContactsClick="selContactsClick"
             @selServiceOrderClick="selServiceOrderClick"
             @getSelectArray="getSelectArray"
+            @selTableCol="selTableCol"
           >
             <template slot="tableButton">
               <el-table-column label="鎿嶄綔" width="60">
@@ -137,7 +138,17 @@
       },
       selValueList: [],
       keyword: "",
-      keywordType: ""
+      keywordType: "",
+      tableColumn: [
+        { label: "鍥炶鍗曠紪鍙�", prop: "number", min: 80, isCommonClick: true, default: true }, // 鍥炶鍗曠紪鍙�
+        { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 130, isClientClick: true }, // 瀹㈡埛鍚嶇О
+        { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚�
+        { label: "瀹㈡埛鏈嶅姟鍗�", prop: "client_service_order", isServiceOrder: true }, // 瀹㈡埛鏈嶅姟鍗�
+        { label: "鍥炶浜�", prop: "member_name" }, // 鍥炶浜�
+        { label: "婊℃剰搴�", prop: "satisfaction_name" } // 婊℃剰搴�
+        // { label: "淇敼鏃堕棿", prop: "modifyTime" } // 淇敼鏃堕棿
+      ],
+      showCol:["鍥炶鍗曠紪鍙�", "瀹㈡埛鍚嶇О", "鑱旂郴浜哄鍚�", "瀹㈡埛鏈嶅姟鍗�", "鍥炶浜�", "婊℃剰搴�"]
     }
   },
   created() {
@@ -153,16 +164,11 @@
     setTable() {
       this.tableList = {
         tableInfomation: [],
-        tableColumn: [
-          { label: "鍥炶鍗曠紪鍙�", prop: "number", min: 80, isCommonClick: true }, // 鍥炶鍗曠紪鍙�
-          { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 130, isClientClick: true }, // 瀹㈡埛鍚嶇О
-          { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚�
-          { label: "瀹㈡埛鏈嶅姟鍗�", prop: "client_service_order", isServiceOrder: true }, // 瀹㈡埛鏈嶅姟鍗�
-          { label: "鍥炶浜�", prop: "member_name" }, // 鍥炶浜�
-          { label: "婊℃剰搴�", prop: "satisfaction_name" } // 婊℃剰搴�
-          // { label: "淇敼鏃堕棿", prop: "modifyTime" } // 淇敼鏃堕棿
-        ]
+        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
@@ -170,6 +176,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