<template>
  <div>
    <el-tabs type="card"  @tab-click="handleClickTabs">
        <el-tab-pane>
            <span slot="label">成品</span>
        </el-tab-pane>
        <el-tab-pane >
            <span slot="label">原材料</span>
        </el-tab-pane>
    </el-tabs>
    <list
    :tableData="tableData"
    :pageSize="pageSize"
    @selecChange="selecChange"
    @handleOpenDetail="handleOpenDetail"
    :currentPage="currentPage"
    :total="total"
    :tabIndex="tabIndex"></list>
  </div>
</template>
<script>
import List from './list'
export default {
  components: {
    List
  },
  props: {
    tableData: Array,
    pageSize: Number,
    currentPage: Number,
    total: Number,
    tabIndex: Number
  },
  data () {
    return {
      mode: ''
    }
  },
  methods: {
    selecChange (val) {
      this.$emit('selecChange', val)
    },
    handleOpenDetail (mode, ...data) {
      this.mode = mode
      this.$router.push({
        name: 'kitTaskPaListAdd',
        params: {
          mode,
          ...data
        }
      })
    },
    // 切换tab
    handleClickTabs (tab, event) {
      this.$emit('handleClickTabs', tab, event)
    },
  }
}
</script>
