<template>
	<div class="message">
	  <!-- 基本信息 -->
	  <div>
	    <div class="describe">基本信息</div>
	    <div class="message-form">
	      <div>项目名称：{{projectdetail.projectName}}  </div>
	      <div class="flex-between">
	        <div>项目编号：{{projectdetail.projectCode}}</div>
	        <div>项目分类：{{projectdetail.classifyName}}</div>
	      </div>
	      <div class="flex-between">
	        <div>采购单位：{{companyName}}</div>
	        <div>项目归属行业：{{projectdetail.industryName}}</div>
	      </div>
	      <div class="flex-between">
	        <div>项目归属地区：{{projectdetail.region}}</div>
	        <div>最小投标单位数：{{projectdetail.minTender}}</div>
	      </div>
	      <div class="flex-between">
	        <div>招标联系人：{{projectdetail.contacts}}</div>
	        <div>联系方式：{{projectdetail.contactsWay}}</div>
	      </div>
	    </div>
	  </div>
	  <!-- 标书费用 -->
	  <div>
	    <div class="describe">标书费用信息</div>
	    <div class="message-form">
	      <div class="flex-between">
	        <div>标书费结算账号：{{projectdetail.bidBookInfoDO.account}}</div>
	        <div>标书费结算开户行：{{projectdetail.bidBookInfoDO.bank}}</div>
	      </div>
	      <div class="flex-between">
	        <div>标书费结算账户名：{{projectdetail.bidBookInfoDO.accountName}}</div>
	        <div>标书费结算联系电话：{{projectdetail.bidBookInfoDO.phone}} </div>
	      </div>
	    </div>
	  </div>
	  <!-- 保证金费用 -->
	  <div>
	    <div class="describe">保证金费用信息</div>
	    <div class="message-form">
	      <div>是否需要投标保证金：{{projectdetail.isNeedEarnest?"是":"否"}}</div>
				<div class='price' v-if="projectdetail.isNeedEarnest">
					<div>投标保证金金额：{{projectdetail.earnestInfoDO.money}}</div>
					<div class="flex-between">
					  <div>投标保证金结算账号：{{projectdetail.earnestInfoDO.account}}</div>
					  <div>投标保证金结算开户行：{{projectdetail.earnestInfoDO.bank}}</div>
					</div>
					<div class="flex-between">
					  <div>投标保证金结算账户名：{{projectdetail.earnestInfoDO.userName}}</div>
					  <div>投标保证金结算联系电话：{{projectdetail.earnestInfoDO.phone}} </div>
					</div>
				</div>
	    </div>
	  </div>
	  <div>
	    <div class="describe">标的需求</div>
	    <dataTable :table-data="projectdetail.commodityVOList" :columns="columns" :margin-top="10" :margin-bottom="0">

	    </dataTable>
	  </div>
      <div>
          <timeSet ref="timeSet" :ruleForm="detail"></timeSet>
      </div>
	  <div class="button">
	    <el-button @click="back">返回</el-button>
	  </div>
	</div>
</template>



<script>
import timeSet from "@/pages/purchaser/bid/seeProject/timeSet.vue"
import { projectdetail,timeInfo} from '@api/supply/bid'
	import dataTable from '@components/nopageTable.vue'
export default {
components: {
      dataTable,
      timeSet
	},
  data() {
    return {
        detail:{},
		companyName:"",
		projectdetail:"",
      breads: ['投标管理', '我参与的项目', '工作台 '],
      nav: ['供应商'],
      dialogFormVisible: false,
      tip: '请上传于招标项目相关的文件,如委托单,技术附件,招标方案,项目真是材料等(文件格式PDF,JPG,JPEG,ZIP,RAR,数量不超过20个,单个文件大小不超过25M)',
      managers: [],
      belongTypes: [],
      projectTypes: [],
      textarea: '',
      tableData: [],
      columns: [{
        label: '标的编码',
        prop: 'encoding'
      },
      {
        label: '标的名称',
        prop: 'bidName'
      },
      {
        label: '数量',
        prop: 'quantity'
      },
      {
        label: '计量单位',
        prop: 'unit'
      },
      {
        label: '品牌',
        prop: 'brand'
      },
      {
        label: '规格型号',
        prop: 'specification'
      },
      {
        label: '标杆价(元)',
        prop: 'price'
      },
      {
        label: '备注',
        prop: 'remark'
      },
    
      ],
      ruleForm: {
        companyName: '',
        projectCode: '',
        classify: '',
        purchaseAgent: '',
        industry: '',
        region: '',
        minTender: '',
        contacts: '',
        contactsWay: '',
        // 招标方式
        bidType: 0,
        isPublishAd: false,
        content: '',
        // 标的需求
        isNeedEarnest: false,
        provinceId: '',
        cityId: '',
        districtId: ''
      }
    }
  },
  computed: {

  },
  created() {
    this.getprojectdetail()
	this.gettimeInfo()
	this.companyName=JSON.parse(localStorage.getItem("userInfo")).companyName
  },
  methods: {
      async getprojectdetail() {
		  let projectId=localStorage.getItem("projectId")
    	        const {data} = await projectdetail(projectId)
                this.projectdetail=data
                this.detail = data
      },
	    async gettimeInfo() {
			 let projectId=localStorage.getItem("projectId")
	  	        const {data} = await timeInfo(projectId)
				this.timeInfo=data
	  	 },
		 back(){
			 this.$router.go(-1)
		 }
  }

}
</script>

<style scoped>
	.message>div {
		background: #fff;
		margin-bottom: 30px;
	}
	
	.message-form>div,.price>div{
		margin-bottom: 10px
	}
	  
	.message-form {
		width: 80%;
		margin: 0 auto
	}
	
	.message-form {
		padding-bottom: 15px;
	}
	
	.message {
		background: #F0F2F5;
	}
	
	.button {
		display: flex;
		justify-content: flex-end;
		padding: 10px 20px;
	
	}
	
	.bid {
		margin-bottom: 20px;
	}
</style>
