<template>
	<view class="control">
		<view class="fixedheader">
			<headers :themeType="true" :showBack="true">
				<view class="headerName">
					{{title}}
				</view>
			</headers>
		</view>
		<view :style="{ 'padding-top': ((statusBarHeight * 2) + 45) * 1.5 + 'rpx' }">
			<dangerBigCheckDetail :tableData="tableData" :type="1"></dangerBigCheckDetail>
		</view>
	</view>
</template>

<script>
	import dangerBigCheckDetail from './dangerBigCheckDetail.vue'
	export default {
		data(){
			return{
				userId: "",
				statusBarHeight: 0,
				tableData: [],
				taskId: "",
				title: ""
			}
		},
		components:{
			dangerBigCheckDetail
		},
		onShow(val){
			this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
		},
		onLoad(val){
			this.userId = val.id
			this.taskId = val.taskId
			this.title = decodeURIComponent(val.name)
			this.initData();
		},
		methods:{
			initData(){
				this.sendRequest({
					url:'xmgl/acceptanceTableCheckTask/getAcceptanceTableCheckTaskInfo',
					method:'post',
					data:{taskId: this.taskId, userId: this.userId},
					success:res=>{
						uni.hideLoading()
						this.tableData = res.result.myCheckrecord.list
						this.tableData.forEach(item=>{
							item.isShow = true
							item.children.forEach(item2=>{
								item2.chooseType = '0'
								item2.children.forEach(item3=>{
									console.log(item3.chooseType)
									if(item3.chooseType != '0'){
										item2.chooseType = ''
										return;
									}
								})
							})
						})
						this.tableData.forEach(item=>{
							item.chooseType = '0'
							item.children.forEach(item2=>{
								if(item2.chooseType != '0'){
									item.chooseType = ''
									return;
								}
							})
						})
						console.log(this.tableData)
					}
				})
			},
			previewDetail(val){
				console.log(val)
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.control{
		min-height: 100%;
		background: #ededed;
		.fixedheader{
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			z-index: 2;
		}
		.flex{
			display: flex;
		}
		.j-between{
			justify-content: space-between;
		}
		.a-center{
			align-items: center;
		}
		.b-bottom{
			border-bottom: 1px solid #F6F6F6;
		}
		.control-h2{
			font-size: 28rpx;
			height: 60rpx;
			padding: 0 20rpx;
			background: rgba(255,255,255,0.5);
		}
		
	}
</style>
