<template>
    <el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
      <el-form label-width="170px">
        <el-row class="el-row-table"> 
  
          <el-col :span="12">
            <el-form-item label="所属企业" >
              <span v-if="detailInfo.beyondEnterpriseName">{{ detailInfo.beyondEnterpriseName }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="户主姓名">
              <span v-if="detailInfo.username">{{ detailInfo.username }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="户主电话" >
              <span v-if="detailInfo.phone">{{ detailInfo.phone }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="改造类型" >
              <span v-if="detailInfo.type">{{ $parent.typeFormat(detailInfo) }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="用气量" >
              <span v-if="detailInfo.dosage">{{ detailInfo.dosage }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="完成时间" >
              <span v-if="detailInfo.finishTime">{{ detailInfo.finishTime }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="所属区域" >
              <span v-if="detailInfo.township">{{ $parent.townshipFormat(detailInfo) }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="状态" >
              <span v-if="detailInfo.status == 0">正常</span>
              <span v-else-if="detailInfo.status == 1">停用</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="24">
            <el-form-item label="房屋位置" >
              <span v-if="detailInfo.housesAddress">{{ detailInfo.housesAddress }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
          <el-col :span="24">
            <el-form-item label="房屋信息" >
              <span v-if="detailInfo.housesInfo">{{ detailInfo.housesInfo }}</span>
              <span v-else>-</span>
            </el-form-item>
          </el-col>
  
        </el-row>
      </el-form>  
    </el-dialog>
  </template>
  
  <script>
import { getBook } from "@/api/system/book"; 
    export default {
      name: "detail-info",
      data(){
          return{
            enterprises: [],
            countyInfo: [],
            detailInfo: {},
            enterpriseName:"",
            detailOpen: false,
            fUploadTimeLable: "",
            fUploadTypeLable: "",
            fUploadType: "",
            fUploadTime: null
          }
      },
    created() {  
      this.getCountyInfo();
      this.getEnterpriseLists();
    },
      methods:{
        getDetailInfo(id){
            getBook(id).then(res =>{
            if(res.code == 200 && res.data){
              this.detailInfo = res.data;
            //   this.detailInfo.fRegion = this.beyondCountyFormat(this.detailInfo);
            //   let fEnterpriseId = this.detailInfo.fEnterpriseId;
            //   if (fEnterpriseId != null) {
            //     this.enterpriseName= this.beyondCompanyFormat(this.detailInfo);
            //   } 
              this.detailOpen = true;
            }
          })
        }
      }
    }
  </script>
  
  <style scoped>
  
  </style>
  