songshankun
2023-10-10 74fae92c3fd076359385d27c5ac4e769a38522ab
src/views/service/clientServiceOrder/index.vue
@@ -30,6 +30,7 @@
            @selClientClick="selClientClick"
            @selCommonClick="selCommonClick"
            @getSelectArray="getSelectArray"
            @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="60">
@@ -123,7 +124,18 @@
      },
      selValueList: [],
      keyword: "",
      keywordType: ""
      keywordType: "",
      tableColumn: [
        { label: "服务单编号", prop: "serviceNumber", min: 100, isCommonClick: true, default: true }, // 服务单编号
        { label: "主题", prop: "subject" }, // 主题
        { label: "客户名称", prop: "client_name", min: 130, isClientClick: true }, // 客户名称
        { label: "实际处理时间", prop: "realTime" }, // 实际处理时间
        { label: "服务人员", prop: "serviceMan_name" }, // 服务人员
        { label: "服务方式", prop: "serviceType_name" }, // 服务方式
        // { label: "产品类别", prop: "reportSourceId" }, // 产品类别
        { label: "故障类别", prop: "faultType_name" } // 故障类别
      ],
      showCol:["服务单编号", "主题", "客户名称", "实际处理时间", "服务人员", "服务方式", "故障类别"]
    }
  },
  created() {
@@ -141,17 +153,11 @@
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "服务单编号", prop: "serviceNumber", min: 100, isCommonClick: true }, // 服务单编号
          { label: "主题", prop: "subject" }, // 主题
          { label: "客户名称", prop: "client_name", min: 130, isClientClick: true }, // 客户名称
          { label: "实际处理时间", prop: "realTime" }, // 实际处理时间
          { label: "服务人员", prop: "serviceMan_name" }, // 服务人员
          { label: "服务方式", prop: "serviceType_name" }, // 服务方式
          // { label: "产品类别", prop: "reportSourceId" }, // 产品类别
          { label: "故障类别", prop: "faultType_name" } // 故障类别
        ]
        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
@@ -159,6 +165,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