Ver Fonte

停车场

zhengkaixin há 3 anos atrás
pai
commit
84a78477d6

+ 22 - 0
src/projects/parking/apis/car.js

@@ -48,3 +48,25 @@ export function parkingTradeWebPay(params) {
 		method: 'post',
 	})
 }
+
+
+//获取停车场信息
+export function userGetCarDetail(code,companyId) {
+	return request({
+		url: '/mobile/parkingInfoApi/userGetCarDetail?carNumber='+code+'&merchantId='+companyId,
+		
+		method: 'get',
+	})
+}
+
+//获取停车场信息
+export function userGetCarMember(carNumber,companyId) {
+	return request({
+		url: '/mobile/parkingInfoApi/userGetCarMember',
+		data: Qs.stringify({
+			carNumber:carNumber,
+			 merchantId:companyId
+		}),
+		method: 'post',
+	})
+}

+ 9 - 0
src/projects/parking/router/car.js

@@ -19,6 +19,15 @@ const routesCar = [
 					title: '搜索',
 				}
 			},
+			//车辆录入
+			{
+				path: 'input',
+				name: 'CarInput',
+				component: () => import('../views/Car/Input.vue'),
+				meta: {
+					title: '车辆录入',
+				}
+			},
 			//支付
 			{
 				path: 'pay',

+ 181 - 0
src/projects/parking/views/Car/Input.vue

@@ -0,0 +1,181 @@
+<template>
+	<div>
+		<common-car ref="common" @asynCallBack="asynCallBack"></common-car>
+		<top-header :pageTitle="pageTitle"></top-header>
+
+		<div class="mui-content vongi-car-index">
+			<div class="vongi-car-banner">
+<!-- 				<h5 class="mui-ellipsis">停车位置:{{detail.parkingName}}</h5>
+ -->				<div class="flew">
+					<input type="text" v-model="searchForm.carNumber" placeholder="请输入车牌号查询">
+					<button @click="searchByCarNumber" class="mui-btn mui-btn-blue">查询</button>
+				</div>
+			</div>
+			
+		</div>
+		
+			<div class="vongi-qingjiadt" v-if="kongResult">
+				<form class="mui-input-group vongi-cd-payli">
+					
+				 
+				 <div class="mui-input-row">
+				 	<label>车牌号</label>
+				 	<span v-text="channelForm.carNumber"></span>
+				 </div>
+					<div class="mui-input-row">
+						<label>生效时间</label>
+						<span v-text="detail.inTime"></span>
+					</div>
+					<div class="mui-input-row">
+						<label>截止时间</label>
+						<span v-text="detail.memberTime"></span>
+					</div>
+				</form>
+				<div class="fyy-footer padd30">
+					<div class="bindfyy-btn">
+						<button type="button" @click="submit" class="mui-btn mui-btn-primary ">确认录入</button>
+					</div>
+				</div>
+			</div>
+			
+		 
+	 
+		
+		
+	<!-- 	<div class="vongi-car-footer">
+			<div class="mui-media-body">
+				<b>停车场收费说明:</b><br>
+				缴费后请于规定时间离场,离场会自动抬杆。如果找不到停车信息,或者临牌停车,请至集中缴费处缴纳现金。
+			</div>
+		</div> -->
+
+		<loading :visible="isLoading"></loading>
+	</div>
+</template>
+
+<script>
+	import * as API_Car from '@/apis/car'
+	import CommonCar from '@/components/CommonCar.vue'
+	import Loading from '$project/components/Loading.vue'
+	import TopHeader from '$project/components/TopHeader.vue'
+	import {
+		mapGetters,
+		mapMutations
+	} from 'vuex'
+	import * as types from '$project/store/mutation-types'
+	export default {
+		name: 'CarSearch',
+		components: {
+			CommonCar,
+			Loading,
+			TopHeader,
+		},
+		data() {
+			return {
+				isLoading: false,
+
+				pageTitle: '车牌查询',
+
+				searchForm: {
+					carNumber: '',
+					companyId: '',
+				},
+				
+				channelForm: {
+					channelId: '',
+					companyId: '',
+				},
+
+				kongResult: false,
+
+				detail: {}
+			}
+		},
+		created() {
+			if (this.$route.query.companyId) {
+				//入口页必须带merchantId
+				this.set_parking_company_id(this.$route.query.companyId);
+			} else {
+				if (!this.parking_company_id) {
+					mui.alert('参数错误');
+				}
+			}
+
+			
+
+		},
+		methods: {
+			//获取停车场信息
+			 submit(){
+				 	this.isLoading = true;
+				 API_Car.userGetCarMember(this.channelForm.carNumber,this.channelForm.companyId).then(response => {
+					
+				 	this.isLoading = false;
+				 	this.kongResult = false;
+					this.searchForm.carNumber=""
+					mui.alert('录入成功');
+				 
+				 }).catch(error => {
+				 	this.isLoading = false;
+				 	mui.toast(error);
+				 	
+				 })
+			 },
+			//检测
+			checkForm() {
+				if (!this.searchForm.carNumber) {
+					mui.toast('请输入车牌号码');
+					return false;
+				} else {
+					return true;
+				}
+			},
+			//查询车牌信息
+			searchByCarNumber() {
+				if (this.checkForm()) {
+					this.isLoading = true;
+					
+					API_Car.userGetCarDetail(this.searchForm.carNumber,this.parking_company_id).then(response => {
+						this.detail=response;
+						this.channelForm={
+							carNumber:this.searchForm.carNumber,
+							companyId:this.parking_company_id
+						}
+						this.isLoading = false;
+						this.kongResult = true;
+					
+
+					}).catch(error => {
+						this.isLoading = false;
+						mui.toast(error);
+						
+					})
+				}
+			},
+			
+			asynCallBack() {},
+			...mapMutations({
+				set_parking_company_id: types.SET_PARKING_COMPANY_ID,
+			})
+		},
+		mounted() {
+			
+		
+		},
+		destroyed() {
+
+		},
+		computed: {
+			...mapGetters({
+				wx_openId: 'wx_openid',
+				ali_openId: 'ali_openid',
+				parking_company_id: 'parking_company_id'
+			})
+		}
+	}
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style>
+</style>