<template>
	<div class="app-container qyzx-details">
		<div class="bottomlist">
			<ul class="bottomlist-content">
				<li class="bottomlist-list"  >
					<p class="list-titel">
						 {{textList.projectName}}
						 <!-- <div  v-else-if="item.projectName" v-html="item.projectName"></div> -->
					</p>
					<div class="content-label">
						<span class="list-label list-label-zb" v-if="textList.province||textList.city||textList.district">{{textList.province}}<template v-if="textList.city">-{{textList.city}}</template><template v-if="textList.area">-{{textList.area}}</template></span>
						<span class="list-label list-label-zb" v-if="textList.projectLevel">{{textList.projectLevel}}</span>
					</div>
					
					<div  class="list-content">
						<p class="list-content-text"  v-if="textList.constructUnit">
							<span>项目法人：</span>
							<span v-if="textList.constructUnitId">
								<span class="blue"  @click="getUipIdByCid(textList.constructUnitId)" v-html="textList.constructUnit"></span>
							</span>
							<span v-else  v-html="textList.constructUnit"></span>						
						</p>
						<p class="list-content-text" v-if="textList.projectType">
							<span>项目类型：</span>
							<span>{{textList.projectType}}</span>
						</p>
						<p class="list-content-text" v-if="textList.totalInvestment>0">
							<span>项目投资金额：</span>
							<span>{{textList.totalInvestment}}万元</span>
						</p>
						<p class="list-content-text" v-if="textList.year">
							<span>项目年度：</span>
							<span>{{textList.year}}年</span>
						</p>
					</div>
					
				</li>
			</ul>

		</div>

		<div class="content main3">
			<div class="common-title">项目基本信息</div>
			<div class="main3-box">
				<p>
					<label class="label">项目法人</label>
					<span style="padding-left: 0;" v-if="textList.constructUnitId">
						<span class="blue"  @click="getUipIdByCid(textList.constructUnitId)" v-html="textList.constructUnit"></span>
					</span>
					<span v-else   v-html="textList.constructUnit||'--'"></span>						
					<label class="label">主管部门</label>
					<span>{{textList.chargeDepartment||'--'}}</span>
				</p>
				<p>
					<label class="label">项目地区</label>
					<span>{{textList.province}}<template v-if="textList.city">-{{textList.city}}</template><template v-if="textList.area">-{{textList.area}}</template></span>
					<label class="label">项目级别</label>
					<span >{{textList.projectLevel||'--'}}</span>

				</p>
				
				<p>
					<label class="label">项目类型</label>
					<span>{{textList.projectType||'--'}}</span>
					<label class="label">项目年度</label>
					<span>{{textList.year?textList.year+'年':'--'}}</span>
				</p>
				<p>
					<label class="label">拟开工时间</label>
					<span>{{textList.planStartDate?textList.planStartDate+'年':'--'}}</span>
					<label class="label">拟建成时间</label>
					<span>{{textList.planCompletionDate?textList.planCompletionDate+'年':'--'}}</span>
				</p>
				<p>
					<label class="label">总投资额 </label>
					<span>{{textList.totalInvestment>0?textList.totalInvestment+'万元':'--'}}</span>
					<label class="label">已完成投资额</label>
					<span>{{textList.completedInvestment>0?textList.completedInvestment+'万元':'--'}}</span>
				</p>
				<p>
					<label class="label">年度投资额 </label>
					<span>{{textList.planInvestment>0?textList.planInvestment+'万元':'--'}}</span>
					<label class="label">联系人及联系方式</label>
                    <!-- <span v-if="textList.personTel && textList.personTel.length>0">
                        <template v-for="item in JSON.parse(textList.personTel)">{{ item.tel }} </template>
                    </span>
                    <span v-else>--</span> -->
					<span >{{textList.contactPersonAndTel||'--'}}</span>
				</p>
				
			
			</div>
		</div>
	
		<div class="content main3">
		  <div class="common-title">项目建设内容</div>
		  <div class="main3-box">
				<p>
					<label class="label">建设地点</label>
					<span>{{textList.projectAddress||'--'}}</span>
					<label class="label">项目进度(工作进展)</label>
					<span>{{textList.projectSchedule||'--'}}</span>
				</p>
				
				<p>
					<label class="label">建设规模</label>
					<span class="span-one">{{textList.projectScale||'--'}}</span>
				</p>
				
			
			</div>
		</div>
		
		<div class="content main3">
		  <div class="common-title">来源＆附件下载</div>
		  <div class="main3-box">
				<p>
					<label class="label">项目清单</label>
					<span class="span-one">
						<span v-if="textList.fileUrl" @click="linkTo(textList.fileUrl)" class="blue">{{textList.fileTitle||'--'}}</span>
						<span v-else>{{textList.fileTitle||'--'}}</span>
					</span>
				</p>
				<p>
					<label class="label">来源网站</label>
					<span class="span-one">
						<span v-if="textList.sourceUrl" @click="linkTo(textList.sourceUrl)" class="blue">{{textList.sourceName||'--'}}</span>
						<span v-else>{{textList.sourceName||'--'}}</span>
					</span>
				</p>
				
			
			</div>
		</div>
		

	</div>
