<!--
 * @Title: 
 * @Description: 巡检填报
 * @Author: swp
 * @Date: 2022-08-24 10:49:21
 * @LastEditors: 
 * @LastEditTime: 2022-08-24 10:49:21
-->
<template>
	<view class="container">
		<uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
			@clickLeft="toBack">
			<view class="nav-title">
				<text>{{title}}</text>
			</view>
		</uni-nav-bar>
		<uni-forms ref="baseForm" :model="formData">
			<uni-section title="移动网络信号" ftitleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-top: 10px;padding-bottom: 10px;padding-left: 15px;padding-right: 15px;">
					<uni-forms-item name="networkSignalStatus" label="手机网络信号" label-width="130px" required>
						<uni-data-checkbox v-model="formData.networkSignalStatus" :localdata="ispItems.items">
						</uni-data-checkbox>
					</uni-forms-item>
					<view
						style="margin-top: 10px;margin-bottom: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.6rem;color:skyblue;">
						备注：如以下物联网卡信息发生变化，请仔细核对修改</view>
					<uni-forms-item name='networkPayer' label="物联网卡运营商" label-width="130px">
						<uni-easyinput v-model="formData.networkPayer" placeholder="请录入物联网卡运营商名称" />
					</uni-forms-item>
					<uni-forms-item name='networkSimId' label="物联网卡号" label-width="130px">
						<uni-easyinput v-model="formData.networkSimId" placeholder="请录入物联网卡号" />
					</uni-forms-item>
				</view>
			</uni-section>
			<uni-section title="基础信息" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-top: 10px;padding-bottom: 10px;padding-left: 15px;padding-right: 15px;">
					<uni-forms-item label="测站名称:" label-width="100px">
						<view class="view-flex-rs" style="height: 100%;">
							<view class="view-flex-cc"><text>{{rtuInfo.rtuName}}</text></view>
						</view>
					</uni-forms-item>
					<uni-forms-item label="测站编码:" label-width="100px">
						<view class="view-flex-rs" style="height: 100%;">
							<view class="view-flex-cc"><text>{{rtuInfo.rtuCode}}</text></view>
						</view>
					</uni-forms-item>
					<uni-forms-item label="测站类型:" label-width="100px">
						<view class="view-flex-rs" style="height: 100%;">
							<view class="view-flex-cc">
								<text>{{toRtuKind()}}</text>
							</view>
						</view>
					</uni-forms-item>
				</view>
			</uni-section>
			<uni-section title="地理信息" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-top: 10px;padding-bottom: 10px;padding-left: 15px;padding-right: 15px;">
					<!-- <view style="margin-bottom: 10px;font-size: 0.7rem;color:lightcoral;">备注：以下信息可以进行修改</view> -->
					<uni-forms-item label="测站安装地址:" label-width="100px">
						<view class="view-flex-rs" style="height: 100%;">
							<view class="view-flex-cc"><text>{{data.locationDesc}}</text></view>
						</view>
					</uni-forms-item>
					<uni-forms-item label="经纬度:" label-width="100px">
						<view class="view-flex-rs" style="height: 100%;">
							<view class="view-flex-cc"><text>{{data.lng}}/{{data.lat}}</text></view>
						</view>
					</uni-forms-item>
				</view>
			</uni-section>
			<uni-section title="站点状态检查" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<uni-card title="检查项(单选)" :is-shadow="false">
					<radio-group @change="onSiteCheckStatusRadioChange" class="view-flex-rs">
						<label style="margin-right: 10px;width:80px" class="view-flex-rs"
							v-for="(item, index) in data.siteCheckStatus.items" :key="item.id">
							<view>
								<radio :value="item.id" :checked="index === data.siteCheckStatus.current" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</radio-group>
				</uni-card>
				<uni-card title="拍摄照片" extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项，至少要拍一张照片</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.siteCheckPhotos" :key="index" class="view-flex-cc"
							style="width: 100px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onSiteCheckPhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onSiteCheckPhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card title="站点检查补充说明：" :is-shadow="false">
					<uni-easyinput type="textarea" v-model="data.siteCheckRemark" placeholder="请输入站点检查补充说明" />
				</uni-card>
			</uni-section>
			<uni-section v-if="rtuInfo.isRain" title="雨量站检查" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<uni-card title="检查项(多选)" :is-shadow="false">
					<checkbox-group @change="onRainSiteCheckboxChange" class="view-flex-rs">
						<label class="view-flex-rs" style="margin-right: 10px;font-size: 0.7rem;"
							v-for="(item, index) in data.rainSiteCheckItems.items" :key="item.id">
							<view>
								<checkbox v-if="item.checked" :value="item.id" checked="true" />
								<checkbox v-else :value="item.id" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</checkbox-group>
				</uni-card>
				<uni-card title="拍摄照片" extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.rainSiteCheckPhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onRainSitePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onRainSiteCheckPhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card title="巡检结果" :is-shadow="false">
					<radio-group @change="onRainSiteCheckStatusRadioChange" class="view-flex-rs">
						<label style="margin-right: 10px;width:80px" class="view-flex-rs"
							v-for="(item, index) in data.rainSiteCheckStatus.items" :key="item.id">
							<view>
								<radio :value="item.id" :checked="index === data.rainSiteCheckStatus.current" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</radio-group>
				</uni-card>
				<uni-card title="雨量站检查补充说明：" :is-shadow="false">
					<uni-easyinput type="textarea" v-model="data.rainSiteCheckRemark" placeholder="请输入雨量站检查补充说明" />
				</uni-card>
			</uni-section>
			<uni-section v-if="rtuInfo.isRiver || rtuInfo.isRes" title="水位站检查" titleFontSize="0.8rem"
				style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<uni-card title="检查项(多选)" :is-shadow="false">
					<checkbox-group @change="onWaterSiteCheckboxChange" class="view-flex-rs">
						<label class="view-flex-rs" style="margin-right: 10px;font-size: 0.7rem;"
							v-for="(item, index) in data.waterSiteCheckItems.items" :key="item.id">
							<view>
								<checkbox v-if="item.checked" :value="item.id" checked="true" />
								<checkbox v-else :value="item.id" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</checkbox-group>
				</uni-card>
				<uni-card title="拍摄照片" extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.waterSiteCheckPhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onWaterSitePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onWaterSiteCheckPhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card title="巡检结果" :is-shadow="false">
					<radio-group @change="onWaterSiteCheckStatusRadioChange" class="view-flex-rs">
						<label style="margin-right: 10px;width:80px" class="view-flex-rs"
							v-for="(item, index) in data.waterSiteCheckStatus.items" :key="item.id">
							<view>
								<radio :value="item.id" :checked="index === data.waterSiteCheckStatus.current" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</radio-group>
				</uni-card>
				<uni-card title="水位站检查补充说明：" :is-shadow="false">
					<uni-easyinput type="textarea" v-model="data.waterSiteCheckRemark" placeholder="请输入水位站检查补充说明" />
				</uni-card>
			</uni-section>
			<uni-section v-if="rtuInfo.isGround" title="墒情站检查" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<uni-card title="检查项(多选)" :is-shadow="false">
					<checkbox-group @change="onGroundSiteCheckboxChange" class="view-flex-rs">
						<label class="view-flex-rs" style="margin-right: 10px;font-size: 0.7rem;"
							v-for="(item, index) in data.groundSiteCheckItems.items" :key="item.id">
							<view>
								<checkbox v-if="item.checked" :value="item.id" checked="true" />
								<checkbox v-else :value="item.id" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</checkbox-group>
				</uni-card>
				<uni-card title="拍摄照片" extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.groundSiteCheckPhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onGroundSitePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>

								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onGroundSiteCheckPhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card title="巡检结果" :is-shadow="false">
					<radio-group @change="onGroundSiteCheckStatusRadioChange" class="view-flex-rs">
						<label style="margin-right: 10px;width:80px" class="view-flex-rs"
							v-for="(item, index) in data.groundSiteCheckStatus.items" :key="item.id">
							<view>
								<radio :value="item.id" :checked="index === data.groundSiteCheckStatus.current" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</radio-group>
				</uni-card>
				<uni-card title="墒情站检查补充说明：" :is-shadow="false">
					<uni-easyinput type="textarea" v-model="data.groundSiteCheckRemark" placeholder="请输入墒情站检查补充说明" />
				</uni-card>
			</uni-section>
			<uni-section title="其他设备检查" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<uni-card title="检查项(多选)" :is-shadow="false">
					<checkbox-group @change="onOthersEquipmentCheckboxChange" class="view-flex-rs-flex-wrap">
						<label class="view-flex-rs"
							style="width: 140px;margin-bottom: 10px;margin-right: 10px;font-size: 0.7rem;"
							v-for="(item, index) in data.othersEquipmentCheckItems.items" :key="item.id">
							<view>
								<checkbox v-if="item.checked" :value="item.id" checked="true" />
								<checkbox v-else :value="item.id" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</checkbox-group>
				</uni-card>
				<uni-card title="拍摄照片" extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.othersEquipmentCheckPhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onOthersEquipmentPhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onOthersEquipmentCheckPhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card title="巡检结果" :is-shadow="false">
					<radio-group @change="onOthersEquipmentCheckStatusRadioChange" class="view-flex-rs">
						<label style="margin-right: 10px;width:80px" class="view-flex-rs"
							v-for="(item, index) in data.othersEquipmentCheckStatus.items" :key="item.id">
							<view>
								<radio :value="item.id" :checked="index === data.othersEquipmentCheckStatus.current" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</radio-group>
				</uni-card>
				<uni-card title="其他设备检查补充说明：" :is-shadow="false">
					<uni-easyinput type="textarea" v-model="data.othersEquipmentCheckRemark"
						placeholder="请输入其他设备检查补充说明" />
				</uni-card>
			</uni-section>
			<uni-section title="设备更换" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<uni-card title="设备项(多选)" :is-shadow="false">
					<checkbox-group @change="onEquipmentReplaceCheckboxChange" class="view-flex-rs-flex-wrap">
						<label class="view-flex-rs"
							style="width: 140px;margin-bottom: 10px;margin-right: 10px;font-size: 0.7rem;"
							v-for="(item, index) in data.equipmentsReplaceItems.items" :key="item.id">
							<view>
								<checkbox v-if="item.checked" :value="item.id" checked="true" />
								<checkbox v-else :value="item.id" />
							</view>
							<view style="font-size: 0.7rem;">{{item.dictValue}}</view>
						</label>
					</checkbox-group>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.rtuReplace" title="RTU型号说明" :is-shadow="false">
					<uni-easyinput v-model="data.rtuModelRemark" placeholder="请录入RTU型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.rtuReplace" title="RTU更换照片" extra="点击下方按钮开始拍摄"
					:is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.rtuReplacePhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onRtuReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onRtuReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.rainSensorReplace" title="雨量计型号说明"
					:is-shadow="false">
					<uni-easyinput v-model="data.rainSensorModelRemark" placeholder="请录入雨量计型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.rainSensorReplace" title="雨量计更换照片"
					extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.rainSensorReplacePhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onRainSensorReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onRainSensorReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.waterSensorReplace" title="水位计型号说明"
					:is-shadow="false">
					<uni-easyinput v-model="data.waterSensorModelRemark" placeholder="请录入水位计型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.waterSensorReplace" title="水位计更换照片"
					extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.waterSensorReplacePhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onWaterSensorReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onWaterSensorReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.groundSensorReplace" title="墒情计型号说明"
					:is-shadow="false">
					<uni-easyinput v-model="data.groundSensorModelRemark" placeholder="请录入墒情计型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.groundSensorReplace" title="墒情计更换照片"
					extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.groundSensorReplacePhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onGroundSensorReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onGroundSensorReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.batteryReplace" title="蓄电池型号说明" :is-shadow="false">
					<uni-easyinput v-model="data.batteryModelRemark" placeholder="请录入蓄电池型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.batteryReplace" title="蓄电池更换照片" extra="点击下方按钮开始拍摄"
					:is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.batteryReplacePhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onBatteryReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onBatteryReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.sunPowerReplace" title="太阳能板型号说明"
					:is-shadow="false">
					<uni-easyinput v-model="data.sunPowerModelRemark" placeholder="请录入太阳能板型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.sunPowerReplace" title="太阳能板更换照片" extra="点击下方按钮开始拍摄"
					:is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.sunPowerReplacePhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onSunPowerReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onSunPowerReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.batteryControllerReplace" title="充电控制器型号说明"
					:is-shadow="false">
					<uni-easyinput v-model="data.batteryControlModelRemark" placeholder="请录入充电控制器型号说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.batteryControllerReplace" title="充电控制器更换照片"
					extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.batteryControlReplacePhotos" :key="index"
							class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onBatteryControllerReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onBatteryControllerReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace" title="其他设备说明"
					:is-shadow="false">
					<uni-easyinput v-model="data.otherEquipmentModelRemark" placeholder="请录入其他设备说明" />
				</uni-card>
				<uni-card v-if="data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace" title="其他设备更换照片"
					extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view
						style="padding-top: 10px;padding-left: 0px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
						备注：必填项</view>
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.otherEquipmentReplacePhotos" :key="index"
							class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onOtherEquipmentReplacePhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onOtherEquipmentReplacePhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
			</uni-section>
			<uni-section title="遗留问题补充说明" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-top: 10px;padding-bottom: 10px;padding-left: 15px;padding-right: 15px;">
					<uni-easyinput type="textarea" v-model="data.inspectionRemainProblemsRemark"
						placeholder="请输入遗留问题补充说明" />
				</view>
			</uni-section>
			<uni-section title="巡检工作留存照片" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view
					style="padding-top: 10px;padding-left: 15px;padding-right: 15px;font-size: 0.7rem;color:lightcoral;">
					备注：必填项，至少要拍一张整体的站点照片</view>
				<uni-card title="拍摄照片" extra="点击下方按钮开始拍摄" :is-shadow="false">
					<view class="view-flex-rs-flex-wrap">
						<view v-for="(item, index) in data.inspectionWorkPhotos" :key="index" class="view-flex-cc"
							style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item">
										<view class="close-icon" @click="onInspectionWorkPhotoDel(index)">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(item)" mode="widthFix">
											</image>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 80px;">
							<view class="img-container">
								<view class="note-image-box">
									<view class="note-image-item" @click="onInspectionWorkCheckPhotoAdd()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</uni-card>
			</uni-section>
		</uni-forms>
	
		<view class="footer">
			<view class="control">
				<view class="view-flex-rc">
					<view class="block"
						style="width: 120px;height:28px;margin-left: 10px;margin-right: 10px;border-radius:7px;background-color:lightblue"
						@click="toSave()">
						<view class="view-flex-cc">
							<uni-icons class="input-uni-icon" type="folder-add" size="18" color="#999" />
						</view>
						<view class="view-flex-cc" style="padding-left:5px;">
							<text style="color:black;font-size:0.7rem">暂存</text>
						</view>
					</view>
					<view class="block"
						style="width: 120px;height:28px;margin-left: 10px;margin-right: 10px;border-radius:7px;background-color:lightpink"
						@click="toSubmit()">
						<view class="view-flex-cc">
							<uni-icons class="input-uni-icon" type="checkmarkempty" size="18" color="#999" />
						</view>
						<view class="view-flex-cc" style="padding-left:5px;">
							<text style="color:black;font-size:0.7rem">立即提交</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import http from '@/http/api.js';
	import {
		pathToBase64,
		base64ToPath
	} from '@/js_sdk/mmmm-image-tools/index.js';
	import {
		oss,
		devUrl,
		prodUrl
	} from '@/common/setting';

	export default {
		components: {

		},
		data() {
			return {
				formData: {

				},
				rules: {
					networkSignalStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择手机网络信号',
						}]
					},
				},
				title: '设备巡检填报',
				baseURL: '',
				baseOSS: '',
				rtuCode: '',
				ispItems: {
					items: [{
						'value': 0,
						'text': '正常'
					}, {
						'value': 1,
						'text': '三大运营商均无信号'
					}],
					current: -1,
				},
				rtuInfo: {
					isRain: 0,
					isRiver: 0,
					isRes: 0,
					isGround: 0,
					rtuCode: '',
					rtuName: '',
					lng: '',
					lat: '',
					locationDesc: '',
					isRain: false,
					isWaterLevel: false,
					isGround: false,
					isCamera: false,
				},
				data: {
					lng: '',
					lat: '',
					locationDesc: '',
					//站点状态检查项
					siteCheckStatus: {
						items: [{
							'id': '0',
							'dictValue': '水毁'
						}, {
							'id': '1',
							'dictValue': '丢失'
						}, {
							'id': '2',
							'dictValue': '损坏'
						}, {
							'value': '3',
							'dictValue': '正常'
						}],
						current: 3,
					},
					siteCheckPhotos: [],
					siteCheckRemark: '',
					//雨量站检查数据
					rainSiteCheckItems: {
						items: [{
							'id': '0',
							'checked': false,
							'dictValue': '故障排查'
						}, {
							'id': '1',
							'checked': false,
							'dictValue': '清理堵塞'
						}, {
							'id': '2',
							'checked': false,
							'dictValue': '雨量计校核'
						}],
						current: -1,
					},
					rainSiteCheckItemsCheckBox: {
						equipmentFaultCheck: 0,
						equipmentClear: 0,
						rainSensorCheck: 0,
					},
					rainSiteCheckPhotos: [],
					rainSiteCheckStatus: {
						items: [{
							'id': '0',
							'dictValue': '异常'
						}, {
							'id': '1',
							'dictValue': '正常'
						}],
						current: 1,
					},
					rainSiteCheckRemark: '',
					//水位站检查数据
					waterSiteCheckItems: {
						items: [{
							'id': '0',
							'checked': false,
							'dictValue': '故障排查'
						}, {
							'id': '1',
							'checked': false,
							'dictValue': '水位计校核'
						}],
						current: -1,
					},
					waterSiteCheckItemsCheckBox: {
						equipmentFaultCheck: 0,
						waterSensorCheck: 0,
					},
					waterSiteCheckPhotos: [],
					waterSiteCheckStatus: {
						items: [{
							'id': '0',
							'dictValue': '异常'
						}, {
							'id': '1',
							'dictValue': '正常'
						}],
						current: 1,
					},
					waterSiteCheckRemark: '',
					//墒情站检查数据
					groundSiteCheckItems: {
						items: [{
							'id': '0',
							'checked': false,
							'dictValue': '故障排查'
						}, {
							'id': '1',
							'checked': false,
							'dictValue': '墒情计校核'
						}],
						current: -1,
					},
					groundSiteCheckItemsCheckBox: {
						equipmentFaultCheck: 0,
						groundSensorCheck: 0,
					},
					groundSiteCheckPhotos: [],
					groundSiteCheckStatus: {
						items: [{
							'id': '0',
							'dictValue': '异常'
						}, {
							'id': '1',
							'dictValue': '正常'
						}],
						current: 1,
					},
					groundSiteCheckRemark: '',
					//其他设备检查
					othersEquipmentCheckItems: {
						items: [{
							'id': '0',
							'checked': false,
							'dictValue': '设备接地检测'
						}, {
							'id': '1',
							'checked': false,
							'dictValue': '电源电压检测'
						}, {
							'id': '2',
							'checked': false,
							'dictValue': '太阳能板检查'
						}, {
							'id': '3',
							'checked': false,
							'dictValue': '蓄电池检查'
						}, {
							'id': '4',
							'checked': false,
							'dictValue': '网络通信检查'
						}],
						current: -1,
					},
					othersEquipmentCheckItemsCheckBox: {
						equipmentGroundWireCheck: 0,
						bvCheck: 0,
						sunPowerCheck: 0,
						btCheck: 0,
						netCheck: 0,
					},
					othersEquipmentCheckPhotos: [],
					othersEquipmentCheckStatus: {
						items: [{
							'id': '0',
							'dictValue': '异常'
						}, {
							'id': '1',
							'dictValue': '正常'
						}],
						current: 1,
					},
					othersEquipmentCheckRemark: '',
					//设备替换
					equipmentsReplaceItems: {
						items: [{
							'id': '0',
							'checked': false,
							'dictValue': 'RTU'
						}, {
							'id': '1',
							'checked': false,
							'dictValue': '雨量计'
						}, {
							'id': '2',
							'checked': false,
							'dictValue': '水位计'
						}, {
							'id': '3',
							'checked': false,
							'dictValue': '墒情计'
						}, {
							'id': '4',
							'checked': false,
							'dictValue': '蓄电池'
						}, {
							'id': '5',
							'checked': false,
							'dictValue': '太阳能板'
						}, {
							'id': '6',
							'checked': false,
							'dictValue': '充电控制器'
						}, {
							'id': '7',
							'checked': false,
							'dictValue': '其他'
						}],
						current: -1,
					},
					equipmentsReplaceItemsCheckBox: {
						rtuReplace: 0,
						rainSensorReplace: 0,
						waterSensorReplace: 0,
						groundSensorReplace: 0,
						batteryReplace: 0,
						sunPowerReplace: 0,
						batteryControllerReplace: 0,
						otherEquipmentReplace: 0
					},
					rtuModelRemark: '',
					rtuReplacePhotos: [],
					rainSensorModelRemark: '',
					rainSensorReplacePhotos: [],
					waterSensorModelRemark: '',
					waterSensorReplacePhotos: [],
					groundSensorModelRemark: '',
					groundSensorReplacePhotos: [],
					batteryModelRemark: '',
					batteryReplacePhotos: [],
					sunPowerModelRemark: '',
					sunPowerReplacePhotos: [],
					batteryControlModelRemark: '',
					batteryControlReplacePhotos: [],
					otherEquipmentModelRemark: '',
					otherEquipmentReplacePhotos: [],
					//巡检遗留问题描述
					inspectionRemainProblemsRemark: '',
					//工作留存数据
					inspectionWorkPhotos: [],
				},
			}
		},
		computed: {
			getIcon() {
				return path => {
					return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
				}
			},
		},
		onShow() {},
		created() {},
		onReady() {
			console.log("onReady++++++++++++++")
			// 需要在onReady中设置规则
			this.$refs.baseForm.setRules(this.rules)
		},
		onLoad(options) {
			this.rtuCode = options.rtuCode;
			this.baseOSS = oss;
			this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
			this.loadRtuInfo();
		},
		methods: {
			toOss(path) {
				let url = this.baseOSS + path;
				return url;
			},
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			getDetail() {
				console.log("ddddddddddddddddddddd")
				//this.formData.networkSimId='1111'
				let that = this;
				let postData = {};
				postData['id'] = this.orderId;
				http.request({
					url: '/galaxy-business/rtu/check/order/detail',
					method: 'GET',
					data: postData
				}).then(res => {
					console.log("ddddddddddddddddddddd " + JSON.stringify(res.data))
					//if (res.data != null) {
					let p = {};
					p['networkSimId'] = res.data.networkSimId;
					p['networkPayer'] = res.data.networkPayer;
					that.formData = p;
					//}
				}).catch(err => {
					console.log(err)
				})
			},
			toRtuKind() {
				let htmltext = '';
				if (this.rtuInfo.isRain === 1) {
					htmltext = htmltext + "雨量站";
				}
				if (this.rtuInfo.isRiver == 1 || this.rtuInfo.isRes == 1) {
					if (htmltext.length > 0) {
						htmltext = htmltext + ' / ';
					}
					htmltext = htmltext + '水位站';
				}
				if (this.rtuInfo.isGround == 1) {
					if (htmltext.length > 0) {
						htmltext = htmltext + ' / ';
					}
					htmltext = htmltext + '墒情站';
				}
				if (this.rtuInfo.isVideo == 1) {
					if (htmltext.length > 0) {
						htmltext = htmltext + ' / ';
					}
					htmltext = htmltext + '视频站';
				}
				return htmltext;
			},
			loadCacheData() {
				let formdata = uni.getStorageSync('inspection_report_storage_' + this.rtuCode);
				if (null != formdata && '' != formdata) {
					this.data = formdata;

					let p = {};
					p['networkSignalStatus'] = formdata.networkSignalStatus;
					p['networkSimId'] = formdata.networkSimId;
					p['networkPayer'] = formdata.networkPayer;
					that.formData = p;

					//雨位计
					if (this.data.rainSiteCheckItemsCheckBox.equipmentFaultCheck == 1) {
						this.data.rainSiteCheckItems.items[0].checked = true;
					}
					if (this.data.rainSiteCheckItemsCheckBox.equipmentClear == 1) {
						this.data.rainSiteCheckItems.items[1].checked = true;
					}
					if (this.data.rainSiteCheckItemsCheckBox.rainSensorCheck == 1) {
						this.data.rainSiteCheckItems.items[2].checked = true;
					}
					//水位计
					if (this.data.waterSiteCheckItemsCheckBox.equipmentFaultCheck == 1) {
						this.data.waterSiteCheckItems.items[0].checked = true;
					}
					if (this.data.waterSiteCheckItemsCheckBox.waterSensorCheck == 1) {
						this.data.waterSiteCheckItems.items[1].checked = true;
					}
					//墒情计
					if (this.data.groundSiteCheckItemsCheckBox.equipmentFaultCheck == 1) {
						this.data.groundSiteCheckItems.items[0].checked = true;
					}
					if (this.data.groundSiteCheckItemsCheckBox.groundSensorCheck == 1) {
						this.data.groundSiteCheckItems.items[1].checked = true;
					}
					//其他设备
					if (this.data.othersEquipmentCheckItemsCheckBox.equipmentGroundWireCheck == 1) {
						this.data.othersEquipmentCheckItems.items[0].checked = true;
					}
					if (this.data.othersEquipmentCheckItemsCheckBox.bvCheck == 1) {
						this.data.othersEquipmentCheckItems.items[1].checked = true;
					}
					if (this.data.othersEquipmentCheckItemsCheckBox.sunPowerCheck == 1) {
						this.data.othersEquipmentCheckItems.items[2].checked = true;
					}
					if (this.data.othersEquipmentCheckItemsCheckBox.btCheck == 1) {
						this.data.othersEquipmentCheckItems.items[3].checked = true;
					}
					if (this.data.othersEquipmentCheckItemsCheckBox.netCheck == 1) {
						this.data.othersEquipmentCheckItems.items[4].checked = true;
					}
					//设备更换
					if (this.data.equipmentsReplaceItemsCheckBox.rtuReplace == 1) {
						this.data.equipmentsReplaceItems.items[0].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.rainSensorReplace == 1) {
						this.data.equipmentsReplaceItems.items[1].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.waterSensorReplace == 1) {
						this.data.equipmentsReplaceItems.items[2].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.groundSensorReplace == 1) {
						this.data.equipmentsReplaceItems.items[3].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.batteryReplace == 1) {
						this.data.equipmentsReplaceItems.items[4].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.sunPowerReplace == 1) {
						this.data.equipmentsReplaceItems.items[5].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.batteryControllerReplace == 1) {
						this.data.equipmentsReplaceItems.items[6].checked = true;
					}
					if (this.data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace == 1) {
						this.data.equipmentsReplaceItems.items[7].checked = true;
					}
				} else {
					//this.getDetail();
				}
			},
			clearCache() {
				uni.removeStorageSync('inspection_report_storage_' + this.rtuCode);
			},
			loadRtuInfo() {
				let that = this;
				let postData = {};
				postData['rtuCode'] = this.rtuCode;
				http.request({
					url: '/galaxy-business/rtu/base/detail',
					method: 'GET',
					data: postData
				}).then(res => {
					if (res.data != null) {
						console.log(JSON.stringify(res.data))

						that.rtuInfo = res.data;

						that.rtuInfo.isRain = 1;
						that.rtuInfo.isRiver = 1;
						that.rtuInfo.isRes = 1;
						that.rtuInfo.isGround = 1;

						that.data['lng'] = that.rtuInfo.lng;
						that.data['lat'] = that.rtuInfo.lat;
						that.data['locationDesc'] = that.rtuInfo.locationDesc;

						let p = {};
						p['networkSimId'] = that.rtuInfo.networkSimId;
						p['networkPayer'] = that.rtuInfo.networkPayer;
						that.formData = p;
						that.loadCacheData();
					}
				}).catch(err => {
					console.log(err)
				})
			},
			toSave() {
				let that = this;
				uni.setStorageSync('inspection_report_storage_' + this.rtuCode, this.data);
				uni.showModal({
					content: '已成功缓存，确认返回！',
					showCancel: true,
					success(res) {
						if (res.confirm) {
							that.toBack();
						}
					}
				});
			},
			toSubmit() {
				let that = this;
				this.$refs.baseForm.validate().then(res => {
					console.log('表单数据信息1：', res);
					//console.log('表单数据信息2：', that.formData);
					if (that.formData.networkSignalStatus == 0) {
						let next = false;
						let msg = '';

						if (that.data.siteCheckPhotos.length > 0) {
							next = true;
						} else {
							next = false;
							msg = "站点状态检查照片为必填项，请至少要拍一张照片,请检查!";
						}

						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.rtuReplace == 1) {
								if (this.data.rtuReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换RTU设备时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.rainSensorReplace == 1) {
								if (this.data.rainSensorReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换雨量计时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.waterSensorReplace == 1) {
								if (this.data.waterSensorReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换水位计时，请至少要拍一张照片,请检查!";
								}
							}
						}

						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.groundSensorReplace == 1) {
								if (this.data.groundSensorReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换墒情计时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.batteryReplace == 1) {
								if (this.data.batteryReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换蓄电池时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.sunPowerReplace == 1) {
								if (this.data.sunPowerReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换太阳能板时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.batteryControllerReplace == 1) {
								if (this.data.batteryControlReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换充电控制器时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (this.data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace == 1) {
								if (this.data.otherEquipmentReplacePhotos.length > 0) {
									next = true;
								} else {
									next = false;
									msg = "更换其他设备时，请至少要拍一张照片,请检查!";
								}
							}
						}
						if (next) {
							if (that.data.inspectionWorkPhotos.length > 0) {
								next = true;
							} else {
								next = false;
								msg = "巡检工作留存照片为必填项，请至少要拍一张整体的站点照片,请检查!";
							}
						}
						if (next) {
							that.submitData();
						} else {
							uni.showModal({
								content: msg,
								showCancel: false,
								success(res) {
									if (res.confirm) {

									}
								}
							});
						}
					} else {
						that.submitData();
					}
				}).catch(err => {
					console.log('表单错误信息：', err);
					uni.showModal({
						content: "内容填报错误，请根据提示信息检查录入内容!",
						showCancel: false,
						success(res) {
							if (res.confirm) {
								//that.$refs.baseForm.clearValidate();
							}
						}
					});
				})
			},
			submitData() {
				let formdata = this.formData;
				formdata['rtuCode'] = this.rtuCode;
				formdata['lng'] = this.data.lng;
				formdata['lat'] = this.data.lat;
				formdata['locationDesc'] = this.data.locationDesc;
				formdata['siteCheckItem'] = '' + this.data.siteCheckStatus.current;
				if (this.data.siteCheckPhotos.length > 0) {
					let photos = '';
					for (let i = 0; i < this.data.siteCheckPhotos.length; i++) {
						if (photos.length > 0) {
							photos = photos + ',';
						}
						photos = photos + this.data.siteCheckPhotos[i];
					}
					formdata['siteCheckPhotos'] = photos;
				}
				formdata['siteCheckRemark'] = this.data.siteCheckRemark;
				//雨量站点检查信息
				if (this.rtuInfo.isRain) {
					let items = '';
					if (this.data.rainSiteCheckItemsCheckBox.equipmentFaultCheck == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					items = items + ',';
					if (this.data.rainSiteCheckItemsCheckBox.equipmentClear == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					items = items + ',';
					if (this.data.rainSiteCheckItemsCheckBox.rainSensorCheck == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					formdata['rainSiteCheckItem'] = items;
					if (this.data.rainSiteCheckPhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.rainSiteCheckPhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.rainSiteCheckPhotos[i];
						}
						formdata['rainSiteCheckPhotos'] = photos;
					}
					formdata['rainSiteCheckRemark'] = this.data.rainSiteCheckRemark;
					formdata['rainSiteCheckResult'] = this.data.rainSiteCheckStatus.current;
				}
				//水位站点检查信息
				if (this.rtuInfo.isRiver || this.rtuInfo.isRes) {
					let items = '';
					if (this.data.waterSiteCheckItemsCheckBox.equipmentFaultCheck == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					items = items + ',';
					if (this.data.waterSiteCheckItemsCheckBox.waterSensorCheck == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					formdata['waterSiteCheckItem'] = items;
					if (this.data.waterSiteCheckPhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.waterSiteCheckPhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.waterSiteCheckPhotos[i];
						}
						formdata['waterSiteCheckPhotos'] = photos;
					}
					formdata['waterSiteCheckRemark'] = this.data.waterSiteCheckRemark;
					formdata['waterSiteCheckResult'] = this.data.waterSiteCheckStatus.current;
				}
				//墒情站点检查信息
				if (this.rtuInfo.isGround) {
					let items = '';
					if (this.data.groundSiteCheckItemsCheckBox.equipmentFaultCheck == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					items = items + ',';
					if (this.data.groundSiteCheckItemsCheckBox.groundSensorCheck == 1) {
						items = items + '1'
					} else {
						items = items + '0';
					}
					formdata['groundSiteCheckItem'] = items;
					if (this.data.groundSiteCheckPhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.groundSiteCheckPhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.groundSiteCheckPhotos[i];
						}
						formdata['groundSiteCheckPhotos'] = photos;
					}
					formdata['groundSiteCheckRemark'] = this.data.groundSiteCheckRemark;
					formdata['groundSiteCheckResult'] = this.data.groundSiteCheckStatus.current;
				}

				//其他设备检查信息

				let otheritems = '';
				if (this.data.othersEquipmentCheckItemsCheckBox.equipmentGroundWireCheck == 1) {
					otheritems = otheritems + '1'
				} else {
					otheritems = otheritems + '0';
				}
				otheritems = otheritems + ',';
				if (this.data.othersEquipmentCheckItemsCheckBox.bvCheck == 1) {
					otheritems = otheritems + '1'
				} else {
					otheritems = otheritems + '0';
				}
				otheritems = otheritems + ',';
				if (this.data.othersEquipmentCheckItemsCheckBox.sunPowerCheck == 1) {
					otheritems = otheritems + '1'
				} else {
					otheritems = otheritems + '0';
				}
				otheritems = otheritems + ',';
				if (this.data.othersEquipmentCheckItemsCheckBox.btCheck == 1) {
					otheritems = otheritems + '1'
				} else {
					otheritems = otheritems + '0';
				}
				otheritems = otheritems + ',';
				if (this.data.othersEquipmentCheckItemsCheckBox.netCheck == 1) {
					otheritems = otheritems + '1'
				} else {
					otheritems = otheritems + '0';
				}

				formdata['otherEquipmentCheckItem'] = otheritems;
				if (this.data.othersEquipmentCheckPhotos.length > 0) {
					let photos = '';
					for (let i = 0; i < this.data.othersEquipmentCheckPhotos.length; i++) {
						if (photos.length > 0) {
							photos = photos + ',';
						}
						photos = photos + this.data.othersEquipmentCheckPhotos[i];
					}
					formdata['otherEquipmentCheckPhotos'] = photos;
				}
				formdata['otherEquipmentCheckRemark'] = this.data.othersEquipmentCheckRemark;
				formdata['otherEquipmentCheckResult'] = this.data.othersEquipmentCheckStatus.current;

				formdata['rtuReplace'] = this.data.equipmentsReplaceItemsCheckBox.rtuReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.rtuReplace == 1) {
					formdata['rtuModelRemark'] = this.data.rtuModelRemark;
					if (this.data.rtuReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.rtuReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.rtuReplacePhotos[i];
						}
						formdata['rtuReplacePhotos'] = photos;
					}
				}

				formdata['rainSensorReplace'] = this.data.equipmentsReplaceItemsCheckBox.rainSensorReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.rainSensorReplace == 1) {
					formdata['rainSensorModelRemark'] = this.data.rainSensorModelRemark;
					if (this.data.rainSensorReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.rainSensorReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.rainSensorReplacePhotos[i];
						}
						formdata['rainSensorReplacePhotos'] = photos;
					}
				}
				formdata['waterSensorReplace'] = this.data.equipmentsReplaceItemsCheckBox.waterSensorReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.waterSensorReplace == 1) {
					formdata['waterSensorModelRemark'] = this.data.waterSensorModelRemark;
					if (this.data.waterSensorReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.waterSensorReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.waterSensorReplacePhotos[i];
						}
						formdata['waterSensorReplacePhotos'] = photos;
					}
				}
				formdata['groundSensorReplace'] = this.data.equipmentsReplaceItemsCheckBox.groundSensorReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.groundSensorReplace == 1) {
					formdata['groundSensorModelRemark'] = this.data.groundSensorModelRemark;
					if (this.data.groundSensorReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.groundSensorReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.groundSensorReplacePhotos[i];
						}
						formdata['groundSensorReplacePhotos'] = photos;
					}
				}
				formdata['batteryReplace'] = this.data.equipmentsReplaceItemsCheckBox.batteryReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.batteryReplace == 1) {
					formdata['batteryModelRemark'] = this.data.batteryModelRemark;
					if (this.data.batteryReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.batteryReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.batteryReplacePhotos[i];
						}
						formdata['batteryReplacePhotos'] = photos;
					}
				}
				formdata['sunPowerReplace'] = this.data.equipmentsReplaceItemsCheckBox.sunPowerReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.sunPowerReplace == 1) {
					formdata['sunPowerModelRemark'] = this.data.sunPowerModelRemark;
					if (this.data.sunPowerReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.sunPowerReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.sunPowerReplacePhotos[i];
						}
						formdata['sunPowerReplacePhotos'] = photos;
					}
				}
				formdata['batteryControllerReplace'] = this.data.equipmentsReplaceItemsCheckBox.batteryControllerReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.batteryControllerReplace == 1) {
					formdata['batteryControllerModelRemark'] = this.data.batteryControlModelRemark;
					if (this.data.batteryControlReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.batteryControlReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.batteryControlReplacePhotos[i];
						}
						formdata['batteryControllerReplacePhotos'] = photos;
					}
				}
				formdata['otherEquipmentReplace'] = this.data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace;
				if (this.data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace == 1) {
					formdata['otherEquipmentModelRemark'] = this.data.otherEquipmentModelRemark;
					if (this.data.otherEquipmentReplacePhotos.length > 0) {
						let photos = '';
						for (let i = 0; i < this.data.otherEquipmentReplacePhotos.length; i++) {
							if (photos.length > 0) {
								photos = photos + ',';
							}
							photos = photos + this.data.otherEquipmentReplacePhotos[i];
						}
						formdata['otherEquipmentReplacePhotos'] = photos;
					}

				}

				formdata['remainQuestion'] = this.data.inspectionRemainProblemsRemark;
				if (this.data.inspectionWorkPhotos.length > 0) {
					let photos = '';
					for (let i = 0; i < this.data.inspectionWorkPhotos.length; i++) {
						if (photos.length > 0) {
							photos = photos + ',';
						}
						photos = photos + this.data.inspectionWorkPhotos[i];
					}
					formdata['inspectionWorkPhotos'] = photos;
				}

				console.log('toSubmit事件:', JSON.stringify(formdata));
				let that = this;
				http.request({
					url: '/galaxy-business/equipment/inspection/report/save',
					method: 'POST',
					data: formdata
				}).then(res => {
					console.log('res ', JSON.stringify(res));
					if (res.success) {
						if (res.data.code == 0) {
							that.clearCache();
							uni.showModal({
								content: '填报信息已成功提交',
								showCancel: false,
								success(res) {
									if (res.confirm) {
										uni.navigateBack();
									}
								}
							});
						} else {

							uni.showModal({
								content: res.data.msg,
								showCancel: false
							});
						}
					} else {

						uni.showModal({
							content: '提交失败',
							showCancel: false
						});
					}
				}).catch(err => {
					//	console.log('errr3',JSON.stringify(err));
					uni.showModal({
						content: '' + err.data.msg,
						showCancel: false
					});
				})
			},
			//站点状态检查项
			onSiteCheckStatusRadioChange: function(evt) {
				for (let i = 0; i < this.data.siteCheckStatus.items.length; i++) {
					if (this.data.siteCheckStatus.items[i].id === evt.detail.value) {
						this.data.siteCheckStatus.current = i;
						break;
					}
				}
			},
			//雨量站检查项
			onRainSiteCheckboxChange: function(evt) {
				this.data.rainSiteCheckItemsCheckBox.equipmentFaultCheck = 0;
				this.data.rainSiteCheckItemsCheckBox.equipmentClear = 0;
				this.data.rainSiteCheckItemsCheckBox.rainSensorCheck = 0;
				for (let i = 0; i < evt.detail.value.length; i++) {
					let c = evt.detail.value[i];
					if (c === '0') {
						this.data.rainSiteCheckItemsCheckBox.equipmentFaultCheck = 1;
					} else if (c === '1') {
						this.data.rainSiteCheckItemsCheckBox.equipmentClear = 1;
					} else if (c === '2') {
						this.data.rainSiteCheckItemsCheckBox.rainSensorCheck = 1;
					}
				}
			},
			//雨量站检查结果
			onRainSiteCheckStatusRadioChange: function(evt) {
				for (let i = 0; i < this.data.rainSiteCheckStatus.items.length; i++) {
					if (this.data.rainSiteCheckStatus.items[i].id === evt.detail.value) {
						this.data.rainSiteCheckStatus.current = i;
						break;
					}
				}
			},
			//水位站检查项
			onWaterSiteCheckboxChange: function(evt) {
				this.data.waterSiteCheckItemsCheckBox.equipmentFaultCheck = 0;
				this.data.waterSiteCheckItemsCheckBox.waterSensorCheck = 0;
				for (let i = 0; i < evt.detail.value.length; i++) {
					let c = evt.detail.value[i];
					if (c === '0') {
						this.data.waterSiteCheckItemsCheckBox.equipmentFaultCheck = 1;
					} else if (c === '1') {
						this.data.waterSiteCheckItemsCheckBox.waterSensorCheck = 1;
					}
				}
			},
			//水位站检查结果
			onWaterSiteCheckStatusRadioChange: function(evt) {
				for (let i = 0; i < this.data.waterSiteCheckStatus.items.length; i++) {
					if (this.data.waterSiteCheckStatus.items[i].id === evt.detail.value) {
						this.data.waterSiteCheckStatus.current = i;
						break;
					}
				}
			},
			//墒情站检查项
			onGroundSiteCheckboxChange: function(evt) {
				this.data.groundSiteCheckItemsCheckBox.equipmentFaultCheck = 0;
				this.data.groundSiteCheckItemsCheckBox.groundSensorCheck = 0;
				for (let i = 0; i < evt.detail.value.length; i++) {
					let c = evt.detail.value[i];
					if (c === '0') {
						this.data.groundSiteCheckItemsCheckBox.equipmentFaultCheck = 1;
					} else if (c === '1') {
						this.data.groundSiteCheckItemsCheckBox.groundSensorCheck = 1;
					}
				}
			},
			//墒情站检查结果
			onGroundSiteCheckStatusRadioChange: function(evt) {
				for (let i = 0; i < this.data.groundSiteCheckStatus.items.length; i++) {
					if (this.data.groundSiteCheckStatus.items[i].id === evt.detail.value) {
						this.data.groundSiteCheckStatus.current = i;
						break;
					}
				}
			},
			//其他设备检查项
			onOthersEquipmentCheckboxChange: function(evt) {
				this.data.othersEquipmentCheckItemsCheckBox.equipmentGroundWireCheck = 0;
				this.data.othersEquipmentCheckItemsCheckBox.bvCheck = 0;
				this.data.othersEquipmentCheckItemsCheckBox.sunPowerCheck = 0;
				this.data.othersEquipmentCheckItemsCheckBox.btCheck = 0;
				this.data.othersEquipmentCheckItemsCheckBox.netCheck = 0;

				for (let i = 0; i < evt.detail.value.length; i++) {
					let c = evt.detail.value[i];
					if (c === '0') {
						this.data.othersEquipmentCheckItemsCheckBox.equipmentGroundWireCheck = 1;
					} else if (c === '1') {
						this.data.othersEquipmentCheckItemsCheckBox.bvCheck = 1;
					} else if (c === '2') {
						this.data.othersEquipmentCheckItemsCheckBox.sunPowerCheck = 1;
					} else if (c === '3') {
						this.data.othersEquipmentCheckItemsCheckBox.btCheck = 1;
					} else if (c === '4') {
						this.data.othersEquipmentCheckItemsCheckBox.netCheck = 1;
					}
				}
			},
			//其他设备检查结果
			onOthersEquipmentCheckStatusRadioChange: function(evt) {
				for (let i = 0; i < this.data.othersEquipmentCheckStatus.items.length; i++) {
					if (this.data.othersEquipmentCheckStatus.items[i].id === evt.detail.value) {
						this.data.othersEquipmentCheckStatus.current = i;
						break;
					}
				}
			},
			//设备更换
			onEquipmentReplaceCheckboxChange: function(evt) {

				this.data.equipmentsReplaceItemsCheckBox.rtuReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.rainSensorReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.waterSensorReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.groundSensorReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.batteryReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.sunPowerReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.batteryControllerReplace = 0;
				this.data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace = 0;
				for (let i = 0; i < evt.detail.value.length; i++) {
					let c = evt.detail.value[i];
					if (c === '0') {
						this.data.equipmentsReplaceItemsCheckBox.rtuReplace = 1;
					} else if (c === '1') {
						this.data.equipmentsReplaceItemsCheckBox.rainSensorReplace = 1;
					} else if (c === '2') {
						this.data.equipmentsReplaceItemsCheckBox.waterSensorReplace = 1;
					} else if (c === '3') {
						this.data.equipmentsReplaceItemsCheckBox.groundSensorReplace = 1;
					} else if (c === '4') {
						this.data.equipmentsReplaceItemsCheckBox.batteryReplace = 1;
					} else if (c === '5') {
						this.data.equipmentsReplaceItemsCheckBox.sunPowerReplace = 1;
					} else if (c === '6') {
						this.data.equipmentsReplaceItemsCheckBox.batteryControllerReplace = 1;
					} else if (c === '7') {
						this.data.equipmentsReplaceItemsCheckBox.otherEquipmentReplace = 1;
					}
				}
			},
			onSiteCheckPhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadSiteCheckPhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadSiteCheckPhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.siteCheckPhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onSiteCheckPhotoDel(index) {
				this.data.siteCheckPhotos.splice(index, 1);

			},
			onRainSiteCheckPhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadRainSiteCheckPhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadRainSiteCheckPhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.rainSiteCheckPhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onRainSitePhotoDel(index) {
				this.data.rainSiteCheckPhotos.splice(index, 1);

			},
			onWaterSiteCheckPhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadWaterSiteCheckPhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadWaterSiteCheckPhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.waterSiteCheckPhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onWaterSitePhotoDel(index) {
				this.data.waterSiteCheckPhotos.splice(index, 1);

			},
			onGroundSiteCheckPhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadGroundSiteCheckPhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadGroundSiteCheckPhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.groundSiteCheckPhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onGroundSitePhotoDel(index) {
				this.data.groundSiteCheckPhotos.splice(index, 1);

			},
			onOthersEquipmentCheckPhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadOthersEquipmentCheckPhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadOthersEquipmentCheckPhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.othersEquipmentCheckPhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onOthersEquipmentPhotoDel(index) {
				this.data.othersEquipmentCheckPhotos.splice(index, 1);

			},
			onInspectionWorkCheckPhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadInspectionWorkCheckPhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadInspectionWorkCheckPhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.inspectionWorkPhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onInspectionWorkPhotoDel(index) {
				this.data.inspectionWorkPhotos.splice(index, 1);

			},
			onRtuReplacePhotoDel(index) {
				this.data.rtuReplacePhotos.splice(index, 1);
			},
			onRtuReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadRtuReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadRtuReplacePhoto(imagePath) {
				let that = this;
				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.rtuReplacePhotos.push(path);
							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onRainSensorReplacePhotoDel(index) {
				this.data.rainSensorReplacePhotos.splice(index, 1);
			},
			onRainSensorReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadRainSensorReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadRainSensorReplacePhoto(imagePath) {
				let that = this;
				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.rainSensorReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onWaterSensorReplacePhotoDel(index) {
				this.data.waterSensorReplacePhotos.splice(index, 1);
			},
			onWaterSensorReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadWaterSensorReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadWaterSensorReplacePhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.waterSensorReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onGroundSensorReplacePhotoDel(index) {
				this.data.groundSensorReplacePhotos.splice(index, 1);
			},
			onGroundSensorReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadGroundSensorReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadGroundSensorReplacePhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.groundSensorReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onBatteryReplacePhotoDel(index) {
				this.data.batteryReplacePhotos.splice(index, 1);
			},
			onBatteryReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadBatteryReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadBatteryReplacePhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.batteryReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onSunPowerReplacePhotoDel(index) {
				this.data.sunPowerReplacePhotos.splice(index, 1);
			},
			onSunPowerReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadSunPowerReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadSunPowerReplacePhoto(imagePath) {
				let that = this;

				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.sunPowerReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onBatteryControllerReplacePhotoDel(index) {
				this.data.batteryControlReplacePhotos.splice(index, 1);
			},
			onBatteryControllerReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadBatteryControllerReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadBatteryControllerReplacePhoto(imagePath) {
				let that = this;
				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.batteryControlReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			onOtherEquipmentReplacePhotoDel(index) {
				this.data.otherEquipmentReplacePhotos.splice(index, 1);
			},
			onOtherEquipmentReplacePhotoAdd() {
				let that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadOtherEquipmentReplacePhoto(path);
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			uploadOtherEquipmentReplacePhoto(imagePath) {
				let that = this;
				uni.showLoading({
					title: '上传中'
				});
				uni.uploadFile({
					url: this.baseURL + '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
						uni.getStorageSync('accessToken'),
					fileType: 'image',
					filePath: imagePath,
					name: 'file',
					success: (uploadFileRes) => {
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								that.data.otherEquipmentReplacePhotos.push(path);

							}
						}
					},
					fail: (err) => {
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
		}
	}
</script>

<style>
	/* page {
		background-color: rgb(240, 242, 244);
	} */
</style>

<style lang="scss" scoped>
	.cell-hover-class {
		background-color: rgb(235, 237, 238);
	}

	.view-flex-rs {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}

	.view-flex-rs-flex-wrap {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		flex-wrap: wrap;
	}

	.view-flex-rc {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	.view-flex-re {
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		align-items: center;
	}

	.view-flex-cs {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
	}

	.view-flex-cc {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.view-flex-ce {
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		align-items: center;
	}

	.line-body {
		padding-left: 10px;
		padding-right: 10px;
	}

	.required-star {
		color: #FF0000;
		font-size: 15px;
		width: 20px;
		text-align: center;
		padding-left: 0px;
		padding-right: 2px;
	}

	.item-title {
		color: #909399;
		font-size: 15px;
	}

	.mline-text {
		padding-left: 2px;
		width: 100%;
		/* background-color:#909399; */
		height: 70px;
		border: 1px solid #FF5A5F;
		border-radius: 5px;
	}

	.footer {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 1;
		height: 100rpx;
		padding: 20rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		background-color: whitesmoke;

		.ipt {
			width: 380rpx;
			height: 77rpx;
			background: #f7f7f7;
			border-radius: 38px;
			padding: 0 37rpx;
			box-sizing: border-box;
			margin-right: 20rpx;
		}

		.control {
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: flex-end;

			.block {
				display: flex;
				align-items: center;
				justify-content: center;
				flex: 1;
			}

			.icon {
				height: auto;
			}

			.c {
				width: 41rpx;
				margin-right: 10rpx;
			}

			.s {
				width: 36rpx;
			}

			.t {
				width: 31rpx;
			}
		}
	}

	.container {
		padding: 0 0 100rpx;
	}

	.img-container {
		margin-bottom: 0px;
		width: 100px;
		height: 100px;

		.note-image-box {
			margin-top: 0px;
			display: flex;
			flex-wrap: wrap;
			padding: 10px;

			.note-image-item {
				position: relative;
				width: 100%;
				height: 0;
				padding-top: 100%;
				box-sizing: border-box;
				// background-color: #18B566;

				.close-icon {
					display: flex;
					justify-content: center;
					align-items: center;
					position: absolute;
					right: 0px;
					top: 0px;
					width: 22px;
					height: 22px;
					border-radius: 50%;
					background-color: #d5d5d5;
					z-index: 2;
				}

				.image-box {
					display: flex;
					justify-content: center;
					align-items: center;
					position: absolute;
					top: 0px;
					right: 0px;
					border: 0px;
					left: 0px;
					border: 1px #eee solid;
					border-radius: 5px;
					overflow: hidden;
					width: 99%;
					height: 99%;

				}


			}
		}
	}

	.input-body {
		background-color: #fff;
		padding: 10px;
	}

	.decoration {
		width: 6px;
		height: 6px;
		margin-right: 4px;
		border-radius: 50%;
		background-color: cadetblue;
	}
</style>