<template>
  <div class="flex-full" style="height: 40%">
    <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid >
      <template partial='head'>
        <tr>
          <th style="text-align: center;">序号</th>
          <th style="text-align: center;">用户编号</th>
          <th style="text-align: center;">用户名</th>
          <th style="text-align: center;">手机号</th>
          <th style="text-align: center;">购气金额</th>
          <th style="text-align: center;">购气量</th>
          <th style="text-align: center;">购气次数</th>
          <th style="text-align: center;">付款方式</th>
          <th style="text-align: center;">缴费日期</th>
        </tr>
      </template>
      <template partial='body'>
        <tr>
          <td style="text-align: center;">{{$index+1}}</td>
          <td style="text-align: center;">{{row.f_userinfo_code}}</td>
          <td style="text-align: center;">{{row.f_user_name}}</td>
          <td style="text-align: center;">{{row.f_user_phone}}</td>
          <td style="text-align: center;">{{row.f_preamount}}</td>
          <td style="text-align: center;">{{row.f_pregas}}</td>
          <td style="text-align: center;">{{row.f_times}}</td>
          <td style="text-align: center;">{{row.f_payment}}</td>
          <td style="text-align: center;">{{row.f_operate_date}}</td>
        </tr>

      </template>
      <template partial='foot'></template>
    </data-grid>
  </div>
</template>

<script>
  import {HttpResetClass} from 'vue-client'

  let initGen = async function (self, val) {
    let http = new HttpResetClass()
    console.log(self.$login.f, '================')
    let res = await http.load('POST', 'rs/sql/sale_getUserPropertiesList', {data: {condition: `f_userinfo_id=${self.data.f_userinfo_id} and f_orgid = ${self.$login.f.orgid}` }}, {resolveMsg: null, rejectMsg: null})
    self.model = Object.assign({}, self.model, val)
    self.model.rows = res.data
  }
  export default {
    props: ['data'],
    data () {
      return {
        model: {
          rows: []
        }
      }
    },
    watch: {
      'data' (val) {
        if (val) {
          initGen(this, val)
        }
      }},

    ready () {
      initGen(this, this.data)
    }

  }
</script>
<style>

</style>

