<template>
  <work-busy :is-busy="excessive"></work-busy>
  <div class="panel panel-default auto repair-info-content">
    <div class="panel-body">
      <div class="panel panel-default well" v-for="row in model">
        <div class="bg-info">
          <div class="row form-group">
            <div class="col-xs-12 col-sm-12 col-md-12">
              <div class="row">
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  镀锌管:{{ row.f_galvanize_pipe }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  三通:{{ row.f_tee }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  对丝:{{ row.f_nipple }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'" >
                  弯头:{{ row.f_elbow }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  管卡:{{ row.f_pipe_strap }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  灶前阀:{{ row.f_zqf }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  自闭阀:{{ row.f_zbf }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  燃气具:{{ row.f_gas_appliance }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  燃气具年限:{{ row.f_gas_appliance_num}}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  热水器:{{ row.f_geyser }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  热水器年限:{{ row.f_geyser_num}}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  壁挂锅炉:{{ row.f_bgl }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  壁挂锅炉型号:{{ row.f_bgl_style }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='非民用'">
                  壁挂锅炉年限:{{ row.f_bgl_num}}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='民用'">
                  气表品牌:{{ row.f_meter_brand }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='民用'">
                  气表型号:{{ row.f_meter_style }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='民用'">
                  燃气具类型:{{ row.f_appliance_type }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='民用'">
                  燃气具品牌:{{ row.f_appliance_brand }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6" v-if="row.f_user_type!=='民用'">
                  燃气具型号:{{ row.f_appliance_model }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6">
                  点火人员: {{ row.f_lgniter }}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6">
                  交付日期: {{ row.f_deliver_date.substring(0, 11) }}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <p v-show="model.length == 0 ">此用户暂无点火信息</p>
    </div>
  </div>
</template>

<script>
import {HttpResetClass, PagedList} from 'vue-client'
import co from 'co'

export default {
  title: '查询用户',
  data () {
    return {
      excessive: false,
      model: [],
      show: false,
      row: Object
    }
  },
  props: {
    user: {
      type: Object
    },
    f_userinfo_id: ''
  },
  methods: {
    getmodel () {
      let userinfoid
      if (this.f_userinfo_id) {
        userinfoid = this.f_userinfo_id
      } else {
        userinfoid = this.user.f_userinfo_id
        //tag
      }
      //tag
      this.excessive = true
      let http = new HttpResetClass()
      http.load('post', `${this.$androidUtil.getProxyUrl()}/rs/sql/IgnitionInfor`, {data: {condition: `f_userinfo_id in (${userinfoid})`}}).then((row) => {
        this.model = row.data
        this.excessive = false
      })
      //tag
      // this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/IgnitionInfor`, {condition:`f_userinfo_id = '${this.f_userinfo_id}'`}).then((row) => {
      //   this.model = row.data
      //   this.excessive=false
      // })
    },
    back () {

    }
  },
  watch: {
    'user' (val) {
      // this.model.search(`card_id = ${this.user.card_id}`)
      if (this.user) {
        if (!(this.user.isNuN)) {
          this.model = []
          this.getmodel()
        }
      }
    },
    'f_userinfo_id' () {
      if (this.f_userinfo_id) {
        this.model = []
        this.getmodel()
      }
    }
  },
  ready () {
    if (this.user && this.user.f_userinfo_id) {
      this.getmodel()
    }
    if (this.f_userinfo_id) {
      this.getmodel()
    }
  }
}
</script>
<style>
.app-botton {
  position: fixed;
  background: #87b2dd;
  color: #FFF;
  padding: 8px;
  text-align: center;
  font-size: 1.2em;
  z-index: 10;
  opacity: 0.5;
  bottom: 50px;
  margin-top: -10px;
  height: 40px;
}
</style>
