songshankun
2023-09-28 bf0f6d157dce61a6294b9b5abf760382f4523a5a
feat: 客户服务单列表配置列显隐控制
2个文件已修改
42 ■■■■ 已修改文件
src/components/makepager/TableCommonView.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/clientServiceOrder/index.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue
@@ -461,7 +461,7 @@
  // background: #06c062;
  top: 0;
  right: -6px;
  z-index: 9;
  z-index: 11;
  .label {
    position: absolute;
    top: 6px;
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