</template>

<script>
	import api from '@/api/radar/radar.js';
	import {encodeStr} from "@/assets/js/common.js"
	export default {
		name: 'MajorProjectDetails',
		data() {
			return {
				encodeStr,
				id: '',
				textList: {},
				pageNum1:1,
				pageSize1:10,
				tableData1:[],
				total1:0,
				
				pageNum2:1,
				pageSize2:10,
				tableData2:[],
				total2:0,
			}
		},
		created() {
			this.id = this.$route.params.id;
			this.approvalInfoDetail();
			this.approvalExaminePage();
			this.approvalMarketingPage();
			
		},
		methods: {
			linkTo(url){
				window.open(url,'_blank')
			},
			approvalInfoDetail() {
				api.getImportantDetail({
					md5Id: this.id
				}).then(res => {
					// console.log(res);
					this.textList = res.data;
				}).catch(error => {
		
				});
			},
			handleCurrentChange1(pageNum1) {
				this.pageNum1 = pageNum1;
				this.search(pageNum1, this.pageSize1);
			},
			approvalExaminePage(pageNum1, pageSize1) {
				if (!pageNum1) {
					this.pageNum1 = 1;
				}
				if (!pageSize1) {
					this.pageSize1 = 20;
				}
				var data = {
					id: this.id,
					pageNum: this.pageNum1,
					pageSize: this.pageSize1
				}
				api.approvalExaminePage(data).then(res => {
					// console.log(res);
					this.tableData1 = res.rows;
			
				}).catch(error => {
			
				});
			},
			handleCurrentChange2(pageNum2) {
				this.pageNum2 = pageNum2;
				this.search(pageNum2, this.pageSize2);
			},
			getUipIdByCid(companyId){
				var params=[companyId]
				api.getUipIdByCid(params).then(res=>{
					if (res.code==200) {
						if(res.data&&res.data.length>0&&res.data[0].uipId){
							this.$router.push({path: '/enterprise/'+this.encodeStr(companyId)})
						}else{
							this.$router.push({path: '/company/'+this.encodeStr(companyId)})
						}
					}
				}).catch(error=>{
					
				});
			},
			approvalMarketingPage(pageNum2, pageSize2) {
				if (!pageNum2) {
					this.pageNum2 = 1;
				}
				if (!pageSize2) {
					this.pageSize2 = 20;
				}
				var data = {
					id: this.id,
					pageNum: this.pageNum2,
					pageSize: this.pageSize2
				}
				api.approvalMarketingPage(data).then(res => {
					// console.log(res);
					this.tableData2 = res.rows;
			
				}).catch(error => {
			
				});
			}
			
		
		}
	}
</script>

