<template>
  <el-button
    size="small"
    type="primary"
    class="ele-btn-icon"
    style="margin-left: 5px"
    :disabled="disabled"
    @click="show = true"
    >批量设置{{ title }}

    <ele-modal
      custom-class="ele-dialog-form long-dialog-form"
      :centered="true"
      :visible.sync="show"
      :close-on-click-modal="false"
      width="600px"
      :maxable="true"
      :resizable="true"
      :append-to-body="true"
    >
      <div>
        {{ title }}：
        <el-date-picker
          v-model="value"
          type="date"
          placeholder="选择日期"
          value-format="yyyy-MM-dd"
        >
        </el-date-picker>
      </div>
      <div slot="footer" class="footer">
        <el-button type="primary" @click="warehouseChangeAll">确认</el-button>
        <el-button @click="show = false">返回</el-button>
      </div>
    </ele-modal>
  </el-button>
</template>
<script>
  export default {
    components: {},
    data() {
      return {
        show: false,
        value: ''
      };
    },
    props: {
      disabled: {
        default: true,
        type: Boolean
      },
      valueKey: '',
      title: ''
    },
    created() {},
    computed: {},
    methods: {
      warehouseChangeAll() {
        if (!this.value) {
          return this.$message.error(this.title + '不能为空！');
        }
        this.$emit('success', { key: this.valueKey, value: this.value });
        this.cancel();
      },
      cancel() {
        this.show = false;
      }
    }
  };
</script>

<style scoped lang="scss"></style>
