<template>
  <el-dialog title="证照详情" :visible.sync="dialogVisible" width="60%">
     <el-descriptions title="" :column="3" size="medium" border>
       <el-descriptions-item>
     	<template slot="label"> 证照编号 </template>
     	{{form.code}}
       </el-descriptions-item>
       <el-descriptions-item>
     	<template slot="label"> 类型 </template>
      	{{getDictValue('证件类型', form.type)}}
       </el-descriptions-item>
       <el-descriptions-item>
     	<template slot="label"> 持证人</template>
     	{{form.holder}}
       </el-descriptions-item>
       <el-descriptions-item :span="2">
     	  <template slot="label"> 有效期至 </template>
     	  {{form.validityStartTime + ' — ' + form.validityEndTime}}
       </el-descriptions-item>
       <el-descriptions-item>
       	<template slot="label"> 状态 </template>
     	  {{getDictValue('规则状态', form.status)}}
       </el-descriptions-item>
       <el-descriptions-item>
       	<template slot="label"> 颁发时间 </template>
       	{{form.enactorTime}}
       </el-descriptions-item>
       <el-descriptions-item>
       	<template slot="label"> 创建人 </template>
     	   {{form.createUserName}}
       </el-descriptions-item>
       <el-descriptions-item>
       	<template slot="label"> 创建机构 </template>
       	{{form.createUserDeptName}}
       </el-descriptions-item>
       <el-descriptions-item>
       	<template slot="label"> 创建时间 </template>
      	{{form.createTime}}
       </el-descriptions-item>
       <el-descriptions-item :span="3">
       	<template slot="label"> 证件图片 </template>
        <el-image
          style="width: 100px; height: 100px"
          :src="form.imageUrl"
          :preview-src-list="[form.imageUrl]"
        />
       </el-descriptions-item>
       <el-descriptions-item :span="3">
       	<template slot="label"> 备注 </template>
     	  {{form.remark}}
       </el-descriptions-item>
     </el-descriptions>
    <div slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import { getPhotoInfo } from '@/api/documentManagement';
  import dictMixins from '@/mixins/dictMixins';
  import { getImageUrl } from '@/utils/file.js';
  export default {
    mixins: [dictMixins],
    components: {},
    //注册组件
    data () {
      return {
        dialogVisible: false,
        form: { }
      };
    },
    computed: {
    },
    created () {
      this.requestDict('证件类型');
      this.requestDict('规则状态');
    },
    methods: {
      open (row) {
        this.dialogVisible = true;
        this.getInfo(row.id)
      },
      async getInfo(id){
        const data = await getPhotoInfo(id)
        this.form = data
        this.form.imageUrl  = getImageUrl(data.fileObj.storePath)
      },
    }
  };
</script>

<style lang="scss">
 .el-form-item{
    margin-bottom:20px!important;
 }
</style>
