Browse Source

优化,增加完成时间可选, 上报类型

zhengkaixin 1 month ago
parent
commit
7819349fa0
4 changed files with 150 additions and 22 deletions
  1. 2 1
      config/.env.dev.js
  2. 34 6
      pages/index/index.vue
  3. 100 12
      pages/task/maintenanceTaks.vue
  4. 14 3
      pages/team/teamList.vue

+ 2 - 1
config/.env.dev.js

@@ -6,7 +6,7 @@ const UNI_APP = {
 	BASE_URL: 'https://youdian-test.hbjp.com.cn/floorlock-server/',
 	BASE_URL: 'https://youdian-test.hbjp.com.cn/floorlock-server/',
 	//##https://youdian-test.hbjp.com.cn/floorlock-portal/#/home
 	//##https://youdian-test.hbjp.com.cn/floorlock-portal/#/home
 	
 	
-	BASE_URL:"https://zbyj.hbjp.com.cn/floorlock-server/",
+	//BASE_URL:"https://zbyj.hbjp.com.cn/floorlock-server/",
 	//BASE_URL: 'https://dgj.jzrccs.com/electric-manager-api/',
 	//BASE_URL: 'https://dgj.jzrccs.com/electric-manager-api/',
 	
 	
 	//BASE_URL:'http://192.168.77.162:8081/electric-manager-api/', //sz
 	//BASE_URL:'http://192.168.77.162:8081/electric-manager-api/', //sz
@@ -16,6 +16,7 @@ const UNI_APP = {
 
 
 
 
 	openId:"oRGjz7GpSbld27nUK9Q6V6jvXMJo",
 	openId:"oRGjz7GpSbld27nUK9Q6V6jvXMJo",
+	openId:"oRGjz7DZM-rK3MpkjV6_VnoUhLI0",
 	
 	
 	
 	
 	//appid
 	//appid

+ 34 - 6
pages/index/index.vue

@@ -34,7 +34,7 @@
 					故障上报
 					故障上报
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="item-na-b"  >
+			<view class="item-na-b"  v-if="isAdmin"  >
 
 
 			</view>
 			</view>
 			<view class="item-na end"   @click="gotoUrl('/pages/team/teamList')" v-if="isAdmin"  >
 			<view class="item-na end"   @click="gotoUrl('/pages/team/teamList')" v-if="isAdmin"  >
@@ -44,8 +44,13 @@
 				<view class="na-text">
 				<view class="na-text">
 					团队管理
 					团队管理
 				</view>
 				</view>
-			</view>
-			<view class="item-na end"   @click="gotoUrl('/pages/task/listTask')" v-else  >
+			</view>
+			
+			<view class="item-na-b"  >
+			
+			</view>
+			
+			<view class="item-na end"   @click="gotoUrl('/pages/task/listTask')"   >
 				<view class="na-img">
 				<view class="na-img">
 					<image class="img" src="@/assets/img/index/na-2.png" mode=""></image>
 					<image class="img" src="@/assets/img/index/na-2.png" mode=""></image>
 				</view>
 				</view>
@@ -155,7 +160,10 @@
 					</view>
 					</view>
 					<view class="body">
 					<view class="body">
 						<view class="line1">
 						<view class="line1">
-							<view class="title">
+							<view class="title">
+								<span  v-if="item.type" :class="'typeN typeN'+item.type">
+									{{item.typeN}}
+								</span>
 								{{item.errorCodeText}}
 								{{item.errorCodeText}}
 
 
 							</view>
 							</view>
@@ -691,8 +699,28 @@ import {
 						font-size: 24rpx;
 						font-size: 24rpx;
 						margin-top: 8rpx;
 						margin-top: 8rpx;
 					}
 					}
-					.line1 {
-						.title {
+					.line1 {
+						.typeN{
+							font-size: 24rpx;
+							margin-right: 8rpx;
+							display: flex;
+							align-items: center;
+								border-radius: 4px;
+								padding: 2px 8rpx;
+								color: #fff;
+								font-weight: 400;
+						}
+						.typeN1{
+							background-color:#1677ff;
+							//border: 1px solid #1677ff;
+						}
+						.typeN2{
+							background-color:#19be6b;
+							//border: 1px solid #19be6b;
+							 
+						}
+						.title {
+							display: flex;
 							color: rgba(51, 51, 51, 1);
 							color: rgba(51, 51, 51, 1);
 							font-size: 28rpx;
 							font-size: 28rpx;
 							font-weight: bold;
 							font-weight: bold;

+ 100 - 12
pages/task/maintenanceTaks.vue

@@ -2,7 +2,10 @@
 	<view  class="jpmain  " >
 	<view  class="jpmain  " >
 			<u-navbar  title="维修结果" title-color="#101010"></u-navbar>
 			<u-navbar  title="维修结果" title-color="#101010"></u-navbar>
 			
 			
-			
+				<u-picker mode="time" v-model="completionTimeShow"
+				@confirm="completionTimeConfirm" :default-time="taskInfo.completionTime"
+				 :params="params"></u-picker>
+
 			
 			
 			<view class="list" >
 			<view class="list" >
 				<view class="item">
 				<view class="item">
@@ -11,8 +14,12 @@
 				
 				
 					</view>
 					</view>
 					<view class="value">
 					<view class="value">
+						<span  v-if="floorlockErrorRecord.type" :class="'typeN typeN'+floorlockErrorRecord.type">
+							{{floorlockErrorRecord.typeN}}
+						</span>
 						{{floorlockErrorRecord.errorCodeText}}
 						{{floorlockErrorRecord.errorCodeText}}
 						
 						
+						
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="item item-plus"  v-if="floorlockErrorRecord.errorDesc">
 				<view class="item item-plus"  v-if="floorlockErrorRecord.errorDesc">
@@ -47,6 +54,16 @@
 						
 						
 					</view>
 					</view>
 				</view>
 				</view>
+				<view class="item" v-if="floorlockErrorRecord.type==2">
+					<view class="name">
+						上报人
+				
+					</view>
+					<view class="value">
+						{{floorlockErrorRecord.createByName}}
+						
+					</view>
+				</view>
 			</view>
 			</view>
 			
 			
 			
 			
@@ -56,7 +73,7 @@
 						地锁编号
 						地锁编号
 				
 				
 					</view>
 					</view>
-					<view class="value">
+					<view class="value valueplus">
 						{{floorlockInfo.lockNo}}
 						{{floorlockInfo.lockNo}}
 						<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
 						<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
 					</view>
 					</view>
@@ -76,7 +93,7 @@
 						所属停车场
 						所属停车场
 				
 				
 					</view>
 					</view>
-					<view class="value" @click="navigate">
+					<view class="value valueplus" @click="navigate">
 						<view>{{parkingInfo.name}}</view>
 						<view>{{parkingInfo.name}}</view>
 						<image class="img" v-if="parkingInfo.latitude&&parkingInfo.longitude"
 						<image class="img" v-if="parkingInfo.latitude&&parkingInfo.longitude"
 						 src="@/assets/img/daohuang.png" mode=""></image>
 						 src="@/assets/img/daohuang.png" mode=""></image>
@@ -95,15 +112,22 @@
 				
 				
 			</view>
 			</view>
 			<view class="list" >
 			<view class="list" >
-				<view class="item"  v-if="floorlockErrorRecord.status!=0">
+				<view class="item"  >
 					<view class="name">
 					<view class="name">
 						处理时间
 						处理时间
 				
 				
 					</view>
 					</view>
-					<view class="value">
+					<view class="value" v-if="floorlockErrorRecord.status!=0">
 						{{floorlockErrorRecord.updateTime}}
 						{{floorlockErrorRecord.updateTime}}
 						
 						
 					</view>
 					</view>
+					<view class="value valueplus" 
+					@click="completionTimeShow=true"
+					v-else>
+						{{taskInfo.completionTime}}
+						<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
+						
+					</view>
 				</view>
 				</view>
 				
 				
 				
 				
@@ -118,7 +142,7 @@
 						class="textarea"></textarea>
 						class="textarea"></textarea>
 					</view>
 					</view>
 					<view class="value"  v-else >
 					<view class="value"  v-else >
-						<textarea placeholder="请记录处理步骤及结果" 
+						<textarea placeholder="" 
 						placeholder-class="textareaclass"
 						placeholder-class="textareaclass"
 						v-model="floorlockErrorRecord.repairDesc"
 						v-model="floorlockErrorRecord.repairDesc"
 						class="textarea"></textarea>
 						class="textarea"></textarea>
@@ -172,6 +196,12 @@
 	import * as API from '@/apis/pagejs/pagesTask.js'
 	import * as API from '@/apis/pagejs/pagesTask.js'
 	import * as WxJsApi from '@/apis/utils/wxJsApi.js'
 	import * as WxJsApi from '@/apis/utils/wxJsApi.js'
 	
 	
+	import {
+		
+		currentTimeStamp,
+		parseUnixTime
+	} from '@/apis/utils'
+	
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -182,6 +212,15 @@
 				},
 				},
 				header:{
 				header:{
 					
 					
+				},
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: true,
+					minute: true,
+					second: true,
+					timestamp: true,
 				},
 				},
 				codeN:"",
 				codeN:"",
 				selectTaskInfoCode:false,
 				selectTaskInfoCode:false,
@@ -196,12 +235,14 @@
 					id:"",
 					id:"",
 					desc:"",
 					desc:"",
 					images:"",
 					images:"",
+					completionTime:"",
 					
 					
 				},
 				},
 				codeList:[],
 				codeList:[],
 				id:"",
 				id:"",
 				imgList:[],
 				imgList:[],
 				repairImageList:[],
 				repairImageList:[],
