index.vue 4.37 KB
<template>
  <div class="scrm-sub-client-container">
    <el-button type="primary" icon="el-icon-plus">创建员工</el-button>
    <div class="pageContent">
      <search-form :ploading="sloading" class="searchTop border-shadow" :formModel="searchForm" :formList="employeeFormList" @setTableHeightEvent="setTableHeightEvent" @resetTable="resetTable" @searchTable="searchTable">
        <span class="inline-b" slot="form-slot">
          <!-- :id="tableParams.btnId" -->
          <el-button plain @click="resetTable">重置</el-button>
          <el-button type="primary" @click="searchTable">查询</el-button>
          <!-- <el-button type="primary" @click="syncClick" :loading="sloading">同步数据</el-button> -->
        </span>
      </search-form>
      <GLTable @setTableFinishFun="setTableFinishFun" ref="employeeManage" :hasNum="true" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
        <template slot="auth-button" slot-scope="scope">
          <span @click="btnClick('edit', scope.scope)" class="blue-text">编辑标签组</span>
        </template>
      </GLTable>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchForm: {},
      employeeFormList: [
        {
          type: 'select',
          prop: 'merchantName',
          label: '商户名称',
          placeholder: '请选择',
          options: [
            {
              label: '冒烟商户AB',
              value: 1
            },
            {
              label: '冒烟门店2021',
              value: 2
            }
          ]
        },
        {
          type: 'input',
          inputType: 'text',
          prop: 'creator',
          label: '创建者',
          placeholder: '请输入创建者'
        },
        {
          type: 'select',
          prop: 'status',
          label: '状态',
          placeholder: '请选择',
          options: [
            {
              label: '开启',
              value: 1
            },
            {
              label: '关闭',
              value: 2
            }
          ]
        },
        {
          type: 'input',
          inputType: 'text',
          prop: 'staffName',
          label: '员工姓名',
          placeholder: '请输入员工姓名'
        },
        {
          type: 'input',
          inputType: 'text',
          prop: 'staffPhone',
          label: '手机号',
          placeholder: '请输入手机号'
        },
      ],
      tableParams: {
        listName: 'data',
        tableColumns: [
          {
            label: '员工姓名',
            prop: 'staffName',
            width: 120,
          },
          {
            label: '角色',
            prop: 'roleName',

          },
          {
            label: '登录手机号',
            prop: 'staffPhone',
            width: 125
          },
          {
            label: '企微号',
            prop: 'entmicroName',
            width: 125
          },
          {
            label: '状态',
            prop: 'statusName',
            width: 80
          },
          {
            label: '创建者',
            prop: 'createdAccount'
          },
          {
            label: '商户名(商户号)',
            prop: 'merchantName',
            width: 160
          },
          {
            label: '更新时间',
            prop: 'updatedTime',
            width: 110
          },
          {
            label: '启用开关',
            prop: 'statusName',
            width: 85
          }
        ],
        tableOption: {
          width: 170
        }
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
      getListApi: ''
    }
  },
  methods: {
    setTableFinishFun(content) {
      
    },
    setTableHeightEvent() {
      this.$refs.employeeManage.setTableHeightFun()
    },
    btnClick() {},
    //搜索表格
    searchTable() {
      this.$refs.employeeManage.refreshTable()
    },
    //重置表格
    resetTable() {
      this.searchForm = {}
      this.$refs.employeeManage.refreshTable()
    }
  }
}
</script>

<style lang="scss" scoped>
.scrm-sub-client-container {
  .pageContent {
    padding: 6px 20px 30px;
    margin-top: 20px;
    background-color: #fff;
    .el-button + .el-button {
      margin-left: 20px;
    }
  }
}
</style>