<template>
  <div>
    <div class="content">
      <dataBreadcrumb :breads="breads"></dataBreadcrumb>
      <changeNav :navs="navs"></changeNav>
      <div class="message">
        <div class="flex-between">
         <div>项目编号：{{projectCode}}</div>
         <div>项目名称：{{projectName}}</div>
        </div>
        <div v-if="state" class="flex-between">
          <div>日期：{{detail.createTime}}</div>
          <div>招标结果通知书编号：{{detail.number}}</div>
        </div>
        <div v-if="state">
          <div class="flex" >
              <div style="margin-right: 20px;">附件:</div>
              <ul>
                        <!-- <li v-for="(item, i) in detail" :key="i"> -->
                            <a  target="_blank" :href=detail.resultBookUrl>{{ detail.resultBookName }}</a>
                    </ul>
            <!-- <div style="margin-right: 20px;">附件：中标通知书.pdf</div>
            <el-button size="mini">下载</el-button>  -->
          </div>
        </div>
		<div v-else class="detail1">
			没找到招标结果通知书！
		</div>
      </div>
      <div class="centerButton">
        <el-button @click="back">返回</el-button>
      </div>
    </div>
  </div>
</template>

<script>
		import { bidResultBook} from '@api/supply/bid'
import dataBreadcrumb from '@components/dataBreadcrumb.vue'
import changeNav from '@components/changeNav.vue'
export default {
  components: {
    dataBreadcrumb,
    changeNav
  },
  data() {
    return {
      breads: ['投标管理 ', '我参加的项目', '工作台'],
      navs: ['招标结果通知书'],
	  projectCode:"",
	  projectName:"",
	  detail:[],
      state:true,
    }
  },
 methods: {
 	  back(){
 	  		this.$router.go(-1)  
 	  },
 	  async getbidResultBook() {
		let message={};
 	 message.projectId=localStorage.getItem("projectId")
	 message.companyId=localStorage.getItem("companyId")
 	          const {
 	            data,
 	            code
 	          } = await bidResultBook(message)

			  if(code==200){
                  this.detail=data
                  /*this.createTime = data.createTime .substring(0,10) */
                  /* this.resultId=data.resultId */
			  }else{
				  this.state=false
			  }
 	      }
 },
 created() {
 	  this.projectCode=localStorage.getItem("projectCode")
 	  this.projectName=localStorage.getItem("projectName")
 	 this.getbidResultBook()
 }

}
</script>

	
<style scoped>
	.detail1{
		text-align: center;
		font-size: 20px;
		font-weight: bold;
		margin-top: 30px;
	}
	.content>h1{
		text-align: center;
		margin-top:20px;
		margin-bottom:40px;
		font-weight: bold;
	}
	.content>.img{
	width: 600px;
     margin:0 auto
	}
	.enclosure{
		margin: 20px 0;
	}
	.message{
		width: 70%;
		margin:0 auto
	}
	.message>div{

		margin-bottom: 30px;
	}
	
	.notice{
		width: 80%;
		border:1px solid #000
	}
	.notice{
		margin-top: 200px;
		margin-bottom: 30px;
		padding: 20px 0;
	}
	.notice>h3{
		margin: 20px 0;
	}
</style>
