<template>
  <div class="auto">
    <validator name='v'>
      <form class="form-horizontal">
        <div class="row">
          <div class="col-sm-4 form-group" :class="[$v.reason.required ? 'has-error' : '']">
            <label for="f_reason" class="font_normal_body">停用原因</label>
            <input type="text" v-show="false" v-model="$refs.reason.selectedItems"  v-validate:reason='{required: true }'>
            <v-select v-model="model.f_reason"
                      placeholder='停用原因'
                      :value.sync="model.f_reason"
                      :options='reason'
                      v-ref:reason
                      close-on-select ></v-select>
          </div>
        </div>
        <div class="row" style="margin-top:1px;" >
          <div class="col-sm-8 form-group">
            <label for="f_reason" class="font_normal_body">备&nbsp;&nbsp;注</label>
            <input class="input_search" style="width:80%" v-model="model.f_othereason"  />
          </div>
        </div>
      </form>
      <div style="text-align:right;">
        <button class="button_search button_spacing" @click="confirm()"  :disabled='!$v.valid'>确认</button>
        <button class="button_clear" @click="clean()" >取消</button>
      </div>
    </validator>
  </div>
  <upload :blodid="blodid" v-if="true" isremark="true" fusetype="表具停用"></upload>
</template>
<script>
  /**
   *综合业务
   表具停用组件
   */
  export default {
    title: '表具停用',
    props: ['row'],
    data () {
      return {
        blodid: '',
        showupload: true,
        model: {},
        reason: this.$appdata.getParam('停用原因')
      }
    },
    ready () {
      this.blodid = this.row.f_userinfo_id
    },
    methods: {
      async confirm () {
        await this.$LogicService.meterDisable(this.model, this.row)
        this.$dispatch('success')
      },
      clean () {
        this.$dispatch('refresh')
      }
    }
  }
</script>

<style>
</style>
