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/service/serviceContract/index.vue |   54 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/src/views/service/serviceContract/index.vue b/src/views/service/serviceContract/index.vue
index aa48f5a..1cdb09c 100644
--- a/src/views/service/serviceContract/index.vue
+++ b/src/views/service/serviceContract/index.vue
@@ -31,6 +31,7 @@
               @selClientClick="selClientClick"
               @selCommonClick="selCommonClick"
               @getSelectArray="getSelectArray"
+              @selTableCol="selTableCol"
           >
             <template slot="tableButton">
               <el-table-column label="鎿嶄綔" width="60">
@@ -128,7 +129,20 @@
       },
       selValueList: [],
       keyword: "",
-      keywordType: ""
+      keywordType: "",
+      tableColumn: [
+        { label: "鏈嶅姟鍚堝悓缂栧彿", prop: "number", isCommonClick: true, default: true }, // 鏈嶅姟鍚堝悓缂栧彿
+        { label: "瀹㈡埛鍚嶇О", prop: "client_name", isClientClick: true }, // 瀹㈡埛鍚嶇О
+        { label: "绛剧害鏃ユ湡", prop: "signTime" }, // 绛剧害鏃ユ湡
+        { label: "鍚堝悓绫诲瀷", prop: "serviceContractType" }, // 鍚堝悓绫诲瀷
+        { label: "鍚堝悓鐘舵��", prop: "serviceContractStatus" }, // 鍚堝悓鐘舵��
+        { label: "璐熻矗浜�", prop: "member_name" }, // 璐熻矗浜�
+        { label: "浜у搧鍚嶇О", prop: "productName", isProductName: true }, // 浜у搧鍚嶇О
+        { label: "鏈嶅姟寮�濮嬫棩", prop: "startTime" }, // 鏈嶅姟寮�濮嬫棩
+        { label: "鏈嶅姟鍒版湡鏃�", prop: "endTime" }, // 鏈嶅姟鍒版湡鏃�
+        { label: "浠风◣鍚堣", prop: "amountTotal" } // 浠风◣鍚堣
+      ],
+      showCol:["鏈嶅姟鍚堝悓缂栧彿", "瀹㈡埛鍚嶇О", "绛剧害鏃ユ湡", "鍚堝悓绫诲瀷", "鍚堝悓鐘舵��", "璐熻矗浜�", "浜у搧鍚嶇О", "鏈嶅姟寮�濮嬫棩", "鏈嶅姟鍒版湡鏃�", "浠风◣鍚堣"]
     }
   },
   created() {
@@ -146,25 +160,29 @@
     setTable() {
       this.tableList = {
         tableInfomation: [],
-        tableColumn: [
-          { label: "鏈嶅姟鍚堝悓缂栧彿", prop: "number", isCommonClick: true }, // 鏈嶅姟鍚堝悓缂栧彿
-          { label: "瀹㈡埛鍚嶇О", prop: "client_name", isClientClick: true }, // 瀹㈡埛鍚嶇О
-          { label: "绛剧害鏃ユ湡", prop: "signTime" }, // 绛剧害鏃ユ湡
-          { label: "鍚堝悓绫诲瀷", prop: "serviceContractType" }, // 鍚堝悓绫诲瀷
-          { label: "鍚堝悓鐘舵��", prop: "serviceContractStatus" }, // 鍚堝悓鐘舵��
-          { label: "璐熻矗浜�", prop: "member_name" }, // 璐熻矗浜�
-          { label: "浜у搧鍚嶇О", prop: "productName", isProductName: true }, // 浜у搧鍚嶇О
-          { label: "鏈嶅姟寮�濮嬫棩", prop: "startTime" }, // 鏈嶅姟寮�濮嬫棩
-          { label: "鏈嶅姟鍒版湡鏃�", prop: "endTime" }, // 鏈嶅姟鍒版湡鏃�
-          { label: "浠风◣鍚堣", prop: "amountTotal" } // 浠风◣鍚堣
-        ]
+        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
         const value = this.tableList.tableColumn[i].prop
         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() {
@@ -205,16 +223,6 @@
         })
     },
     // 鎼滅储
-    searchClick(val, content) {
-      this.keyword = content
-      this.keywordType = val.label
-      this.getData()
-    },
-    resetClick() {
-      this.keyword = ""
-      this.keywordType = ""
-      this.getData()
-    },
     onFilterSearch(searchText){
       this.keyword = searchText ?? ""
       this.keywordType = "鏈嶅姟鍚堝悓缂栧彿"

--
Gitblit v1.8.0