+				completionTimeShow:false,
 			};
 			};
 		},
 		},
 		onLoad(op) {
 		onLoad(op) {
@@ -213,6 +254,7 @@
 				'Authorization':token
 				'Authorization':token
 			}
 			}
 			this.id=op.id
 			this.id=op.id
+			this.taskInfo.completionTime= parseUnixTime(currentTimeStamp())
 			this.errDetails()
 			this.errDetails()
 			
 			
 			
 			
@@ -225,6 +267,11 @@
 			})
 			})
 		},
 		},
 		methods:{
 		methods:{
+			completionTimeConfirm(e){
+				console.log(e)
+				
+				this.taskInfo.completionTime= parseUnixTime(new Date(e.timestamp* 1000))
+			},
 			previewImage(i,name) {
 			previewImage(i,name) {
 				let imgs = this[name];
 				let imgs = this[name];
 				//imgs.push(img);
 				//imgs.push(img);
@@ -293,9 +340,7 @@
 					})
 					})
 				})
 				})
 			},
 			},
-			submit(){
-				
-				
+			submitApi(){
 				let files = [];
 				let files = [];
 				// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
 				// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
 				files = this.$refs.uUpload.lists.filter(val => {
 				files = this.$refs.uUpload.lists.filter(val => {
@@ -348,6 +393,28 @@
 						icon: "none"
 						icon: "none"
 					})
 					})
 				})
 				})
