<template>
	<view class="content">
		<view class="item" v-for="(item,index) in list" :key="index">
			<view class="title">
				<view class="left">{{item.check_location}}</view>
				<view class="right">扣分：{{item.score}}</view>
			</view>
			<view class="time">
				<view class="icon"></view>
				<view class="text">{{item.check_datetime}}</view>
			</view>
			<view class="inner">
				<view class="item">
					<view class="label">问题描述：</view>
					<view class="text">{{item.problem}}</view>
				</view>
				<view class="item">
					<view class="label">解决建议：</view>
					<view class="text">{{item.correct_proposal}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import time from "@/common/time.js"
	
	export default {
		data() {
			return {
				start_time: "",
				end_time: "",
				depart_id:"",
				
				list:[]
			};
		},
		onLoad(option) {
			// 初始化时间
			this.start_time = new Date().format("yyyy-MM-01")
			this.end_time = new Date().format("yyyy-MM-dd")
			this.depart_id = option.depart_id
			
			this.get_list()
		},
		methods:{
			get_list(){
				this.$p_api.danger_depart_info({
					depart_id:this.depart_id,
					start_time: this.start_time,
					end_time: this.end_time
				}).then((res)=>{
					// console.log(res.data.data)
					this.list = res.data.data
				})
			}
		}
		
	}
</script>

<style lang="scss">
	page{
		background-color: #F1F1F1;
	}
	.content{
		width: 749rpx;
		
		box-sizing: border-box;
		padding: 24rpx;
	}
	.item{
		margin-bottom: 20rpx;
		background-color: #FFFFFF;
		border-radius: 8px;
		overflow: hidden;
		
		.title{
			line-height: 80rpx;
			border-left: 8rpx solid #E54E3A;
			border-bottom: 1px solid #eee;
			
			display: flex;
			justify-content: space-between;
			.left{
				padding-left: 20rpx;
			}
			.right{
				margin-right: 20rpx;
				color: #BE5853;
			}
		}
		.time{
			height: 80rpx;
			display: flex;
			align-items: center;
			
			box-sizing: border-box;
			padding: 0 20rpx;
			.icon{
				width: 40rpx;
				height: 40rpx;
				background-image: url(./icon/time.png);
				background-size: cover;
				background-repeat: no-repeat;
			}
			.text{
				margin-left: 10rpx;
			}
		}
		.inner{
			width: 700rpx;
			box-sizing: border-box;
			padding: 0 20rpx 40rpx;
			.item{
				display: flex;
				.label{
					width: 220rpx;
				}
				.text{
					width: 480rpx;
				}
			}
		}
	}
</style>
