<template>
  <div class="auto form-horizontal">
    <modal :show.sync="show" v-ref:modal large backdrop="false" :width="900">
      <header slot="modal-header" class="modal-header">
        <button type="button" class="close" @click="closeShow"><span>&times;</span></button>
        <h4 class="modal-title">发票信息</h4>
      </header>
      <article slot="modal-body" class="modal-body">
        <div class="auto select-overspread form-horizontal">
          <div class="row auto">
            <div class="col-sm-6 form-group form-input-group" :class="[!row.f_paper_name ? 'has-error' : '']">
              <label class="control-label">开票名称:</label>
              <input class="form-control col-sm-2"
                     v-model="row.f_paper_name" placeholder="开票名称">
            </div>
            <div class="col-sm-6 form-group form-input-group">
              <nobr class="col-sm-4"><label class="control-label">是否征税:</label></nobr>
              <v-select v-model="row.invoice_is_pax"
                        placeholder='请选择'
                        :value.sync="row.invoice_is_pax"
                        close-on-select
                        :width="60" disabled
                        :value-single="true"
                        :search="false"
                        :options='is_pax' clear-button>
              </v-select>
            </div>
            <div class="col-sm-12 form-group form-input-group">
              <label class="control-label">开户行及账号:</label>
              <input class="form-control col-sm-2"
                     v-model="row.f_paper_account" placeholder="购方开户行及账号">
            </div>
            <div class="col-sm-12 form-group form-input-group" >
              <label class="control-label">纳税人识别号:</label>
              <input class="form-control col-sm-2"
                     v-model="row.f_taxpayer_id" placeholder="纳税人识别号">
            </div>
            <div class="col-sm-12 form-group form-input-group" :class="[!row.f_buy_address ? 'has-error' : '']">
              <label class="control-label">开票地址:</label>
              <input class="form-control col-sm-2"
                     v-model="row.f_buy_address" placeholder="开票地址">
            </div>
            <div class="col-sm-12 form-group form-input-group" :class="[!row.f_buy_phone ? 'has-error' : '']">
              <label class="control-label">开票电话:</label>
              <input class="form-control col-sm-2"
                     v-model="row.f_buy_phone" placeholder="开票电话">
            </div>
            <div class="col-sm-12 form-group form-input-group">
              <label class="control-label">邮箱推送:</label>
              <input class="form-control col-sm-2"
                     v-model="row.f_email" placeholder="邮箱推送">
            </div>
          </div>
        </div>
      </article>
      <footer slot="modal-footer" class="modal-footer">
        <button type="button" class="btn button_search"
                :disabled="!(row.f_paper_name&&row.f_buy_phone&&row.f_buy_address)"
                @click='confirm'>确认收费
        </button>
      </footer>
    </modal>
  </div>
</template>
<script>
import {HttpResetClass} from 'vue-client'

export default {
  title: '电子发票',
  data () {
    return {
      is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}]
    }
  },
  props: ['row', 'show'],
  ready () {
  },
  methods: {
    confirm () {
      this.$dispatch('confirm')
    },
    closeShow () {
      this.$dispatch('closemodalshow')
    }
  },
  watch: {
    'row' () {
      this.row.invoice_is_pax = ['征税']
    }
  },
  events: {}
}
</script>
<style>
</style>
