<template>
  <!--<div class="select-overspread repair-bg auto" style="padding-bottom:5px;">-->
    <div class="panel panel-default auto repair-info-content repair-bg">
        <div class="span auto compatible" >
          <!--换表相关信息-->
          <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
            <!--<div class="col-sm-3 col-xs-3 col-md-3" >-->
              <!--<button type="button" name="button" class="btn btn-primary" @click="sellhistory()">-->
                <!--购气记录-->
              <!--</button>-->
            <!--</div>-->
            <div class="col-sm-4 col-xs-4 col-md-4" >
              <button type="button" name="button" class="btn btn-primary" @click="changewatch()">
                换表记录
              </button>
            </div>
            <div class="col-sm-4 col-xs-4 col-md-4">
              <button type="button" name="button" class="btn btn-primary" @click="repairhistory()">
                维修记录
              </button>
            </div>
            <div class="col-sm-4 col-xs-4 col-md-4">
              <button type="button" name="button" class="btn btn-primary" @click="checkrecord()">
                安检记录
              </button>
            </div>
          </div>
        </div>
        <div>
          <changemeter-info :user="user" v-if="showChangeMeter"></changemeter-info>
          <repair-list :user="user" v-if="showRepair"></repair-list>
          <safecheck-hitsory-info :user="user" v-if="showSafecheck"></safecheck-hitsory-info>
        </div>
      </div>
    <!--</div>-->
</template>
<script>


  export default {
    title: '历史记录查询',

    props: {
      // 工单
      user: {
        type: Object
      }
    },
    data() {
      return {
        showSafecheck:false,
        showChangeMeter:false,
        showRepair:false
      }
    },
    ready() {
      // console.log(Util.f.f_parentname)
    },
    methods: {
      // 该方法 传入参数
      sellhistory() {
        this.$goto('hand-sell-info', {user: this.user}, 'self')
      },
      changewatch(row) {
        this.showChangeMeter = !this.showChangeMeter
        this.showSafecheck = false
        this.showRepair = false

        // this.$goto('changemeter-info', {user: this.user}, 'self')
      },
      // mute() {
      //   HostApp.mute()
      // },
      repairhistory(row) {
        this.showChangeMeter = false
        this.showSafecheck = false
        this.showRepair = !this.showRepair
        // this.$goto('repair-list', {user: this.user}, 'self')
      },
      checkrecord(row) {
        this.showChangeMeter = false
        this.showSafecheck = !this.showSafecheck
        this.showRepair = false
        // this.$goto('safecheck-hitsory-info', {user: this.user}, 'self')
      },
      // reader() {
      //   console.log('this.service.serviceid: ' + this.service.serviceid)
      //   HostApp._open_a_page({
      //     type: 'boomerang',
      //     page: 'com.aofeng.hotline.activity.BluetoothActivity',
      //     param: {
      //       operator: Util.f.name,
      //       requestCode: 111,
      //       repairFormId: this.service.f_service_id,
      //       callback: 'javascript:console.log("boomerang");'
      //     }
      //   })
      // },
    },
    computed: {
      // hunei() {
      //   if (this.model && this.model.servicerepair.length > 0) {
      //     let result = this.model.servicerepair.find((row) => {
      //       return (row.f_type === '户内维修')
      //     })
      //     result.f_type = '户内维修'
      //     result.f_new_backnumber = 0
      //     result.f_old_id = this.model.baseuserinfo.jb_table_code
      //     result.f_old_overplus = this.model.baseuserinfo.f_overplus_gas
      //     result.f_old_backnumber = this.model.baseuserinfo.f_jibiao_base
      //     result.f_old_type = this.model.baseuserinfo.jb_type
      //     return result
      //   }
      //   return null
      // },
    }
  }
</script>
<style scoped>
  .class-erro {
    color: #a94442;
  }
</style>
