<template>
  <modal :show.sync="show" v-ref:modal :backdrop="isBack">
    <div slot="modal-header" class="modal-header">
      <span class="modal-title font">
        隐患处理单打印
      </span>
    </div>

    <div slot="modal-body" class="modal-body">
      <div id="print1" >
        <div id="print2">
          <style id="style1">
            #print2 td{
              height:32px;
              width: 100px;
              text-align: center;
            }
            #print2 table{
              margin: auto;
            }
            #print2 h1{
              text-align: center;
            }
            #print2 p{
              text-align: center;
            }
            .border-btn{
              border-bottom: #000000 solid 2px;
            }
          </style>
          <table border="1" cellspacing="0">
            <tr>
              <td colspan="6"> <h3>{{loginorg}}</h3> </td>
            </tr>
            <tr>
              <td><b>用户编号</b></td><td>{{data.f_userinfo_code}}</td><td ><b>用户姓名</b></td><td >{{data.f_user_name}}</td><td><b>联系电话</b></td>
              <td>{{data.f_user_phone}}</td>
            </tr>
            <tr>
              <td><b>地址</b></td><td colspan="5">{{data.f_address}}
            </tr>
            <tr align="left">
              <td><b>检查项</b></td><td>{{data.f_device_type}}</td>
              <td><b>检查内容</b></td><td>{{data.f_item_name}}</td>
              <td><b>检查结果</b></td><td>{{data.f_item_value}}</td>
            </tr>
            <tr align="left">
              <td><b>表号</b></td><td>{{data.f_meternumber}}</td>
              <td><b>表位置</b></td><td>{{data.f_aroundmeter}}</td>
              <td><b>维修描述</b></td><td>{{data.f_deal_remark}}</td>
            </tr>
            <tr align="left">
              <td><b>安检员</b></td><td>{{data.f_checker_name}}</td>
              <td><b>处理结果</b></td><td>{{data.f_is_repaired}}</td>
              <td><b>处理公司</b></td><td>{{data.f_dealer_name}}</td>
            </tr>
            <tr>
              <td><b>处理人</b></td><td>{{data.f_repairman}}</td>
              <td><b>处理时间</b></td><td>{{data.f_dealer_endtime}}</td>
              <td><b>用户签字</b></td><td><img-self :src='realsignpath' alt="未签名"></img-self></td>
            </tr>
            <tr style="max-width: 550px">
              <td ><b>隐患处理前照片</b></td>
              <td colspan="2"><img-self :src="path" alt="无隐患处理前照片"  width="150"
                            height="200"></img-self></td>
              <td><b>隐患处理后照片</b></td>
                <td colspan="2"><img-self :src="realpath" alt="无总体安检照片"  width="150"
                              height="200"></img-self></td>
            </tr>
          </table>
        </div>
      </div>
      确定打印隐患处理单？
    </div>
    <div slot="modal-footer" class="modal-footer">
      <button type="button" class="btn btn-cancel" @click="cancel()">取消</button>
      <print-element class="btn btn-success width-80" id="print1" styleid='style1' top='40' left='60' width='100%' height='100%' v-ref:printelement>打印</print-element>
    </div>
  </modal>
</template>

<script>

  import co from 'co'
  import { PagedList,HttpResetClass } from 'vue-client'
  import * as Util from '../../Util'
  import ObjConfig from '../../../utils/GerJsonObjectConfig'
  import {jsonSort} from '../../../utils/LdapHelper'
  import Vue from "vue";
  export default {
    title: '隐患信息',
    data () {
      return {
        loginorg:this.$login.f.orgs+'隐患处理单',
        yhpaths:null,
        yhpathdeals:null,
        isBack:false,
        path:''
      }
    },
    props: ['data','show','realpath','realsignpath','path'],
    ready: function () {
      console.log("shuj" + JSON.stringify(this.data))
      console.log("realpath" + JSON.stringify(this.realpath))
      console.log("realsignpath" + JSON.stringify(this.realsignpath))
      console.info('照片路径' + JSON.stringify(this.data.f_path))
      this.path = '/rs/image/file/' + JSON.stringify(this.data.f_path).split('"')[1]

    },
    methods: {
      cancel(){
        this.$parent.showcheckmsg = false
      },

    }
  }
</script>
<style media="screen" scoped>
  .divtext {
    min-width: 50px;
    max-width: 200px;
    border: 1px solid green;
    display: inline-block;
  }
  .bg-info{
    border-left: 5px solid #5989be;
  }
  .bg-cus-body {
    margin-left: 5px;
  }

</style>
