<template>
  <div class="auto form-horizontal" >
    <modal :show.sync="show"  v-ref:modal middle backdrop="false">
      <header slot="modal-header" class="modal-header">
        <h3 style="color:black" class="modal-title">自定义短信模版</h3>
      </header>
      <article slot="modal-body" style = "padding-bottom:10px;">
        <textarea class="form-control col-sm-4" v-model="model.f_user_defined" rows="8" placeholder=""></textarea>
      </article>
      <footer slot="modal-footer" class="modal-footer">
        <button type="button" class="btn btn-default" @click="confirm('false')">生成短信</button>
        <button type="button" class="btn btn-default" @click="confirm('true')">生成并发送短信</button>
        <button type="button" class="btn btn-default" @click='cancel()'>取消</button>
      </footer>
    </modal>
  </div>
</template>
<script>
export default {
  title: '收费发票',
  data () {
    return {
      model: {
        f_user_defined: ''
      }
    }
  },
  props: ['show'],
  methods: {
    cancel  () {
      this.model.f_user_defined = ''
      this.$dispatch('toggle')
    },
    confirm (args) {
      this.$dispatch('definedMessage', {msg: this.model.f_user_defined, issend: args})
    }
  }
}

</script>
<style >
</style>
