src/views/client/followupRecords/index.vue
@@ -16,7 +16,7 @@
        >
          <template slot="leftButton">
            <el-button size="small" type="primary"  @click="addBtnClick">新建</el-button>
            <el-button size="small"  @click="delClick">删除</el-button>
            <!-- <el-button size="small" @click="delClick">删除</el-button> -->
          </template>
        </CommonSearch>
      </div>
@@ -29,17 +29,16 @@
              ref="tableListRef"
              v-loading="loading"
              :table-list="tableList"
              :select-box="!isDetail"
              @selContactsClick="selContactsClick"
              @selClientClick="selClientClick"
              @getSelectArray="getSelectArray"
              @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="60" fixed="right">
              <el-table-column label="操作" width="90" fixed="right">
                <template slot-scope="scope">
                  <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
                  <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
                </template>
              </el-table-column>
            </template>
@@ -149,7 +148,18 @@
        { label: "负责人", prop: "member_name", min: 110 }, // 负责人
        { label: "跟进记录", prop: "record", min: 130 } // 跟进记录
      ],
      showCol:['主题','客户名称','联系人姓名','联系人姓名','客户状态','联系方式','联系日期','下次回访日期','负责人','跟进记录']
      showCol: [
        "主题",
        "客户名称",
        "联系人姓名",
        "联系人姓名",
        "客户状态",
        "联系方式",
        "联系日期",
        "下次回访日期",
        "负责人",
        "跟进记录"
      ]
    }
  },
  created() {
@@ -172,12 +182,13 @@
  methods: {
    setTable() {
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
        tableColumn:this.setColumnVisible(this.showCol)
      }
      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
      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
@@ -186,7 +197,7 @@
      }
    },
    setColumnVisible(showCol){
      return  this.tableColumn.map(ele=>{
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn:showCol.includes(ele.label)
@@ -194,8 +205,8 @@
      })
    },
    selTableCol(val) {
      this.showcol = val;
      this.tableList.tableColumn = this.setColumnVisible(val);
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 请求数据
    async getData() {
@@ -238,7 +249,7 @@
    },
    // 搜索
    onFilterSearch(searchText){
      this.search_map.name = searchText ?? ''
      this.search_map.name = searchText ?? ""
      this.pagerOptions.currPage = 1
      this.getData()
    },
@@ -256,15 +267,15 @@
      this.editConfig.infomation = { ...row, sale_chance_name: "", sales_leads_name: "" }
    },
    // 删除
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
    delClick(id) {
      // if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            getDeleteFollowRecord({ ids: this.selValueList }).then((response) => {
          getDeleteFollowRecord({ ids: [id] }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
@@ -274,9 +285,9 @@
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
      // } else {
      //   this.$message.warning("请至少选择一条记录")
      // }
    },
    getSelectArray(val) {
      console.log(val)