+			},
+			submit(){
+				
+				if(!this.taskInfo.desc){
+					uni.showModal({
+						title: '提示',
+						showCancel: true,
+						cancelText:"返回填写",
+						confirmText:"继续提交",
+						content: "未填写处理步骤,是否继续提交",
+						success: res1 => {
+							if (res1.confirm) {
+								this.submitApi()
+							} else if (res1.cancel) {
+								//('用户点击取消');
+							}
+						}
+					})
+				}else{
+					this.submitApi()
+				}
+			
 				
 				
 				
 				
 			},
 			},
@@ -378,11 +445,15 @@
 					}
 					}
 					white-space: pre;
 					white-space: pre;
 			}
 			}
+			.valueplus{
+				display: flex;
+				justify-content: space-between;
+			}
 			.value{
 			.value{
 				font-size: 32rpx;
 				font-size: 32rpx;
 				    width: 60%;
 				    width: 60%;
-				display: flex;
-				    justify-content: space-between;
+				    display: flex;
+					align-items: center;
 					input::placeholder{
 					input::placeholder{
 						color:#AAAAAA;
 						color:#AAAAAA;
 					}
 					}
@@ -396,7 +467,24 @@
 						width: 100%;
 						width: 100%;
 						border-radius: 4px;
 						border-radius: 4px;
 					}
 					}
-					
+					.typeN{
+						font-size: 24rpx;
+						margin-right: 8rpx;
+						display: flex;
+						align-items: center;
+							border-radius: 4px;
+							padding: 2px 8rpx;
+							color: #fff;
+					}
+					.typeN1{
+						background-color:#1677ff;
+						//border: 1px solid #1677ff;
+					}
+					.typeN2{
+						background-color:#19be6b;
+						//border: 1px solid #19be6b;
+						 
+					}
 			}
 			}
 		}
 		}
 		.item-plus{
 		.item-plus{

+ 14 - 3
pages/team/teamList.vue

@@ -28,7 +28,7 @@
 				<view class="body">
 				<view class="body">
 					<view class="line1">
 					<view class="line1">
 						<view class="title">
 						<view class="title">
-							{{item.realName}}
+							{{item.realName}} ({{item.userName}})
 		
 		
 						</view>
 						</view>
 						
 						
@@ -36,8 +36,8 @@
 					
 					
 					<view class="line2">
 					<view class="line2">
 						<view class="value">
 						<view class="value">
-							{{item.userName}}
-		
+							
+							{{roleNamesShow(item.roleNames)}}
 						</view>
 						</view>
 					
 					
 					</view>
 					</view>
@@ -99,6 +99,17 @@
 			this.getList()
 			this.getList()
 		},
 		},
 		methods: {
 		methods: {
+			roleNamesShow(str){
+				var sz=str.split(",")
+				var rsz=[]
+				sz.forEach(item=>{
+					if(item.indexOf('巡检')!=-1){
+						rsz.push(item)
+					}
+					
+				})
+				return rsz.join(',')
+			},
 			submit(){
 			submit(){
 					
 					
 			},
 			},