<template>
  <el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">

    <el-form label-width="140px">
      <el-row class="el-row-table">
        <el-col :span="12">
          <el-form-item label="隐患唯一编码">
            <span v-if="detailInfo.fHazardUniqueCode">{{ detailInfo.fHazardUniqueCode }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="隐患自有编号">
            <span v-if="detailInfo.fHazardOutUniqueCode">{{ detailInfo.fHazardOutUniqueCode }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="设计供气企业编码">
            <span v-if="detailInfo.fInvolveEnterpriseCode">{{ detailInfo.fInvolveEnterpriseCode }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="检查对象分类">
            <span v-if="detailInfo.fObjType">{{ $parent.fObjTypeFormat(detailInfo) }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="对象编码">
            <span v-if="detailInfo.fObjCode">{{ detailInfo.fObjCode }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="行政区县级行政区ID">
            <span v-if="detailInfo.fObjBelongRegionId">{{ detailInfo.fObjBelongRegionId }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="监督检查时间">
            <span v-if="detailInfo.fCheckTime">{{ detailInfo.fCheckTime }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="隐患分类分级编码">
            <span v-if="detailInfo.fHazardTypeLevelId">{{ detailInfo.fHazardTypeLevelId }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="隐患描述">
            <span v-if="detailInfo.fHazardDesc">{{ detailInfo.fHazardDesc }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="是否执行" prop="fIsEnforcement">
            <span v-if="detailInfo.fIsEnforcement == '1'">是</span>
            <span v-else-if="detailInfo.fIsEnforcement == '0'">否</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>


        <el-col :span="12">
          <el-form-item label="隐患整改前照片">
            <el-image
              :src="detailInfo.fBeforePicture"
              :preview-src-list="[detailInfo.fBeforePicture]"
              v-if="detailInfo.fBeforePicture != '' && detailInfo.fBeforePicture != null"
              :z-index=5000
              style="width: 200px;height: 200px;"
            ></el-image>
            <span v-else>-</span>
          </el-form-item>
        </el-col>



        <el-col :span="12">
          <el-form-item label="备注">
            <span v-if="detailInfo.fRemark">{{ detailInfo.fRemark }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>
      </el-row>

    </el-form>

  </el-dialog>

</template>

<script>
  import { getRef } from "@/api/supervision/spot";
  export default {
    name: "detail-info",
    data(){
        return{
          detailInfo: {
            fDeleteFlag: 0
          },
          detailOpen: false
        }
    },
    methods:{
      getDetailInfo(id){
        getRef(id).then(res =>{
          if(res.code == 200 && res.data){
            this.detailInfo = res.data;
            this.detailOpen = true;
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
