From 74fae92c3fd076359385d27c5ac4e769a38522ab Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期二, 10 十月 2023 15:41:15 +0800
Subject: [PATCH] feat: 销售机会/报价单销售总单/销售子单 列表添加序号

---
 src/views/client/client/index.vue |   40 +++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue
index a1c4e19..357b5fc 100644
--- a/src/views/client/client/index.vue
+++ b/src/views/client/client/index.vue
@@ -44,6 +44,7 @@
               @selClientClick="selClientClick"
               @selContactsClick="selContactsClick"
               @getSelectArray="getSelectArray"
+              @selTableCol="selTableCol"
           >
             <template slot="tableButton">
               <el-table-column label="鎿嶄綔" width="150">
@@ -149,7 +150,18 @@
         visible: false,
         infomation: {}
       },
-      not_admin: 2
+      not_admin: 2,
+      tableColumn:[
+        { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100, isClientClick: true, default:true}, // 瀹㈡埛鍚嶇О
+        { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
+        { label: "閲嶈绾у埆", prop: "client_level" }, // 閲嶈绾у埆
+        { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", min: 90 }, // 涓嬫鍥炶鏃ユ湡
+        { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃
+        { label: "瀹㈡埛鐘舵��", prop: "client_status" }, // 瀹㈡埛鐘舵��
+        { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚�
+        { label: "鑱旂郴浜烘墜鏈哄彿鐮�", prop: "contact_phone" } // 鎵嬫満鍙风爜
+      ],
+      showCol:['瀹㈡埛鍚嶇О','閿�鍞礋璐d汉','閲嶈绾у埆','涓嬫鍥炶鏃ユ湡','璇︾粏鍦板潃','瀹㈡埛鐘舵��','鑱旂郴浜哄鍚�','鑱旂郴浜烘墜鏈哄彿鐮�']
     }
   },
   created() {
@@ -163,17 +175,11 @@
     setTable() {
       this.tableList = {
         tableInfomation: [],
-        tableColumn: [
-          { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100, isClientClick: true }, // 瀹㈡埛鍚嶇О
-          { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
-          { label: "閲嶈绾у埆", prop: "client_level" }, // 閲嶈绾у埆
-          { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", min: 90 }, // 涓嬫鍥炶鏃ユ湡
-          { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃
-          { label: "瀹㈡埛鐘舵��", prop: "client_status" }, // 瀹㈡埛鐘舵��
-          { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚�
-          { label: "鑱旂郴浜烘墜鏈哄彿鐮�", prop: "contact_phone" } // 鎵嬫満鍙风爜
-        ]
+        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
@@ -181,6 +187,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