<template>
  <el-dialog
    title="锁定座位"
    :visible.sync="visible"
    width="30%"
    @close="handleClose">
    <el-form
      inline
      :model="form"
      ref="form"
      class="form-wrap"
      label-width="100px">
      <div class="dialog-info">
        <el-form-item
          style="width:100%"
          label="备注"
          prop="remark">
          <el-input v-model="form.remark"></el-input>
        </el-form-item>
      </div>
    </el-form>

    <div slot="footer">
      <el-button @click="handleClose">
        取 消
      </el-button>
      <el-button
        type="primary"
        :loading="loading"
        @click="handleSubmit">
        确 定
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
const defaultForm = {
  remark: ''
}

export default {
  computed: {
    ticketTypeList () {
      return this.$store.state.app.ticketTypeList
    }
  },
  data () {
    return {
      title: '',
      visible: false,
      loading: false,
      form: {
        ...defaultForm
      }
    }
  },
  methods: {
    show () {
      this.visible = true
      this.$nextTick(() => {
        this.reset()
        this.form = JSON.parse(JSON.stringify(defaultForm))
      })
    },
    reset () {
      this.$refs.form.resetFields()
    },
    handleClose () {
      this.visible = false
    },
    handleSubmit () {
      this.$emit('update', this.form.remark)
      this.visible = false
    }
  }
}
</script>

<style lang="scss" scoped>
.periodItem {
  display: flex;  margin: 0 10px 10px 0; align-items: center;
}
.form-wrap {
  .priceInput {
     margin: 0 10px;
    .el-input-number{
        width: 160px;
    }
    ::v-deep .el-input {
      width: 100%;
    }
  }
}

</style>
