<template>
  <div class="auto">
    <partial-view v-ref:pv>
      <div class="row">
        <label class = "col-sm-4">客户名称:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.f_user_name}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">表编号:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.f_user_id}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4"> 超用气量:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_overusefee}}</span>
        <label class = "col-sm-4">超用金额:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_overuseamount}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">是否缴费:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.f_whether_pay}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">操作人:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.f_operator}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">操作时间:</label>
        <span class = "col-sm-8" style="text-align:left">{{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 params = {
      items: 'id, f_user_name, f_user_id, f_overuseamount, f_overusefee, f_whether_pay, f_state, f_operator',
      tablename: 't_overuse',
      condition: 'id = ' + this.data.id,
      orderitem: 'id'
    }
    this.$info(`加载数据中..., sql:${sql}`)
    this.$refs.pv.load('rs/logic/getOneData', {data: {sql: sql, params: params}}).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>
