Bladeren bron

巡检切换站点

zhengkaixin 2 weken geleden
bovenliggende
commit
60aa619ea6

+ 2 - 0
apis/pagejs/pagejsIndex.js

@@ -1,6 +1,8 @@
 import request from '@/apis/utils/request'
 
 
+
+
 export function errList(data) {
 	var url='/mobile/inspectionError/errList';
 	return request({

+ 12 - 0
apis/pagejs/pagesInspection.js

@@ -1,6 +1,18 @@
 import request from '@/apis/utils/request'
 
 
+
+
+export function stationList(data) {
+	var url='/mobile/inspectionRecord/stationList';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+
 export function recordList(data) {
 	var url='/mobile/inspectionRecord/recordList';
 	return request({

+ 9 - 0
apis/utils/wxJsApi.js

@@ -14,6 +14,15 @@ export function addSysLog(message) {
 		method: 'post',
 	})
 }
+
+export function findStationByGun(data) {
+
+	return request({
+		url: '/mobile/inspectionRecord/findStationByGun',
+		data: data,
+		method: 'post',
+	})
+}
 //获取微信配置
 export function getWxConfig(jsApiList) {
 	var jsApiList = jsApiList || ['chooseImage', 'getLocalImgData', 'scanQRCode','openLocation'];

+ 67 - 43
components/Tabbar.vue

@@ -67,56 +67,80 @@
 				if(item.pagePath){
 						return true;
 				}else{
-					console.log(111)
+					if(process.jphelp.NODE_ENV=='dev'){
+						this.findStationByGun("YQ202207150011001")
+					}else{
+						this.getScanCode()
+					}
+					
 					return false;
 				}
 				
 			},
+			
+			findStationByGun(id){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				WxJsApi.findStationByGun({
+					gunNo:id,
+				
+				
+				}).then((response) => {
+					uni.hideLoading();
+					var chargingStation=response.data.chargingStation
+					if(chargingStation){
+						uni.navigateTo({
+							url:"/pages/inspection/add?stationId="+chargingStation.id
+						})
+					}else{
+						uni.showToast({
+							title: "未查询到充电站",
+							icon: "none"
+						})
+					}
+					
+				
+				}).catch(error => {
+					
+					uni.hideLoading();
+					
+				})
+			},
+			
 			//微信扫二维码
 			getScanCode() {
-				console.log("getScanCode")
-				if (this.userId) {
-					WxJsApi.scanQRCode(1).then(res => {
-						var url=res;
-						//("scanQRCode------" + res)
-						if(res&&this.branchParameterBl()&&url.indexOf('youdian.hbjp.com.cn')!=-1){
-							
-								if(url.indexOf('?code=')!=-1){
-									url=url.replace('?code=','?code1233=')
-								}
-								
-								
-								if(process.car.NODE_ENV=='test'){
-									url='https://youdian.hbjp.com.cn/charging-prod/mobile-charging-car-test/#/'
-									+url.split("#/")[1]
-								}else{
-									url='https://youdian.hbjp.com.cn/charging-prod/mobile-charging-car/#/'
-									+url.split("#/")[1]
-								}
-								console.log(url)
-								//window.location.href=url;
-								this.youdianurl=url
-								this.youdianshow=true
-							
-						}else if (res) {
+				WxJsApi.scanQRCode(1).then(res => {
+					var url=res;
+					
+					var gunId="";
+					if(url&&url.indexOf("#/?jpcode=")>-1){
+						gunId=url.split("#/?jpcode=")[1]
+					}
+					if(url&&url.indexOf("#/?gunId=")>-1){
+						 gunId=url.split("#/?gunId=")[1].trim()
+						
+					}
+					
+					if(url&&url.indexOf("&gunId=")>-1){
+						gunId=url.split("&gunId=")[1].trim()
+					}
+					
+					if(gunId){
+						this.findStationByGun(gunId)
+					}else{
+						uni.showToast({
+							title: "请扫充电桩二维码",
+							icon: "none"
+						})
+					}
+					
+					
+				}).catch(error => {
 							
-							API.scanCode(res).then((response) => {
-			
-							}).catch(error => {
-								uni.showToast({
-									title: error,
-									icon: "none"
-								})
-							})
-						}
-					}).catch(error => {
-			
-					})
-				} else {
-					uni.navigateTo({
-						url: '/pages/login/login'
-					})
-				}
+				})
 			},
 			
 

+ 7 - 0
pages.json

@@ -209,6 +209,13 @@
 			{
 				"navigationBarTitleText" : ""
 			}
+		},
+		{
+			"path" : "pages/inspection/selectStation",
+			"style" : 
+			{
+				"navigationBarTitleText" : ""
+			}
 		}
 	],
 

+ 47 - 17
pages/inspection/add.vue

@@ -8,17 +8,21 @@
 
 		<view class="list">
 			<view class="item">
-				荆鹏充电站
-
-
+				{{record.stationName}}
+				<span   @click="gotoSelectStation()"
+				style="color: rgba(16,16,16,1);font-size: 28rpx;    float: right; font-weight: 400;">
+					切换站点
+					<u-icon name="arrow-right" size="24" color="#BBBBBB" ></u-icon>
+				</span>
+				
 			</view>
 			<view class="item ">
 				<view class="name">
-					站点地址 荆州市沙市区江津东路155号院内
+					站点地址 {{record.stationAddress}}
 
 				</view>
-				<view class="value">
-					站点地址 荆州市沙市区江津东路155号院内
+				<view class="name">
+					上次巡检 {{record.lastInspectionTime}}
 
 				</view>
 			</view>
@@ -190,6 +194,7 @@
 				floorlockInfo: {},
 				floorlockErrorRecord: {},
 				parkingInfo: {},
+				stationInfo:{},
 				stationId:"",
 				taskInfo: {
 					id: "",
@@ -223,6 +228,7 @@
 			}
 			if(op.stationId){
 				this.stationId = op.stationId
+				this.id=""
 			}
 			this.taskInfo.inspectionTime = parseUnixTime(currentTimeStamp())
 			this.errDetails()
@@ -241,6 +247,26 @@
 			})
 		},
 		methods: {
+			gotoSelectStation() {
+				uni.navigateTo({
+					url: '/pages/inspection/selectStation',
+					events: {
+						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+						acceptDataFromOpenerPage: (item) => {
+							console.log(item)
+							
+							this.stationId = item.item.id
+							this.id=""
+							
+							this.errDetails(1)
+							this.$forceUpdate()
+			
+						},
+			
+					}
+			
+				})
+			},
 			memberListchange(e){
 				console.log(e)
 				this.$forceUpdate()
@@ -319,20 +345,24 @@
 				// 	"," + _self.stationDetail.station.latitude + "&name=" + _self.stationDetail.station.name;
 
 			},
-			errDetails() {
+			errDetails( bl) {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
 
 				API.recordDetails({
-					id: this.id
-				}).then((res) => {
+					id: this.id,
+					stationId:this.stationId
+				}).then((res) => {
+					this.record=res.data.record
+					
+					if(!bl){
+						this.content=res.data.content
+						uni.hideLoading();
+						this.contentMethod()
+					}
 					
-					this.content=res.data.content
-					this.record=res.data.record
-					uni.hideLoading();
-					this.contentMethod()
 				}).catch(error => {
 
 					uni.hideLoading();
@@ -436,9 +466,9 @@
 					return
 				}
 				this.taskInfo.userIds=mp.join()
-				this.taskInfo.id=this.id
-				this.taskInfo.status=0
-				this.taskInfo.stationId=this.record.stationId
+				//this.taskInfo.id=this.id
+				this.taskInfo.status=1
+				this.taskInfo.stationId=this.stationId
 				
 				
 				
@@ -529,7 +559,7 @@
 					color: red
 				}
 
-				white-space: pre;
+				
 			}
 
 			.valueplus {

+ 2 - 0
pages/inspection/info.vue

@@ -5,6 +5,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/pagesInspection.js'
+	
 	export default {
 		data() {
 			return {

+ 2 - 2
pages/inspection/list.vue

@@ -195,7 +195,7 @@
 			},
 			gotoTask(k){
 				uni.navigateTo({
-				  url: '/pages/inspection/add?id='+k.id,
+				  url: '/pages/inspection/add?stationId='+k.stationId,
 				  events: {
 				    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
 				    acceptDataFromOpenerPage: (data)=>{
@@ -209,7 +209,7 @@
 			},
 			change(e){
 				this.current=e
-				this.listForm.pageIndex=0
+				this.listForm.pageIndex=1
 				this.listForm.status=this.tabslist[e].status
 				this.list =[]
 				this.getList()

+ 232 - 0
pages/inspection/selectStation.vue

@@ -0,0 +1,232 @@
+<template>
+	<view>
+		<u-navbar  title="选择站点" title-color="#101010"></u-navbar>
+		
+		<view class="top">
+			<view class="search">
+				<view class="searchBox">
+					<u-search shape="square" placeholder="搜索站点" maxlength="12" v-model="testName" :show-action="false"
+						:animation="true"></u-search>
+					<u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
+				</view>
+			</view>
+		</view>
+		<view class="body2">
+			<view class="item" v-if="isAll"  @click="returnName( {id:''})">
+				<view class="v">
+					
+			
+					<view class="v1" style="font-weight: bold;" >
+						查询全部
+					</view>
+					
+				</view>
+				<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
+			</view>
+			<view class="item" v-for="(item,i) in list" :key="i"
+				@click="returnName( item)">
+				<view class="v">
+					
+
+					<view class="v1" >
+						<!-- {{item.stationNo}}<span class="y">|</span> -->{{item.name}}
+					</view>
+					
+					<view class="v2" v-if="item.address" >
+						{{item.address}}
+					</view>
+				</view>
+				<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
+			</view>
+
+			 
+		</view>
+
+		<u-divider color="#B6BDC3" :isnone="list.length==0">已经到底了</u-divider>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/pagesInspection.js'
+
+	export default {
+		data() {
+			return {
+				list: [],
+				testName: "",
+				listForm: {
+					pageIndex: 1,
+					pageSize: 15,
+					recordsTotal: 1,
+				
+				},
+				queryName: "",
+				type: 1,
+				isAll: 0,
+			};
+		},
+		onLoad(op) {
+			if (op.isAll) {
+				this.isAll = op.isAll
+			}
+			if (op.type) {
+				this.type = op.type
+			}
+			this.getList()
+		},
+		onReachBottom() {
+			if (this.list.length < this.listForm.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
+		methods: {
+			myLoadmore() {
+				this.listForm.pageIndex += 1;
+				this.getList()
+			},
+			getList(bl) {
+				if (bl) {
+					this.listForm.pageIndex = 1
+				}
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				//this.listForm.id = this.jphelp.getPersonInfo().id
+				this.listForm.queryContent=this.queryName
+				
+			
+				API.stationList(this.listForm).then((res) => {
+					
+					var list = this.list
+					
+									
+					
+					if (this.listForm.pageIndex == 1) {
+						list = res.data.data;
+					} else {
+						list = [
+							...list,
+							...res.data.data
+						];
+					}
+					this.list =list
+					this.listForm.recordsTotal=res.data.recordsTotal
+					
+					uni.hideLoading();
+
+				}).catch(error => {
+
+					uni.hideLoading();
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			returnName(  obj) {
+				const eventChannel = this.getOpenerEventChannel();
+
+				eventChannel.emit('acceptDataFromOpenerPage', {
+				 
+					item: obj
+				})
+				uni.navigateBack()
+			},
+			testBtn() {
+
+				this.queryName=this.testName
+				this.listForm.queryContent=this.queryName
+				
+				this.getList(1)
+			},
+			getInfo() {
+
+			}
+
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: rgba(242, 244, 246, 1);
+	}
+</style>
+<style lang="scss" scoped>
+	::v-deep .u-content {
+		width: 380% !important;
+	}
+
+	.search {
+
+		padding: 16rpx 32rpx;
+		background: #fff;
+
+		.searchBox {
+			display: flex;
+			align-items: center;
+			background: #F2F2F2;
+			padding: 2rpx 16rpx;
+			border-radius: 16rpx;
+			justify-content: space-between;
+		}
+	}
+
+	.body2 {
+		padding-top: 20rpx;
+		.item:not(:last-child) {
+			border-bottom: 2rpx solid rgba(232, 232, 232, 1);
+		}
+
+		.item {
+			padding: 24rpx 32rpx;
+			background: #fff;
+			display: flex;
+			justify-content: space-between;
+
+			.vquery {
+				display: flex;
+				align-items: center;
+			}
+
+			.buildMode {
+				font-size: 24rpx;
+				border: 2rpx solid #bbbbbb;
+				border-radius: 8rpx;
+				color: #1677ff;
+				padding: 2rpx 8rpx;
+				margin: 0 8rpx;
+
+			}
+
+			.buildMode1 {
+				color: #1677ff;
+				border: 2rpx solid #1677ff;
+			}
+
+			.buildMode2 {
+				color: #4CAF50;
+				border: 2rpx solid #4CAF50;
+			}
+
+			.qName {
+				color: #FF5100
+			}
+
+			.v1 {
+				color: rgba(16, 16, 16, 1);
+				font-size: 32rpx;
+			}
+			.y{
+				margin: 0 8rpx;
+				color:rgba(119, 119, 119, 1);
+				
+			}
+			.v2 {
+				color: rgba(119, 119, 119, 1);
+				font-size: 24rpx;
+			}
+
+		}
+	}
+</style>

+ 1 - 1
pages/task/listTask.vue

@@ -290,7 +290,7 @@
 			},
 			change(e){
 				this.current=e
-				this.listForm.pageIndex=0
+				this.listForm.pageIndex=1
 				this.listForm.status=e
 				this.list =[]
 				this.getList()