Explorar el Código

对接数据,前后联调,bug修复

Ming hace 4 años
padre
commit
4ce13cb612

+ 12 - 6
data/json.js

@@ -515,37 +515,43 @@ let repairSquare = [{
 		"id": "561",
 		"title": "报修总数",
 		"num": "5",
-		"color": "#7992F9"
+		"color": "#7992F9",
+		"cl_type":0
 	},
 	{
 		"id": "561",
 		"title": "未处理",
 		"num": "1",
-		"color": "#FDCA60"
+		"color": "#FDCA60",
+		"cl_type":1
 	},
 	{
 		"id": "561",
 		"title": "未审核",
 		"num": "1",
-		"color": "#59D1EA"
+		"color": "#59D1EA",
+		"cl_type":2
 	},
 	{
 		"id": "561",
 		"title": "未通过",
 		"num": "1",
-		"color": "#F77070"
+		"color": "#F77070",
+		"cl_type":3
 	},
 	{
 		"id": "561",
 		"title": "已完成",
 		"num": "1",
-		"color": "#72D06A"
+		"color": "#72D06A",
+		"cl_type":4
 	},
 	{
 		"id": "561",
 		"title": "超时完成",
 		"num": "1",
-		"color": "#F7895E"
+		"color": "#F7895E",
+		"cl_type":5
 	}
 
 ];

+ 9 - 0
pages.json

@@ -639,6 +639,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/repair/repairDetailDone/repairDetailDone",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "报修详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	
 	

+ 26 - 4
pages/accountManage/accountManage.vue

@@ -16,6 +16,7 @@
 				</tr>
 			</table>	 -->
 			
+			<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" /></view>
 			
 			<uni-table border stripe emptyText="暂无更多数据" >
 			    <!-- 表头行 -->
@@ -34,6 +35,7 @@
 			    </uni-tr>
 			
 			</uni-table>
+			
 
 		</view>
 		
@@ -50,11 +52,18 @@
 	export default {
 		data() {
 			return {
-				getData:[]
+				getData:[],
+				// 每页数据量
+				pageSize: 100,
+				// 当前页
+				pageCurrent: 1,
+				// 数据总量
+				total: '',
+				loading: false
 			}
 		},
 		onLoad:function(option){
-			this.getDataList({'company_code':uni.getStorageSync('selectedCode')})
+			this.getDataList({'company_code':uni.getStorageSync('selectedCode'),'page':this.pageCurrent,"number":this.pageSize})
 		},
 		methods: {
 			
@@ -67,10 +76,23 @@
 					showLoading: true
 				})
 				this.getData=res.data.data;
-		
-				console.log(this.getData)
+				console.log(res.data.data[0])
+				console.log(res.data.data.length)
+				console.log(this.getData.length);
+				this.total=res.data.total;
+			},
+			
+			// 分页触发
+			change(e) {
+				console.log(e)
+				// this.$refs.table.clearSelection()
+				// this.selectedIndexs.length = 0
+				this.getDataList({'company_code':uni.getStorageSync('selectedCode'),'page':e.current,"number":this.pageSize})
+				// this.getDataList(e.current)
 			},
 			
