<template>
  <div class="flex" :model="model">
      <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
        <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
          <div class="row">
            <ul class="nav nav-tabs">
              <li class="active"><a href="#">生产厂家</a></li>
            </ul>
          </div>
        </div>
      </criteria>
      <data-grid :model="model" partial='list'  class="list_area table_sy"  v-ref:grid>
        <template partial='head'>
          <tr>
            <th>
              <nobr>序号</nobr>
            </th>
            <th>
              <nobr>卡品牌</nobr>
            </th>
          </tr>
        </template>
        <template partial='body'>
          <tr>
            <td style="text-align:center">{{$index + 1}}</td>
            <td style="text-align:center">{{row.name}}</td>
          </tr>
        </template>
      </data-grid>
  </div>
</template>

<script>
  import {HttpResetClass} from 'vue-client'
  export default {
    data () {
      return {
        cardTools: [],
        f_orgid: '',
        model: {rows: []}
      }
    },
    props: {
      row: {},
      ispartial: false,
      f_filialeid: {
        type: String
      }
    },
    ready () {
      this.search()
    },
    methods: {
      async gettoolcards () {
        try {
          let http = new HttpResetClass()
          let res = await http.load('GET', `rs/vue/toolcards.json`, {}, {resolveMsg: null, rejectMsg: null})
          this.model.rows = res.data.value ? res.data.value : res.data
        } catch (e) { }
      },
      search () {
        this.gettoolcards()
      },
      getorg (val) {
        this.f_orgid = this.$login.convertToIn(val)
        this.f_filialeid = val[0]
      }
    },
    watch: {
      'model.rows.length' (val) {
        if (val === 1) {
          this.$refs.grid.select(this.model.rows[0])
        }
      }
    }
  }
</script>
