<template>
  <!--<partial-view v-ref:pv>-->
  <div class="panel panel-info auto">
    <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-3 control-label">表号:</label>
        <span class="col-sm-3">{{model.f_meternumber}}</span>

        <label class="col-sm-3 control-label">表状态:</label>
        <span class="col-sm-3">{{model.f_table_state}}</span>
      </div>
      <div class="row">
        <label class="col-sm-3 control-label">表品牌:</label>
        <span class="col-sm-3">{{model.f_meter_brand}}</span>

        <label class="col-sm-3 control-label">表型号:</label>
        <span class="col-sm-3">{{model.f_meter_style}}</span>
      </div>

      <div class="row">
        <div v-if="!model.f_meter_type.includes('卡表')">
          <label class="col-sm-3 control-label">表底数:</label>
          <span class="col-sm-2">{{model.f_meter_base}}</span>
        </div>

        <div v-if="model.f_billing === '按金额'">
          <label class="col-sm-4 control-label">表上剩余金额:</label>
          <span class="col-sm-3">{{model.f_balance_amount}}</span>
        </div>
        <div v-if="model.f_billing === '按气量'">
          <label class="col-sm-4 control-label">表上剩余气量:</label>
          <span class="col-sm-3">{{model.f_balance_gas}}</span>
        </div>
        <div v-if="model.f_meter_type === '气量卡表'">
          <label class="col-sm-4 control-label">表累计购气量:</label>
          <span class="col-sm-3">{{model.f_total_gas}}</span>
        </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)
      this.search()
    },
    methods: {
      search() {
        getUserinfoGen(this)
      }
    },
    watch: {
      'data' () {
        this.search()
      }
    }
  }
</script>

<style>

</style>
