“yueshang” 1 рік тому
батько
коміт
adcff186d7

+ 6 - 1
pagesA/fire/fire_device/add_device/add_device.vue

@@ -109,7 +109,7 @@
 				showSex: false, //有无避难层
 				showSex4: false, //设备状态
 				showSex5: false, //所属单位
-				actions2: getDictDatas(DICT_TYPE.FPD_TYPE),
+				actions2: getDictDatas(DICT_TYPE.DICT_FIRE_DECIVE_TYPE),
 				actions4: [{
 						id: 0,
 						name: '正常'
@@ -542,4 +542,9 @@
 	.example {
 		overflow-y: auto;
 	}
+	/deep/.u-action-sheet {
+		overflow-y: auto;
+		height: 1000rpx;
+		background-color: #fff;
+	}
 </style>

+ 7 - 2
pagesA/fire/fire_device/edit_device/edit_device.vue

@@ -34,7 +34,7 @@
 					<u-form-item label="所属建筑	">
 						<u-input v-model="formData.buildingId" placeholder="请输入所属建筑" />
 					</u-form-item>
-					<u-form-item label="设施类别" prop="ywbnc" @click="
+					<u-form-item label="设施类别" prop="formData.fpdType" @click="
 							showSex = true;
 							hideKeyboard();
 						">
@@ -113,7 +113,7 @@
 				showSex: false, //有无避难层
 				showSex4: false, //设备状态
 				showSex5: false, //所属单位
-				actions2: getDictDatas(DICT_TYPE.FPD_TYPE),
+				actions2: getDictDatas(DICT_TYPE.DICT_FIRE_DECIVE_TYPE),
 				actions4: [{
 					id: 0,
 					name: '正常'
@@ -587,4 +587,9 @@
 	.example {
 		overflow-y: auto;
 	}
+	/deep/.u-action-sheet {
+		overflow-y: auto;
+		height: 1000rpx;
+		background-color: #fff;
+	}
 </style>

+ 16 - 14
pagesA/fire/fire_device/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="uni-container uni-container-bg">
-		<view class="example container" :style="'height: ' + (screenHeight - 120) + 'px'">
+		<view class="example container">
 			<!-- 搜索框 -->
 			<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
 				<uni-col :span="24">
@@ -24,7 +24,7 @@
 				</u-form>
 			</view>
 			<!-- 卡片栏 -->
-			<view class="" v-if="tableData.length>0 && isLoaded">
+			<view class="" v-if="tableData.length>0 && isLoaded" style="margin-bottom: 90rpx;">
 				<uni-card v-for="(item, index) in tableData" :isFull="true">
 					<!-- :thumbnail="qr&ids==item.id?item.fpdQcode:''" :key="index"
 				  :title="item.fpdName"
@@ -398,18 +398,20 @@
 			hideKeyboard() {
 				uni.hideKeyboard();
 			},
-			// 触底的事件
-			onReachBottom() {
-				// 判断是否还有下一页数据
-				if (this.pageNo * this.pageSize >= this.total)
-					return uni.showToast({
-						title: `数据加载完毕`
-					});
-				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
-				if (this.loading) return;
-				this.pageNo += 1;
-				this.getData(this.pageNo);
-			}
+			
+		},
+		// 触底的事件
+		onReachBottom() {
+			console.log(this.loading,'ssss');
+			// 判断是否还有下一页数据
+			if (this.pageNo * this.pageSize >= this.total)
+				return uni.showToast({
+					title: `数据加载完毕`
+				});
+			// 判断是否正在请求其它数据,如果是,则不发起额外的请求
+			if (this.loading) return;
+			this.pageNo += 1;
+			this.getData(this.pageNo);
 		}
 	};
 </script>

+ 59 - 57
pagesA/fire/fire_inspetItem/add-street/streetCzfpczl.vue

@@ -29,11 +29,14 @@
 					<view>
 						<view class="paizhao">现场照片</view>
 						<view class="paizhao-posit" v-if="!isview">
-							<image :src="photograph" @click="photoUpload" class="tiantupian-photo"></image>
+							<view class="">
+								<image :src="photograph" @click="photoUpload" class="tiantupian-photo"></image>
+								<span v-if="loading" class="photo-loading">上传照片中...</span>
+							</view>
 							<view class="">
 								拍照上传
+								
 							</view>
-							
 						</view>
 					</view>
 					<view v-if="formData.streetRepPicsDOList" class="show-photo">
@@ -55,25 +58,21 @@
 								</view>
 							</view>
 						</view>
-
 					</view>
 				</view>
-				
 			</u--form>
 		</view>
 		<view class="sub-botn heigthButton">
 			<u-button v-if="isedit" @click="submit('customForm')" type="primary" shape="circle" size="large"
 				color="#4CB2B6" text="确认修改" style="width:200px">
 			</u-button>
-			<u-button v-else-if="!formData.id" @click="submit('customForm')" type="primary" shape="circle"
-				size="large" color="#4CB2B6" text="确认新增" style="width:200px">
+			<u-button v-else-if="!formData.id" @click="submit('customForm')" type="primary" shape="circle" size="large"
+				color="#4CB2B6" text="确认新增" style="width:200px">
 			</u-button>
-			<u-button v-else-if="isview" @click="submit('customForm')" type="primary" shape="circle"
-				size="large" color="#4CB2B6" text="返回" style="width:200px">
+			<u-button v-else-if="isview" @click="submit('customForm')" type="primary" shape="circle" size="large"
+				color="#4CB2B6" text="返回" style="width:200px">
 			</u-button>
 		</view>
-		<!-- 加载中 -->
-		<!-- <isLodingModel></isLodingModel> -->
 	</view>
 </template>
 
@@ -120,7 +119,7 @@
 				isview: false, //查看
 				screenHeight: this.$screenHeight,
 				wheight: '',
-				loading:false
+				loading: false
 			}
 		},
 		mounted() {
@@ -140,8 +139,6 @@
 			}
 		},
 		onLoad(option) {
-			this.loading=true
-			
 			if (option.editData) {
 				this.isedit = true
 				this.parentId = option.editData
@@ -169,56 +166,60 @@
 				this.formData.streetRepPicsDOList.splice(index, 1)
 			},
 			photoUpload() {
+				this.loading = true
 				takePhotos(this)
-			},
-			bindDateChange(e) {
-				this.formData.reporttime = e.detail.value
-			},
-			submit(ref) {
-				this.$refs[ref].validate().then(res => {
-					const formList = this.formData
-					Object.keys(formList).forEach(key => {
-						formList[key] = formList[key] === '' ? 0 : formList[key];
-					});
-					formList.streetRepPicsDOList.forEach((item) => {
-						// 删除除了feildname和url以外的多余字段
-						Object.keys(item).forEach((key) => {
-							if (key !== 'feildname' && key !== 'url' && key !== 'repid') {
-								delete item[key];
-							}
-						});
-						// 如果feildname为空,赋值为默认名称
-						if (!item.feildname) {
-							item.feildname = '默认名称';
+		},
+		bindDateChange(e) {
+			this.formData.reporttime = e.detail.value
+		},
+		submit(ref) {
+			this.$refs[ref].validate().then(res => {
+				const formList = this.formData
+				Object.keys(formList).forEach(key => {
+					formList[key] = formList[key] === '' ? 0 : formList[key];
+				});
+				formList.streetRepPicsDOList.forEach((item) => {
+					// 删除除了feildname和url以外的多余字段
+					Object.keys(item).forEach((key) => {
+						if (key !== 'feildname' && key !== 'url' && key !== 'repid') {
+							delete item[key];
 						}
 					});
-					console.log(formList, 'this.formData');
-					if (this.isedit) {
-						updateCzfpczl(JSON.stringify(this.formData)).then(res => {
-							this.$modal.msg('修改成功')
-							this.isedit = false
-							setTimeout(() => {
-								uni.navigateBack()
-							}, 400)
-						})
-					} else if (this.isview) {
-						this.isview = false
-						uni.navigateBack()
-					} else {
-						createCzfpczl(JSON.stringify(this.formData)).then(res => {
-							this.$modal.msg('新增成功')
-							setTimeout(() => {
-								uni.navigateBack()
-							}, 400)
-						})
+					// 如果feildname为空,赋值为默认名称
+					if (!item.feildname) {
+						item.feildname = '默认名称';
+					}
+					if(this.isedit&&!item.repid){
+						item.repid=this.parentId
 					}
+				});
+				console.log(formList, 'this.formData');
+				if (this.isedit) {
+					updateCzfpczl(JSON.stringify(this.formData)).then(res => {
+						this.$modal.msg('修改成功')
+						this.isedit = false
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 400)
+					})
+				} else if (this.isview) {
+					this.isview = false
+					uni.navigateBack()
+				} else {
+					createCzfpczl(JSON.stringify(this.formData)).then(res => {
+						this.$modal.msg('新增成功')
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 400)
+					})
+				}
 
-				}).catch(err => {
-					console.log(err);
-				})
-			}
+			}).catch(err => {
+				console.log(err);
+			})
 		}
 	}
+	}
 </script>
 
 
