<template>
  <div style="height:100%">
    <data-grid :model="model" class="table_sy"   partial='list' v-ref:grid >
      <template partial='head' >
        <tr>
          <th style="text-align: center"><nobr>序号</nobr></th>
          <th style="text-align: center"><nobr>一阶补差单价</nobr></th>
          <th style="text-align: center"><nobr>二阶补差单价</nobr></th>
          <th style="text-align: center"><nobr>三阶补差单价</nobr></th>
          <th style="text-align: center"><nobr>补差气量</nobr></th>
          <th style="text-align: center"><nobr>补差金额</nobr></th>

          <th style="text-align: center"><nobr>补差开始时间</nobr></th>
          <th style="text-align: center"><nobr>补差结束日期</nobr></th>
          <th style="text-align: center"><nobr>缴费状态</nobr></th>
          <th style="text-align: center"><nobr>操作时间</nobr></th>
          <th style="text-align: center"><nobr>操作人</nobr></th>
        </tr>
      </template>
      <template partial='body' >
        <tr >
          <td style="text-align: center;">{{$index + 1}}</td>
          <td style="text-align: center;">{{row.f_change_price1}}</td>
          <td style="text-align: center;">{{row.f_change_price2}}</td>
          <td style="text-align: center;">{{row.f_change_price3}}</td>
          <td style="text-align: center;">{{row.f_real_amount}}</td>
          <td style="text-align: center;">{{row.f_surplus_fee}}</td>

          <td style="text-align: center;">{{row.f_start_date}}</td>
          <td style="text-align: center;">{{row.f_end_date}}</td>
          <td style="text-align: center;">{{row.f_whether_pay}}</td>
          <td style="text-align: center;">{{row.f_operate_date}}</td>
          <td style="text-align: center;">{{row.f_operator}}</td>
        </tr>
      </template>
    </data-grid>
  </div>
</template>
<script>
import {HttpResetClass} from 'vue-client'

let asyncReady = async function (self) {
  await self.refresh()
}
export default {
  title: '调价补差记录',
  props: ['row'],
  data () {
    return {
      model: {rows: []}
    }
  },
  ready () {
    asyncReady(this)
  },
  methods: {
    async refresh(){
      let http = new HttpResetClass()
      var suplusList = await http.load('POST', 'rs/sql/singleTable_OrderBy',
        {data: {items: "*",
            tablename: 't_surplus_detail',
            condition: `f_userinfo_id = '${this.row.f_userinfo_id}' and f_state='有效' and f_whether_pay = '否'`,
            orderitem: 'f_userinfo_id'}},
        {resolveMsg: null, rejectMsg: null})
      this.model.rows = suplusList.data
    }
  },
  watch: {
    'row.f_userfiles_id'(){
      this.refresh()
    }
  }
}
</script>
