<template >
  <div id="stand-work-list" class="flex bg-white p-10">
    <div class="height:auto">
      <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;"><nobr>{{row.f_card_id}}</nobr></td>
              <td style="text-align: center;"><nobr>{{row.f_meter_brand}}</nobr></td>
              <td style="text-align: center;"><nobr>{{row.f_type}}</nobr></td>
              <td style="text-align: center;"><nobr>{{row.f_othereason}}</nobr></td>
              <td style="text-align: center;"><nobr>{{row.f_pregas}}</nobr></td>
              <td style="text-align: center;"><nobr>{{row.f_operate_date}}</nobr></td>
            </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/fillGasQuery', 15),
        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(){
        if(this.args && this.args.model) {
          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>
