songshankun
2023-09-28 c3b53e3dd1923e851e8c618b13e428422376bc60
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