<template>
  <div id="unit" class="flex-row" style="width: 100%">
    <div class="flex binary-left" style="flex: 1; width:50%">
      <transfer-audit v-ref:list @select-changed="selected"></transfer-audit>
    </div>
    <div class="flex binary-left" style="width:50%">
      <transfer-audit-dispose-basics
        :row="row"
        :images="images"
        :user-info="userInfo"
        :title="title">
      </transfer-audit-dispose-basics>
    </div>
  </div>
</template>

<script>
  import Json from 'vue-resource/src/http/interceptor/json'

  export default {
    title: '第三方过户预约审核',
    data () {
      return {
        row: {},
        title: '',
        imgInfo: [],
        userInfo: [],
        images: []
      }
    },
    ready () {
    },
    methods: {
      async selected(data) {
        console.log("data?", data)
        this.userInfo = []
        this.imgInfo = []
        this.title = data.val.f_operate_type + '处理'
        this.row = data.val
        // 普通预约信息字段
        this.userInfo.push({
          key: data.val.f_describe,
          value: data.val
        })
        try {
          await this.$resetget(`http://193.168.1.50:8210/third/rs/content/images?path=${data.val.f_userinfo_code}`, {resolveMsg: null, rejectMsg: '获取数据错误！'})
          // await this.$resetget(`http://127.0.0.1:8091/rs/content/images?path=${data.val.f_userinfo_code}`, {resolveMsg: null, rejectMsg: '获取数据错误！'})
            .then(res => {
              console.log('离谱啊', res)
              let img = res.data.replace('[', '')
              img = img.replace(']', '')
              this.images = img.split(',')
              console.log('离谱到家了', this.images)
            }
            )
        } catch (e) {
          console.log(e.message)
        }
      },
      init () {
        this.row = {},
        this.title = '',
        this.imgInfo= [],
        this.userInfo= []
      }
    },
    events: {
      'refresh' () {
        this.$refs.list.$refs.paged.$refs.criteria.search()
        this.init()
      }
    }
  }
</script>
<style>
</style>
