<template>
    <div>
        <el-dialog
          title="共享商品"
          :visible.sync="shareFormVisible"
          :before-close="close"
          width="66%">
          <el-table :data="tableData" @selection-change="handleChange">
            <table-column type="selection" fixed align="center"></table-column>
            <table-column label="仓库编码" prop="cdwhCode"></table-column>
            <table-column label="仓库名称" prop="cdwhName"></table-column>
          </el-table>
          <div class="more-query-btn">
            <el-button v-auth="50300030101" type="primary" @click="handleConfirm">确认</el-button>
          </div>
        </el-dialog>
    </div>
</template>
<script>
export default {
  data () {
    return {
      projectIds: []
    }
  },
  props: {
    shareFormVisible: Boolean,
    tableData: Array,
    skuIds: Array,
  },
  mounted () {

  },
  methods: {
    close () {
      this.$emit('close')
    },

    handleChange (selection) {
      this.projectIds = selection.map(item => item.ebpjId)
    },

    // 确认
    handleConfirm () {
      this.$emit('handleShareConfirm', this.skuIds, this.projectIds)
    },

  },

  watch: {

  }
}
</script>
