<template>
  <div class="auto" style="overflow-y: hidden; margin-left: 1%; height: 100%;">
    <!--<partial-view v-ref:pv>-->
    <div class="panel panel-info ">
      <div class="panel-heading auto" style="text-align: center">
        <h4 style="display:inline-block;">表具信息</h4>
      </div>
      <div class="panel-body auto">
        <div class="row">
          <label class="col-sm-4 control-label">表号:</label>
          <span class="col-sm-2">{{model.f_meternumber}}</span>
          <label class="col-sm-4 control-label">表底数:</label>
          <span class="col-sm-2">{{model.f_meter_base}}</span>
        </div>
        <div class="row">
          <label class="col-sm-4 control-label">表品牌:</label>
          <span class="col-sm-2">{{model.f_meter_brand}}</span>
          <label class="col-sm-4 control-label">表型号:</label>
          <span class="col-sm-2">{{model.f_meter_style}}</span>
        </div>

        <div class="row" v-if="model.f_meter_type.includes('卡表')">
          <label class="col-sm-4 control-label">累计购气量:</label>
          <span class="col-sm-2">{{model.f_total_gas}}</span>
          <label class="col-sm-4 control-label">累计购气金额:</label>
          <span class="col-sm-2">{{model.f_total_fee}}</span>
        </div>

        <div class="row">
          <div v-if="model.f_billing === '按气量'">
            <label class="col-sm-4 control-label">表上剩余气量:</label>
            <span class="col-sm-2">{{model.f_balance_gas}}</span>
          </div>
          <div v-if="model.f_billing === '按金额'">
            <label class="col-sm-4 control-label">表上剩余金额:</label>
            <span class="col-sm-2">{{model.f_balance_amount}}</span>
          </div>
          <div v-if="model.f_meter_type !== '机表'">
            <label class="col-sm-4 control-label">购气次数:</label>
            <span class="col-sm-2">{{model.f_times ? model.f_times : 0}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>

</template>

<script>

  import { HttpResetClass } from 'vue-client'

  let getUserinfoGen = async function (self) {
    let http = new HttpResetClass()
    let res = await http.load('POST', 'rs/sql/sale_getUserfilesDetail', {
      data: {
        condition: `f_user_id = '${self.data.f_user_id}'`
      }
    }, {resolveMsg: null, rejectMsg: '获取用户信息失败'})
    console.log('获取的用户信息。。', res)
    self.model = Object.assign({}, self.model, res.data[0])
  }
  export default {
    title: '档案信息',
    data () {
      return {
        model: {}
      }
    },
    props: ['data'],
    ready () {
      console.log('用户详细信息', this.data)
      getUserinfoGen(this)
    }
  }
</script>

<style>

</style>
