<template>
  <el-dialog
    title="领料单"
    :visible.sync="visible"
    :before-close="handleClose"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    append-to-body
    width="76%"
  >
    <div>
      <pickList :isReturn="true" @selectionChange="selectionChange"> </pickList>
    </div>

    <template slot="footer">
      <el-button size="mini" @click="handleClose">取 消</el-button>
      <el-button size="mini" type="primary" @click="save()">确 定</el-button>
    </template>
  </el-dialog>
</template>

<script>
  import pickList from '../../pick/pickApply/index.vue';

  export default {
    name: 'PickList',
    components: { pickList },

    data() {
      return {
        visible: true,

        pickIds: []
      };
    },

    methods: {
      handleClose() {
        this.$emit('closeDialog', false);
      },

      selectionChange(ids) {
        this.pickIds = ids;
      },

      save() {
        this.$emit('emitSave', this.pickIds);
      },
    }
  };
</script>
