<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="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: 'company'
      },
      {
        label: '行业类型',
        prop: 'type'
      },
      {
        label: '管理员',
        prop: 'admin'
      },
      {
        label: '创建时间',
        prop: 'date',
        sortable: true
      },
      {
        slot: 'operate'
      }
      ],
      breads: ['供应商管理', '供应商列表'],
      itemList: [{
        date: '2016-05-02',
        type: '制作业',
        admin: '麻花图',
        company: '腾讯1'
      }, {
        date: '2016-05-02',
        type: '制作业',
        admin: '麻花图',
        company: '腾讯1'
      }, {
        date: '2016-05-02',
        type: '制作业',
        admin: '麻花图',
        company: '腾讯1'
      }],
      pageObj: {
        size: 10,
        total: 1,
        currentPage: 1,
        sizes: [100, 200, 300],
        func: (currentPage) => {
          this.pageTurning(currentPage)
        }
      }
    }
  },
  methods: {
    handleClick(row) {
      console.log(row)
      this.$router.push('/admin/supply/businessDetail')
    }
  }
}
</script>

<style>

</style>
