<template>
  <el-dialog title="详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
    <el-form label-width="90px">
      <el-row class="el-row-table">
        <el-col :span="12">
          <el-form-item label="项目名称">
            <span v-if="detailInfo.title">{{ detailInfo.title }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="项目编号">
            <span v-if="detailInfo.number">{{ detailInfo.number }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="项目分类">
            <span v-if="detailInfo.cateId">{{ $parent.cateIdFormat(detailInfo) }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="项目描述">
            <span v-if="detailInfo.content">{{ detailInfo.content }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="开始时间">
            <span v-if="detailInfo.starttime">{{ detailInfo.starttime }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="结束时间">
            <span v-if="detailInfo.endtime">{{ detailInfo.endtime }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="项目附件">
            <span v-if="detailInfo.fileUrl!=null && detailInfo.fileUrl != ''">
              <a style="color: #1c84c6" :href="detailInfo.fileUrl" target="_blank">查看/下载</a>
            </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.tel">{{ detailInfo.tel }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>

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

<style scoped>

</style>
