<template>
  <div id="boxlist" class="flex" style="flex:1; ">
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div novalidate class="form-inline" partial>
        </div>
      </criteria>
      <data-grid class="list_area table_sy" :model="model" partial='list' v-ref:grid>
        <template partial='head'>
          <tr>
            <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_userinfo_code}}</td>
          <td>{{row.f_user_name}}</td>
          <td>{{row.f_address}}</td>
          <td>{{row.f_slice_area}}</td>
        </template>
      </data-grid>
  </criteria-paged>
 </div>
</template>
<script>
import { PagedList } from 'vue-client'

export default {
  title: '调压箱',
  data () {
    return {
      model: new PagedList('rs/sql/adjustableUserQuery', 20)
    }
  },
  props: ['data'],
  ready () {
    this.model.search(`f_adjustable_id = ${this.data.id} and f_orgid = '${this.$login.f.orgid}'`)
  },
  methods: {
    search () {
      this.$dispatch('search')
    }
  },
  watch: {
    data () {
      this.model.search(`f_adjustable_id = ${this.data.id} and f_orgid = '${this.$login.f.orgid}'`)
    }
  }
}
</script>