@@ -241,7 +242,8 @@
 		box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.15);
 		border-radius: 30rpx;
 	}
-	.example{
+
+	.example {
 		overflow-y: auto;
 	}
 </style>

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetDpccdtfpczl.vue

@@ -183,6 +183,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetDypczl.vue

@@ -200,6 +200,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetHypczl.vue

@@ -192,6 +192,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetQypczl.vue

@@ -196,6 +196,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetTsrqbf.vue

@@ -221,6 +221,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 4 - 2
pagesA/fire/fire_inspetItem/add-street/streetXfsssbpczl.vue

@@ -355,9 +355,11 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
-					console.log(formList, 'this.formData');
-					if (this.isedit) {
+					if (this.isedit) {	
 						updateXfsssbpczl(JSON.stringify(this.formData)).then(res => {
 							this.$modal.msg('修改成功')
 							this.isedit = false

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetXftdpczl.vue

@@ -180,6 +180,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 3 - 0
pagesA/fire/fire_inspetItem/add-street/streetXfxcjypxyl.vue

@@ -192,6 +192,9 @@
 						if (!item.feildname) {
 							item.feildname = '默认名称';
 						}
+						if(this.isedit&&!item.repid){
+							item.repid=this.parentId
+						}
 					});
 					console.log(formList, 'this.formData');
 					if (this.isedit) {

+ 18 - 20
pagesA/fire/fire_station/index.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="uni-container uni-container-bg">
-		<view class="example container" :style="'height: ' + (screenHeight - 120) + 'px'">
+	<view class="uni-container">
+		<view class="example container">
 			<!-- 搜索框 -->
 			<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
 				<uni-col :span="24">
@@ -25,7 +25,7 @@
 			</view>
 
 			<!-- 卡片栏 -->
-			<view v-if="tableData.length>0 && isLoaded">
+			<view v-if="tableData.length>0 && isLoaded" style="margin-bottom: 80rpx;">
 				<view v-for="(item, index) in tableData" :key="index"
 					v-if="formData.orgName === item.orgName || formData.orgId === item.orgId">
 					<uni-card>
@@ -194,7 +194,6 @@
 			},
 			// 获取数据
 			getData() {
-				this.tableData = []
 				this.loading = true;
 				// 获取消防站信息详细信息
 				getStation({
@@ -207,6 +206,7 @@
 					this.isLoaded = true
 					this.tableData = [...this.tableData, ...response.data.list]
 					this.loading = false
+					this.total=response.data.total
 					// this.tableData = response.data.list;
 					// console.log(this.tableData[0].id, 'ppp');
 					// localStorage.setItem('fireId',this.tableData[0].id)
@@ -274,21 +274,6 @@
 					this.tableData = response.data.list;
 				});
 			},
-
-
-			// 触底的事件
-			onReachBottom() {
-				// 判断是否还有下一页数据
-				if (this.pageNo * this.pageSize >= this.total)
-					return uni.showToast({
-						title: `数据加载完毕`
-					});
-				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
-				if (this.loading) return;
-				this.pageNo += 1;
-				this.getData(this.pageNo);
-			},
-
 			// 隐藏键盘
 			hideKeyboard() {
 				uni.hideKeyboard();
@@ -302,6 +287,19 @@
 				let value = new Date(e.value);
 				this.formData.start = uni.$u.timeFormat(e.value, 'yyyy/mm/dd');
 			}
+		},
+		// 触底的事件
+		onReachBottom() {
+			console.log(this.loading,'ssss');
+			// 判断是否还有下一页数据
+			if (this.pageNo * this.pageSize >= this.total)
+				return uni.showToast({
+					title: `数据加载完毕`
+				});
+			// 判断是否正在请求其它数据,如果是,则不发起额外的请求
+			if (this.loading) return;
+			this.pageNo += 1;
+			this.getData(this.pageNo);
 		}
 	};
 </script>
@@ -424,7 +422,7 @@
 		height: 110rpx;
 		position: fixed;
 		right: 15px;
-		bottom: 80rpx;
+		bottom: 10rpx;
 	}
 
 	//列表样式

