Przeglądaj źródła

报警器、切断阀 增加最少必须上传一张图片和一个视频的限制条件

zhanghongrui 6 miesięcy temu
rodzic
commit
b0bf544a17

+ 16 - 1
pages/oldrenovation/indoor/indoor.vue

@@ -1253,7 +1253,22 @@
 							if (this.isEmpty(this.brandValue.id)) {
 								this.$modal.msg("请选择厂家")
 							} else {
-								this.onsubmit(e);
+								//this.onsubmit(e);
+
+
+								const hasImage = this.imgArr.some(item => item.endsWith('.jpg') || item.endsWith(
+										'.png') || item
+									.endsWith('.jpeg') || item.endsWith('.JPG') || item.endsWith('.PNG') || item
+									.endsWith('.JPEG'));
+								const hasVideo = this.imgArr.some(item => item.endsWith('.mp4') || item.endsWith('.MP4'));
+
+								if (hasImage && hasVideo) {
+
+									this.onsubmit(e);
+
+								} else {
+									this.$modal.msg('请至少上传一张照片和一个视频')
+								}
 							}
 						} else {
 							this.onsubmit(e); //暂存

+ 16 - 1
pages/statistics/historyDetails.vue

@@ -361,7 +361,7 @@
 			choosevideo() {
 				let _this = this;
 				uni.chooseVideo({
-						sourceType: this.enginType == `old_renovation` ? ['camera'] : ['album', 'camera'],
+					sourceType: this.enginType == `old_renovation` ? ['camera'] : ['album', 'camera'],
 					maxDuration: 30,
 					success(resp) {
 						const task = uni.uploadFile({
@@ -608,6 +608,21 @@
 							isSubmit = false;
 						}
 					}
+
+					if (this.title == '表后管' || this.title == '报警器' || this.title == '切断阀') {
+						const hasImage = res.zEngiineeringPhotoBoList.some(item => item.endsWith('.jpg') || item.endsWith(
+								'.png') || item
+							.endsWith('.jpeg') || item.endsWith('.JPG') || item.endsWith('.PNG') || item
+							.endsWith('.JPEG'));
+						const hasVideo = res.zEngiineeringPhotoBoList.some(item => item.endsWith('.mp4') || item.endsWith('.MP4'));
+						isSubmit = false;
+						if (hasImage && hasVideo) {
+							isSubmit = true;
+						} else {
+							this.$modal.msg('请至少上传一张照片和一个视频');
+							isSubmit = false;
+						}
+					}
 				})
 				if (!isSubmit) {
 					return