<template>
  <div class="auto">
    <partial-view v-ref:pv>
      <div class="row">
        <label class = "col-sm-3 control-label">用户姓名:</label>
        <span class = "col-sm-3">{{model.f_user_name}}</span>
        <label class = "col-sm-3 control-label"> 缴费类型:</label>
        <span class = "col-sm-3">{{model.f_cost_type}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-3 control-label"> 用户类型:</label>
        <span class = "col-sm-3">{{model.f_user_type}}</span>
        <label class="col-sm-3">用气性质:</label>
        <span class = "col-sm-3">{{model.f_gasproperties}}</span>
      </div>
      <div class="row">

      </div>
      <div class="row">
        <label class = "col-sm-3 control-label"> 地址:</label>
        <span class = "col-sm-8">{{model.f_address}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-3 control-label">操作人:</label>
        <span class = "col-sm-3">{{model.f_operator}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-3 control-label">操作时间:</label>
        <span class = "col-sm-9">{{data.f_operate_date}}</span>
      </div>
    </partial-view>
  </div>
</template>

<script>
export default {
  title: '新增户档案详情',
  props: ['data'],
  data () {
    return {
      model: {}
    }
  },
  ready () {
    let sql = 'singleTable_OrderBy'
    let condition = {
      items: 'f_userinfo_id,f_user_name,f_user_type,f_gasproperties,f_cost_type,f_address,f_operator',
      tablename: 't_userinfo',
      condition: ' f_userinfo_id = ' + this.data.f_userinfo_id,
      orderitem: 'f_userinfo_id'
    }
    this.$info(`加载数据中..., sql:${sql}`)
    this.$refs.pv.load('rs/logic/getOneData', {data: {sql: sql, params: condition}}).then((a) => {
      this.$info(`成功获取到数据！, data:${JSON.stringify(a.data)}`)
      this.model = a.data
    }).catch((error) => {
      if (error.status) {
        this.$warn(`加载数据出错, ${JSON.stringify(error)}`)
        return
      }
      throw error
    })
  }
}
</script>
