<template>
	<div class="checkPersonnelInfo">
		<headNav
		@backPage="backPage"
		:title="'人员信息'"></headNav>
		
		<div class="mainCheck" v-if="dataList.length > 0">
			<div class="headTip FontColorInfo">
				主检查人
			</div>
			<div>
				<van-cell title="主检查人" :value="dataList[0].user_name" />
				<van-cell title="联系方式" :value="dataList[0].phone" />
			</div>
		</div>
		
		<template v-if="dataList.length > 1">
			<template v-for="(item, index) in dataList">
				<div v-if="index > 0" class="otherCheck" :key="index">
					<div class="headTip FontColorInfo">
						协检查人
					</div>
					<div>
						<van-cell title="协检查人" :value="item.user_name" />
						<van-cell title="联系方式" :value="item.phone" />
					</div>
				</div>
			</template>
		</template>
		<v-mask :showOverLay="showOverLay"></v-mask>
	</div>
</template>

<script>
	import headNav from '@/components/headNav.vue'
	import { get, post } from '@/utils/http.js'
	import mask_overLay from "@/components/overLay_xy.vue";
	
	export default {
		name: 'checkPersonnelInfo',
		components: {
			headNav,
			"v-mask": mask_overLay,
		},
		data() {
			return {
				showOverLay: true,
				dataList: [],
			}
		},
		mounted() {
			this.init();
		},
		methods: {
			// 初始化
			init() {
				this.getDetailInfoApi();
			},
			
			// 获取任务详情信息
			getDetailInfoApi() {
				get(`/v2/api/enforce-job/${ this.$route.params.ID }`).then(res => {
					// if (res.success == true) {
					// 	let person = [];
					// 	let phone = [];
					// 	if (res.data.checkPerson) {
					// 		person = res.data.checkPerson.split(',');
					// 	}
					// 	if (res.data.checkPersonTel) {
					// 		phone = res.data.checkPersonTel.split(',');
					// 	}
					// 	this.dataList = {
					// 		person: person,
					// 		phone: phone
					// 	};
					// }
					this.dataList = res.executors || []
					this.showOverLay = false
				});
			},
			
			backPage() {
				this.$router.go(-1);
			},
			
		},
	}
</script>

<style lang="scss" scoped>
	.checkPersonnelInfo {
		font-size: 14px;
		
		.headTip {
			margin-bottom: 10px;
			padding: 0 15px;
		}
		
		.mainCheck {
			margin-top: 57px;
		}
		
		.otherCheck {
			margin-top: 10px;
		}
	}
</style>

<style lang="scss">
	.checkPersonnelInfo {
		
		.van-cell {
			font-size: 12px;
			
			.van-cell__title {
				color: #4f4f4f;
			}
			
			&::after {
				border-bottom: 1px solid #ebebeb;
			}
		}
	}
</style>
