Преглед на файлове

现场档案验证大图 监察上报详情图片放大

ming преди 3 години
родител
ревизия
118c299d3b

+ 1 - 0
pages/eleControl/controlReport/controlReportAdd/controlReportAdd.vue

@@ -101,6 +101,7 @@
 			var input = document.createElement('input');//创建元素
 			input.type = 'file'//添加file类型
 			input.onchange = (event) => {
+				// alert(1)
 			 _self.upFile(input, event)
 			}
 			this.$refs.input.$el.appendChild(input)

+ 15 - 3
pages/eleControl/controlReport/controlReportDetail/controlReportDetail.vue

@@ -27,11 +27,15 @@
 
 
 			<view class="form-item">
-				<view class="title"><text class="necessary">*</text>上传图片:</view>
-				<view style="width:500rpx">
+				<view class="title"><text class="necessary">*</text>上传图片:</view> 
+				<view @click="previewImage()" style="width:500rpx;text-align:left">
+					<image :src=this.$websiteUrl+controlReportDetail.scene_pictures mode="aspectFit"></image>
+				</view>
+				
+				<!-- <view style="width:500rpx">
 					<img :src=this.$websiteUrl+controlReportDetail.scene_pictures style="width:30%">
 
-				</view>
+				</view> -->
 			</view>
 
 			<view class="form-item">
