<template>
  <div  class="flex" :model="model">
<!--    <criteria-paged v-ref:paged>-->
      <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>-->
<!--          </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>
<!--    </criteria-paged>-->
  </div>


</template>



<script>

  import {HttpResetClass, PagedList} from 'vue-client'
  import Vue from 'vue'



  export default {
    data () {
      return {
        cardTools:[],
        f_orgid: '',
        model:{rows:[]}
      }
    },
    props: {
      // orderitem: {
      //   type: String,
      //   default: 'f_price_id'
      // },
      row: {},
      // config: {},
      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

          console.log(this.cardTools)

          }catch (e) {
            console.log(e)
          }

      },
      search () {
        this.gettoolcards()
        // console.log(this.cardTools)
      },
      getorg (val) {
        this.f_orgid = this.$login.convertToIn(val)
        this.f_filialeid = val[0]
      },
      selfSearch (args) {
        getEditUserState()
      },

    },
    watch: {
      'model.rows.length' (val) {
        if (val === 1) {
          this.$refs.paged.$refs.grid.select(this.model.rows[0])
        }
      }
    }
  }
</script>
