<template>
  <partial-view v-ref:pv>
    <div class="panel panel-info auto" style="margin-top: auto">
      <div class="panel-heading"  style="height: 35px">
        <h4 style="display:inline-block;margin-top: auto">设备信息</h4>
      </div>
      <div class="auto " v-for="(index,row) in userDevices">
        <h5 style="display:inline-block;margin-top: auto">设备{{index+1}}</h5>
        <div class="row">
          <label class = "col-sm-5 " >设备类型</label>
          <span class = "col-sm-7" >{{row?row.f_devices_type:dafault.f_devices_type}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >设备编号</label>
          <span class = "col-sm-7" >{{row?row.f_devices_no:dafault.f_devices_no}}</span>
        </div>
        <!--<div class="row" >-->
          <!--<label class = "col-sm-5 " >设备品牌</label>-->
          <!--<span class = "col-sm-7" >{{row?row.f_times:dafault.f_times}}</span>-->
        <!--</div>-->
        <div class="row" >
          <label class = "col-sm-5 ">设备型号</label>
          <span class = "col-sm-7" >{{row?row.f_devices_model:dafault.f_devices_model}}</span>
        </div>
        <div class="row" >
          <label class = "col-sm-5 ">安装人</label>
          <span class = "col-sm-7" >{{row?row.f_input_person:dafault.f_input_person}}</span>
        </div>

        <div class="row">
          <label class = "col-sm-5 " >安装日期</label>
          <span class = "col-sm-7">{{row?row.f_input_date:dafault.f_input_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >生产日期</label>
          <span class = "col-sm-7">{{row?row.f_make_date:dafault.f_make_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >设备数量</label>
          <span class = "col-sm-7">{{row?row.f_devices_num:dafault.f_devices_num}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >到期日期</label>
          <span class = "col-sm-7">{{row?row.f_expire_date:dafault.f_expire_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >管道类型</label>
          <span class = "col-sm-7">{{row?row.f_pipe_type:dafault.f_pipe_type}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >管道安装日期</label>
          <span class = "col-sm-7">{{row?row.f_pipeinstall_date:dafault.f_pipeinstall_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >管道到期日期</label>
          <span class = "col-sm-7">{{row?row.f_pipeexpire_date:dafault.f_pipeexpire_date}}</span>
        </div>
        <div class="row">
          <label class = "col-sm-5 " >钢管连接</label>
          <span class = "col-sm-7">{{row?row.f_pipe_connection:dafault.f_pipe_connection}}</span>
        </div>

        <div class="row">
          <label class = "col-sm-5 " >备&emsp;&emsp;注</label>
          <span class = "col-sm-7">{{row?row.comments:dafault.comments}}</span>
        </div>
      </div>
    </div>
  </partial-view>
</template>

<script>
  /*用户档案相关信息组件*/
  export default {
    ready () {
      console.log('看看userinfo里面接收的row数据', this.data)
    },
    title: '客户基本信息',
    data () {
      return {
        dafault: {
          f_devices_type: '****',
          f_devices_no: '****',
          f_input_person: '****',
          f_devices_model: '****',
          f_input_date: '****',
          f_make_date: '****',
          f_devices_num: '****',
          f_expire_date: '****',
          f_pipe_type: '****',
          f_pipeinstall_date: '****',
          f_pipeexpire_date: '****',
          f_comments: '****'
        },
        userDevices: [],
        model: null
      }
    },
    props: ['data'],
    methods: {
      dealmsg (val) {
        this.$dispatch('deal-msg', val)
      }
    },
    watch: {
      'data' (val) {
        if (val !== null) {
          this.$resetpost('rs/sql/sale_GetDevicesInfo', {data: {condition: `f_userinfo_id = '${val.f_userinfo_id}'`}}, {rejectMsg: null, resolveMsg: null}).then(
            (res) => {
              this.userDevices = res.data
            }
          )
        } else {
          this.userDevices = []
        }
        console.log('val========', val)
      }
    }
  }
</script>
<style lang="less">
  .row {
    /*border-bottom:1px solid #F2F6FA;*/
    margin-left: 0;
    margin-right: 0;
  }

</style>