@@ -84,6 +88,14 @@
 		},
 		mounted() {},
 		methods: {
+			previewImage() {
+				// alert(this.$websiteUrl)
+				uni.previewImage({
+					// urls: [this.$websiteUrl+this.controlReportDetail.scene_pictures],
+					urls: [this.controlReportDetail.scene_pictures?this.$websiteUrl+this.controlReportDetail.scene_pictures : "/static/cameraIcon2.png"]
+				});
+			
+			},
 
 			goArchiveDetail() {
 				if (this.controlReportDetail.site_id) {

+ 56 - 46
pages/siteArchive/siteArchiveAdd/siteArchiveAdd.vue

@@ -113,18 +113,15 @@
 					</image>
 				</view>
 			</view>
-			
+
 			<view class="form-item extraDis radioSec">
 				<view class="title"><text class="necessary">*</text>门挡板:</view>
 				<view class="radioCameraflex">
-					<evan-radio v-model="formMess.door_baffle" label="1"
-						class="margin-right-xl">是</evan-radio>
-					<evan-radio v-model="formMess.door_baffle" label="0"
-						class="margin-right-xl">否</evan-radio>
-					<evan-radio v-model="formMess.door_baffle" label="2"
-						class="margin-right-xs">其他</evan-radio>
-					<input v-if="this.formMess.door_baffle!=2" disabled="disabled"
-						type="text" v-model="formMess.door_baffle_describe">
+					<evan-radio v-model="formMess.door_baffle" label="1" class="margin-right-xl">是</evan-radio>
+					<evan-radio v-model="formMess.door_baffle" label="0" class="margin-right-xl">否</evan-radio>
+					<evan-radio v-model="formMess.door_baffle" label="2" class="margin-right-xs">其他</evan-radio>
+					<input v-if="this.formMess.door_baffle!=2" disabled="disabled" type="text"
+						v-model="formMess.door_baffle_describe">
 					<input v-else type="text" v-model="formMess.door_baffle_describe">
 					<image mode="aspectFit"
 						:src="this.formMess.door_baffle_picture?this.formMess.door_baffle_picture:'/static/cameraIcon.png'"
@@ -132,7 +129,7 @@
 					</image>
 				</view>
 			</view>
-			
+
 
 			<view class="form-item extraDis radioSec" style="display:flex">
 				<view class="title"><text class="necessary">*</text>灭火器超期:</view>
@@ -294,7 +291,7 @@
 						@tap="goCamera('charged_display_image','charged_display_picture')"></image>
 				</view>
 			</view>
-			
+
 			<view class="form-item extraDis radioSec" style="display:block">
 				<view class="title"><text class="necessary">*</text>是否具备照明:</view>
 				<view class="radioCameraflex">
@@ -309,7 +306,7 @@
 						@tap="goCamera('lighting_image','lighting_picture')"></image>
 				</view>
 			</view>
-			
+
 			<view class="info-tit margin-left-xs">
 				<text class="cuIcon-titles margin-right-xs"></text>
 				安全工器具
@@ -410,7 +407,7 @@
 
 					"annihilator_insufficient_configuration": "0",
 					"annihilator_insufficient_configuration_describe": "",
-					
+
 					"door_baffle": "0",
 					"door_baffle_describe": "",
 
@@ -439,14 +436,14 @@
 					"overdue_electrician_certificate_describe": "",
 
 					"old_equipment": "",
-					"high_voltage_cabinet":"",
-					
+					"high_voltage_cabinet": "",
+
 					"charged_display": "0",
 					"charged_display_describe": "",
-					
+
 					"lighting": "0",
 					"lighting_describe": "",
-					
+
 
 					"blanket_insufficient_configuration": "0",
 					"blanket_insufficient_configuration_describe": "",
@@ -462,8 +459,8 @@
 					damage_picture: '',
 					water_leakage_picture: '',
 					annihilator_insufficient_configuration_picture: '',
-					
-					door_baffle_picture:'',
+
+					door_baffle_picture: '',
 					// annihilator_overdue_picture: '',
 					pile_up_sundries_picture: '',
 					serious_ash_deposition_picture: '',
@@ -472,11 +469,11 @@
 					no_electrician_picture: '',
 					electrician_lack_picture: '',
 					overdue_electrician_certificate_picture: '',
-					
+
 					charged_display_picture: '',
 					lighting: '',
-					
-					
+
+
 					blanket_insufficient_configuration_picture: '',
 					ground_wire_picture: '',
 					analog_screen_picture: '',
@@ -523,8 +520,8 @@
 					)
 					.test(d);
 			},
-			
-			
+
+
 			// 正则表达式匹配年月日时分秒
 			isDate2(d) {
 				return (
@@ -534,15 +531,14 @@
 			},
 			// 相机拍照
 			goCamera(name, upimage) {
+
 				const that = this;
 				uni.chooseImage({
 					count: 1, // 最多可以选择的图片张数
 					sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
 					sourceType: ['camera'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
 					success: function(res) {
-						console.log(res.tempFilePaths[0])
 						that.formMess[upimage] = res.tempFilePaths[0];
-						console.log(res.tempFilePaths[0])
 						uni.uploadFile({
 							url: that.$BASE_URL + 'MonitoringReporting/setUpload',
 							filePath: that.formMess[upimage],
@@ -551,10 +547,24 @@
 								'user': 'test'
 							},
 							success: (uploadFileRes) => {
-								that.formMess[upimage] = that.$websiteUrl + JSON.parse(
-										uploadFileRes.data)
-									.img_url;
-								console.log(that.formMess)
+								console.log('uploadFileRes')
+								console.log(JSON.parse(
+									uploadFileRes.data))
+								if (JSON.parse(uploadFileRes.data).flag) {
+									that.formMess[upimage] = that.$websiteUrl + JSON.parse(
+											uploadFileRes.data)
+										.img_url;
+										
+
+								}else{
+									that.formMess[upimage] = '';
+									uni.showToast({
+										title: JSON.parse(uploadFileRes.data).msg,
+										icon: "none"
+									});	
+								}
+								
+								// console.log(that.formMess)
 							}
 						});
 					}
@@ -660,8 +670,8 @@
 					});
 					return
 				}
-				
-				
+
+
 				if (!this.formMess.annihilator_overdue) {
 					uni.showToast({
 						title: "请输入灭火器超期时间",
@@ -676,7 +686,7 @@
 					});
 					return
 				}
-				
+
 				if (!this.formMess.old_equipment) {
 					uni.showToast({
 						title: "请输入变压器年份",
@@ -691,7 +701,7 @@
 					});
 					return
 				}
-				
+
 				if (!this.formMess.high_voltage_cabinet) {
 					uni.showToast({
 						title: "请输入高压柜年份",
@@ -706,10 +716,10 @@
 					});
 					return
 				}
-				
-				
-				
-				
+
+
+
+
 
 				let data = this.formMess;
 				// let url = 'Archives/addArchives';
@@ -731,11 +741,11 @@
 					});
 				}
 				setTimeout(() => {
-					if(this.control){
+					if (this.control) {
 						uni.navigateBack({
-						     delta: 2
-						    });
-					}else{
+							delta: 2
+						});
+					} else {
 						uni.navigateTo({
 							url: '/pages/siteArchive/siteArchive',
 						});
@@ -743,17 +753,17 @@
 
 
 					// const pages = getCurrentPages();
-					
+
 					//  uni.$emit('deltaOptions',值)
-					 
+
 					// if (pages.length > 1) {
 					// 	uni.navigateBack({
 					// 		delta: 2,
 					// 		fail: function() {
 					// 			console.log('回退失败');
-								
+
 					// 			//跳转
-							
+
 
 					// 		}
 					// 	});