<template>
	<view class="fullHeight dangerRecords">
		<headers class="fixedheader" :themeType="true" :showBack="true">
			<view class="headerName">
				隐患上报记录
			</view>
		</headers>
		<scroll-view class="smallHeight" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }" scroll-y>
			<view class="record-list">
				<view class="record-item" v-for="(item,index) in dataList" :key="index">
					<view class="record-title flex">
						<view class="title-tag bg1"></view>
						<view class="content">{{item.checkContent}}</view>
						<text class="record-status status1">未完成</text>
					</view>
					<view class="record-content flex">
						<view class="record-detail">
							<view class="record-text">整改人：<text>{{item.changeUserName}}</text></view>
							<view class="record-text">整改单位：<text>{{item.enterpriseName}}</text></view>
							<view class="record-text">上报时间：<text>{{item.createTime}}</text></view>
							<view class="record-text">要求完成时间：<text>{{item.changeLimitTime}}</text></view>
						</view>
						<view class="record-actions">
							<view class="edit-btn" @click="editDetail">编辑</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import headers from '../../../components/headers/headers.vue'
	export default{
		data(){
			return{
				statusBarHeight: 0,
				selectId: 1,
				dataList: [],
				projectSn: "",
				userId: ""
			}
		},
		components:{
			headers
		},
		onShow(){
			this.statusBarHeight=uni.getStorageSync('systemInfo').statusBarHeight;
			this.userId = JSON.parse(uni.getStorageSync('userInfo')).userId
			this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
			this.queryData()
		},
		methods:{
			editDetail(){
				// uni.navigateTo({
				// 	url: './addExamine?id=' + this.selectId + '&type=2'
				// })
			},
			queryData(){
				let _this = this
				let data = {
					changeUser: "",
					createUser: this.userId,
					reviewId: "",
					itemId: "",
					pageNo: 1,
					pageSize: 1000,
					projectSn: this.projectSn,
				}
				console.log(this.userId)
				this.sendRequest({
					url: 'xmgl/hiddenDangerInspectRecord/list',
					method: 'post',
					data: data,
					success: res => {
						this.dataList=res.result.records
						console.log(res.result, '-----list')
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.dangerRecords{
	.fixedheader{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 2;
	}
	.smallHeight{
		height: 100%;
		box-sizing: border-box;
		background: #efefef;
	}
	.flex{
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.record-list{
		padding: 28rpx;
		.record-item{
			background: #fff;
			border-radius: 8rpx;
			padding: 10rpx 0;
			margin-bottom: 20rpx;
			.record-title{
				font-weight: 600;
				padding: 16rpx 0;
				font-size: 28rpx;
				margin-left: 30rpx;
				position: relative;
				border-bottom: 2px solid #eee;
				.title-tag{
					position: absolute;
					top: 50%;
					left: -30rpx;
					width: 6rpx;
					height: 40rpx;
					transform: translateY(-50%);
				}
				.bg1{
					background: #E6A23C;
				}
				.content{
					text-overflow: ellipsis;
					overflow: hidden;
					white-space: nowrap;
				}
				.record-status{
					font-weight:normal;
					margin-right: 30rpx;
					white-space: nowrap;
				}
				.status1{
					color: #E6A23C;
				}
			}
			.record-content{
				padding-left: 30rpx;
				padding-top: 20rpx;
				font-size: 24rpx;
				.record-text{
					color: #C0C0C0;
					margin-bottom: 12rpx;
					uni-text{
						color: #000;
					}
				}
				.record-actions{
					.edit-btn{
						color: #409EFF;
						margin-right: 20rpx;
						padding: 6rpx 12rpx;
						border-radius: 8rpx;
						border: 1px solid #409EFF;
					}
				}
			}
		}
	}
}
</style>
