<template>
  <div id="unit" class="flex" >
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div novalidate class="form-inline" partial>
          <div class="form-group">
            <label for="f_bank_name" class = "control-form">银行名称:</label>
            <v-select id="f_bank_name"
            v-model="model.f_bank_name"
            placeholder='银行名称'
            condition="s.f_bank_name= '{}' "
            :value.sync="model.f_bank_name"
            :options='$parent.$parent.bankname'
            close-on-select ></v-select>
          </div>
          <div class="form-group form-input-group">
            <label for="startDate" class="control-label">开始日期:</label>
            <datepicker id="startDate" placeholder="开始日期" width='100%'
              v-model="model.startDate"
              :value.sync="model.startDate"
              :disabled-days-of-Week="[]"
              condition="f_trade_date > '{} 00:00:00' "
              :format="'yyyy-MM-dd'"
              :show-reset-button="reset">
            </datepicker>
          </div>

          <div class="form-group form-input-group">
            <label for="endDate" class="control-label">结束日期:</label>
            <datepicker id="endDate" placeholder="结束日期" width='100%'
              v-model="model.endDate"
              :value.sync="model.endDate"
              condition="f_trade_date < '{} 23:59:59' "
              :disabled-days-of-Week="[]"
              :format="'yyyy-MM-dd'"
              :show-reset-button="reset">
            </datepicker>
          </div>
          <div class="form-group">
            <button class="btn btn-success width-80" @click="search()" v-el:cx>查询</button>
          </div>
        </div>
      </criteria>
      <data-grid :model="model" partial='list' v-ref:grid>
        <template partial='head'>
          <tr>
            <th>序号</th>
            <th>煤气方流水号</th>
            <th>银行流水号</th>
            <th>煤气方用户id</th>
            <th style="white-space: nowrap;">银行用户id</th>
            <th>煤气方金额</th>
            <th>银行金额</th>
            <th>燃气方日期</th>
            <th>银行日期</th>
            <th>煤气房记录是否有效</th>
            <th>对账信息</th>
            <th>对账结果</th>
          </tr>
        </template>
        <template partial='body'>
          <td style="text-align: center;">{{$index+1}}</td>
          <td>{{row.f_serial_id}}</td>
          <td>{{row.f_trade_number}}</td>
          <td>{{row.sell_f_user_id}}</td>
          <td>{{row.bank_f_user_id}}</td>
          <td>{{row.f_collection}}</td>
          <td>{{row.f_total_charge}}</td>
          <td>{{row.f_delivery_date}}</td>
          <td>{{row.f_trade_date}}22</td>
          <td>{{row.f_charge_state}}</td>
          <td>{{row.msg}}</td>
          <td>{{row.result}}</td>
        </template>
      </data-grid>
  </criteria-paged>
 </div>
</template>
<script>
import { PagedList } from 'vue-client'


export default {
  title: '银行对账',
  data () {
    return {
      model: new PagedList('rs/sql/bankPayment', 20, {orderitem: '" f_delivery_date DESC "'}),
      bankname: [{label: '全部', value: ''}, ...this.$appdata.getParam('银行名称')]
    }
  },
  props: [],
  ready () {
    this.model.search('1=1')
  },
  methods: {
    search () {
      this.model.search()
    }
  }
}
</script>