<style lang="scss" scoped>
	.bottomlist {
		width: 100%;
		background-color: #FFFFFF;

		border-radius: 4px 4px 4px 4px;

		.bottomlist-title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 12px;
			padding: 16px;
			border-bottom: 1px solid #EFEFEF;

			.title-right {
				display: flex;
				align-items: center;

				p:first-child {
					font-size: 12px;
					font-weight: 400;
					color: #3D3D3D;
					margin-right: 10px;
				}

				p:last-child {
					display: flex;
					align-items: center;
					font-size: 14px;
					font-weight: 400;
					color: rgba(35, 35, 35, 0.8);
				}

				img {
					width: 18px;
					height: 18px;
				}
			}

		}

		.bottomlist-content {

			padding-bottom: 0px;
		}

		.bottomlist-list {
			padding: 16px;
			font-size: 14px;
			border-bottom: 1px solid #EFEFEF;
			padding-bottom: 14px;

			.list-titel {
				font-size: 16px;
				font-weight: 700;
				color: #3D3D3D;
				line-height: 19px;

				.list-titel-a {
					text-decoration: none;
					color: #3D3D3D;
				}

				a:hover,
				a:visited,
				a:link,
				a:active {
					color: #3D3D3D;
				}
			}

			.content-label {
				margin-top: 12px;
				margin-bottom: 8px;

				.list-label {
					background: #F3F3FF;
					color: #8491E8;
					border-radius: 1px 1px 1px 1px;
					padding: 3px 7px;
					font-size: 12px;
					margin-right: 12px;
				
				}
				.list-label-zb{
					font-weight: 400;
					color: #8491E8;
					background: #F3F3FF;
				}
			}


			.list-content {
				margin-top: 3px;
				display: flex;
				justify-content: start;
				align-items: center;

				.list-content-text {
					margin-top: 7px;
					display: flex;
					justify-content: start;
					align-items: center;
					margin-right: 27px;
					font-size: 14px;

					span:first-child {
						font-weight: 400;
						color: rgba(35, 35, 35, 0.4);
						line-height: 15px
					}

					span:last-child {
						font-weight: 400;
						color: rgba(35, 35, 35, 0.8);
						line-height: 15px
					}

					.blue {
						color: #0081FF !important;
						cursor: pointer;

					}

				}


			}

			.list-addree {
				width: auto;
				background: #F3F4F5;
				display: inline-flex;
				margin-top: 7px;

				.list-content-text {
					margin-top: 0px;

					span {
						line-height: 30px !important;
					}
				}

				img {
					width: 14px;
					margin: 0 8px;

				}
			}


		}

		.bottomlist-list:hover {
			background: #F6F9FC;
			cursor: pointer;
		}

		.pagination {
			padding: 14px;

			.el-pagination {
				float: right;
			}
		}
	}

	.app-container {
		padding: 0;
	}

	.qyzx-details {
		.tab {
			font-size: 12px;
			color: #A1A1A1;

			span {
				color: #232323;
			}
		}

		.content {
			margin-top: 16px;
			background: #FFFFFF;
			padding: 16px;
			border-radius: 4px;
		}

		.common-title {
			margin-bottom: 8px;
		}

		.main1 {
			.title {
				color: #232323;
				font-size: 16px;
				line-height: 28px;
				font-weight: bold;
				margin-bottom: 8px;
				text-align: left;

				img {
					width: 28px;
					height: 28px;
					margin-bottom: -9px;
					margin-right: 17px;
				}
			}

			p {
				color: #3D3D3D;
				font-size: 14px;
				margin: 0;
			}
		}

		.main2 {
			.list {
				display: flex;
				margin: 16px 0;
			}

			.item {
				width: 24.5%;
				margin-right: 16px;
				height: 100px;
				display: flex;
				justify-content: space-between;
				border-radius: 8px;

				.item-left {
					margin-left: 16px;
					margin-top: 24px;

					h4 {
						color: #232323;
						font-size: 22px;
						line-height: 22px;
						font-weight: bold;
						margin: 0;

						span {
							font-weight: 400;
							margin-left: 4px;
							font-size: 18px;
						}
					}

					p {
						margin: 0;
						color: #3D3D3D;
						font-size: 14px;
						padding-top: 8px;
					}
				}

				.img {
					width: 56px;
					height: 56px;
					margin-top: 22px;
					margin-right: 12px;
				}
			}

			.color1 {
				background: rgba(246, 190, 59, 0.08);
				border: 1px solid rgba(246, 190, 59, 0.2);
			}

			.color2 {
				background: rgba(148, 216, 196, 0.102);
				border: 1px solid rgba(73, 187, 154, 0.1);
			}

			.color3 {
				background: rgba(57, 100, 199, 0.06);
				border: 1px solid rgba(57, 100, 199, 0.1);
			}

			.color4 {
				background: rgba(0, 129, 255, 0.04);
				border: 1px solid rgba(0, 129, 255, 0.1);
			}
		}

		.main3 {
			.main3-box {
				margin-top: 22px;
				border-top: 1px solid #E6E9F0;

				p {
					display: flex;
					margin: 0;
					border-left: 1px solid #E6E9F0;
					border-right: 1px solid #E6E9F0;
					border-bottom: 1px solid #E6E9F0;
					background: #fff;
					.label {
						width: 10%;
						height: auto;
						font-weight: 400;
						font-size: 12px;
						padding: 12px;
						background: #F0F3FA;
						display: flex;
						align-items: center;
					}

					span {
						display: flex;
						align-items: center;
						width: 40%;
						color: #000;
						padding: 12px;
						font-size: 12px;
					}

					.span-one {
						width: 90%;
					}
					.blue {
						color: #0081FF !important;
						cursor: pointer;
					
					}

				}

			}
		}

		.main4 {
			.main4-box {
				margin-top: 22px;

				.label {
					width: 14%;
					background: #F0F3FA;
					border: 1px solid #E6E9F0;
					display: inline-block;
					height: 40px;
					line-height: 40px;
					font-size: 12px;
					color: rgba(35, 35, 35, 0.8);
					padding-left: 12px;
				}

				span {
					width: 19%;
					display: inline-block;
					height: 40px;
					line-height: 40px;
					border-top: 1px solid #E6E9F0;
					border-bottom: 1px solid #E6E9F0;
					padding-left: 12px;
					font-size: 12px;
				}

				span:last-child {
					width: 20%;
					border-right: 1px solid #E6E9F0;
				}
			}
		}

		.main3 {
			.table-item {
				margin-top: 22px;
				.pagination {
					padding: 14px;
				
					.el-pagination {
						float: right;
					}
				}
				
			}
		}
	}
</style>