<template>
  <div class="flex-full" style="height: 40%">
    <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid >
      <template partial='head'>
        <tr>
          <th style="text-align: center;">序号</th>
          <th style="text-align: center;">客户编号</th>
          <th style="text-align: center;">客户名称</th>
          <th style="text-align: center;">客户地址</th>
          <th style="text-align: center;">入户时间</th>
          <th style="text-align: center;">用户状态</th>
          <th style="text-align: center;">防盗卡号</th>
          <th style="text-align: center;">所属阀井</th>
          <th style="text-align: center;">机表阀门状态</th>
          <th style="text-align: center;">安检类型</th>
          <th style="text-align: center;">上次时间</th>
          <th style="text-align: center;">操作人</th>
          <th style="text-align: center;">操作时间</th>
          <th style="text-align: center;">所属公司</th>
          <th style="text-align: center;">备注</th>
        </tr>
      </template>
      <template partial='body'>
        <tr>
          <td style="text-align: center;">{{$index+1}}</td>
          <td style="text-align: center;">{{row.f_userinfo_code}}</td>
          <td style="text-align: center;">{{row.f_user_name}}</td>
          <td style="text-align: center;">{{row.f_address}}</td>
          <td style="text-align: center;">{{row.f_in_time}}</td>
          <td style="text-align: center;">{{row.f_user_state}}</td>
          <td style="text-align: center;">{{row.f_fdcard_id}}</td>
          <td style="text-align: center;">{{row.f_valve_wall}}</td>
          <td style="text-align: center;">{{row.f_bqf_state}}</td>
          <td style="text-align: center;">{{row.f_check_type}}</td>
          <td style="text-align: center;">{{row.f_last_time}}</td>
          <td style="text-align: center;">{{row.f_operator}}</td>
          <td style="text-align: center;">{{row.f_operate_date}}</td>
          <td style="text-align: center;">{{row.f_orgname}}</td>
          <td style="text-align: center;">{{row.f_describe}}</td>
        </tr>
      </template>
      <template partial='foot'></template>
    </data-grid>
  </div>
</template>

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

  let initGen = async function (self, val) {
    let http = new HttpResetClass()
    console.log(self.$login.f, '================')
    let res = await http.load('POST', 'rs/sql/getstopairuserrecord', {data: {condition: `f_userinfo_id = ${self.data.f_userinfo_id}` }}, {resolveMsg: null, rejectMsg: null})
    self.model = Object.assign({}, self.model, val)
    self.model.rows = res.data
  }
  export default {
    props: ['data'],
    data () {
      return {
        model: {
          rows: []
        }
      }
    },
    watch: {
      'data' (val) {
        if (val) {
          initGen(this, val)
        }
      }},

    ready () {
      initGen(this, this.data)
    }

  }
</script>
<style>

</style>

