<template >
  <div id="stand-work-list" class="flex bg-white p-10">
    <div class="span">
      <criteria-paged :model="model" v-ref:paged  >
        <data-grid :model="model" partial='list' v-ref:grid>
          <template partial='head'>
            <tr>
              <!--<th>序号</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' partial='list' v-ref:grid>
            <tr >
              <!--              <td style="text-align: center;">{{$index+1}}</td>-->
              <td style="text-align:center">{{row.f_balance}}</td>
              <td style="text-align:center">{{row.f_balance}}</td>
              <th style="text-align:center">{{row.f_curbalance}}</th>
              <th style="text-align:center">{{row.f_last_tablebase}}</th>
              <th style="text-align:center">{{row.f_tablebase}}</th>
              <th style="text-align:center">{{row.f_operate_date}}</th>
            </tr>
          </template>
          <template partial='foot'></template>
        </data-grid>
      </criteria-paged>
    </div>
  </div>
</template>

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

  export default {
    title: '抄表',
    data () {
      return {
        condition: '1=1',
        model: new PagedList('rs/sql/manage_singleTable', 20, {items: '`*`', tablename: '`t_othercharge`', orderitem: '`f_operate_date DESC`'}),
        row: null,
        isdeal: true,
        obj: {
          userid: this.$login.f.id,
          source: `tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
          res: this.$login.f.f_fengongsi,
          resids: this.$login.f.f_orgids
        },
        show: false
      }
    },
    props:
      {
        f_userinfo_id: '',
        isdeal: {},
        args:{},
      },
    ready () {
      this.search()
    },
    methods: {
      search(){
        this.condition = ` f_userinfo_id = ${this.f_userinfo_id} `
        if(this.args.model.f_start_date) this.condition += `and f_operate_date >='${this.args.model.f_start_date}' `
        if(this.args.model.f_end_date) this.condition += `and f_operate_date <= '${this.args.model.f_end_date}' `
        this.model.search(this.condition, this.args.model)
      }
    },
    watch: {
      args(val){
        this.search()
      }
    }
  }
</script>
