<template>

	<view class="">
		<view class="cu-list menu-avatar">
			<view class="cu-item"  :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in getData"
			 :key="index" :data-target="'move-box-' + index" @tap="goDetail(item)">
				<view class="content" style="left:0;width:80%">
					<view class="pro-title">
						<view class="cut">计划:{{item.plan_name}}</view>
					</view>
					<view class="pro-des  ">
						<view class="text-cut">
							点位：{{item.spot_name}}
						</view>
					</view>
					<view class="pro-date ">{{item.wc_time}}</view>
				</view>
				<view class="nav-right num margin-right-sm">
					<view class="text-grey">
						<button class="cu-btn radius bg-green sm" v-if="item.spot_abnormal==0">正常</button>
						<button class="cu-btn radius bg-orange sm" v-if="item.spot_abnormal==1">异常</button>
						<button class="cu-btn radius bg-red sm" v-if="item.spot_abnormal==2">故障</button>
						<button class="cu-btn radius bg-orange sm" v-if="item.spot_abnormal==3">其他</button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import json from '../../../data/json.js';
	export default {
		data() {
			return {
				deviceManage: json.weiBaoRecord,
				modalName: null,
				getData:[]
			};
		},
		
		onLoad:function(option){
			this.goRecordList({'company_code':uni.getStorageSync('selectedCode')})
		},
		onNavigationBarButtonTap(e) {
			console.log(e)
			uni.navigateTo({
				url: '/pages/export/export',
	
			});
		},
		methods: {
			
			// 维保记录列表数据请求
			async goRecordList(params = {}) {
				const res = await this.$myRequest({
					url: 'Maintenance/getMaintenanceRecorList',
					data:params,
					showLoading: true
				})
				this.getData=res.data.data;
				console.log(this.getData);
			},
		
			// 页面跳转
			goDetail(item) {
				uni.navigateTo({
					url: '/pages/weiBao/recordDetail/recordDetail?id='+item.id,
				});
			},
		}

	}
</script>

<style lang="scss">
	.cu-item{
		height:180rpx!important
	}
</style>
