songshankun
2023-09-28 aeaf5640ea95d6ac4f4e2c98c5b15b4145f17fbd
src/views/client/salesLead/index.vue
@@ -28,6 +28,7 @@
              :table-list="tableList"
              @selSalesLeadClick="selSalesLeadClick"
              @getSelectArray="getSelectArray"
              @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="120">
@@ -134,7 +135,18 @@
        // 分配
        visible: false,
        infomation: {}
      }
      },
      tableColumn:[
        { label: "客户名称", prop: "name", min: 190, isSalesLeadClick: true ,default:true}, // 客户名称
        { label: "销售线索编号", prop: "number", min: 130 }, // 销售线索编号
        { label: "联系人姓名", prop: "contact_name", min: 130 }, // 联系人姓名
        { label: "手机号码", prop: "contact_phone", min: 130 }, // 手机号码
        { label: "商机来源", prop: "sales_resources", min: 130 }, // 商机来源
        { label: "省份", prop: "province", min: 130 }, // 省份
        { label: "城市", prop: "city", min: 130 }, // 城市
        { label: "负责人", prop: "member_name", min: 130 } // 负责人
      ],
      showCol:["客户名称","销售线索编号","联系人姓名","手机号码","商机来源","省份","城市","负责人"]
    }
  },
  created() {
@@ -145,17 +157,11 @@
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "name", min: 190, isSalesLeadClick: true }, // 客户名称
          { label: "销售线索编号", prop: "number", min: 130 }, // 销售线索编号
          { label: "联系人姓名", prop: "contact_name", min: 130 }, // 联系人姓名
          { label: "手机号码", prop: "contact_phone", min: 130 }, // 手机号码
          { label: "商机来源", prop: "sales_resources", min: 130 }, // 商机来源
          { label: "省份", prop: "province", min: 130 }, // 省份
          { label: "城市", prop: "city", min: 130 }, // 城市
          { label: "负责人", prop: "member_name", min: 130 } // 负责人
        ]
        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
@@ -163,6 +169,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() {
      await getSalesLeadsList({