<template>
	<view>
		<view class="timeBox flex justify-between align-center padding-lr-sm">
			<view class="time">{{this.getData.plan_name}}</view>
			<button class="cu-btn radius bg-green sm" v-if="this.getData.spot_abnormal==0">正常</button>
			<button class="cu-btn radius bg-orange sm" v-if="this.getData.spot_abnormal==1">异常</button>
			<button class="cu-btn radius bg-red sm" v-if="this.getData.spot_abnormal==2">故障</button>
			<button class="cu-btn radius bg-red sm" v-if="this.getData.spot_abnormal==3">其他</button>
		</view>
		
		<view>
			<view class="basic-info">
				<view class="info-tit margin-left-xs">
					<text class="cuIcon-titles margin-right-xs"></text>
					基本信息
				</view>
				<view class="info-content">
					<view class="info-one-info ">
						<text>所属单位：</text>
						<text>{{this.getData.owner_name}}</text>
					</view>

					<view class="info-one-info ">
						<text>单位地址：</text>
						<text>{{this.getData.owner_address}}</text>
					</view>
					<view class="info-one-info ">
						<text>维保点位：</text>
						<text>{{this.getData.spot_name}}</text>
					</view>
					<view class="info-one-info ">
						<text>点位地址：</text>
						<text>{{this.getData.spot_address}}</text>
					</view>
					<view class="info-one-info ">
						<text>预期时间：</text>
						<text>{{this.getData.ywc_time}}</text>
					</view>
					<view class="info-one-info ">
						<text>完成时间：</text>
						<text>{{this.getData.wc_time}}</text>
					</view>
				</view>
			</view>
			
			<!-- 维保信息 -->
			<view class="basic-info">
				<view class="info-tit margin-left-xs">
					<text class="cuIcon-titles margin-right-xs"></text>
					维保信息
				</view>
				<view class="info-content">
					<view class="info-one-info ">
						<text>维保人员：</text>
						<text>{{this.getData.name}}</text>
					</view>
			
					<view class="info-one-info ">
						<text>联系方式：</text>
						<text>{{this.getData.phone}}</text>
					</view>
					<view class="info-one-info ">
						<text>维保描述：</text>
						<text>{{this.getData.dwsb_remarks}}</text>
					</view>
				</view>
			</view>
			<!-- 处理状态start -->
			<view class="processStatus">
				<view class="info-tit margin-left-xs">
					<text class="cuIcon-titles margin-right-xs"></text>
					维保图片
				</view>
				<view class="imgPic padding-lr padding-bottom-lg">
					<image v-if="!this.getData.report_photos&&this.dataRes==1" mode='widthFix' src="/static/defaultImg.jpg" width="100%"/>
					<image v-else  mode='widthFix'  :src="`${this.$websiteUrl}${this.getData.report_photos}`"  width="100%"/>
				</view>
			</view>
			<!-- 处理状态end -->
		</view>

		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				radio: 'A',
				radio: 'B',
				modalName: null,
				reason: '',
				type: '0',
				detailMessage: {},
				detailMessage2: {},
				msg: '',
				msg2: '',
				flag:false,
				companyCode:0,
				
				getData:{},
				dataRes:0

			}
		},
		onLoad: function(option) {
			this.goRecordDetail({
				'company_code': uni.getStorageSync('selectedCode'),
				"id": option.id
			})
		},
		methods: {
			// 维保记录列详情数据请求
			async goRecordDetail(params = {}) {
				const res = await this.$myRequest({
					url: 'Maintenance/getMaintenanceRecordDetails',
					data: params,
					showLoading: true
				})
				this.getData = res.data.data[0];
				console.log('this.getData.report_photos');
				console.log(this.getData.report_photos);
				this.dataRes=1
			},
			


		}
	}
</script>

<style lang="scss">
	
</style>
