<template>
	<view class="safe-list">
		<view class="list-detail">
			<view class="list-item" @click="previewData(1)">
				<view>问题隐患<text class="num">{{info.hiddenDangerNum}}</text></view>
				<uni-icons type="arrowright"></uni-icons>
			</view>
			<view class="list-item" @click="previewData(2)">
				<view>排查记录<text class="num">{{listData.length}}</text></view>
				<uni-icons type="arrowright"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['detailId',"info"],
		data(){
			return{
				listData: [],
			}
		},
		created() {
			this.initData();
		},
		methods:{
			initData() {
				this.sendRequest({
					url: 'xmgl/xzSecurityQualityInspectionRecord/list',
					method: 'post',
					data: {
						engineeringId: this.detailId,
						projectSn: this.info.projectSn,
						pageNo: 1,
						pageSize: -1,
						recordType: 2,
						type: 11,
					},
					success: res => {
						uni.hideLoading()
						if (res.code == 200) {
							this.listData = res.result.page.records;
							console.log(res)
						}
					}
				})
			},
			previewData(val){
				if(val == 1){
					uni.navigateTo({
						// url:'../safeManage/dangerList?type=5&engineeringId='+this.detailId
						url:"./list/list?type=1&engineeringId=" + this.detailId
					})
				} else if(val == 2){
					uni.navigateTo({
						url:"./list/list?type=2&engineeringId=" + this.detailId
						// url:'../safeManage/dangerList?type=6&engineeringId='+this.detailId
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.safe-list{
		padding-top: 20rpx;
		.list-detail{
			background: #fff;
			padding: 0 40rpx;
			.list-item{
				height: 96rpx;
				border-bottom: 1px solid #F6F6F6;
				line-height: 92rpx;
				font-size: 14px;
				display: flex;
				justify-content: space-between;
			}
			.num{
				margin-left: 40rpx;
			}
		}
	}
</style>
