<template>

	<view class="">
		<view class="cu-list menu-avatar">
			<view class="cu-item deviceTypeItem" v-for="(item,index) in getData" :key="index" @tap="goReportDetail(item)">
				<view class="cu-avatar round" >
					<image class="image-bg" src="/static/month-report-icon.png"/>
				</view>
				<view class="content">
					<view class="title">{{item.company_name}} {{item.event_time}}</view>
				</view>
				<view class="nav-right num">
					<view>
						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
					</view>
				</view>
			</view>


		</view>
	</view>
</template>

<script>
	import json from '../../../data/json.js';
	export default {
		data() {
			return {
				deviceType: json.deviceType,
				getData:[]
			};
		},
		onLoad: function(option) {
			
			this.getDataList({'company_code':uni.getStorageSync('selectedCode')})

		},

		methods: {
			
			// 列表数据请求
			async getDataList(params = {}) {
				const res = await this.$myRequest({
					url: 'MonthlyReport/getMonthlyReportList',
					data:params,
					showLoading: true
				})
				this.getData=res.data.data;
				// console.log(JSON.parse(res))
				console.log(this.getData[0].company_name)
			
			},
			goReportDetail(item) {
				uni.navigateTo({
					url: '/pages/analyse/monthDetail/monthDetail?id='+item.id,
				});
			}

		}

	}
</script>

<style lang="scss">

</style>
