<template>
  <div class="userList">
    <div class="content">
      <dataTable :table-data="itemList" :columns="columns" :page-obj="pageObj" :breads="breads" :checklist="checklist">
        <el-table-column slot="operate" label="操作" align="center" fixed="right" width="100">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="see(scope.row)">查看</el-button>
            <el-button type="text" size="small" @click="handleClick(scope.row)">启用</el-button>
          </template>
        </el-table-column>
      </dataTable>

    </div>
  </div>
</template>

<script>
import dataTable from '@components/dataTable.vue'
export default {
  name: 'businessList',
  components: {
    dataTable
  },
  data() {
    return {
      checklist: [{
        title: '单位名称',
        type: 'input',
        model: 'company',
        placeholder: '请输入'
      }],
      columns: [{
        label: '用户姓名',
        prop: 'name'
      },
      {
        label: '单位名称',
        prop: 'company'
      },
      {
        label: '用户角色',
        prop: 'user'
      },
      {
        label: '创建时间',
        prop: 'date',
        sortable: true
      },
      {
        label: '状态',
        prop: 'state'
      },
      {
        slot: 'operate'
      }
      ],
      breads: ['供应商管理', '用户信息管理'],
      itemList: [{
        date: '2016-05-02',
        name: '马云',
        user: '管理员',
        company: '腾讯1',
        state: '正常'

      },
      {
        date: '2016-05-02',
        name: '马云',
        user: '管理员',
        company: '腾讯2',
        state: '正常'
      },
      {
        date: '2016-05-02',
        name: '马云',
        user: '管理员',
        company: '腾讯3',
        state: '正常'

      },
      {
        date: '2016-05-02',
        name: '马云',
        user: '管理员',
        company: '腾讯4',
        state: '正常'
      }
      ],
      pageObj: {
        size: 10,
        total: 1,
        currentPage: 1,
        sizes: [100, 200, 300],
        func: (currentPage) => {
          this.pageTurning(currentPage)
        }
      }
    }
  },
  methods: {
    see() {
      this.$router.push('/admin/supply/userDetail')
    },
    handleClick(row) {
      console.log(row)
    }
  }
}
</script>

<style>

</style>
