|
|
@@ -0,0 +1,1808 @@
|
|
|
+<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">
|
|
|
+ <view class="uni-form-item view-flex-rs" style="margin-top: 0px;">
|
|
|
+ <uSection title="巡检总结情况" titleFontSize="0.8rem" type="line" style="width: 100%;">
|
|
|
+ <uni-forms-item style="padding-left: 10px;padding-right:10px">
|
|
|
+ <uni-easyinput label="总结说明" type="textarea" v-model="baseInfo.reportDesc"
|
|
|
+ placeholder="请输入总结说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uGroup title="总体设施设备图片" margin-top="0px">
|
|
|
+ <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.photo1Take" class="note-image-item">
|
|
|
+ <view class="close-icon" @click="onBasePhoto1DeleteClick()">
|
|
|
+ <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
|
|
|
+ </view>
|
|
|
+ <view class="image-box">
|
|
|
+ <image :src="toOss(baseInfo.photo1Url)" mode="widthFix"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-else class="note-image-item" @click="getBasePhoto1()">
|
|
|
+ <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.photo2Take" class="note-image-item">
|
|
|
+ <view class="close-icon" @click="onBasePhoto2DeleteClick()">
|
|
|
+ <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
|
|
|
+ </view>
|
|
|
+ <view class="image-box">
|
|
|
+ <image :src="toOss(baseInfo.photo2Url)" mode="widthFix"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-else class="note-image-item" @click="getBasePhoto2()">
|
|
|
+ <view class="image-box">
|
|
|
+ <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ <uSection title="RTU设备" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="品牌" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="rtuInfo.rtuBrandText" placeholder="请录入品牌" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="型号" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="rtuInfo.rtuModelText" placeholder="请录入型号" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="更换时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="rtuInfo.rtuReplaceDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="上报省市县" label-width="130px" required>
|
|
|
+ <checkbox-group @change="datagramToCheckboxChange">
|
|
|
+ <label style="margin-right: 10px;font-size: 0.7rem;"
|
|
|
+ v-for="(item, index) in datagramIp.items" :key="item.id">
|
|
|
+ <checkbox v-if="item.checked" :value="item.id" checked="true" />
|
|
|
+ <checkbox v-else :value="item.id" />
|
|
|
+ {{item.dictValue}}
|
|
|
+ </label>
|
|
|
+ </checkbox-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onRtuStatusRadioChange"
|
|
|
+ style="display: flex;flex-direction: row;justify-content: flex-start;">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in rtuInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === rtuInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="rtuInfo.remark" placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ <uGroup title="RTU图片" margin-top="0px">
|
|
|
+ <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="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>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ <view class="uni-form-item">
|
|
|
+ <uSection title="雨量传感器" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="是否有雨量计" label-width="130px" required>
|
|
|
+ <radio-group @change="onRainActiveRadioChange"
|
|
|
+ style="display: flex;flex-direction: row;justify-content: flex-start;">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in rainSensorInfo.active.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === rainSensorInfo.active.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 12px;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="品牌" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="rainSensorInfo.rainSensorBrandText" placeholder="请录入品牌" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="型号" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="rainSensorInfo.rainSensorModelText" placeholder="请录入型号" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="更换时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false"
|
|
|
+ v-model="rainSensorInfo.rainSensorReplaceDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onRainSensorStatusRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in rainSensorInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === rainSensorInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 12px;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="rainSensorInfo.remark"
|
|
|
+ placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ <uGroup title="雨量传感器图片" margin-top="0px">
|
|
|
+ <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>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ <view class="uni-form-item">
|
|
|
+ <uSection title="水位传感器" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="是否有水位计" label-width="130px" required>
|
|
|
+ <radio-group @change="onWaterActiveRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in waterSensorInfo.active.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === waterSensorInfo.active.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="品牌" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="waterSensorInfo.waterSensorBrandText" placeholder="请录入品牌" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="型号" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="waterSensorInfo.waterSensorModelText" placeholder="请录入型号" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="更换时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false"
|
|
|
+ v-model="waterSensorInfo.waterSensorReplaceDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="类型" label-width="130px" required>
|
|
|
+ <radio-group @change="onWaterSensorTypeRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in waterLevelSensorType.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === waterLevelSensorType.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onWaterSensorStatusRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in waterSensorInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id"
|
|
|
+ :checked="index === waterSensorInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="waterSensorInfo.remark"
|
|
|
+ placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ <uGroup title="水位传感器图片" margin-top="0px">
|
|
|
+ <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>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ <view class="uni-form-item">
|
|
|
+ <uSection title="墒情传感器" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="是否有墒情传感器" label-width="130px" required>
|
|
|
+ <radio-group @change="onGroundActiveRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in groundSensorInfo.active.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === groundSensorInfo.active.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="品牌" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="groundSensorInfo.groundSensorBrandText" placeholder="请录入品牌" />
|
|
|
+ </uni-forms-item>
|
|
|
+
|
|
|
+ <uni-forms-item label="型号" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="groundSensorInfo.groundSensorModelText" placeholder="请录入型号" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="更换时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false"
|
|
|
+ v-model="groundSensorInfo.groundSensorReplaceDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="类型" label-width="130px" required>
|
|
|
+ <radio-group @change="onGroundSensorTypeRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in groundSensorType.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === groundSensorType.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onGroundSensorStatusRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in groundSensorInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id"
|
|
|
+ :checked="index === groundSensorInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="groundSensorInfo.remark"
|
|
|
+ placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ <uGroup title="墒情传感器图片" margin-top="0px">
|
|
|
+ <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>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ <view class="uni-form-item">
|
|
|
+ <uSection title="供电系统" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="蓄电池容量(AH)" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="powerInfo.batteryModel" placeholder="请录入容量" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="蓄电池更换时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false"
|
|
|
+ v-model="powerInfo.batteryReplaceDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="太阳能板功率(W)" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="powerInfo.sunPowerModel" placeholder="请录入功率" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="太阳能板更换时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false"
|
|
|
+ v-model="powerInfo.sunPowerReplaceDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onPowerStatusRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in powerInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === powerInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="powerInfo.remark"
|
|
|
+ placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ <uGroup title="供电系统图片" margin-top="0px">
|
|
|
+ <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="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>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ <view class="uni-form-item">
|
|
|
+ <uSection title="4G移动网络" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="是否使用4G移动网络" label-width="130px" required>
|
|
|
+ <radio-group @change="onNetworkActiveRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in networkInfo.active.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === networkInfo.active.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="SIM卡号" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="networkInfo.simCcid" placeholder="请录入请录入SIM卡号" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="开卡单位" label-width="130px" required>
|
|
|
+ <uni-easyinput v-model="networkInfo.simPay" placeholder="请录入SIM卡开卡单位" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="缴费截止时间" label-width="130px" required>
|
|
|
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="networkInfo.simPayEndDate" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onNetworkStatusRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in networkInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === networkInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="networkInfo.remark"
|
|
|
+ placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ <view class="uni-form-item">
|
|
|
+ <uSection title="北斗通讯" type="line" titleFontSize="0.8rem" style="width: 100%;">
|
|
|
+ <uGroup margin-top="0">
|
|
|
+ <uni-forms-item label="是否使用北斗网络" label-width="130px" required>
|
|
|
+ <radio-group @change="onSatelliteActiveRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in satelliteInfo.active.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === satelliteInfo.active.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="通讯模式" label-width="130px" required>
|
|
|
+ <radio-group @change="onSatelliteModelRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in satelliteModel.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === satelliteModel.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="运行状态" label-width="130px" required>
|
|
|
+ <radio-group @change="onSatelliteStatusRadioChange" class="view-flex-rs">
|
|
|
+ <label style="margin-right: 20px;width:80px;" class="view-flex-rs"
|
|
|
+ v-for="(item, index) in satelliteInfo.runStatus.items" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <radio :value="item.id" :checked="index === satelliteInfo.runStatus.current" />
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item>
|
|
|
+ <uni-easyinput label="备注说明" type="textarea" v-model="satelliteInfo.remark"
|
|
|
+ placeholder="请输入备注说明" />
|
|
|
+ </uni-forms-item>
|
|
|
+ </uGroup>
|
|
|
+ </uSection>
|
|
|
+ </view>
|
|
|
+ </uni-forms>
|
|
|
+ <view class="footer">
|
|
|
+ <view class="control">
|
|
|
+ <view style="display: flex;flex-direction: row;justify-content: flex-start;">
|
|
|
+ <view
|
|
|
+ style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
|
|
|
+ @click="toSave()">
|
|
|
+ <view style="display:flex;flex-direction: column;justify-content: center;">
|
|
|
+ <uIcons class="input-uni-icon" type="gear" size="18" color="#999" />
|
|
|
+ </view>
|
|
|
+ <view style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
|
|
|
+ <text style="color:black;font-size:0.6rem">暂存</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightpink"
|
|
|
+ @click="toSubmit()">
|
|
|
+ <view style="display:flex;flex-direction: column;justify-content: center;">
|
|
|
+ <uIcons class="input-uni-icon" type="location" size="18" color="#999" />
|
|
|
+ </view>
|
|
|
+ <view style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
|
|
|
+ <text style="color:black;font-size:0.6rem">立即提交</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <u-gap height="70"></u-gap> -->
|
|
|
+ </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';
|
|
|
+
|
|
|
+ import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
|
|
|
+ import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
|
|
|
+ import uGroup from '@/uni_modules/uni-group/uni-group.vue'
|
|
|
+ import uSection from '@/uni_modules/uni-section/uni-section.vue'
|
|
|
+ import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
|
|
|
+ import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
|
|
|
+ import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
|
|
|
+ import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
|
|
|
+ import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
|
|
+ import uCard from '@/uni_modules/uni-card/components/uni-card/uni-card.vue'
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ uNavBar,
|
|
|
+ uDataPicker,
|
|
|
+ uPagination,
|
|
|
+ uBreadcrumb,
|
|
|
+ uList,
|
|
|
+ uListItem,
|
|
|
+ uIcons,
|
|
|
+ uGroup,
|
|
|
+ uSection,
|
|
|
+ uCard,
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ this.rtuCode = options.rtuCode;
|
|
|
+ this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
|
|
|
+ //初始化巡检填报字典
|
|
|
+ this.getReportDict();
|
|
|
+ //查询计划信息
|
|
|
+ //this.getPlanInfo();
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ 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: '',
|
|
|
+ rtuCode: '',
|
|
|
+ //planInfo: {},
|
|
|
+ waterLevelSensorType: {
|
|
|
+ items: [],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ groundSensorType: {
|
|
|
+ items: [],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ satelliteModel: {
|
|
|
+ items: [],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ datagramIp: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'checked': false,
|
|
|
+ 'dictValue': '发往县'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'checked': false,
|
|
|
+ 'dictValue': '发往市'
|
|
|
+ }, {
|
|
|
+ 'id': '2',
|
|
|
+ 'checked': false,
|
|
|
+ 'dictValue': '发往省'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ baseInfo: {
|
|
|
+ reportDesc: '',
|
|
|
+ photo1Url: '',
|
|
|
+ photo1Take: false,
|
|
|
+ photo2Url: '',
|
|
|
+ photo2Take: false
|
|
|
+ },
|
|
|
+ rtuInfo: {
|
|
|
+ remark: '',
|
|
|
+ rtuBrand: '',
|
|
|
+ rtuBrandText: '',
|
|
|
+ rtuModel: '',
|
|
|
+ rtuModelText: '',
|
|
|
+ rtuReplaceDate: null,
|
|
|
+ datagramTo: [{
|
|
|
+ text: '发往县',
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ text: '发往市',
|
|
|
+ value: 1
|
|
|
+ }, {
|
|
|
+ text: '发往省',
|
|
|
+ value: 2
|
|
|
+ }],
|
|
|
+ selectedDatagramTo: [],
|
|
|
+ datagramToLevel1: 0,
|
|
|
+ datagramToLevel2: 0,
|
|
|
+ datagramToLevel3: 0,
|
|
|
+ photoUrl: '',
|
|
|
+ photoTake: false,
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ rainSensorInfo: {
|
|
|
+ rainSensorBrand: '',
|
|
|
+ rainSensorModel: '',
|
|
|
+ rainSensorBrandText: '',
|
|
|
+ rainSensorModelText: '',
|
|
|
+ rainSensorReplaceDate: null,
|
|
|
+ remark: '',
|
|
|
+ photoUrl: '',
|
|
|
+ photoTake: false,
|
|
|
+ active: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '有'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '无'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ waterSensorInfo: {
|
|
|
+ waterSensorBrand: '',
|
|
|
+ waterSensorModel: '',
|
|
|
+ waterSensorBrandText: '',
|
|
|
+ waterSensorModelText: '',
|
|
|
+ waterSensorType: '',
|
|
|
+ waterSensorReplaceDate: null,
|
|
|
+ remark: '',
|
|
|
+ photoUrl: '',
|
|
|
+ photoTake: false,
|
|
|
+ active: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '有'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '无'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ groundSensorInfo: {
|
|
|
+ groundSensorBrand: '',
|
|
|
+ groundSensorModel: '',
|
|
|
+ groundSensorBrandText: '',
|
|
|
+ groundSensorModelText: '',
|
|
|
+ groundSensorType: '',
|
|
|
+ groundSensorReplaceDate: null,
|
|
|
+ remark: '',
|
|
|
+ photoUrl: '',
|
|
|
+ photoTake: false,
|
|
|
+ active: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '有'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '无'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ powerInfo: {
|
|
|
+ batteryModel: '',
|
|
|
+ batteryReplaceDate: null,
|
|
|
+ sunPowerModel: '',
|
|
|
+ sunPowerReplaceDate: null,
|
|
|
+ batteryPhotoUrl: '',
|
|
|
+ batteryPhotoTake: false,
|
|
|
+ sunPhotoUrl: '',
|
|
|
+ sunPhotoTake: false,
|
|
|
+ remark: '',
|
|
|
+ active: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '有'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '无'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ networkInfo: {
|
|
|
+ simCcid: '',
|
|
|
+ simPay: '',
|
|
|
+ simPayEndDate: null,
|
|
|
+ remark: '',
|
|
|
+ active: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '有'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '无'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ satelliteInfo: {
|
|
|
+ satelliteModel: '',
|
|
|
+ remark: '',
|
|
|
+ active: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '有'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '无'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ runStatus: {
|
|
|
+ items: [{
|
|
|
+ 'id': '0',
|
|
|
+ 'dictValue': '正常'
|
|
|
+ }, {
|
|
|
+ 'id': '1',
|
|
|
+ 'dictValue': '故障'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ localImageList: [],
|
|
|
+ uploadImageList: [],
|
|
|
+ title: '巡检信息填报',
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ getIcon() {
|
|
|
+ return path => {
|
|
|
+ return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ toOss(path) {
|
|
|
+ return oss + path;
|
|
|
+ },
|
|
|
+ toBack() {
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toSubmit() {
|
|
|
+ var formdata = {};
|
|
|
+ // formdata['planId'] = this.planId;
|
|
|
+ formdata['rtuCode'] = this.rtuCode;
|
|
|
+ formdata['reportDesc'] = this.baseInfo.reportDesc;
|
|
|
+ if (this.baseInfo.photo1Take) {
|
|
|
+ formdata['basePhoto1Take'] = 1;
|
|
|
+ formdata['basePhoto1Url'] = this.baseInfo.photo1Url;
|
|
|
+ } else {
|
|
|
+ formdata['basePhoto1Take'] = 0;
|
|
|
+ }
|
|
|
+ if (this.baseInfo.photo2Take) {
|
|
|
+ formdata['basePhoto2Take'] = 1;
|
|
|
+ formdata['basePhoto2Url'] = this.baseInfo.photo2Url;
|
|
|
+ } else {
|
|
|
+ formdata['basePhoto2Take'] = 0;
|
|
|
+ }
|
|
|
+ formdata['rtuStatus'] = this.rtuInfo.runStatus.current;
|
|
|
+ formdata['rtuBrand'] = this.rtuInfo.rtuBrandText;
|
|
|
+ formdata['rtuModel'] = this.rtuInfo.rtuModelText;
|
|
|
+ formdata['rtuReplaceDate'] = this.rtuInfo.rtuReplaceDate;
|
|
|
+ formdata['datagramToLevel1'] = this.rtuInfo.datagramToLevel1;
|
|
|
+ formdata['datagramToLevel2'] = this.rtuInfo.datagramToLevel2;
|
|
|
+ formdata['datagramToLevel3'] = this.rtuInfo.datagramToLevel3;
|
|
|
+ formdata['rtuDesc'] = this.rtuInfo.remark;
|
|
|
+ if (this.rtuInfo.photoTake) {
|
|
|
+ formdata['rtuPhotoTake'] = 1;
|
|
|
+ formdata['rtuPhotoUrl'] = this.rtuInfo.photoUrl;
|
|
|
+ } else {
|
|
|
+ formdata['rtuPhotoTake'] = 0;
|
|
|
+ }
|
|
|
+ if (this.rainSensorInfo.active.current === 0) {
|
|
|
+ formdata['rainSensorActive'] = 1;
|
|
|
+ formdata['rainSensorBrand'] = this.rainSensorInfo.rainSensorBrandText;
|
|
|
+ formdata['rainSensorModel'] = this.rainSensorInfo.rainSensorModelText;
|
|
|
+ formdata['rainSensorReplaceDate'] = this.rainSensorInfo.rainSensorReplaceDate;
|
|
|
+ formdata['rainSensorDesc'] = this.rainSensorInfo.remark;
|
|
|
+ formdata['rainSensorStatus'] = this.rainSensorInfo.runStatus.current;
|
|
|
+ if (this.rainSensorInfo.photoTake) {
|
|
|
+ formdata['rainSensorPhotoTake'] = 1;
|
|
|
+ formdata['rainSensorPhotoUrl'] = this.rainSensorInfo.photoUrl;
|
|
|
+ } else {
|
|
|
+ formdata['rainSensorPhotoTake'] = 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ formdata['rainSensorActive'] = 0;
|
|
|
+ }
|
|
|
+ if (this.waterSensorInfo.active.current === 0) {
|
|
|
+ formdata['waterLevelSensorActive'] = 1;
|
|
|
+ formdata['waterSensorType'] = this.waterLevelSensorType.items[this.waterLevelSensorType.current].id;
|
|
|
+ formdata['waterSensorBrand'] = this.waterSensorInfo.waterSensorBrandText;
|
|
|
+ formdata['waterSensorModel'] = this.waterSensorInfo.waterSensorModelText;
|
|
|
+ formdata['waterSensorReplaceDate'] = this.waterSensorInfo.waterSensorReplaceDate;
|
|
|
+ formdata['waterSensorDesc'] = this.waterSensorInfo.remark;
|
|
|
+ formdata['waterLevelSensorStatus'] = this.waterSensorInfo.runStatus.current;
|
|
|
+ if (this.waterSensorInfo.photoTake) {
|
|
|
+ formdata['waterSensorPhotoTake'] = 1;
|
|
|
+ formdata['waterSensorPhotoUrl'] = this.waterSensorInfo.photoUrl;
|
|
|
+ } else {
|
|
|
+ formdata['waterSensorPhotoTake'] = 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ formdata['waterLevelSensorActive'] = 0;
|
|
|
+ }
|
|
|
+ if (this.groundSensorInfo.active.current === 0) {
|
|
|
+ formdata['groundWaterSensorActive'] = 1;
|
|
|
+ formdata['groundSensorType'] = this.groundSensorType.items[this.groundSensorType.current].id;
|
|
|
+ formdata['groundWaterSensorStatus'] = this.groundSensorInfo.runStatus.current;
|
|
|
+ formdata['groundSensorBrand'] = this.groundSensorInfo.groundSensorBrandText;
|
|
|
+ formdata['groundSensorModel'] = this.groundSensorInfo.groundSensorModelText;
|
|
|
+ formdata['groundSensorReplaceDate'] = this.groundSensorInfo.groundSensorReplaceDate;
|
|
|
+ formdata['groundSensorDesc'] = this.groundSensorInfo.remark;
|
|
|
+ if (this.groundSensorInfo.photoTake) {
|
|
|
+ formdata['groundSensorPhotoTake'] = 1;
|
|
|
+ formdata['groundSensorPhotoUrl'] = this.groundSensorInfo.photoUrl;
|
|
|
+ } else {
|
|
|
+ formdata['groundSensorPhotoTake'] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ formdata['groundWaterSensorActive'] = 0;
|
|
|
+ }
|
|
|
+ formdata['batteryModel'] = this.powerInfo.batteryModel;
|
|
|
+ formdata['batteryReplaceDate'] = this.powerInfo.batteryReplaceDate;
|
|
|
+ formdata['sunPowerModel'] = this.powerInfo.sunPowerModel;
|
|
|
+ formdata['sunPowerReplaceDate'] = this.powerInfo.sunPowerReplaceDate;
|
|
|
+ formdata['powerStatus'] = this.powerInfo.runStatus.current;
|
|
|
+ formdata['powerDesc'] = this.powerInfo.remark;
|
|
|
+ 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.networkInfo.active.current === 0) {
|
|
|
+ formdata['networkActive'] = 1;
|
|
|
+ formdata['simCcid'] = this.networkInfo.simCcid;
|
|
|
+ formdata['simPay'] = this.networkInfo.simPay;
|
|
|
+ formdata['simPayEndDate'] = this.networkInfo.simPayEndDate;
|
|
|
+ formdata['networkStatus'] = this.networkInfo.runStatus.current;
|
|
|
+ formdata['networkDesc'] = this.networkInfo.remark;
|
|
|
+ } else {
|
|
|
+ formdata['networkActive'] = 0;
|
|
|
+ }
|
|
|
+ if (this.satelliteInfo.active.current === 0) {
|
|
|
+ formdata['satelliteActive'] = 1;
|
|
|
+ formdata['satelliteModel'] = this.satelliteModel.items[this.satelliteModel.current].id;
|
|
|
+ formdata['satelliteStatus'] = this.satelliteInfo.runStatus.current;
|
|
|
+ formdata['satelliteDesc'] = this.satelliteInfo.remark;
|
|
|
+ } else {
|
|
|
+ formdata['satelliteActive'] = 0;
|
|
|
+ }
|
|
|
+ var that = this;
|
|
|
+ http.request({
|
|
|
+ url: '/galaxy-test/equipment/inspection/report/save',
|
|
|
+ method: 'POST',
|
|
|
+ data: formdata
|
|
|
+ }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ uni.showModal({
|
|
|
+ content: '填报信息已成功提交',
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateBack();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ content: '' + res.msg,
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toSave() {
|
|
|
+
|
|
|
+ },
|
|
|
+ rtuReplaceDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ rainSensorReplaceDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ waterSensorReplaceDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ groundSensorReplaceDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ batteryReplaceDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ sunPowerReplaceDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ simPayEndDateClick(e) {
|
|
|
+ console.log('maskClick事件:', e);
|
|
|
+ },
|
|
|
+ dateFormat(dt) {
|
|
|
+ var text = "" + dt.getFullYear();
|
|
|
+ text += "-";
|
|
|
+ text += ((dt.getMonth() + 1) < 10) ? ("0" + (dt.getMonth() + 1)) : (dt
|
|
|
+ .getMonth() +
|
|
|
+ 1);
|
|
|
+ text += "-";
|
|
|
+ text += dt.getDate() < 10 ? "0" + dt.getDate() : dt.getDate();
|
|
|
+ text += " ";
|
|
|
+ text += dt.getHours() < 10 ? "0" + dt.getHours() : dt.getHours();
|
|
|
+ text += ":";
|
|
|
+ text += dt.getMinutes() < 10 ? "0" + dt.getMinutes() : dt.getMinutes();
|
|
|
+ text += ":";
|
|
|
+ text += dt.getSeconds() < 10 ? "0" + dt.getSeconds() : dt.getSeconds();
|
|
|
+ return text;
|
|
|
+ },
|
|
|
+ getReportDict() {
|
|
|
+ var that = this;
|
|
|
+ var waterLevelSensorTypeDictList = [];
|
|
|
+ //查询水位计
|
|
|
+ http.request({
|
|
|
+ url: '/galaxy-system/dict-biz/dictionary?code=water_level_sensor_type',
|
|
|
+ method: 'GET'
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.data != null) {
|
|
|
+ const dictLength = res.data['length'];
|
|
|
+ for (var i = 0; i < dictLength; i++) {
|
|
|
+ let dict = res.data['' + i];
|
|
|
+ waterLevelSensorTypeDictList.push(dict);
|
|
|
+ }
|
|
|
+ that.waterLevelSensorType.items = waterLevelSensorTypeDictList;
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ var groundSensorTypeDictList = [];
|
|
|
+ //查询墒情传感器类型
|
|
|
+ http.request({
|
|
|
+ url: '/galaxy-system/dict-biz/dictionary?code=ground_water_sensor_type',
|
|
|
+ method: 'GET'
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.data != null) {
|
|
|
+ const dictLength = res.data['length'];
|
|
|
+ for (var i = 0; i < dictLength; i++) {
|
|
|
+ let dict = res.data['' + i];
|
|
|
+ groundSensorTypeDictList.push(dict);
|
|
|
+ }
|
|
|
+ that.groundSensorType.items = groundSensorTypeDictList;
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ //查询北斗模式
|
|
|
+ var satelliteModelDictList = [];
|
|
|
+ http.request({
|
|
|
+ url: '/galaxy-system/dict-biz/dictionary?code=satellite_model',
|
|
|
+ method: 'GET'
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.data != null) {
|
|
|
+ const dictLength = res.data['length'];
|
|
|
+ for (var i = 0; i < dictLength; i++) {
|
|
|
+ let dict = res.data['' + i];
|
|
|
+ satelliteModelDictList.push(dict);
|
|
|
+ }
|
|
|
+ that.satelliteModel.items = satelliteModelDictList;
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // getPlanInfo() {
|
|
|
+ // var that = this;
|
|
|
+ // var postData = {};
|
|
|
+ // postData['id'] = this.planId;
|
|
|
+ // http.request({
|
|
|
+ // url: '/galaxy-test/equipment/inspection/plan/detail',
|
|
|
+ // method: 'GET',
|
|
|
+ // data: postData
|
|
|
+ // }).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // if (res.data != null) {
|
|
|
+
|
|
|
+ // that.planInfo = res.data;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }).catch(err => {
|
|
|
+ // console.log(err)
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ onBasePhoto1DeleteClick() {
|
|
|
+ this.baseInfo.photo1Take = false;
|
|
|
+ },
|
|
|
+ onBasePhoto2DeleteClick() {
|
|
|
+ this.baseInfo.photo2Take = 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;
|
|
|
+ },
|
|
|
+ onRainActiveRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.rainSensorInfo.active.items.length; i++) {
|
|
|
+ if (this.rainSensorInfo.active.items[i].id === evt.detail.value) {
|
|
|
+ this.rainSensorInfo.active.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onWaterActiveRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.waterSensorInfo.active.items.length; i++) {
|
|
|
+ if (this.waterSensorInfo.active.items[i].id === evt.detail.value) {
|
|
|
+ this.waterSensorInfo.active.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onGroundActiveRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.groundSensorInfo.active.items.length; i++) {
|
|
|
+ if (this.groundSensorInfo.active.items[i].id === evt.detail.value) {
|
|
|
+ this.groundSensorInfo.active.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onNetworkActiveRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.networkInfo.active.items.length; i++) {
|
|
|
+ if (this.networkInfo.active.items[i].id === evt.detail.value) {
|
|
|
+ this.networkInfo.active.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSatelliteActiveRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.satelliteInfo.active.items.length; i++) {
|
|
|
+ if (this.satelliteInfo.active.items[i].id === evt.detail.value) {
|
|
|
+ this.satelliteInfo.active.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ onWaterSensorTypeRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.waterLevelSensorType.items.length; i++) {
|
|
|
+ if (this.waterLevelSensorType.items[i].id === evt.detail.value) {
|
|
|
+ this.waterLevelSensorType.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onGroundSensorTypeRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.groundSensorType.items.length; i++) {
|
|
|
+ if (this.groundSensorType.items[i].id === evt.detail.value) {
|
|
|
+ this.groundSensorType.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSatelliteModelRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.satelliteModel.items.length; i++) {
|
|
|
+ if (this.satelliteModel.items[i].id === evt.detail.value) {
|
|
|
+ this.satelliteModel.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ datagramToCheckboxChange: function(evt) {
|
|
|
+ console.log(evt)
|
|
|
+ this.rtuInfo.datagramToLevel1 = 0;
|
|
|
+ this.rtuInfo.datagramToLevel2 = 0;
|
|
|
+ this.rtuInfo.datagramToLevel3 = 0;
|
|
|
+ for (let i = 0; i < this.evt.detail.value.length; i++) {
|
|
|
+ let c = this.evt.detail.value[i];
|
|
|
+ if (c === '0') {
|
|
|
+ this.rtuInfo.datagramToLevel1 = 1;
|
|
|
+ } else if (c === '1') {
|
|
|
+ this.rtuInfo.datagramToLevel2 = 1;
|
|
|
+ } else if (c === '2') {
|
|
|
+ this.rtuInfo.datagramToLevel3 = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ onRtuStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.rtuInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.rtuInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.rtuInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onRainSensorStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.rainSensorInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.rainSensorInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.rainSensorInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onWaterSensorStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.waterSensorInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.waterSensorInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.waterSensorInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onGroundSensorStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.groundSensorInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.groundSensorInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.groundSensorInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onPowerStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.powerInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.powerInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.powerInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onNetworkStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.networkInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.networkInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.networkInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSatelliteStatusRadioChange: function(evt) {
|
|
|
+ for (let i = 0; i < this.satelliteInfo.runStatus.items.length; i++) {
|
|
|
+ if (this.satelliteInfo.runStatus.items[i].id === evt.detail.value) {
|
|
|
+ this.satelliteInfo.runStatus.current = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ uploadPhotoCallback(path, photoIndex) {
|
|
|
+ if (photoIndex === 'basePhoto1') {
|
|
|
+ this.baseInfo.photo1Url = path;
|
|
|
+ this.baseInfo.photo1Take = true;
|
|
|
+ } else if (photoIndex === 'basePhoto2') {
|
|
|
+ this.baseInfo.photo2Url = path;
|
|
|
+ this.baseInfo.photo2Take = 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) => {
|
|
|
+ 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) => {
|
|
|
+ console.log(err);
|
|
|
+ reject('err')
|
|
|
+ },
|
|
|
+ complete() {
|
|
|
+ uni.hideLoading()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getBasePhoto1() {
|
|
|
+ var that = this;
|
|
|
+ uni.chooseImage({
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
+ success: (res) => {
|
|
|
+ const len = res.tempFilePaths.length;
|
|
|
+ if (len === 1) {
|
|
|
+ res.tempFilePaths.forEach(path => {
|
|
|
+ that.uploadPhoto(path, 'basePhoto1');
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ content: '只能选择一张图片,请确认!',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getBasePhoto2() {
|
|
|
+ var that = this;
|
|
|
+ uni.chooseImage({
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
+ success: (res) => {
|
|
|
+ const len = res.tempFilePaths.length;
|
|
|
+ if (len === 1) {
|
|
|
+ res.tempFilePaths.forEach(path => {
|
|
|
+ that.uploadPhoto(path, 'basePhoto2');
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ content: '只能选择一张图片,请确认!',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getRtuPhoto() {
|
|
|
+ var that = this;
|
|
|
+ uni.chooseImage({
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
+ 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: ['album', 'camera'],
|
|
|
+ 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: ['album', 'camera'],
|
|
|
+ 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: ['album', 'camera'],
|
|
|
+ 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: ['album', 'camera'],
|
|
|
+ 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: ['album', 'camera'],
|
|
|
+ success: (res) => {
|
|
|
+ const len = res.tempFilePaths.length;
|
|
|
+ if (len === 1) {
|
|
|
+ res.tempFilePaths.forEach(path => {
|
|
|
+ that.uploadPhoto(path, 'sun');
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ content: '只能选择一张图片,请确认!',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSaveClick(e) {
|
|
|
+ if ((this.projectInfo.projectId != null && this.projectInfo.projectId.length > 0) &&
|
|
|
+ (this.checkAreaDict.id != null && this.checkAreaDict.id.length > 0) &&
|
|
|
+ (this.checkItemTypeDict.id != null && this.checkItemTypeDict.id.length > 0) &&
|
|
|
+ (this.checkItemLabelDict.id != null && this.checkItemLabelDict.id.length > 0) &&
|
|
|
+ (this.checkStandardDict.id != null && this.checkStandardDict.id.length > 0)) {
|
|
|
+ try {
|
|
|
+ var data = {};
|
|
|
+ data['failureHiddenDangerDesc'] = this.failureHiddenDangerDesc;
|
|
|
+ data['failureCheckPointDesc'] = this.failureCheckPointDesc;
|
|
|
+ data['failureCorrectiveSuggest'] = this.failureCorrectiveSuggest;
|
|
|
+ data['failureCheckNo'] = this.checkNo;
|
|
|
+ data['failureProjectId'] = this.projectInfo.projectId;
|
|
|
+ data['failureCheckArea'] = this.checkAreaDict.id;
|
|
|
+ data['failureCheckHiddenDangerType'] = this.checkItemTypeDict.id;
|
|
|
+ data['failureCheckHiddenDanger'] = this.checkItemLabelDict.id;
|
|
|
+ data['failureCheckHiddenDangerItemPoint'] = this.checkStandardDict.id;
|
|
|
+ data['failureCheckHiddenDangerStandard'] = this.checkItemStandardBasisDict.id;
|
|
|
+ data['failureHiddenDangerLevel'] = this.hiddenDangerRadio.items[this.hiddenDangerRadio.current]
|
|
|
+ .id;
|
|
|
+ data['failureCorrectivePlanTime'] = this.planTimeRadio.items[this.planTimeRadio.current]
|
|
|
+ .id;
|
|
|
+ data['createTime'] = this.dateFormat(new Date());
|
|
|
+ data['createUserName'] = this.userInfo1.nick_name;
|
|
|
+ this.saveLocalFiles();
|
|
|
+ console.log("save " + data);
|
|
|
+ var list = uni.getStorageSync('check_report_storage_index');
|
|
|
+ if (list != null && list.length > 0) {
|
|
|
+ list.push(this.checkNo);
|
|
|
+ uni.setStorageSync('check_report_storage_index', list);
|
|
|
+ uni.setStorageSync('check_report_storage_' + this.checkNo, data);
|
|
|
+ } else {
|
|
|
+ list = [];
|
|
|
+ list.push(this.checkNo);
|
|
|
+ uni.setStorageSync('check_report_storage_index', list);
|
|
|
+ uni.setStorageSync('check_report_storage_' + this.checkNo, data);
|
|
|
+ }
|
|
|
+ var that = this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '流程确认',
|
|
|
+ content: '请选择复制或继续检查',
|
|
|
+ cancelText: '复制检查单',
|
|
|
+ confirmText: '继续检查',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.onContinunClick();
|
|
|
+ } else if (res.cancel) {
|
|
|
+ that.onCopyClick();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ uni.showModal({
|
|
|
+ content: '保存失败!',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } 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: #ffffff;
|
|
|
+
|
|
|
+ .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;
|
|
|
+ }
|
|
|
+
|
|
|
+ .u-cell-icon {
|
|
|
+ width: 36rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ margin-right: 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .slot-box {
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
+ display: flex;
|
|
|
+ /* #endif */
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .slot-image {
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
+ display: block;
|
|
|
+ /* #endif */
|
|
|
+ margin-right: 10px;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .slot-text {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #4cd964;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .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: 5px;
|
|
|
+ right: 5px;
|
|
|
+ border: 5px;
|
|
|
+ left: 5px;
|
|
|
+ border: 1px #eee solid;
|
|
|
+ border-radius: 5px;
|
|
|
+ overflow: hidden;
|
|
|
+ width: 98%;
|
|
|
+ height: 98%;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .input-body {
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+</style>
|