<template>
  <div class="auto">
    <partial-view v-ref:pv>
      <!-- <div class="row"> -->
        <!-- <label class = " col-sm-3 control-label">用户姓名:</label> -->
        <!-- <span style="padding:0" class = " col-sm-3">{{model[0].f_user_name}}</span> -->
        <!-- <label class = "col-sm-3 control-label">操作人:</label>
        <span class = "col-sm-3">{{model.f_operator}}</span> -->
      <!-- </div> -->
      <table class="table table-bordered table-condensed self-table" id="table" >
        <tbody>
          <!-- <tr>
            <td><b>操作账户</b></td>
            <td colspan="3">{{data.f_user_name}}</td>
          </tr> -->
          <tr>
            <td><b>原入户安装费</b></td>
            <td>{{model.f_construction_cost}}</td>
            <td><b>现入户安装费</b></td>
            <td>{{model.f_new_construction_cost}}</td>
          </tr>
          <tr>
            <td><b>原材料费</b></td>
            <td>{{model.f_material_cost}}</td>
            <td><b>现材料费</b></td>
            <td>{{model.f_new_material_cost}}</td>
          </tr>
          <tr>
            <td><b>原工人费</b></td>
            <td>{{model.f_labor_cost}}</td>
            <td><b>现工人费</b></td>
            <td>{{model.f_new_labor_cost}}</td>
          </tr>
          <tr>
            <td><b>原改管费</b></td>
            <td>{{model.f_change_pipeline_cost}}</td>
            <td><b>现改管费</b></td>
            <td>{{model.f_new_change_pipeline_cost}}</td>
          </tr>
          <tr>
            <td><b>原设备安装费</b></td>
            <td>{{model.f_sbaz_cost}}</td>
            <td><b>现设备安装费</b></td>
            <td>{{model.f_new_sbaz_cost}}</td>
          </tr>
          <!-- <tr>
            <td><b>现入户安装费</b></td>
            <td>{{model.f_new_construction_cost}}</td>
          </tr>
          <tr>
            <td><b>现材料费</b></td>
            <td>{{model.f_new_material_cost}}</td>
          </tr>
          <tr>
            <td><b>现工人费</b></td>
            <td>{{model.f_new_labor_cost}}</td>
          </tr>
          <tr>
            <td><b>现改管费</b></td>
            <td>{{model.f_new_change_pipeline_cost}}</td>
          </tr>
          <tr>
            <td><b>现设备安装费</b></td>
            <td>{{model.f_new_sbaz_cost}}</td>
          </tr> -->
          <tr>
            <td><b>操作日期</b></td>
            <td colspan="3">{{model.f_date}}</td>
          </tr>
        </tbody>
      </table>

    </partial-view>
  </div>
</template>

<script>
import Table from '../../../../Table'
export default {
  title: '报建费用变更',
  props: ['data'],
  data () {
    return {
      model: {}
    }
  },
  ready () {
    let sql = 'singleTable_OrderBy'
    let condition = {
      items: '*',
      tablename: 't_changefee',
      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
      console.log('1111111model', this.model)
      console.log('1111111data', a.data)
    }).catch((error) => {
      if (error.status) {
        this.$warn(`加载数据出错, ${JSON.stringify(error)}`)
        return
      }
      throw error
    })
  },
  methods: {
    // 获取表中字段对应的中文名
    getValue (key) {
      return Table.data[key]
    }
  }
}
</script>
