<template>
  <el-dialog title="详情" :visible.sync="open" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
    <el-form :model="detailInfo" label-width="100px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="姓名">
            <span>{{ detailInfo.username }}</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="电话">
            <span>{{ detailInfo.phone }}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="12">
          <el-form-item label="所在公司">
            <span>{{ detailInfo.company }}</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="所在部门">
            <span>{{ detailInfo.dept }}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="12">
          <el-form-item label="单位职务">
            <span>{{ detailInfo.job }}</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="应急职务" prop="urgentJob">
            <span>{{ detailInfo.urgentJob }}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <el-form-item label="备注">
        <span v-if="detailInfo.remark">{{ detailInfo.remark }}</span>
        <span v-else>-</span>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
  import { getContacts } from "@/api/urgent/contacts";
  export default {
    name: "detail-info",
    data(){
        return{
          open: false,
          detailInfo: {}
        }
    },
    methods:{
      openDetail(id){
        getContacts(id).then(res =>{
          if(res.code == 200){
             this.detailInfo = res.data;
             this.open = true;
          }
        })

      }
    }
  }
</script>

<style scoped>

</style>
