<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">{{data.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_type}}</span>
        <label class = "col-sm-4">换表表费:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_changemeter_fee}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">旧表底数:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_using_base_old}}</span>
        <label class = "col-sm-4">新表底数:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_initial_base_new}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">补气量:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_remanent_gas}}</span>
        <label class = "col-sm-4">补气单价:</label>
        <span class = "col-sm-2" style="text-align:left">{{model.f_remanent_price}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">换表原因:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.f_othereason}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">备注:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.f_comments}}</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">{{model.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: '*',
      tablename: 't_changetables',
      condition: ' id = ' + this.data.id,
      orderitem: '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>
