<template>
    <div style="height:100%">
      <data-grid :model="model" class="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>
            <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;white-space:nowrap;">{{$index+1}}</td>

            <td style="text-align:center;white-space:nowrap;">{{row.gas}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.fee}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_payment}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_balance}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_collection}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_curbalance}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.type}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_serial_id}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_operate_date}}</td>
            <td style="text-align:center;white-space:nowrap;">{{row.f_operator}}</td>
            <td style="text-align:left;white-space:nowrap;">{{row.note}}{{row.f_write_card}}</td>
          </tr>
        </template>
      </data-grid>

  </div>
</template>

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

  export default {
    title: '操作查询',
    data () {
      return {
        model: {rows: []}
      }
    },
    props: ['searchdata'],
    ready () {
      this.getsalerecord()
    },
    methods: {
      async getsalerecord () {
        let http = new HttpResetClass()
        // this.condition = `1=1 and f_user_id = '${this.searchdata.f_user_id}'`
        this.condition = `1=1 and f_userfiles_id = '${this.searchdata.f_userfiles_id}'`
        let record = await http.load('POST', 'rs/sql/sale_RecordQuery', {data: {condition: this.condition}}, {
          rejectMsg: '流水查询出错！！',
          resolveMsg: null
        })
        this.model.rows = record.data
      }
    },
    watch: {
      'searchdata' () {
        if (this.searchdata) {
          this.getsalerecord()
        } else {
          this.model.rows = []
        }
      }
    }
  }
</script>
