<template>
  <partial-view v-ref:pv>
    <div class="panel panel-info auto" >
      <div class="panel-heading"  style="height: 30px">
        <h4 style="display:inline-block;margin-top: auto">档案信息</h4>
      </div>
      <div class="auto info-content">

        <div class="row">
          <label class = "col-sm-5 " >客户编号</label>
          <span class = "col-sm-7"><a @click="dealmsg(data)">{{data?data.f_userinfo_code:dafault.f_userinfo_code}}</a></span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >客户名称</label>
          <span class = "col-sm-7">{{data?data.f_user_name:dafault.f_user_name}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >客户类型</label>
          <span class = "col-sm-7">{{data?data.f_user_type:dafault.f_user_type}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >账户余额</label>
          <span class = "col-sm-7">{{data ? data.f_balance:dafault.f_user_type}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >证件号码</label>
          <span class = "col-sm-7" style="word-break: break-all">{{data?data.f_idnumber:dafault.f_idnumber}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >客户电话</label>
          <span class = "col-sm-7">{{data?data.f_user_phone:dafault.f_user_phone}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >备用电话</label>
          <span class = "col-sm-7">{{data?data.f_rent_phone:dafault.f_rent_phone}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >备注信息</label>
          <span class = "col-sm-7">{{data?data.f_comments:dafault.f_comments}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >客户地址</label>
          <span class = "col-sm-7">{{data?data.f_address:dafault.f_address}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >开户时间</label>
          <span class = "col-sm-7">{{data?data.f_open_date.substr(0,10):dafault.f_open_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >安装时间</label>
          <span class = "col-sm-7">{{data?data.f_install_date.substr(0,10):dafault.f_input_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >人&ensp;口&ensp;数</label>
          <span class = "col-sm-7" style="word-break: break-all">{{data?data.f_people_num:dafault.f_people_num}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >用户等级</label>
          <span class = "col-sm-7" style="word-break: break-all">{{data?data.f_user_level:dafault.f_people_num}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >银行名称</label>
          <span class = "col-sm-7" style="word-break: break-all">{{data?data.f_bank_name:dafault.f_bank_name}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >银行开户名</label>
          <span class = "col-sm-7" style="word-break: break-all">{{data?data.f_bank_accopen:dafault.f_bank_accopen}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >银行缴费编号</label>
          <span class = "col-sm-7" style="word-break: break-all">{{data?data.f_bank_pay_number:dafault.f_bank_pay_number}}</span>
        </div>
      </div>
    </div>
  </partial-view>
</template>

<script>
  /**
   *用户档案相关信息组件
   */

  export default {
    ready () {
      debugger
      console.log('看看userinfo里面接收的data数据：', this.data)
    },
    title: '客户基本信息',
    data () {
      return {
        dafault: {
          f_user_name: '**',
          f_userinfo_code: '********',
          f_people_num: '**',
          f_idnumber: '****',
          f_user_phone: '************',
          f_address: '**街道**小区*栋*单元*层***室',
          f_user_type: '**',
          f_open_date: '****年**月**日',
          f_input_date: '****年**月**日',
          f_hand_date: '****年**月**日',
          f_rent_phone: '************',
          f_comments: '************',
          f_bank_name: '************',
          f_bank_accopen: '************',
          f_bank_pay_number: '************'
        },
        model: null
      }
    },
    props: ['data'],
    methods: {
      dealmsg (val) {
        if (val.f_userinfo_code !== '********') {
          this.$dispatch('deal-msg', val)
        }
      }

    },
    watch: {
      'data' (val) {
        console.log('data', this.data)
      }
    }
  }
</script>
