<!--
 * @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 style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
				<text style="color: white;font-size: 1rem;">{{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: 0px;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>
					<uni-forms-item name='networkPayer' label="物联网卡运营商" label-width="130px">
						<uni-easyinput disabled :styles="styles" v-model="formData.networkPayer"
							placeholder="请录入物联网卡运营商名称" />
					</uni-forms-item>
					<uni-forms-item name='networkSimId' label="物联网卡号" label-width="130px">
						<uni-easyinput disabled :styles="styles" v-model="formData.networkSimId"
							placeholder="请录入物联网卡号" />
					</uni-forms-item>
				</view>
				<view style="padding-left: 15px;padding-right: 15px;padding-top: 0px;padding-bottom: 10px;">
					<view style="margin-top: 0px;color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>维修前照片
					</view>
					<view class="view-flex-rs" style="margin-top: 0px;">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="baseInfo.beforePhoto1Take" class="note-image-item">
										<view class="close-icon" @click="onBaseBeforePhoto1DeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(baseInfo.beforePhoto1Url)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getBaseBeforePhoto1()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="baseInfo.beforePhoto2Take" class="note-image-item">
										<view class="close-icon" @click="onBaseBeforePhoto2DeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(baseInfo.beforePhoto2Url)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getBaseBeforePhoto2()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</uni-section>
			<uni-section title="RTU设备" 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="rtuStatus" label="运行状态" label-width="130px" required>
						<uni-data-checkbox v-model="formData.rtuStatus" :localdata="rtuInfo.runStatus.items">
						</uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="rtuReplace" label="是否更换RTU" label-width="130px" required>
						<uni-data-checkbox v-model="formData.rtuReplace" :localdata="rtuInfo.replaceItems.items">
						</uni-data-checkbox>
					</uni-forms-item>
					<view v-if="formData.rtuReplace==1">
						<uni-forms-item name="rtuBrand" label="品牌" label-width="130px" required>
							<uni-easyinput v-model="formData.rtuBrand" placeholder="请录入品牌" />
						</uni-forms-item>
						<uni-forms-item name="rtuModel" label="型号" label-width="130px" required>
							<uni-easyinput v-model="formData.rtuModel" placeholder="请录入型号" />
						</uni-forms-item>
					</view>
					<uni-forms-item>
						<uni-easyinput type="textarea" v-model="formData.rtuDesc" placeholder="请输入RTU设备维修说明"
							@input="rtuRemarkInput" />
					</uni-forms-item>
					<view style="color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>RTU设备照片</view>
					<view class="view-flex-rs">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="rtuInfo.photoTake" class="note-image-item">
										<view class="close-icon" @click="onRtuPhotoDeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(rtuInfo.photoUrl)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getRtuPhoto()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</uni-section>
			<uni-section title="设备传感器信息">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-top: 10px;padding-left: 15px;padding-right: 15px;">
					<uni-forms-item name="sensorList" label="传感器选择" label-width="130px" required>
						<uni-data-checkbox multiple v-model="formData.sensorList" :localdata="sensorItems.items"
							@change="sensorCheckboxChange"></uni-data-checkbox>
					</uni-forms-item>
				</view>

				<uni-card v-if="sensorList.rainSensor==1" title="雨量传感器">
					<uni-forms-item name="rainSensorStatus" label="运行状态" label-width="130px" required>
						<uni-data-checkbox v-model="formData.rainSensorStatus"
							:localdata="rainSensorInfo.runStatus.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="rainSensorReplace" label="是否更换雨量计" label-width="130px" required>
						<uni-data-checkbox v-model="formData.rainSensorReplace"
							:localdata="rainSensorInfo.replaceItems.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="rainSensorBrand" v-if="formData.rainSensorReplace==1" label="品牌"
						label-width="130px" required>
						<uni-easyinput v-model="formData.rainSensorBrand" placeholder="请录入品牌" />
					</uni-forms-item>
					<uni-forms-item name="rainSensorModel" v-if="formData.rainSensorReplace==1" label="型号"
						label-width="130px" required>
						<uni-easyinput v-model="formData.rainSensorModel" placeholder="请录入型号" />
					</uni-forms-item>
					<uni-forms-item>
						<uni-easyinput label="备注说明" type="textarea" v-model="formData.rainSensorDesc"
							placeholder="请输入雨量传感器维修说明" @input="rainSensorRemarkInput" />
					</uni-forms-item>
					<view style="margin-left: 0px;color: gray;font-size: 0.7rem;"><span
							style="color:red;">*</span>雨量传感器照片</view>
					<view class="view-flex-rs" style="margin-top: 0px;">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="rainSensorInfo.photoTake" class="note-image-item">
										<view class="close-icon" @click="onRainPhotoDeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(rainSensorInfo.photoUrl)" mode="widthFix">
											</image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getRainSensorPhoto()">
										<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="sensorList.waterSensor==1" title="水位传感器">
					<uni-forms-item name="waterLevelSensorStatus" label="运行状态" label-width="130px" required>
						<uni-data-checkbox v-model="formData.waterLevelSensorStatus"
							:localdata="waterSensorInfo.runStatus.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="waterSensorReplace" label="是否更换水位计" label-width="130px" required>
						<uni-data-checkbox v-model="formData.waterSensorReplace"
							:localdata="waterSensorInfo.replaceItems.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="waterSensorBrand" v-if="formData.waterSensorReplace==1" label="品牌"
						label-width="130px" required>
						<uni-easyinput v-model="formData.waterSensorBrand" placeholder="请录入品牌" />
					</uni-forms-item>
					<uni-forms-item name="waterSensorModel" v-if="formData.waterSensorReplace==1" label="型号"
						label-width="130px" required>
						<uni-easyinput v-model="formData.waterSensorModel" placeholder="请录入型号" />
					</uni-forms-item>
					<uni-forms-item>
						<uni-easyinput label="备注说明" type="textarea" v-model="formData.waterSensorDesc"
							placeholder="请输入水位传感器维修说明" @input="waterSensorRemarkInput" />
					</uni-forms-item>
					<view style="margin-left: 0px;color: gray;font-size: 0.7rem;"><span
							style="color:red;">*</span>水位传感器照片</view>
					<view class="view-flex-rs" style="margin-top: 0px;">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="waterSensorInfo.photoTake" class="note-image-item">
										<view class="close-icon" @click="onWaterPhotoDeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(waterSensorInfo.photoUrl)" mode="widthFix">
											</image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getWaterSensorPhoto()">
										<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="sensorList.groundSensor==1" title="墒情传感器">
					<uni-forms-item name="groundWaterSensorStatus" label="运行状态" label-width="130px" required>
						<uni-data-checkbox v-model="formData.groundWaterSensorStatus"
							:localdata="groundSensorInfo.runStatus.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="groundSensorReplace" label="是否更换墒情传感器" label-width="130px" required>
						<uni-data-checkbox v-model="formData.groundSensorReplace"
							:localdata="groundSensorInfo.replaceItems.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="groundSensorBrand" v-if="formData.groundSensorReplace==1" label="品牌"
						label-width="130px" required>
						<uni-easyinput v-model="formData.groundSensorBrand" placeholder="请录入品牌" />
					</uni-forms-item>
					<uni-forms-item name="groundSensorModel" v-if="formData.groundSensorReplace==1" label="型号"
						label-width="130px" required>
						<uni-easyinput v-model="formData.groundSensorModel" placeholder="请录入型号" />
					</uni-forms-item>
					<uni-forms-item>
						<uni-easyinput label="备注说明" type="textarea" v-model="formData.groundSensorDesc"
							placeholder="请输入墒情传感器维修说明" @input="groundSensorRemarkInput" />
					</uni-forms-item>
					<view style="margin-left: 0px;color: gray;font-size: 0.7rem;"><span
							style="color:red;">*</span>墒情传感器照片</view>
					<view class="view-flex-rs" style="margin-top: 0px;">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="groundSensorInfo.photoTake" class="note-image-item">
										<view class="close-icon" @click="onGroundPhotoDeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(groundSensorInfo.photoUrl)" mode="widthFix">
											</image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getGroundSensorPhoto()">
										<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="供电系统" 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="batteryReplace" label="是否更换蓄电池" label-width="130px" required>
						<uni-data-checkbox v-model="formData.batteryReplace"
							:localdata="powerInfo.batteryReplaceItems.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="sunPowerReplace" label="是否更换太阳能板" label-width="130px" required>
						<uni-data-checkbox v-model="formData.sunPowerReplace"
							:localdata="powerInfo.sunPowerReplaceItems.items"></uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item name="powerStatus" label="运行状态" label-width="130px" required>
						<uni-data-checkbox v-model="formData.powerStatus" :localdata="powerInfo.runStatus.items">
						</uni-data-checkbox>
					</uni-forms-item>
					<uni-forms-item>
						<uni-easyinput type="textarea" v-model="formData.powerDesc" placeholder="请输入供电系统维修说明"
							@input="powerRemarkInput" />
					</uni-forms-item>
					<view style="color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>供电系统照片</view>
					<view class="view-flex-rs">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="powerInfo.batteryPhotoTake" class="note-image-item">
										<view class="close-icon" @click="onBatteryPhotoDeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(powerInfo.batteryPhotoUrl)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getBatteryPhoto()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="powerInfo.sunPhotoTake" class="note-image-item">
										<view class="close-icon" @click="onSunPowerPhotoDeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(powerInfo.sunPhotoUrl)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getSunPowerPhoto()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</uni-section>
			<uni-section title="通信网络" ftitleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-left: 15px;padding-right: 15px;padding-top: 10px;padding-bottom: 10px;">
					<uni-forms-item name="networkType" label="网络类型选择" label-width="130px" required>
						<uni-data-checkbox v-model="formData.networkType" :localdata="networkType.items">
						</uni-data-checkbox>
					</uni-forms-item>
					<view v-if="formData.networkType==0">
						<uni-forms-item name="networkStatus" label="运行状态" label-width="130px" required>
							<uni-data-checkbox v-model="formData.networkStatus"
								:localdata="networkInfo.runStatus.items"></uni-data-checkbox>
						</uni-forms-item>
						<uni-forms-item name="networkOverdue" label="是否欠费" label-width="130px" required>
							<uni-data-checkbox v-model="formData.networkOverdue"
								:localdata="networkInfo.overdueItems.items"></uni-data-checkbox>
						</uni-forms-item>
						<uni-easyinput type="textarea" v-model="formData.networkDesc" placeholder="请输入4G移动网络维修说明"
							@input="networkRemarkInput" />
					</view>
					<view v-if="formData.networkType==1">
						<uni-forms-item name="satelliteStatus" label="运行状态" label-width="130px" required>
							<uni-data-checkbox v-model="formData.satelliteStatus"
								:localdata="satelliteInfo.runStatus.items"></uni-data-checkbox>
						</uni-forms-item>
						<uni-easyinput type="textarea" v-model="formData.satelliteDesc" placeholder="请输入北斗通讯网络维修说明"
							@input="satelliteRemarkInput" />
					</view>
				</view>
			</uni-section>
			<uni-section title="维修总结情况" titleFontSize="0.8rem" style="width: 100%;">
				<template v-slot:decoration>
					<view class="decoration"></view>
				</template>
				<view style="padding-left: 15px;padding-right: 15px;padding-top: 10px;padding-bottom: 10px;">
					<uni-easyinput type="textarea" v-model="formData.processDesc" placeholder="请输入总结说明" />
					<view style="margin-top: 10px;color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>维修后照片
					</view>
					<view class="view-flex-rs">
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="baseInfo.afterPhoto1Take" class="note-image-item">
										<view class="close-icon" @click="onBaseAfterPhoto1DeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(baseInfo.afterPhoto1Url)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getBaseAfterPhoto1()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="view-flex-cc" style="width: 120px;">
							<view class="img-container">
								<view class="note-image-box">
									<view v-if="baseInfo.afterPhoto2Take" class="note-image-item">
										<view class="close-icon" @click="onBaseAfterPhoto2DeleteClick()">
											<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
										</view>
										<view class="image-box">
											<image :src="toOss(baseInfo.afterPhoto2Url)" mode="widthFix"></image>
										</view>
									</view>
									<view v-else class="note-image-item" @click="getBaseAfterPhoto2()">
										<view class="image-box">
											<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</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: {},
		onLoad(options) {
			this.orderId = options.orderId;
			this.skipPage = options.skipPage;
			this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
			this.baseOSS = oss;
			this.loadCacheData();
		},
		data() {
			return {
				styles: {
					color: '#333',
					borderColor: '#e5e5e5',
					disableColor: '#FFFFFF'
				},
				formData: {
					sensorList: []
				},
				rules: {
					// 手机网络信号选择
					networkSignalStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择手机网络信号',
						}]
					},
					rtuStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择RTU状态',
						}, ]
					},
					rtuReplace: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否更换RTU',
						}, ]
					},
					rtuBrand: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入RTU品牌',
						}, ]
					},
					rtuModel: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入RTU型号',
						}, ]
					},
					sensorList: {
						rules: [{
							required: true,
							errorMessage: '必填项，请至少选择一个传感器',
						}, ]
					},
					rainSensorStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择雨量计状态',

						}]
					},
					rainSensorReplace: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否更换雨量计',
						}, ]
					},
					rainSensorBrand: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入雨量计品牌',
						}, ]
					},
					rainSensorModel: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入雨量计型号',
						}, ]
					},
					waterLevelSensorStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择水位计状态',
						}, ]
					},
					waterSensorReplace: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否更换水位计',
						}, ]
					},
					waterSensorBrand: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入水位计品牌',
						}, ]
					},
					waterSensorModel: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入水位计型号',
						}, ]
					},
					groundWaterSensorStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择墒情计状态',
						}, ]
					},
					groundSensorReplace: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否更换墒情计',
						}, ]
					},
					groundSensorBrand: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入墒情计品牌',
						}, ]
					},
					groundSensorModel: {
						rules: [{
							required: true,
							errorMessage: '必填项，请录入墒情计型号',
						}, ]
					},
					batteryReplace: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否更换蓄电池',
						}, ]
					},
					sunPowerReplace: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否更换太阳能板',
						}, ]
					},
					powerStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择供电系统状态',
						}, ]
					},
					networkType: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择通信网络类型',
						}, ]
					},
					networkOverdue: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择是否欠费',
						}, ]
					},
					networkStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择4G网络状态',
						}, ]
					},
					satelliteStatus: {
						rules: [{
							required: true,
							errorMessage: '必填项，请选择北斗网络状态',
						}, ]
					},
				},
				orderId: 0,
				skipPage: 1,
				pattern: {
					color: '#7A7E83',
					backgroundColor: '#fff',
					selectedColor: '#007AFF',
					buttonColor: '#007AFF',
					iconColor: '#fff'
				},
				content: [{
						iconPath: '/static/images/user/c6.png',
						selectedIconPath: '/static/images/user/c6.png',
						text: '提交',
						active: false
					},
					{
						iconPath: '/static/images/user/c5.png',
						selectedIconPath: '/static/images/user/c5.png',
						text: '保存',
						active: false
					}
				],
				baseURL: '',
				baseOSS: '',
				waterLevelSensorType: {
					items: [],
					current: -1,
				},
				groundSensorType: {
					items: [],
					current: -1,
				},
				satelliteModel: {
					items: [],
					current: -1,
				},
				ispItems: {
					items: [{
						'value': 0,
						'text': '正常'
					}, {
						'value': 1,
						'text': '三大运营商均无信号'
					}],
					current: -1,
				},
				baseInfo: {
					processDesc: '',
					afterPhoto1Url: '',
					afterPhoto1Take: false,
					afterPhoto2Url: '',
					afterPhoto2Take: false,
					beforePhoto1Url: '',
					beforePhoto1Take: false,
					beforePhoto2Url: '',
					beforePhoto2Take: false
				},
				rtuInfo: {
					remark: '',
					rtuReplace: 0,
					photoUrl: '',
					photoTake: false,
					replaceItems: {
						items: [{
							'value': 0,
							'text': '否'
						}, {
							'value': 1,
							'text': '更换'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},
				},
				sensorItems: {
					items: [{
						'value': 0,
						'checked': false,
						'text': '雨量'
					}, {
						'value': 1,
						'checked': false,
						'text': '水位'
					}, {
						'value': 2,
						'checked': false,
						'text': '墒情'
					}],
					current: -1,
				},
				sensorList: {
					rainSensor: 0,
					waterSensor: 0,
					groundSensor: 0,
				},
				rainSensorInfo: {
					rainSensorReplace: 0,
					replaceItems: {
						items: [{
							'value': 0,
							'text': '否'
						}, {
							'value': 1,
							'text': '更换'
						}],
						current: -1,
					},
					remark: '',
					photoUrl: '',
					photoTake: false,
					active: {
						items: [{
							'value': 0,
							'text': '有'
						}, {
							'value': 1,
							'text': '无'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},
				},
				waterSensorInfo: {
					waterSensorReplace: 0,
					replaceItems: {
						items: [{
							'value': 0,
							'text': '否'
						}, {
							'value': 1,
							'text': '更换'
						}],
						current: -1,
					},
					remark: '',
					photoUrl: '',
					photoTake: false,
					active: {
						items: [{
							'value': 0,
							'text': '有'
						}, {
							'value': 1,
							'text': '无'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},
				},
				groundSensorInfo: {
					groundSensorReplace: 0,
					replaceItems: {
						items: [{
							'value': 0,
							'text': '否'
						}, {
							'value': 1,
							'text': '更换'
						}],
						current: -1,
					},
					remark: '',
					photoUrl: '',
					photoTake: false,
					active: {
						items: [{
							'value': 0,
							'text': '有'
						}, {
							'value': 1,
							'text': '无'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},
				},
				powerInfo: {
					batteryReplace: 0,
					batteryReplaceItems: {
						items: [{
							'value': 0,
							'text': '否'
						}, {
							'value': 1,
							'text': '更换'
						}],
						current: -1,
					},
					sunPowerReplace: 0,
					sunPowerReplaceItems: {
						items: [{
							'value': 0,
							'text': '否'
						}, {
							'value': 1,
							'text': '更换'
						}],
						current: -1,
					},
					batteryPhotoUrl: '',
					batteryPhotoTake: false,
					sunPhotoUrl: '',
					sunPhotoTake: false,
					remark: '',
					active: {
						items: [{
							'value': 0,
							'text': '有'
						}, {
							'value': 1,
							'text': '无'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},

				},
				networkType: {
					items: [{
						'value': 0,
						'text': '4G网络'
					}, {
						'value': 1,
						'text': '北斗网络'
					}],
					current: -1,
				},
				networkInfo: {
					overdueItems: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '欠费'
						}],
						current: -1,
					},
					networkOverdue: 0,
					remark: '',
					active: {
						items: [{
							'value': 0,
							'text': '有'
						}, {
							'value': 1,
							'text': '无'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},
				},
				satelliteInfo: {
					remark: '',
					active: {
						items: [{
							'value': 0,
							'text': '有'
						}, {
							'value': 1,
							'text': '无'
						}],
						current: -1,
					},
					runStatus: {
						items: [{
							'value': 0,
							'text': '正常'
						}, {
							'value': 1,
							'text': '故障'
						}],
						current: -1,
					},
				},
				networkPayer: '',
				networkSimId: '',
				localImageList: [],
				uploadImageList: [],
				title: '维修填报',
				desc: '',
			}
		},
		computed: {
			getIcon() {
				return path => {
					return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
				}
			},
		},
		onReady() {
			console.log("onReady++++++++++++++")
			// 需要在onReady中设置规则
			this.$refs.baseForm.setRules(this.rules)
		},
		onShow() {},
		created() {},
		methods: {
			toOss(path) {
				let url = this.baseOSS + path;
				console.log("tooss " + url)
				return url;
			},
			toBack() {
				uni.navigateBack({
					delta: Number(this.skipPage)
				})
			},
			getDetail() {
				let that = this;
				let postData = {};
				postData['id'] = this.orderId;
				http.request({
					url: '/galaxy-business/rtu/check/order/detail',
					method: 'GET',
					data: postData
				}).then(res => {
					let p = {};
					p['networkSimId'] = res.data.networkSimId;
					p['networkPayer'] = res.data.networkPayer;
					that.formData = p;
				}).catch(err => {
					console.log(err)
				})
			},
			loadCacheData() {
				let formdata = uni.getStorageSync('check_report_storage_' + this.orderId);
				if (formdata) {
					this.formData = formdata;
					console.log(JSON.stringify(formdata))
					let baseBeforePhoto1Take = formdata['baseBeforePhoto1Take'];
					if (baseBeforePhoto1Take == 1) {
						this.baseInfo.beforePhoto1Take = true;
						this.baseInfo.beforePhoto1Url = formdata['baseBeforePhoto1Url'];
					} else {
						this.baseInfo.beforePhoto1Take = false;
					}
					let baseBeforePhoto2Take = formdata['baseBeforePhoto2Take'];
					if (baseBeforePhoto2Take == 1) {
						this.baseInfo.beforePhoto2Take = true;
						this.baseInfo.beforePhoto2Url = formdata['baseBeforePhoto2Url'];
					} else {
						this.baseInfo.beforePhoto2Take = false;
					}
					let baseAfterPhoto1Take = formdata['baseAfterPhoto1Take'];
					if (baseAfterPhoto1Take == 1) {
						this.baseInfo.afterPhoto1Take = true;
						this.baseInfo.afterPhoto1Url = formdata['baseAfterPhoto1Url'];
					} else {
						this.baseInfo.afterPhoto1Take = false;
					}
					let baseAfterPhoto2Take = formdata['baseAfterPhoto2Take'];
					if (baseAfterPhoto2Take == 1) {
						this.baseInfo.afterPhoto2Take = true;
						this.baseInfo.afterPhoto2Url = formdata['baseAfterPhoto2Url'];
					} else {
						this.baseInfo.afterPhoto2Take = false;
					}
					let photoTake = formdata['rtuPhotoTake'];
					if (photoTake == 1) {
						this.rtuInfo.photoTake = true;
						this.rtuInfo.photoUrl = formdata['rtuPhotoUrl'];
					} else {
						this.rtuInfo.photoTake = false;
					}
					this.sensorList.rainSensor = formdata['rainSensorActive'];
					photoTake = formdata['rainSensorPhotoTake'];
					if (photoTake == 1) {
						this.rainSensorInfo.photoTake = true;
						this.rainSensorInfo.photoUrl = formdata['rainSensorPhotoUrl'];
					} else {
						this.rainSensorInfo.photoTake = false;
					}
					this.sensorList.waterSensor = formdata['waterLevelSensorActive'];
					photoTake = formdata['waterSensorPhotoTake'];
					if (photoTake == 1) {
						this.waterSensorInfo.photoTake = true;
						this.waterSensorInfo.photoUrl = formdata['waterSensorPhotoUrl'];
					} else {
						this.waterSensorInfo.photoTake = false;
					}
					this.sensorList.groundSensor = formdata['groundWaterSensorActive'];
					photoTake = formdata['groundSensorPhotoTake'];
					if (photoTake == 1) {
						this.groundSensorInfo.photoTake = true;
						this.groundSensorInfo.photoUrl = formdata['groundSensorPhotoUrl'];
					} else {
						this.groundSensorInfo.photoTake = false;
					}
					photoTake = formdata['batteryPhotoTake'];
					if (photoTake == 1) {
						this.powerInfo.batteryPhotoTake = true;
						this.powerInfo.batteryPhotoUrl = formdata['batteryPhotoUrl'];
					} else {
						this.powerInfo.batteryPhotoTake = false;
					}
					photoTake = formdata['sunPhotoTake'];
					if (photoTake == 1) {
						this.powerInfo.sunPhotoTake = true;
						this.powerInfo.sunPhotoUrl = formdata['sunPhotoUrl'];
					} else {
						this.powerInfo.sunPhotoTake = false;
					}
				} else {
					this.getDetail();
				}
			},
			toSubmit() {
				console.log('表单提交');
				let that = this;
				this.$refs.baseForm.validate().then(res => {
					let next = false;
					let msg = '';
					if (that.formData.networkSignalStatus == 0) {
						//检查必填的图片
						if (this.baseInfo.beforePhoto1Take || this.baseInfo.beforePhoto2Take) {
							next = true;
						} else {
							msg = '维修前照片为必填项，请至少拍一张照片，请检查！';
							next = false;
						}
						if (next) {
							if (this.rtuInfo.photoTake) {
								next = true;
							} else {
								msg = 'RTU设备照片为必填项，请检查！';
								next = false;
							}
						}
						if (next) {
							if (this.sensorList.rainSensor == 1) {
								if (this.formData.rainSensorReplace == 1) {
									if (this.rainSensorInfo.photoTake) {
										next = true;
									} else {
										msg = '更换雨量计后，雨量传感器照片为必填项，请检查！';
										next = false;
									}
								}
							}
						}
						if (next) {
							if (this.sensorList.waterSensor == 1) {
								if (this.formData.waterSensorReplace == 1) {
									if (this.waterSensorInfo.photoTake) {
										next = true;
									} else {
										msg = '更换水位计后，水位传感器照片为必填项，请检查！';
										next = false;
									}
								}
							}
						}
						if (next) {
							if (this.sensorList.groundSensor == 1) {
								if (this.formData.groundSensorReplace == 1) {
									if (this.groundSensorInfo.photoTake) {
										next = true;
									} else {
										msg = '更换墒情计后，墒情传感器照片为必填项，请检查！';
										next = false;
									}
								}
							}
						}
						if (next) {
							if (this.powerInfo.batteryPhotoTake || this.powerInfo.sunPhotoTake) {
								next = true;
							} else {
								msg = '供电系统照片为必填项，请至少拍一张照片，请检查！';
								next = false;
							}
						}
						if (next) {
							if (this.baseInfo.afterPhoto1Take || this.baseInfo.afterPhoto2Take) {
								next = true;
							} else {
								msg = '维修后照片为必填项，请至少拍一张照片，请检查！';
								next = false;
							}
						}
					} else {
						next = true;
					}
					if (next) {
						that.submitData();
					} else {
						uni.showModal({
							content: msg,
							showCancel: false,
							success(res) {
								if (res.confirm) {

								}
							}
						});
					}
				}).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['orderId'] = this.orderId;
				if (this.baseInfo.beforePhoto1Take) {
					formdata['baseBeforePhoto1Take'] = 1;
					formdata['baseBeforePhoto1Url'] = this.baseInfo.beforePhoto1Url;
				} else {
					formdata['baseBeforePhoto1Take'] = 0;
				}
				if (this.baseInfo.beforePhoto2Take) {
					formdata['baseBeforePhoto2Take'] = 1;
					formdata['baseBeforePhoto2Url'] = this.baseInfo.beforePhoto2Url;
				} else {
					formdata['baseBeforePhoto2Take'] = 0;
				}
				if (this.baseInfo.afterPhoto1Take) {
					formdata['baseAfterPhoto1Take'] = 1;
					formdata['baseAfterPhoto1Url'] = this.baseInfo.afterPhoto1Url;
				} else {
					formdata['baseAfterPhoto1Take'] = 0;
				}
				if (this.baseInfo.afterPhoto2Take) {
					formdata['baseAfterPhoto2Take'] = 1;
					formdata['baseAfterPhoto2Url'] = this.baseInfo.afterPhoto2Url;
				} else {
					formdata['baseAfterPhoto2Take'] = 0;
				}
				if (this.rtuInfo.photoTake) {
					formdata['rtuPhotoTake'] = 1;
					formdata['rtuPhotoUrl'] = this.rtuInfo.photoUrl;
				} else {
					formdata['rtuPhotoTake'] = 0;
				}
				if (this.sensorList.rainSensor == 1) {
					formdata['rainSensorActive'] = 1;
					if (this.rainSensorInfo.photoTake) {
						formdata['rainSensorPhotoTake'] = 1;
						formdata['rainSensorPhotoUrl'] = this.rainSensorInfo.photoUrl;
					} else {
						formdata['rainSensorPhotoTake'] = 0;
					}
				} else {
					formdata['rainSensorActive'] = 0;
				}
				if (this.sensorList.waterSensor == 1) {
					formdata['waterLevelSensorActive'] = 1;
					if (this.waterSensorInfo.photoTake) {
						formdata['waterSensorPhotoTake'] = 1;
						formdata['waterSensorPhotoUrl'] = this.waterSensorInfo.photoUrl;
					} else {
						formdata['waterSensorPhotoTake'] = 0;
					}
				} else {
					formdata['waterLevelSensorActive'] = 0;
				}
				if (this.sensorList.groundSensor == 1) {
					formdata['groundWaterSensorActive'] = 1;
					if (this.groundSensorInfo.photoTake) {
						formdata['groundSensorPhotoTake'] = 1;
						formdata['groundSensorPhotoUrl'] = this.groundSensorInfo.photoUrl;
					} else {
						formdata['groundSensorPhotoTake'] = 0;
					}
				} else {
					formdata['groundWaterSensorActive'] = 0;
				}
				if (this.powerInfo.batteryPhotoTake) {
					formdata['batteryPhotoTake'] = 1;
					formdata['batteryPhotoUrl'] = this.powerInfo.batteryPhotoUrl;
				} else {
					formdata['batteryPhotoTake'] = 0;
				}
				if (this.powerInfo.sunPhotoTake) {
					formdata['sunPhotoTake'] = 1;
					formdata['sunPhotoUrl'] = this.powerInfo.sunPhotoUrl;
				} else {
					formdata['sunPhotoTake'] = 0;
				}
				if (this.formData.networkType == 0) {
					formdata['networkActive'] = 1;
					formdata['satelliteActive'] = 0;
				} else if (this.formData.networkType == 1) {
					formdata['networkActive'] = 0;
					formdata['satelliteActive'] = 1;
				}
				let that = this;
				http.request({
					url: '/galaxy-business/rtu/check/order/process/save',
					method: 'POST',
					data: formdata
				}).then(res => {
					if (res.success) {
						uni.showModal({
							content: '维修填报信息已成功提交',
							showCancel: false,
							success(res) {
								if (res.confirm) {
									that.clearCache();
									that.toBack();
								}
							}
						});
					} else {
						uni.showModal({
							content: '' + res.msg,
							showCancel: false
						});
					}
				}).catch(err => {
					console.log(err)
				})
			},
			toSave() {
				this.saveCacheData();
			},
			saveCacheData() {
				this.formData['orderId'] = this.orderId;
				if (this.baseInfo.beforePhoto1Take) {
					this.formData['baseBeforePhoto1Take'] = 1;
					this.formData['baseBeforePhoto1Url'] = this.baseInfo.beforePhoto1Url;
				} else {
					this.formData['baseBeforePhoto1Take'] = 0;
				}
				if (this.baseInfo.beforePhoto2Take) {
					this.formData['baseBeforePhoto2Take'] = 1;
					this.formData['baseBeforePhoto2Url'] = this.baseInfo.beforePhoto2Url;
				} else {
					this.formData['baseBeforePhoto2Take'] = 0;
				}
				if (this.baseInfo.afterPhoto1Take) {
					this.formData['baseAfterPhoto1Take'] = 1;
					this.formData['baseAfterPhoto1Url'] = this.baseInfo.afterPhoto1Url;
				} else {
					this.formData['baseAfterPhoto1Take'] = 0;
				}
				if (this.baseInfo.afterPhoto2Take) {
					this.formData['baseAfterPhoto2Take'] = 1;
					this.formData['baseAfterPhoto2Url'] = this.baseInfo.afterPhoto2Url;
				} else {
					this.formData['baseAfterPhoto2Take'] = 0;
				}
				if (this.rtuInfo.photoTake) {
					this.formData['rtuPhotoTake'] = 1;
					this.formData['rtuPhotoUrl'] = this.rtuInfo.photoUrl;
				} else {
					this.formData['rtuPhotoTake'] = 0;
				}
				if (this.sensorList.rainSensor == 1) {
					this.formData['rainSensorActive'] = 1;
					if (this.rainSensorInfo.photoTake) {
						this.formData['rainSensorPhotoTake'] = 1;
						this.formData['rainSensorPhotoUrl'] = this.rainSensorInfo.photoUrl;
					} else {
						this.formData['rainSensorPhotoTake'] = 0;
					}
				} else {
					this.formData['rainSensorActive'] = 0;
				}
				if (this.sensorList.waterSensor == 1) {
					this.formData['waterLevelSensorActive'] = 1;
					if (this.waterSensorInfo.photoTake) {
						this.formData['waterSensorPhotoTake'] = 1;
						this.formData['waterSensorPhotoUrl'] = this.waterSensorInfo.photoUrl;
					} else {
						this.formData['waterSensorPhotoTake'] = 0;
					}
				} else {
					this.formData['waterLevelSensorActive'] = 0;
				}
				if (this.sensorList.groundSensor == 1) {
					this.formData['groundWaterSensorActive'] = 1;
					if (this.groundSensorInfo.photoTake) {
						this.formData['groundSensorPhotoTake'] = 1;
						this.formData['groundSensorPhotoUrl'] = this.groundSensorInfo.photoUrl;
					} else {
						this.formData['groundSensorPhotoTake'] = 0;
					}
				} else {
					this.formData['groundWaterSensorActive'] = 0;
				}
				if (this.powerInfo.batteryPhotoTake) {
					this.formData['batteryPhotoTake'] = 1;
					this.formData['batteryPhotoUrl'] = this.powerInfo.batteryPhotoUrl;
				} else {
					this.formData['batteryPhotoTake'] = 0;
				}
				if (this.powerInfo.sunPhotoTake) {
					this.formData['sunPhotoTake'] = 1;
					this.formData['sunPhotoUrl'] = this.powerInfo.sunPhotoUrl;
				} else {
					this.formData['sunPhotoTake'] = 0;
				}
				console.log('save事件:', JSON.stringify(this.formData));
				let that = this;
				uni.setStorageSync('check_report_storage_' + this.orderId, this.formData);
				uni.showModal({
					content: '已成功缓存，确认返回！',
					showCancel: true,
					success(res) {
						if (res.confirm) {
							that.toBack();
						}
					}
				});
			},
			clearCache() {
				uni.removeStorageSync('check_report_storage_' + this.orderId);
			},
			sensorCheckboxChange: function(evt) {
				this.sensorList.rainSensor = 0;
				this.sensorList.waterSensor = 0;
				this.sensorList.groundSensor = 0;
				for (let i = 0; i < evt.detail.value.length; i++) {
					let c = evt.detail.value[i];
					if (c === 0) {
						this.sensorList.rainSensor = 1;
					} else if (c === 1) {
						this.sensorList.waterSensor = 1;
					} else if (c === 2) {
						this.sensorList.groundSensor = 1;
					}
				}
			},
			rtuRemarkInput(e) {
				console.log(JSON.stringify(e))
				let desc = "";
				desc += "RTU设备维修说明：" + e;
				if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "雨量传感器维修说明：" + this.formData.rainSensorDesc;
				}
				if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "水位传感器维修说明：" + this.formData.waterSensorDesc;
				}
				if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "墒情传感器维修说明：" + this.formData.groundSensorDesc;
				}
				if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "供电维修说明：" + this.formData.powerDesc;
				}
				if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "4G网络维修说明：" + this.formData.networkDesc;
				}
				if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "北斗维修说明：" + this.formData.satelliteDesc;
				}
				this.formData.processDesc = desc;
			},
			rainSensorRemarkInput(e) {
				let desc = "";
				if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
					desc += "RTU设备维修说明：" + this.formData.rtuDesc;
				}
				if (desc.length > 0) {
					desc += ",\n";
				}
				desc += "雨量传感器维修说明：" + e;
				if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "水位传感器维修说明：" + this.formData.waterSensorDesc;
				}
				if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "墒情传感器维修说明：" + this.formData.groundSensorDesc;
				}
				if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "供电维修说明：" + this.formData.powerDesc;
				}
				if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "4G网络维修说明：" + this.formData.networkDesc;
				}
				if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "北斗维修说明：" + this.formData.satelliteDesc;
				}
				this.formData.processDesc = desc;
			},
			waterSensorRemarkInput(e) {
				let desc = "";
				if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
					desc += "RTU设备维修说明：" + this.formData.rtuDesc;
				}
				if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "雨量传感器维修说明：" + this.formData.rainSensorDesc;
				}
				if (desc.length > 0) {
					desc += ",\n";
				}
				desc += "水位传感器维修说明：" + e;
				if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "墒情传感器维修说明：" + this.formData.groundSensorDesc;
				}
				if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "供电维修说明：" + this.formData.powerDesc;
				}
				if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "4G网络维修说明：" + this.formData.networkDesc;
				}
				if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "北斗维修说明：" + this.formData.satelliteDesc;
				}
				this.formData.processDesc = desc;
			},
			groundSensorRemarkInput(e) {
				let desc = "";
				if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
					desc += "RTU设备维修说明：" + this.formData.rtuDesc;
				}
				if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "雨量传感器维修说明：" + this.formData.rainSensorDesc;
				}
				if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "水位传感器维修说明：" + this.formData.waterSensorDesc;
				}
				if (desc.length > 0) {
					desc += ",\n";
				}
				desc += "墒情传感器维修说明：" + e;
				if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "供电维修说明：" + this.formData.powerDesc;
				}
				if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "4G网络维修说明：" + this.formData.networkDesc;
				}
				if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "北斗维修说明：" + this.formData.satelliteDesc;
				}
				this.formData.processDesc = desc;
			},
			powerRemarkInput(e) {
				let desc = "";
				if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
					desc += "RTU设备维修说明：" + this.formData.rtuDesc;
				}
				if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "雨量传感器维修说明：" + this.formData.rainSensorDesc;
				}
				if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "水位传感器维修说明：" + this.formData.waterSensorDesc;
				}
				if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "墒情传感器维修说明：" + this.formData.groundSensorDesc;
				}
				if (desc.length > 0) {
					desc += ",\n";
				}
				desc += "供电维修说明：" + e;
				if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "4G网络维修说明：" + this.formData.networkDesc;
				}
				if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "北斗维修说明：" + this.formData.satelliteDesc;
				}
				this.formData.processDesc = desc;
			},
			networkRemarkInput(e) {
				let desc = "";
				if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
					desc += "RTU设备维修说明：" + this.formData.rtuDesc;
				}
				if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "雨量传感器维修说明：" + this.formData.rainSensorDesc;
				}
				if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "水位传感器维修说明：" + this.formData.waterSensorDesc;
				}
				if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "墒情传感器维修说明：" + this.formData.groundSensorDesc;
				}
				if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "供电维修说明：" + this.formData.powerDesc;
				}
				if (desc.length > 0) {
					desc += ",\n";
				}
				desc += "4G网络维修说明：" + e;
				if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "北斗维修说明：" + this.formData.satelliteDesc;
				}
				this.formData.processDesc = desc;
			},
			satelliteRemarkInput(e) {
				let desc = "";
				if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
					desc += "RTU设备维修说明：" + this.formData.rtuDesc;
				}
				if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "雨量传感器维修说明：" + this.formData.rainSensorDesc;
				}
				if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "水位传感器维修说明：" + this.formData.waterSensorDesc;
				}
				if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "墒情传感器维修说明：" + this.formData.groundSensorDesc;
				}
				if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "供电维修说明：" + this.formData.powerDesc;
				}
				if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
					if (desc.length > 0) {
						desc += ",\n";
					}
					desc += "4G网络维修说明：" + this.formData.networkDesc;
				}
				if (desc.length > 0) {
					desc += ",\n";
				}
				desc += "北斗维修说明：" + e;
				this.formData.processDesc = desc;
			},
			onBaseBeforePhoto1DeleteClick() {
				this.baseInfo.beforePhoto1Take = false;
			},
			onBaseBeforePhoto2DeleteClick() {
				this.baseInfo.beforePhoto2Take = false;
			},
			onBaseAfterPhoto1DeleteClick() {
				this.baseInfo.afterPhoto1Take = false;
			},
			onBaseAfterPhoto2DeleteClick() {
				this.baseInfo.afterPhoto2Take = false;
			},
			onRtuPhotoDeleteClick() {
				this.rtuInfo.photoTake = false;
			},
			onRainPhotoDeleteClick() {
				this.rainSensorInfo.photoTake = false;
			},
			onWaterPhotoDeleteClick() {
				this.waterSensorInfo.photoTake = false;
			},
			onGroundPhotoDeleteClick() {
				this.groundSensorInfo.photoTake = false;
			},
			onBatteryPhotoDeleteClick() {
				this.powerInfo.batteryPhotoTake = false;
			},
			onSunPowerPhotoDeleteClick() {
				this.powerInfo.sunPhotoTake = false;
			},
			uploadPhotoCallback(path, photoIndex) {
				if (photoIndex === 'baseBeforePhoto1') {
					this.baseInfo.beforePhoto1Url = path;
					this.baseInfo.beforePhoto1Take = true;
				} else if (photoIndex === 'baseBeforePhoto2') {
					this.baseInfo.beforePhoto2Url = path;
					this.baseInfo.beforePhoto2Take = true;
				} else if (photoIndex === 'baseAfterPhoto1') {
					this.baseInfo.afterPhoto1Url = path;
					this.baseInfo.afterPhoto1Take = true;
				} else if (photoIndex === 'baseAfterPhoto2') {
					this.baseInfo.afterPhoto2Url = path;
					this.baseInfo.afterPhoto2Take = true;
				} else if (photoIndex === 'rtu') {
					this.rtuInfo.photoUrl = path;
					this.rtuInfo.photoTake = true;
				} else if (photoIndex === 'rain') {
					this.rainSensorInfo.photoUrl = path;
					this.rainSensorInfo.photoTake = true;
				} else if (photoIndex === 'water') {
					this.waterSensorInfo.photoUrl = path;
					this.waterSensorInfo.photoTake = true;
				} else if (photoIndex === 'ground') {
					this.groundSensorInfo.photoUrl = path;
					this.groundSensorInfo.photoTake = true;
				} else if (photoIndex === 'battery') {
					this.powerInfo.batteryPhotoUrl = path;
					this.powerInfo.batteryPhotoTake = true;
				} else if (photoIndex === 'sun') {
					this.powerInfo.sunPhotoUrl = path;
					this.powerInfo.sunPhotoTake = true;
				}
			},
			uploadPhoto(imagePath, photoIndex) {
				var that = this;
				console.log("accessToken:" + uni.getStorageSync('accessToken'));
				console.log("path " + imagePath);
				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) => {
						uni.hideLoading()
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data);
							if (data.success) {
								let path = data.data['name'];
								console.log("paht " + path);
								that.uploadPhotoCallback(path, photoIndex);
							}
						}

					},
					fail: (err) => {
						uni.hideLoading()
						console.log(err);
						reject('err')
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
			getBaseBeforePhoto1() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'baseBeforePhoto1');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getBaseBeforePhoto2() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'baseBeforePhoto2');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getBaseAfterPhoto1() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'baseAfterPhoto1');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getBaseAfterPhoto2() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'baseAfterPhoto2');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getRtuPhoto() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'rtu');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getRainSensorPhoto() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'rain');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getWaterSensorPhoto() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'water');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getGroundSensorPhoto() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'ground');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getBatteryPhoto() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'battery');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			getSunPowerPhoto() {
				var that = this;
				uni.chooseImage({
					sourceType: ['camera'],
					sizeType: ['compressed'],
					success: (res) => {
						const len = res.tempFilePaths.length;
						if (len === 1) {
							res.tempFilePaths.forEach(path => {
								that.uploadPhoto(path, 'sun');
							})
						} else {
							uni.showModal({
								content: '只能选择一张图片，请确认！',
								showCancel: false
							});
						}
					}
				})
			},
			formReset: function(e) {
				console.log('清空数据')
			},
		}
	}
</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-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;
	}

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

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

	.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: 80px;
		height: 80px;

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

			.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: 98%;
					height: 98%;

				}


			}
		}
	}

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

	.mb-10 {
		margin-top: 0px;
		margin-bottom: 0px;
	}

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