<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>
        </tr>
      </template>
      <template partial='body'>
        <tr>
          <td style="text-align: center;">{{$index+1}}</td>
          <td style="text-align: center;">{{row.f_area_name}}</td>
          <td style="text-align: center;">{{row.f_user_phone}}</td>
          <td style="text-align: center;">{{row.f_describe}}</td>
          <td style="text-align: center;">{{row.f_air_state}}</td>
          <td style="text-align: center;">{{row.changeoperator}}</td>
          <td style="text-align: center;">{{row.f_consult_phone}}</td>
          <td style="text-align: center;">{{row.f_change_date}}</td>
          <td style="text-align: center;">{{row.f_change_reason}}</td>
          <td style="text-align: center;">{{row.f_change_type}}</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/getstopairrecord', {data: {condition: `id = ${self.data.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>