+ 1 - 0
pagesA/fire/hidden_trouble/index.vue

@@ -569,6 +569,7 @@
 					if (res.data) {
 						this.current = 1
 						this.queryParams.dengerStatus = 1
+						this.tableData=[]
 						this.getData(1)
 					}
 				})

+ 7 - 0
static/scss/global.scss

@@ -22,6 +22,13 @@
 .text-grey2 {
 	color: #aaa;
 }
+//加载中拍照
+.photo-loading{
+	color: #c85820;
+	margin-left: 20px;
+	font-size: 20px;
+	vertical-align: middle;
+}
 //卡片前面位置对齐每日巡查
 .name-align-daily,.name-align-task,.name-align-building{
 	display: inline-block;

+ 9 - 3
utils/common.js

@@ -146,13 +146,19 @@ export function takePhotos(vm) {
 										let imgUrl = JSON.parse(res.data);
 										vm.formData.streetRepPicsDOList.push({
 											url: imgUrl.data,
-											feildname: ''
+											feildname: '',
+											repid:''
 										});
 										vm.$forceUpdate();
 									},
 									fail: (err) => {
 										vm.loading = false
 										this.$modal.msg(err)
+									},
+									complete: () => {
+										vm.loading =
+											false; // 无论成功还是失败,都将loading状态设置为false
+										vm.$forceUpdate();
 									}
 								});
 
@@ -166,7 +172,7 @@ export function takePhotos(vm) {
 					);
 				});
 			}
-		}
+		},
 	})
 }
 export function choiceStreet(vm) {
@@ -304,7 +310,7 @@ export function uploadFile(tempFilePaths, i, that) {
 			success: res => {
 				let data = JSON.parse(res.data);
 				// that.formData.attId.push(data.data)
-				that.formData.attId[0]=data.data
+				that.formData.attId[0] = data.data
 				uni.showToast({
 					title: '文件上传成功!'
 				});