+			
+			
 			goAddPer() {
 				uni.navigateTo({
 					url: '/pages/accountManage/perAdd/perAdd',

+ 8 - 1
pages/processList/processList.vue

@@ -5,9 +5,16 @@
 			<scroll-view scroll-x class="bg-white nav text-center">
 				<view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
 					:key="index" @tap="tabSelect" :data-id="index">
-					<view v-if="TabCur==index" class="cu-tag badge">
+					<!-- <view v-if="TabCur==index" class="cu-tag badge">
 						<block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
+					</view> -->
+					
+					
+					<view v-if="TabCur==index&&!TabCur" class="cu-tag badge">
+						<block class="cu-tag badge">{{alarm_count}} </block>
 					</view>
+					
+					
 					{{item}}
 				</view>
 			</scroll-view>

+ 36 - 50
pages/repair/repair.vue

@@ -1,11 +1,11 @@
 <template>
-	<view class="processWrapper " style="    height: calc(100vh - 134px);
+	<view class="processWrapper " style="   
     overflow: scroll;">
 		
 		<!-- 宫格列表 -->
 		<view class="bg-white  " >
 			<view class="cu-list grid col-3 no-border" style="padding-bottom:0">
-				<view class="cu-item justify-center align-center  "  v-for="(item,index) in repairSquare"  
+				<view class="cu-item justify-center align-center  "  v-for="(item,index) in repairSquare"  @tap=searchType(item)
 				 :key="index">
 				 <view :style="`background:${item.color}`" style="width:90%" class=" repairSquare">
 					 <view class="num">{{item.num}}</view>
@@ -18,36 +18,13 @@
 		
 		<block>
 			<view>
-				<!-- <view class="cu-list menu-avatar ">
-					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
-						<view class="cu-avatar " :style="`background-image:url(${item.imgUrl})`"  style="width:82rpx;height:82rpx"></view>
-						<view class="content">
-							<view class="pro-title">
-								<view class="cut">{{item.title}}</view>
-							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.subTitle}}
-								</view>
-							</view>
-							<view class="pro-date ">{{item.time}}</view>
-						</view>
-						<view class="action margin-right-sm" style="text-align:right">
-							
-							<view style="color:#FDCA60" v-if="item.status==0">未处理</view>
-							<view style="color:#59D1EA" v-if="item.status==1">未审核</view>
-							<view style="color:#F77070" v-if="item.status==2">未通过</view>
-							<view style="color:#72D06A" v-if="item.status==3">已完成</view>
-							<view style="color:#F7895E" v-if="item.status==4">超时完成</view>
-						</view>
-					</view>
-				</view> -->
-				
-				
 				<view class="cu-list menu-avatar ">
 					<view class="cu-item" v-for="(item,index) in getDataList" :key="index">
-						<view class="cu-avatar " :style="`background-image:url(${item.imgUrl})`"
-							style="width:82rpx;height:82rpx"></view>
+						<view class="cu-avatar " v-if="item.cl_type==1" style="background-image:url(/static/repair1.png);width:82rpx;height:82rpx"></view>
+						<view class="cu-avatar " v-if="item.cl_type==2" style="background-image:url(/static/repair2.png);width:82rpx;height:82rpx"></view>
+						<view class="cu-avatar " v-if="item.cl_type==3" style="background-image:url(/static/repair3.png);width:82rpx;height:82rpx"></view>
+						<view class="cu-avatar " v-if="item.cl_type==4" style="background-image:url(/static/repair4.png);width:82rpx;height:82rpx"></view>
+						<view class="cu-avatar " v-if="item.cl_type==5" style="background-image:url(/static/repair5.png);width:82rpx;height:82rpx"></view>
 						<view class="content">
 							<view class="pro-title">
 								<view class="cut">{{item.wx_name}}</view>
@@ -58,22 +35,21 @@
 								</view>
 							</view>
 						</view>
-						<view class="action margin-right-sm" style="text-align:right">
-							<view style="color:#FDCA60">未处理</view>
+						<view class="action margin-right-sm" style="text-align:right;z-index:999" >
+							<view style="color:#FDCA60" v-if="item.cl_type==1" @tap="goRepairDetail(item)">未处理</view>
+							<view style="color:#59D1EA" v-if="item.cl_type==2">未审核</view>
+							<view style="color:#F77070" v-if="item.cl_type==3">未通过</view>
+							<view style="color:#72D06A" v-if="item.cl_type==4" >已完成</view>
+							<view style="color:#F7895E" v-if="item.cl_type==5">超时完成</view>
 						</view>
 					</view>
 				</view>
-				
-				
-				
-				
 			</view>
 		</block>
-		
-		<view class="btn-area submitBottomBtn padding-lr-sm">
+
+		<!-- <view class="btn-area submitBottomBtn padding-lr-sm">
 			<button class="bg-blue round  margin-top" @tap="goRepairDetail">报 修 </button>
-		</view>
-		
+		</view> -->
 	
 	</view>
 </template>
@@ -85,7 +61,6 @@
 			return {
 				unporcessList:json.repair,
 				repairSquare: json.repairSquare,
-
 				
 				modalName: null,
 				listTouchStart: 0,
@@ -120,21 +95,32 @@
 				this.repairSquare[5].num=res.data.overtime_count;
 				console.log(this.getData);
 			},
-					
-			
-			
+			
+			// 筛选
+			searchType(item) {
+				this.goRepairList({'company_code':uni.getStorageSync('selectedCode'),"cl_type":item.cl_type})
+				
+			},
+					
 			// 页面跳转
-			goRepairDetail() {
+			goRepairDetail(item) {
 				uni.navigateTo({
-					url: '/pages/repair/repairDetail/repairDetail',
+					url: '/pages/repair/repairDetail/repairDetail?id='+item.id,
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
-			}
-			
-				
-		
+			},
+			// 页面跳转
+			// goRepairDetailDone(item) {
+			// 	uni.navigateTo({
+			// 		url: '/pages/repair/repairDetailDone/repairDetailDone?id='+item.id,
+			// 		success: res => {},
+			// 		fail: () => {},
+			// 		complete: () => {}
+			// 	});
+			// }
+
 		}
 	}
 </script>

+ 157 - 122
pages/repair/repairDetail/repairDetail.vue

@@ -1,124 +1,159 @@
-<template>
-	<view>
-		
-		<form action="" >
-			<view style='height:30rpx'></view>
-			
-			<view class="form-item">
-				<view class="title">
-					<text class="necessary">*</text>
-					报修地址:
-				</view>
-				<input type="text">
-			</view>
-			
-			<view class="form-item margin-top">
-				<view class="title">
-					<text class="necessary">*</text>
-					故障状态:
-				</view>
-				<view>故障</view>
-				
-			</view>
-			
-			<view class="form-item margin-top">
-				<view class="title">
-					<text class="necessary">*</text>
-					上传图片:
-				</view>
-				
-				<view style="width:500rpx">
-					<view class="cu-form-group">
-						<view class="grid col-4 grid-square flex-sub">
-							<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
-							 <image :src="imgList[index]" mode="aspectFill"></image>
-								<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
-									<text class='cuIcon-close'></text>
-								</view>
-							</view>
-							<view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
-								<text class='cuIcon-cameraadd'></text>
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-			
-			<view class="form-item margin-top">
-				<view class="title">
-					<text class="necessary">*</text>
-					报修描述:
-				</view>
-				<textarea maxlength="-1"  @input="textareaAInput" placeholder="" width="250"></textarea>
-			</view>
-		
-			<view class="btn-area submitBottomBtn padding-lr-sm">
-				<button class="bg-blue round  margin-top" @click="addSubmit">提 交 </button>
-			</view>
-			
-		</form>
-
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
-				imgList: [],
-
-			}
-		},
-		methods: {
-			radioChange(e) {
-				console.log('type:' + e.detail.value);
-				this.radioOne = e.detail.value;
-			},
-			
-			ChooseImage() {
-				uni.chooseImage({
-					count: 4, //默认9
-					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-					sourceType: ['album'], //从相册选择
-					success: (res) => {
-						if (this.imgList.length != 0) {
-							this.imgList = this.imgList.concat(res.tempFilePaths)
-						} else {
-							this.imgList = res.tempFilePaths
-						}
-					}
-				});
-			},
-			
-			ViewImage(e) {
-				uni.previewImage({
-					urls: this.imgList,
-					current: e.currentTarget.dataset.url
-				});
-			},
-			DelImg(e) {
-				uni.showModal({
-					title: '删除',
-					content: '确定要删除此图片吗?',
-					cancelText: '取消',
-					confirmText: '确定',
-					success: res => {
-						if (res.confirm) {
-							this.imgList.splice(e.currentTarget.dataset.index, 1)
-						}
-					}
-				})
-			},
-			
-		}
-	}
-</script>
-
-<style lang="scss">
-	
+<template>
+	<view>
+		<form action="">
+			<view style='height:30rpx'></view>
+			<view class="form-item">
+				<view class="title">
+					<text class="necessary">*</text>
+					报修地址:
+				</view>
+				<input type="text" v-model="this.getData.address">
+			</view>
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					故障状态:
+				</view>
+				<view>{{this.getData.type_name}}</view>
+			</view>
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					上传图片:
+				</view>
+				<view style="width:500rpx">
+					<view ref="input" class="input">
+					</view>
+				</view>
+			</view>
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					报修描述:
+				</view>
+				<textarea maxlength="-1" @input="textareaAInput" placeholder="" v-model="msg" width="250"></textarea>
+			</view>
+
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="addSubmit">提 交 </button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				getData:{},
+				
+				msg: '',
+				id: '',
+				reportName: '',
+				radioOne: 0,
+				zb_id: 0
+			}
+		},
+
+
+
+		
+		onLoad: function(option) {
+			this.id = option.id;
+			this.zb_id = option.zb_id,
+			this.getRepairDetail({'company_code':uni.getStorageSync('selectedCode'),"id":option.id})
+		},
+
+		mounted() {
+			// 创建附件上传
+			var _self = this;
+			var input = document.createElement('input'); //创建元素
+			input.type = 'file' //添加file类型
+			input.onchange = (event) => {
+				_self.upFile(input, event)
+			}
+			this.$refs.input.$el.appendChild(input)
+
+		},
+		methods: {
+			radioChange(e) {
+				console.log('type:' + e.detail.value);
+				this.radioOne = e.detail.value;
+			},
+
+			upFile(input, event) {
+				var _self = this;
+				uni.uploadFile({
+					url: 'https://qhome.usky.cn/USKYZHAF/USKYZHAF.php/Home/Inspection/setUpload',
+					files: [{
+						file: input.files[0],
+						uri: event.srcElement.value
+					}],
+					success: (uploadFileRes) => {
+						var data = JSON.parse(uploadFileRes.data)
+						this.img = data.img_url;
+						console.log(this.img)
+					},
+					fail: (err) => {
+						console.log(err)
+					}
+				});
+			},
+			
+			//回显请求
+			async getRepairDetail(params = {}) {
+				const res = await this.$myRequest({
+					url: 'Repair/getFormData',
+					data:params,
+					showLoading: true
+				})
+				this.getData=res.data.data[0];
+			
+				console.log(this.getData)
+			},
 
-	
-</style>
+			addSubmit() {
+				if (!this.img) {
+					uni.showToast({
+						title: "请上传图片",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.msg) {
+					uni.showToast({
+						title: "请输入报修描述",
+						icon: "none"
+					});
+					return
+				}
+				
+				this.powerSubmitRes({
+					"id": this.id,
+					"img": this.img,
+					"remarks": this.msg,
+				})
+			},
+			async powerSubmitRes(params = {}) {
+				const res = await this.$myRequest({
+					url: 'Repair/setRepair',
+					data: params
+				})
+				if (res.data.flag) {
+					uni.showToast({
+						title: "提交成功",
+					});
+					setTimeout(() => {
+						uni.navigateTo({
+							url: '/pages/repair/repair',
+						});
+					}, 1000);
+				}
+			},
+			textareaAInput(e) {
+				this.textareaAValue = e.detail.value
+			},
+		}
+	}
+</script>
 

+ 22 - 0
pages/repair/repairDetailDone/repairDetailDone.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 8 - 3
pages/setting/building/building.vue

@@ -93,8 +93,8 @@
 				消防设施平面布置图
 			</view>
 			<view class="padding-lr">
-				<!-- <img src="../../../static/building1.png" alt="" width="100%"> -->
-				<img :src="this.getDetailData.layout_plan" alt="" width="100%">
+				<img v-if="!this.getDetailData.layout_plan" src="/static/defaultImg.jpg" style="width:100%"></img>
+				<img v-else :src="this.getDetailData.layout_plan" style="width:100%"></img>
 			</view>
 		</view>
 		
@@ -105,7 +105,12 @@
 				建筑平面图
 			</view>
 			<view class="padding-lr padding-bottom-lg">
-				<img :src="this.getDetailData.build_plan" alt="" width="100%">
+				<!-- <img :src="this.getDetailData.build_plan" alt="" width="100%"> -->
+				
+				<img v-if="!this.getDetailData.build_plan" src="/static/defaultImg.jpg" style="width:100%"></img>
+				<img v-else :src="this.getDetailData.build_plan" style="width:100%"></img>
+				
+				
 				<br><br>
 			</view>
 		</view>

+ 46 - 2
pages/unprocessDetail/unprocessDetail.vue

@@ -83,7 +83,51 @@
 			this.getDetailData({
 				"type": option.type,
 				"id": option.id
-			})
+			});
+			
+			let url = "";
+			switch (parseInt(option.type)) {
+				case 1:
+					url = "报警主机"
+					break;
+				case 2:
+					url = "水系统"
+					break;
+				case 4:
+					url = "消防栓监测"
+					break;
+				case 6:
+					url = "RTU测控终端"
+					break;
+				case 7:
+					url = "电气火灾"
+					break;
+				case 16:
+					url = "视频告警"
+					break;
+				case 17:
+					url = "电梯报警"
+					break;
+				case 128:
+					url = "井盖监测"
+					break;
+				case 129:
+					url = "地磁"
+					break;
+				case 130:
+					url = "门磁"
+					break;
+				case 131:
+					url = "可燃气体"
+					break;
+				default:
+					break;
+			}
+			uni.setNavigationBarTitle({
+				title: url+'(未处理)'
+			});
+			
+			
 		},
 		methods: {
 			async getDetailData(params = {}) {
@@ -127,7 +171,7 @@
 					queryParam.device_code = this.getData.device_code;
 					queryParam.if_batch = this.radioOne;
 					queryParam.clwb = query;
-					queryParam.ncmb = this.getData.ncmd;
+					queryParam.ncmd = this.getData.ncmd;
 					queryParam.clnr = this.msg;
 					alert(this.getData.dwtype)
 					if (this.getData.dwtype == 1) {