index.vue 3.48 KB
<template>
  <div class="container">
    <GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
    <div class="table-header">
      <div class="header-text">已激活列表</div>
      <div>
        <el-button class="table-btn" @click="handleSync" :size="size" type="primary" plain mode="el-button">企微接入授权</el-button>
      </div>
    </div>
    <GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
  </div>
</template>

<script>
import url from '@/assets/empty.png'
export default {
  name: 'collocation',
  data() {
    return {
      url,
      searchForm: {
        belongWechat: '',
        staffName: '',
        telphone: '',
        status: ''
      },
      searchFormData: [
        {
          label: '所属企微',
          name: 'belongWechat',
          type: 'input',
          isClear: true
        },
        {
          label: '员工姓名',
          name: 'staffName',
          type: 'input',
          isClear: true
        },
        {
          label: '手机号码',
          name: 'telphone',
          type: 'input',
          isClear: true
        },
        {
          label: '状态',
          name: 'status',
          type: 'select',
          optionList: [
            {
              label: '全部',
              value: ''
            },
            {
              label: '是',
              value: 1
            },
            {
              label: '否',
              value: 0
            }
          ],
          optionId: 'value',
          optionLabel: 'label',
          isClear: true
        }
      ],
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '员工姓名',
            prop: 'staffName'
          },
          {
            label: '员工企微号',
            prop: 'staffNum'
          },
          {
            label: '手机号码',
            prop: 'telphone'
          },
          {
            label: '所属门店',
            prop: 'belongStore'
          },
          {
            label: '所属企微',
            prop: 'belongWechat'
          },
          {
            label: '最后同步时间',
            prop: 'time'
          },
          {
            label: '状态',
            prop: 'status'
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
      //   getListApi: this.$apis.accountConfig.listCustomizedAgentWithPage,
    }
  },
  methods: {
    handleSearch() {
      this.$refs.activeTable.refreshTable()
    },
    // 重置搜索框搜索
    handleReset() {
      this.searchForm = {
        isBuyPermit: '',
        merchantId: '',
        merchantName: ''
      }
      this.handleSearch()
    },
    setTableFinishFun() {
      //接收到的数据为空
      this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  padding: 20px;
  background-color: #fff;
  .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    .header-text {
      font-size: 16px;
      color: #333333;
      font-weight: 600;
    }
  }
  .table-btn {
    color: #5850ff;
    border: 1px solid #5850ff;
  }
}
</style>