<template>
  <div class="auto" style="height: 500px">
    <data-grid :model="model" class="list_area table_sy"  partial='list' v-ref:grid >
      <template partial='head'>
        <tr>
          <th><nobr>操作类型</nobr></th>
          <th><nobr>操作描述</nobr></th>
          <th><nobr>操作备注</nobr></th>
          <th><nobr>公司</nobr></th>
          <th><nobr>部门</nobr></th>
          <th><nobr>操作人</nobr></th>
          <th><nobr>操作日期</nobr></th>
        </tr>
      </template>
      <template partial='body'>
        <tr>
          <td style="text-align:center">{{row.f_type}}</td>
          <td style="text-align:center">{{row.f_describe}}</td>
          <td style="text-align:center">{{row.f_comments}}</td>
          <td style="text-align:center">{{row.f_orgname}}</td>
          <td style="text-align:center">{{row.f_depname}}</td>
          <td style="text-align:center">{{row.f_operator}}</td>
          <td style="text-align:center">{{row.f_operate_date}}</td>
        </tr>
      </template>
      <template partial='foot'></template>
    </data-grid>
  </div>
</template>
<script>
export default {
  title: '详细信息',
  data () {
    return {
      model: {
        rows: []
      }

    }
  },
  props: ['row', 'id'],
  ready () {
    this.search()
  },
  methods: {
    async search () {
      // 获取这个气价的所有记录
      console.log('气价记录', this.row)

      let data = {
        tablename: `t_meterinfo_operationlog`,
        items: '*',
        condition: '1=1',
        orderitem: 'id'

      }
      if (this.id) {
        data.condition = `f_meterinfo_id = '${this.id}'`
      }

      let res = await this.$resetpost('rs/sql/singleTable_OrderBy', {data: data}, {rejectMsg: '获取气价记录出错', resolveMsg: null})

      this.model.rows = res.data
    }
  },
  watch: {
    'row' () {
      this.search()
    }

  }

}
</script>
