Browse Source

h5流程修改

qzyReal 3 years ago
parent
commit
5c316c3327

+ 135 - 151
app/pages.json

@@ -1,191 +1,175 @@
 {
 	"easycom": {
-			"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
-		},
+		"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
+	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": ""//首页
+				"navigationBarTitleText": "" //首页
 				//"navigationStyle":"custom"
 			}
-		}
-	    ,{
-            "path" : "pages/enterprise-reg/enterprise-reg",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//企业注册
+		}, {
+			"path": "pages/enterprise-reg/enterprise-reg",
+			"style": {
+				"navigationBarTitleText": "" //企业注册
 				//"navigationStyle":"custom"
-            }
-            
-        }
-        ,{
-            "path" : "pages/login/login",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//登录
+			}
+
+		}, {
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": "" //登录
 				//"navigationStyle":"custom"
-            }
-            
-        }
-        ,{
-            "path" : "pages/business-entering/business-entering",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//业务录入
+			}
+
+		}, {
+			"path": "pages/business-entering/business-entering",
+			"style": {
+				"navigationBarTitleText": "" //业务录入
 				//"navigationStyle":"custom"
-            }
-            
-        }
-		,{
-		    "path" : "pages/business-entering/business-edit",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""//业务录入
-		    }
-		    
-		}
-		,{
-		    "path" : "pages/business-entering/business-detail",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""//业务录入
+			}
+
+		}, {
+			"path": "pages/business-entering/business-edit",
+			"style": {
+				"navigationBarTitleText": "" //业务录入
+			}
+
+		}, {
+			"path": "pages/business-entering/business-detail",
+			"style": {
+				"navigationBarTitleText": "" //业务录入
 				//"navigationStyle":"custom"
-		    }
-		    
-		}
-		,{
-		    "path" : "pages/customer-management/customer-list",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""//业务录入
+			}
+
+		}, {
+			"path": "pages/customer-management/customer-list",
+			"style": {
+				"navigationBarTitleText": "" //业务录入
 				//"navigationStyle":"custom"
-		    }
-		    
-		}
-        ,{
-            "path" : "pages/business-order/business-order",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//业务订单
+			}
+
+		}, {
+			"path": "pages/business-order/business-order",
+			"style": {
+				"navigationBarTitleText": "" //业务订单
 				//"navigationStyle":"custom"
-            }
-            
-        }
-        ,{
-            "path" : "pages/customer-management/customer-management",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//客户管理
+			}
+
+		}, {
+			"path": "pages/customer-management/customer-management",
+			"style": {
+				"navigationBarTitleText": "" //客户管理
 				//"navigationStyle":"custom"
-            }
-            
-        }
-        ,{
-            "path" : "pages/inout-record/inout-record",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//出入记录
+			}
+
+		}, {
+			"path": "pages/inout-record/inout-record",
+			"style": {
+				"navigationBarTitleText": "" //出入记录
 				//"navigationStyle":"custom"
-            }
-            
-        }
-        ,{
-            "path" : "pages/choose-business/choose-business",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//选择业务
+			}
+
+		}, {
+			"path": "pages/choose-business/choose-business",
+			"style": {
+				"navigationBarTitleText": "" //选择业务
 				//"navigationStyle":"custom"
-            }
-            
-        },
+			}
+
+		},
 		{
-            "path" : "pages/ok/registerSuccess",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": ""//注册成功
+			"path": "pages/ok/registerSuccess",
+			"style": {
+				"navigationBarTitleText": "" //注册成功
 				//"navigationStyle":"custom"
-            }
-            
-        },
+			}
+
+		},
 		{
-		    "path" : "pages/business-order/sureOrder",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
-		},{
-		    "path" : "pages/business-order/surePay",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/business-order/sureOrder",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
+		}, {
+			"path": "pages/business-order/surePay",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-		    "path" : "pages/business-order/sureOut",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/business-order/sureOut",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-		    "path" : "pages/business-order/sureIn",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/business-order/sureIn",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-		    "path" : "pages/business-order/createOrder",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/business-order/createOrder",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-		    "path" : "pages/customer-management/customer-judge",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/customer-management/customer-judge",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-		    "path" : "pages/wx/index",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/wx/index",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-		    "path" : "pages/wx/pay",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": ""
-		    }
-		    
+			"path": "pages/wx/pay",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom"
+			}
+
+		}, {
+			"path": "pages/wx/payOrderTemp",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
 		},
 		{
-            "path" : "pages/business-entering/item-select",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "选择项目",
-                "enablePullDownRefresh": false,
-				"navigationStyle":"custom"
-            }
-            
-        }
-    ],
+			"path": "pages/wx/payOrder",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+
+		},
+		{
+			"path": "pages/business-entering/item-select",
+			"style": {
+				"navigationBarTitleText": "选择项目",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+			}
+
+		}
+	],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",
 		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor":"#0080ff",
+		"navigationBarBackgroundColor": "#0080ff",
 		"backgroundColor": "#F8F8F8"
 	}
 }

+ 6 - 34
app/pages/business-order/business-order.vue

@@ -33,14 +33,6 @@
 						<text class="p2">{{businessItem.netWeight}}(吨)</text>
 					</view>
 					<view class="item">
-						<text class="p1">车辆状态:</text>
-						<text class="p2">
-							<text v-if="businessItem.realInTime==null">未入场</text>
-							<text v-if="businessItem.realInTime!=null&&businessItem.adminConfirmOut==0">已入场</text>
-							<text v-if="businessItem.outDayTime!=null&&businessItem.adminConfirmOut==1">已离场</text>
-						</text>
-					</view>
-					<view class="item">
 						<text class="p1">账单确认:</text>
 						<text class="p2">
 							<text v-if="businessItem.confirmInput==0">未确认</text>
@@ -57,37 +49,17 @@
 					</view>
 				</view>
 				<view class="b">
-					<view class="btn b3" v-if="businessItem.realInTime!=null&&businessItem.chinaCarInTime!=null
-								&&businessItem.complete==0
-								&&customemrId=='1'" @click="completeFn(businessItem)">
-						生成账单</view>
 					<view class="btn b3" v-if="businessItem.confirmInput==0
-								&&businessItem.payStatus==1
-								&&businessItem.outDayTime!=null
 								&&perList.indexOf('tb-business-confirm')!=-1
 								&&customemrId!='1'" @click="sureZdFn(businessItem)">
-						确认账单</view>
-					<view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1
-								&&businessItem.payStatus==1&&businessItem.confirmInput==1&&customemrId!='1'" @click="fkFn(businessItem)">
-						马上支付</view>
-					<!-- <view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1&&
-									customemrId=='1'&&businessItem.payStatus<3&&businessItem.outDayTime!=null" @click="fkFn(businessItem)">
-						确认支付</view> -->
-					<view class="btn b1" v-if="customemrId=='1'&&(businessItem.realInTime==null||businessItem.chinaCarInTime==null)"
-						@click="rcFn(businessItem)">确认入场</view>
-					<view class="btn b1"
-					 v-if="customemrId=='1'
-					&&businessItem.complete==1
-					&&businessItem.payStatus>1
-					&&businessItem.adminConfirmPay==1
-					&&businessItem.adminConfirmOut==0"
-						@click="cc(businessItem)">确认离场</view>
+						支付账单</view>
+					<!-- <view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1
+								&&businessItem.payStatus==1&&customemrId!='1'" @click="fkFn(businessItem)">
+						马上支付</view> -->
+						<view class="btn b3" @click="toDetail(businessItem)">详情</view>
 					<view class="btn b1" v-if="businessItem.confirmInput==0" @click="editFn(businessItem)">修改</view>
-					<view class="btn b3" @click="toDetail(businessItem)">详情</view>
 					<view class="btn b4" v-if="businessItem.payStatus==1
 								&&businessItem.confirmInput==0
-								&&businessItem.realInTime==null
-								&&businessItem.outDayTime==null
 								&&perList.indexOf('tb-business-add')!=-1" @click="deleteFn(businessItem)">删除</view>
 				</view>
 			</view>
@@ -174,7 +146,7 @@
 				this.$common.to('/pages/business-order/createOrder?id=' + data.id)
 			},
 			sureZdFn(data) {
-				this.$common.to('/pages/business-order/sureOrder?id=' + data.id)
+				this.$common.to('/pages/wx/payOrderTemp?id=' + data.id)
 			},
 			fkFn(data) {
 				this.$common.to('/pages/business-order/surePay?id=' + data.id)

+ 1 - 4
app/pages/business-order/sureOrder.vue

@@ -44,12 +44,11 @@
 				</view>
 			</view>
 		</view>
-		<u-button type="primary" @click="confirmFn">确认</u-button>
+		<u-button type="primary" @click="confirmFn">马上支付</u-button>
 	</view>
 </template>
 
 <script>
-	import request from '../../utils/request.js'
 	export default {
 		data() {
 			return {
@@ -57,8 +56,6 @@
 				form: {
 					partMoney: 0
 				},
-				imgList: [],
-				uploadImageUrl: request.server + '/upload/image',
 			}
 		},
 		onLoad(options) {

+ 147 - 43
app/pages/wx/pay.vue

@@ -1,8 +1,13 @@
 <template>
 	<view>
 		<view class="box">
-			<u-search placeholder="输入车牌号查询" shape="square" v-model="p.carNo" @search="searchFn()" @change="searchFn"
-				:height="80">
+			<view class="top" style="padding-top: 50rpx;">
+				<text class="title">支付</text>
+			</view>
+			<u-search placeholder="输入车牌号查询" 
+			shape="square" v-model="p.carNo"
+			 @search="searchFn()" @change="searchFn"
+				:height="80" style="margin: 30rpx;">
 			</u-search>
 		</view>
 		<view class="list" v-show="list.length>0">
@@ -13,28 +18,47 @@
 			</u-radio-group>
 		</view>
 		<view class="car-list" v-show="cars.length>0">
-			<view>停车费:</view>
-			<view class="item" v-for="item in cars" style="margin: 20rpx 0 0 40rpx;">
-				<view class="l">{{item.carNo}}:{{item.price}}元</view>
+			<view class="card">
+				<view class="title">
+					停车费:
+				</view>
+				<view v-for="(tingcheItem,index) in cars" :key="index">
+					<label class="c-item">
+						<view class="c">{{tingcheItem.carNo}}</view>
+						<view class="r">{{tingcheItem.price}}元</view>
+					</label>
+				</view>
 			</view>
-		</view>
-		<view class="car-list" v-show="item.itemsPrice" style="margin-top:40rpx;">
-			<view>业务费:{{item.itemsPrice}}元</view>
-			<view class="item" v-for="item in item.list" style="margin: 20rpx 0 0 40rpx;">
-				<view class="l">{{item.name}}:{{item.price}}元</view>
+
+			<view class="card" v-if="item.itemsPrice">
+				<view class="title">
+					业务费:{{item.itemsPrice}}元
+				</view>
+				<view v-for="(yewuItem,index) in item.list" :key="index">
+					<label class="c-item">
+						<view class="c">{{yewuItem.name}}</view>
+						<view class="r">{{yewuItem.price}}元</view>
+					</label>
+				</view>
 			</view>
 		</view>
-		<view class="item" v-if="total">
-			<view>
-				合计费用:{{total}}元
-			</view>
-			<u-radio-group style="margin: 50rpx 0 20rpx 30rpx;" v-model="form.payType" placement="column"
+	
+		<view class="bottom bgc-f bottom-safety" v-if="total>0">
+			<!-- <u-radio-group style="margin: 50rpx 0 20rpx 30rpx;" v-model="form.payType" placement="column"
 				@change="payTypeChange">
 				<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in payTypeList" :key="index"
 					:label="item.name" :name="item.value">
 				</u-radio>
-			</u-radio-group>
-			<u-button type="primary" @click="confirmPayFn">立即支付</u-button>
+			</u-radio-group> -->
+			<view class="box">
+				<view class="l">
+					<text class="t1">金额:</text>
+					<text class="t2">¥{{total}}元</text>
+				</view>
+				<view class="r">
+					<view class="btn" @click="confirmPayFn()">立即支付</view>
+				</view>
+			</view>
 		</view>
 	</view>
 
@@ -51,8 +75,8 @@
 				code: '',
 				selectNo: '',
 				openid: '',
-				businessId:'',
-				state:'',
+				businessId: '',
+				state: '',
 				list: [],
 				cars: [],
 				item: {
@@ -60,7 +84,7 @@
 					businessId: '',
 					list: []
 				},
-				total:0,
+				total: 0,
 				payTypeList: [{
 					name: '微信支付',
 					value: 3
@@ -69,12 +93,12 @@
 					partMoney: 0,
 					payType: 3
 				},
-				
+
 			}
 		},
 		onLoad(options) {
 			this.code = options.code;
-			this.state=options.state;
+			this.state = options.state;
 			this.getOpenidByCode();
 		},
 		created() {},
@@ -99,7 +123,6 @@
 						jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表
 					});
 					jweixin.ready(function() {
-						console.log('111')
 
 					});
 					jweixin.error(function(res) {
@@ -108,18 +131,21 @@
 				})
 			},
 			confirmPayFn() {
+				let businessId = this.state == 'STATE' ? this.businessId : null;
+				let carId = this.state == 'STATE' ? null : this.cars.map(obj => obj.id).join(',')
 				let p = {
-					businessId: this.businessId,
-					carId: this.cars.map(obj=>obj.id).join(','),
+					businessId: businessId,
+					carId: carId,
 					money: this.total,
 					tradeType: "JSAPI",
 					openid: this.openid
 				}
-				this.$api.getPrePay(p).then(resp => {
+				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
-					let that=this;
+					let that = this;
 					jweixin.chooseWXPay({
-						timestamp: data.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
+						timestamp: data
+							.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
 						nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
 						package: data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
 						signType: data.signType, // 微信支付V3的传入RSA,微信支付V2的传入格式与V2统一下单的签名格式保持一致
@@ -127,6 +153,9 @@
 						success: function(res) {
 							if (res.errMsg === "chooseWXPay:ok") {
 								that.$common.toast('支付成功')
+								that.cars=[];
+								that.item.list=[];
+								that.total=0
 								// wx.closeWindow();
 							}
 						}
@@ -152,19 +181,23 @@
 			},
 			groupChange(value) {
 				this.list = [];
-				this.businessId=value;
+				this.businessId = value;
 				this.$api.getBusinessMoney({
 					businessId: value,
-					state:this.state
+					state: this.state
 				}).then(resp => {
 					let data = resp.data;
 					this.cars = data.carList;
-					this.total=data.total;
+					this.total = data.total;
 					Object.assign(this.item, {
 						itemsPrice: data.itemsPrice,
 						businessId: value,
 						list: data.itemList
 					})
+					if(data.total==0){
+						this.$common.toast('您无需缴费');
+						this.p.carNo=''
+					}
 				})
 			},
 			searchFn() {
@@ -186,21 +219,92 @@
 		background-color: #fff;
 	}
 
-	.box {
+	.card {
+		.title {
+			padding: 30rpx;
+			box-sizing: border-box;
+			font-size: 34rpx;
+			font-weight: bold;
+		}
+	}
+
+	.content {
 		display: flex;
-		flex: 1;
-		align-items: center;
-		justify-content: center;
 		flex-direction: column;
-		padding: 40rpx 0;
+		padding: 30rpx;
+		box-sizing: border-box;
+		color: #999;
 	}
 
-	.list {
-		margin-left: 120rpx;
-		width: 380rpx;
-		border-radius: 5rpx;
-		//background-color: rgb(242, 242, 242);
-		margin-top: -35rpx;
-		padding: 20rpx;
+	.c-item {
+		display: flex;
+		align-items: center;
+		margin: 15rpx 30rpx;
+		padding: 40rpx 30rpx;
+		border-radius: 10rpx;
+		background-color: #fff;
+		border: 1rpx solid #f5f5f5;
+
+		.l {}
+
+		.c {
+			font-size: 30rpx;
+			color: #191919;
+			font-weight: bold;
+			margin-left: 20rpx;
+		}
+
+		.r {
+			font-size: 30rpx;
+			color: #ff4200;
+			font-weight: bold;
+			margin-left: auto;
+		}
 	}
+
+	.bottom {
+		min-height: 100rpx;
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+
+		.box {
+			display: flex;
+			width: 100%;
+			min-height: 100rpx;
+			align-items: center;
+
+			.l {
+				padding-left: 30rpx;
+				flex: 2;
+
+				.t1 {
+					color: #333;
+				}
+
+				.t2 {
+					color: #ff4200;
+					font-size: 38rpx;
+					font-weight: bold;
+				}
+			}
+
+			.r {
+				flex: 1;
+
+				.btn {
+					background-color: #ff4200;
+					min-height: 100rpx;
+					display: flex;
+					color: #fff;
+					font-size: 30rpx;
+					align-items: center;
+					justify-content: center;
+				}
+			}
+		}
+	}
+
+	@import '@/common/common.scss'
 </style>

+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-// const server = 'http://127.0.0.1:8099/pro';
+const server = 'http://127.0.0.1:8099/pro';
 // const server = 'http://47.101.143.145/pro';
- const server = 'https://dxkaa1.bgigc.com/pro';
+ // const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

+ 62 - 57
sp-admin/sa-view/tb-business-car/tb-business-car-add.html

@@ -3,7 +3,8 @@
 	<head>
 		<title>-添加/修改</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 		<!-- 所有的 css js 资源 -->
 		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
@@ -14,8 +15,17 @@
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 		<style type="text/css">
-			.c-panel .el-form .c-label{width: 7em !important;}
-			.c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+			.china-car-size .el-input__inner {
+				width: 130px;
+			}
 		</style>
 	</head>
 	<body>
@@ -23,18 +33,25 @@
 			<!-- ------- 内容部分 ------- -->
 			<div class="s-body">
 				<div class="c-panel">
-                    <div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-if="id == 0">数据添加</div>
 					<div class="c-title" v-else>数据修改</div>
 					<el-form v-if="m">
-						<sa-item type="text" name="" v-model="m.id" br></sa-item>
-						<sa-item type="text" name="" v-model="m.businessId" br></sa-item>
-						<sa-item type="text" name="" v-model="m.carNo" br></sa-item>
-						<sa-item type="text" name="" v-model="m.preInTime" br></sa-item>
-						<sa-item type="text" name="" v-model="m.preOutTime" br></sa-item>
-						<sa-item type="text" name="" v-model="m.realInTime" br></sa-item>
-						<sa-item type="text" name="" v-model="m.realOutTime" br></sa-item>
-						<sa-item type="text" name="" v-model="m.money" br></sa-item>
-						<sa-item type="text" name="" v-model="m.driverPhone" br></sa-item>
+						<sa-item type="text" name="车牌号" v-model="m.carNo" br></sa-item>
+						<div class="c-item">
+							<label class="c-label"><span style="color: red;">*</span>车辆规格:</label>
+							<el-input-number class="china-car-size" v-model="m.carSize" controls-position="right"
+								:min="4.2" :max="50"></el-input-number>
+						</div>
+						<div class="c-item">
+							<label class="c-label">联系人:</label>
+							<el-input v-model="m.driverName" placeholder="联系人" readonly>
+							</el-input>
+						</div>
+						<div class="c-item">
+							<label class="c-label">联系号码:</label>
+							<el-input v-model="m.driverPhone" placeholder="联系人" readonly>
+							</el-input>
+						</div>
 						<sa-item name="" class="s-ok" br>
 							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
 						</sa-item>
@@ -47,82 +64,70 @@
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
 		</div>
-        <script>
-			
+		<script>
 			var app = new Vue({
 				components: {
 					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
 				},
 				el: '.vue-box',
 				data: {
-					id: sa.p('id', 0),		// 获取超链接中的id参数(0=添加,非0=修改) 
-					m: null,		// 实体对象 
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: {
+						id: '', //  
+						businessId: sa.p('businessId', -1), //  
+						carNo: '', //  
+						carSize: '', //  
+						driverName: '', //  
+						money: '', //  
+						driverPhone: '', //  
+					}, // 实体对象 
 				},
 				methods: {
-					// 创建一个 默认Model 
-					createModel: function() {
-						return {
-							id: '',		//  
-							businessId: '',		//  
-							carNo: '',		//  
-							preInTime: '',		//  
-							preOutTime: '',		//  
-							realInTime: '',		//  
-							realOutTime: '',		//  
-							money: '',		//  
-							driverPhone: '',		//  
-						}
-					},
 					// 提交数据 
-					ok: function(){
+					ok: function() {
 						// 表单校验 
 						let m = this.m;
-						sa.checkNull(m.id, '请输入 []');
-						sa.checkNull(m.businessId, '请输入 []');
-						sa.checkNull(m.carNo, '请输入 []');
-						sa.checkNull(m.preInTime, '请输入 []');
-						sa.checkNull(m.preOutTime, '请输入 []');
-						sa.checkNull(m.realInTime, '请输入 []');
-						sa.checkNull(m.realOutTime, '请输入 []');
-						sa.checkNull(m.money, '请输入 []');
-						sa.checkNull(m.driverPhone, '请输入 []');
-				
+						sa.checkNull(m.carNo, '请输入 [车牌号]');
+						sa.checkNull(m.carSize, '请输入 [车辆规格]');
+						let phone = m.driverPhone;
+						if (phone && !sa.isPhone(phone)) {
+							sa.error('联系号码不正确')
+							return;
+						}
+
 						// 开始增加或修改
-						if(this.id <= 0) {	// 添加
-							sa.ajax('/TbBusinessCar/add', m, function(res){
-								sa.alert('增加成功', this.clean); 
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbBusinessCar/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
 							}.bind(this));
-						} else {	// 修改
-							sa.ajax('/TbBusinessCar/update', m, function(res){
+						} else { // 修改
+							sa.ajax('/TbBusinessCar/update', m, function(res) {
 								sa.alert('修改成功', this.clean);
 							}.bind(this));
 						}
 					},
 					// 添加/修改 完成后的动作
 					clean: function() {
-						if(this.id == 0) {
+						if (this.id == 0) {
 							this.m = this.createModel();
 						} else {
-							parent.app.f5();		// 刷新父页面列表
-							sa.closeCurrIframe();	// 关闭本页 
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
 						}
 					}
 				},
-				mounted: function(){
+				mounted: function() {
 					// 初始化数据 
-					if(this.id <= 0) {	
-						this.m = this.createModel();
-					} else {	
+					if (this.id > 0) {
 						sa.ajax('/TbBusinessCar/getById?id=' + this.id, function(res) {
 							this.m = res.data;
-							if(res.data == null) {
+							if (res.data == null) {
 								sa.alert('未能查找到 id=' + this.id + " 详细数据");
 							}
 						}.bind(this))
 					}
 				}
 			})
-			
 		</script>
 	</body>
-</html>
+</html>

+ 25 - 18
sp-admin/sa-view/tb-business-car/tb-business-car-info.html

@@ -3,7 +3,8 @@
 	<head>
 		<title>-详情</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 		<!-- 所有的 css js 资源 -->
 		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
@@ -14,7 +15,9 @@
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 		<style type="text/css">
-			.c-panel .c-label{width: 8em;}
+			.c-panel .c-label {
+				width: 8em;
+			}
 		</style>
 	</head>
 	<body>
@@ -23,22 +26,28 @@
 			<div class="s-body">
 				<div class="c-panel">
 					<el-form v-if="m">
-						<sa-info name="" br>{{m.id}}</sa-info>
-						<sa-info name="" br>{{m.businessId}}</sa-info>
-						<sa-info name="" br>{{m.carNo}}</sa-info>
-						<sa-info name="" br>{{m.preInTime}}</sa-info>
-						<sa-info name="" br>{{m.preOutTime}}</sa-info>
-						<sa-info name="" br>{{m.realInTime}}</sa-info>
-						<sa-info name="" br>{{m.realOutTime}}</sa-info>
-						<sa-info name="" br>{{m.money}}</sa-info>
-						<sa-info name="" br>{{m.driverPhone}}</sa-info>
+						<el-row>
+							<el-col span=12>
+								<sa-info name="车牌号" br>{{m.carNo}}</sa-info>
+								<sa-info name="入场时间" br>{{m.realInTime}}</sa-info>
+								<sa-info name="离场时间" br>{{m.realOutTime}}</sa-info>
+								<sa-info name="停车费" br>{{m.money}}元</sa-info>
+							</el-col>
+							<el-col span=12>
+								<sa-info name="联系人" br>{{m.driverName}}</sa-info>
+								<sa-info name="联系号码" br>{{m.driverPhone}}</sa-info>
+								<sa-info name="状态" br>
+									<label v-if="m.isLock==1">锁定</label>
+									<label v-else>正常</label>
+								</sa-info>
+							</el-col>
+						</el-row>
 					</el-form>
 				</div>
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
-				<el-button type="success" @click="sa.closeCurrIframe()">确定</el-button>
-				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
 			</div>
 		</div>
 		<script>
@@ -48,21 +57,19 @@
 				},
 				el: '.vue-box',
 				data: {
-					id: sa.p('id', 0),	// 获取数据ID 
+					id: sa.p('id', 0), // 获取数据ID 
 					m: null
 				},
-				methods: {
-				},
+				methods: {},
 				mounted: function() {
 					sa.ajax('/TbBusinessCar/getById?id=' + this.id, function(res) {
 						this.m = res.data;
-						if(res.data == null) {
+						if (res.data == null) {
 							sa.alert('未能查找到 id=' + this.id + " 详细数据");
 						}
 					}.bind(this))
 				}
 			})
-			
 		</script>
 	</body>
 </html>

+ 76 - 90
sp-admin/sa-view/tb-business-car/tb-business-car-list.html

@@ -3,7 +3,8 @@
 	<head>
 		<title>-列表</title>
 		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 		<!-- 所有的 css & js 资源 -->
 		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
@@ -17,82 +18,73 @@
 	<body>
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
 			<div class="c-panel">
-				<!-- ------------- 检索参数 ------------- -->
-				<div class="c-title">检索参数</div>
-				<el-form ref="form" :model='p' @submit.native.prevent>
-					<sa-item type="text" name="" v-model="p.id"></sa-item>
-					<sa-item type="text" name="" v-model="p.businessId"></sa-item>
-					<sa-item type="text" name="" v-model="p.carNo"></sa-item>
-					<sa-item type="text" name="" v-model="p.preInTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.preOutTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.realInTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.realOutTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.money"></sa-item>
-					<sa-item type="text" name="" v-model="p.driverPhone"></sa-item>
-					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
-					<br />
-					<sa-item name="综合排序">
-						<el-radio-group v-model="p.sortType" class="s-radio-text">
-							<el-radio :label="0">默认</el-radio>
-							<el-radio :label="1"></el-radio>
-							<el-radio :label="2"></el-radio>
-							<el-radio :label="3"></el-radio>
-							<el-radio :label="4"></el-radio>
-							<el-radio :label="5"></el-radio>
-							<el-radio :label="6"></el-radio>
-							<el-radio :label="7"></el-radio>
-							<el-radio :label="8"></el-radio>
-							<el-radio :label="9"></el-radio>
-						</el-radio-group>
-					</sa-item>
-				</el-form>
-				<!-- ------------- 快捷按钮 ------------- -->
-				<sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>
+				<div class="fast-btn">
+					<el-button size="mini" type="primary"  @click="add()">
+						新增</el-button>
+						<el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+				</div>
 				<!-- ------------- 数据列表 ------------- -->
-				<el-table class="data-table" ref="data-table" :data="dataList" >
-					<sa-td type="selection"></sa-td>
-					<sa-td name="" prop="id" ></sa-td>
-					<sa-td name="" prop="businessId" ></sa-td>
-					<sa-td name="" prop="carNo" ></sa-td>
-					<sa-td name="" prop="preInTime" ></sa-td>
-					<sa-td name="" prop="preOutTime" ></sa-td>
-					<sa-td name="" prop="realInTime" ></sa-td>
-					<sa-td name="" prop="realOutTime" ></sa-td>
-					<sa-td name="" prop="money" ></sa-td>
-					<sa-td name="" prop="driverPhone" ></sa-td>
-					<el-table-column label="操作" fixed="right"  width="240px">
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td name="车牌号" prop="carNo"></sa-td>
+					<sa-td name="车辆规格" prop="carSize"></sa-td>
+					<sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
+					</sa-td>
+					<sa-td width=100 name="车辆状态" prop="isLock" type="switch" :jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}"
+						@change="s => updateStatus(s.row)"></sa-td>
+					<sa-td name="联系人" prop="driverName"></sa-td>
+					<sa-td name="联系号码" prop="driverPhone"></sa-td>
+					<sa-td name="入场时间" prop="realInTime" width=180></sa-td>
+					<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
+					<el-table-column label="预交停车费">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+							<label>{{s.row.basePartMoney}}</label>
+						</template>
+					</el-table-column>
+					<el-table-column label="实际停车费">
+						<template slot-scope="s">
+							<label v-if="s.row.money">{{s.row.money}}</label>
+							<label v-else>未计算</label>
+						</template>
+					</el-table-column>
+				
+					
+					<el-table-column label="操作" fixed="right" width="200px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
+							</el-button>
+							<el-button v-if="s.row.pay==0" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+							</el-button>
+							<el-button v-if="s.row.pay==0" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
+							</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
 				<!-- ------------- 分页 ------------- -->
-				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
 			</div>
 		</div>
 		<script>
 			var app = new Vue({
 				components: {
-					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),  
-					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),		
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
 				},
 				el: '.vue-box',
 				data: {
 					p: { // 查询参数  
-						id: '',		//  
-						businessId: '',		//  
-						carNo: '',		//  
-						preInTime: '',		//  
-						preOutTime: '',		//  
-						realInTime: '',		//  
-						realOutTime: '',		//  
-						money: '',		//  
-						driverPhone: '',		//  
-						pageNo: 1,		// 当前页 
-						pageSize: 10,	// 页大小 
-						sortType: 0		// 排序方式 
+						id: '', //  
+						businessId: sa.p('id', '-1'), //  
+						carNo: '', //  
+						preInTime: '', //  
+						preOutTime: '', //  
+						realInTime: '', //  
+						realOutTime: '', //  
+						money: '', //  
+						driverPhone: '', //  
+						pageNo: 1, // 当前页 
+						pageSize: 10, // 页大小 
+						sortType: 0 // 排序方式 
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合 
@@ -103,28 +95,20 @@
 						sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
-							sa.f5TableHeight();		// 刷新表格高度 
+							sa.f5TableHeight(); // 刷新表格高度 
 						}.bind(this));
 					},
 					// 查看
 					get: function(data) {
-						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id, '1050px', '90%');
-					},
-					// 查看 - 根据选中的
-					getBySelect: function(data) {
-						var selection = this.$refs['data-table'].selection;
-						if(selection.length == 0) {
-							return sa.msg('请选择一条数据')
-						}
-						this.get(selection[0]);
+						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id+'&businessId='+this.p.businessId, '800px', '80%');
 					},
 					// 修改
 					update: function(data) {
-						sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id, '1000px', '90%');
+						sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id+'&businessId='+this.p.businessId, '500px', '70%');
 					},
 					// 新增
 					add: function(data) {
-						sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1', '1000px', '90%');
+						sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1'+'&businessId='+this.p.businessId, '550px', '80%');
 					},
 					// 删除
 					del: function(data) {
@@ -132,26 +116,28 @@
 							sa.ajax('/TbBusinessCar/delete?id=' + data.id, function(res) {
 								sa.arrayDelete(this.dataList, data);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							}.bind(this))
 						}.bind(this));
 					},
-					// 批量删除
-					deleteByIds: function() {
-						// 获取选中元素的id列表 
-						let selection = this.$refs['data-table'].selection;
-						let ids = sa.getArrayField(selection, 'id');
-						if(selection.length == 0) {
-							return sa.msg('请至少选择一条数据')
-						}
-						// 提交删除 
-						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
-							sa.ajax('/TbBusinessCar/deleteByIds', {ids: ids.join(',')}, function(res) {
-								sa.arrayDelete(this.dataList, selection);
-								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
-							}.bind(this))
+					// 改 - 状态(0=否,1=是)
+					updateStatus: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.isLock;
+						var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
+							id: data.id,
+							value: data.isLock
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
 						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.isLock = oldValue;
+							}
+						})
 					},
 				},
 				created: function() {

+ 1 - 2
sp-admin/sa-view/tb-business/tb-business-add.html

@@ -98,7 +98,6 @@
 													<i class="el-icon-folder-add"></i>
 												</div>
 											</el-input>
-											</el-autocomplete>
 										</div>
 									</div>
 								</el-card>
@@ -232,7 +231,7 @@
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>车辆规格:</label>
 							<el-input-number class="china-car-size" v-model="car.form.carSize" controls-position="right"
-								:min="1" :max="50"></el-input-number>
+								:min="4.2" :max="50"></el-input-number>
 						</div>
 						<div class="c-item">
 							<label class="c-label">联系人:</label>

+ 0 - 117
sp-admin/sa-view/tb-business/tb-business-car-list.html

@@ -1,117 +0,0 @@
-<!DOCTYPE html>
-<html>
-	<head>
-		<title>-列表</title>
-		<meta charset="utf-8">
-		<meta name="viewport"
-			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
-		<!-- 所有的 css & js 资源 -->
-		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
-		<link rel="stylesheet" href="../../static/sa.css">
-		<script src="../../static/kj/vue.min.js"></script>
-		<script src="../../static/kj/element-ui/index.js"></script>
-		<script src="../../static/kj/httpVueLoader.js"></script>
-		<script src="../../static/kj/jquery.min.js"></script>
-		<script src="../../static/kj/layer/layer.js"></script>
-		<script src="../../static/sa.js"></script>
-	</head>
-	<body>
-		<div class="vue-box" style="display: none;" :style="'display: block;'">
-			<div class="c-panel">
-				<!-- ------------- 数据列表 ------------- -->
-				<el-table class="data-table" ref="data-table" :data="dataList">
-					<sa-td type="selection"></sa-td>
-					<sa-td name="车牌号" prop="carNo"></sa-td>
-					<sa-td name="车辆规格" prop="carSize"></sa-td>
-					<sa-td name="联系人" prop="driverName"></sa-td>
-					<sa-td name="联系号码" prop="driverPhone"></sa-td>
-					<sa-td name="入场时间" prop="realInTime"></sa-td>
-					<sa-td name="离场时间" prop="realOutTime"></sa-td>
-					<el-table-column label="停车费">
-						<template slot-scope="s">
-							<label v-if="s.row.money">{{s.row.money}}</label>
-							<label v-else>{{s.row.basePartMoney}}</label>
-						</template>
-					</el-table-column>
-					<sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
-					</sa-td>
-					<sa-td name="状态" prop="isLock" type="switch" :jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}"
-						@change="s => updateStatus(s.row)"></sa-td>
-					<!-- 	<el-table-column label="操作" fixed="right" width="240px">
-						<template slot-scope="s">
-							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
-							</el-button>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
-							</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
-							</el-button>
-						</template>
-					</el-table-column> -->
-				</el-table>
-				<!-- ------------- 分页 ------------- -->
-				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
-				</sa-item>
-			</div>
-		</div>
-		<script>
-			var app = new Vue({
-				components: {
-					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
-					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
-				},
-				el: '.vue-box',
-				data: {
-					p: { // 查询参数  
-						id: '', //  
-						businessId: sa.p('id', '-1'), //  
-						carNo: '', //  
-						preInTime: '', //  
-						preOutTime: '', //  
-						realInTime: '', //  
-						realOutTime: '', //  
-						money: '', //  
-						driverPhone: '', //  
-						pageNo: 1, // 当前页 
-						pageSize: 10, // 页大小 
-						sortType: 0 // 排序方式 
-					},
-					dataCount: 0,
-					dataList: [], // 数据集合 
-				},
-				methods: {
-					// 刷新
-					f5: function() {
-						sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
-							this.dataList = res.data; // 数据
-							this.dataCount = res.dataCount; // 数据总数 
-							sa.f5TableHeight(); // 刷新表格高度 
-						}.bind(this));
-					},
-					// 改 - 状态(0=否,1=是)
-					updateStatus: function(data) {
-						// 声明变量记录是否成功 
-						var isOk = false;
-						var oldValue = data.isLock;
-						var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
-							id: data.id,
-							value: data.isLock
-						}, function(res) {
-							isOk = true;
-							sa.msg('修改成功');
-						}.bind(this));
-						// 如果未能修改成功, 则回滚 
-						$.when(ajax).done(function() {
-							if (isOk == false) {
-								data.isLock = oldValue;
-							}
-						})
-					},
-				},
-				created: function() {
-					this.f5();
-					sa.onInputEnter();
-				}
-			})
-		</script>
-	</body>
-</html>

+ 63 - 39
sp-admin/sa-view/tb-business/tb-business-info.html

@@ -29,44 +29,69 @@
 				<div class="c-panel">
 					<el-form v-if="m">
 						<el-row>
-							<el-col span="12">
-								<sa-info name="客户名称" br>{{m.customerName}}</sa-info>
-
-								<sa-info name="业务编号" br>{{m.no}}</sa-info>
-								<sa-info name="境外车牌号" br>{{m.cardNo}}</sa-info>
-								<sa-info name="境外车规格" br>{{m.cardSize}}(米)</sa-info>
-								<sa-info name="入场时间" br>
-									<label v-if="m.realInTime">{{m.realInTime}}</label>
-									<label v-else>未入场</label>
-								</sa-info>
-								<sa-info name="出场时间" br>{{m.outDayTime}}</sa-info>
-								<!-- <sa-info name="停车时长" br>{{m.partTime}}(分)</sa-info> -->
-								<sa-info name="货物" br>{{m.goodsName}}</sa-info>
-								<sa-info name="载重" br>{{m.netWeight}}(吨)</sa-info>
-								<sa-info type="enum" name="支付状态" :value="m.payStatus"
-									:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
-								<sa-info name="支付人" br>{{m.payBy}}</sa-info>
-								<sa-info name="支付时间" br>{{m.payTime}}</sa-info>
-								<sa-info type="img-list" name="支付凭证" :value="m.payTicket" br></sa-info>
-
-							</el-col>
-							<el-col span="12">
-
-								<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
-								<sa-info name="录入人" br>{{m.createBy}}</sa-info>
-								<sa-info name="中国车牌" br>{{m.chinaCarNo}}</sa-info>
-								<sa-info name="中国司机" br>{{m.driverName}}</sa-info>
-								<sa-info name="联系号码" br>{{m.driverPhone}}</sa-info>
-								<sa-info name="入场时间" br>{{m.chinaCarInTime}}</sa-info>
-								<sa-info name="出场时间" br>{{m.chinaCarOutTime}}</sa-info>
-								<sa-info name="确认时间" br>{{m.confirmInputTime}}</sa-info>
-								<sa-info name="确认人" br>{{m.confirmInputBy}}</sa-info>
-								<sa-info name="境外车停车费" br>{{m.partMoney}}(元)</sa-info>
-								<sa-info name="中国车停车费用" br>{{m.chinaPartMoney}}(元)</sa-info>
-								<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
-								<sa-info name="合计费用" br>{{m.totalMoney}}(元)</sa-info>
-
-							</el-col>
+							<el-collapse value='1'>
+								<el-collapse-item name="1">
+									<div slot="title">
+										基础资料
+									</div>
+									<div>
+									<el-row>
+										<el-col span="12">
+											<sa-info name="客户名称" br>{{m.customerName}}</sa-info>
+											<sa-info name="业务编号" br>{{m.no}}</sa-info>
+											<sa-info name="境外车牌号" br>{{m.cardNo}}</sa-info>
+											<sa-info name="境外车规格" br>{{m.cardSize}}(米)</sa-info>
+											<sa-info name="货物" br>{{m.goodsName}}</sa-info>
+											<sa-info name="载重" br>{{m.netWeight}}(吨)</sa-info>
+											<sa-info type="enum" name="支付状态" :value="m.payStatus"
+												:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
+										</el-col>
+										<el-col span="12">
+											<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
+											<sa-info name="录入人" br>{{m.createBy}}</sa-info>
+											<sa-info name="中国车牌" br>{{m.chinaCarNo}}</sa-info>
+											<sa-info name="预交停车费" br>{{m.partMoney+m.chinaPartMoney}}(元)</sa-info>
+											<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
+											<sa-info name="合计费用" br>{{m.totalMoney}}(元)</sa-info>
+												<sa-info name="支付时间" br>{{m.payTime}}</sa-info>
+										</el-col>
+									</el-row>
+									</div>
+								</el-collapse-item>
+							</el-collapse>
+							
+						</el-row>
+						<el-row>
+							<el-collapse value='1'>
+								<el-collapse-item name="1">
+									<div slot="title">
+										车辆信息
+									</div>
+									<el-table :data="m.cars" style="width: 100%">
+										<sa-td name="车牌号" prop="carNo"></sa-td>
+										<sa-td name="车辆规格" prop="carSize"></sa-td>
+										<sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
+										</sa-td>
+										<sa-td width="120" name="支付状态" prop="isLock" type="enum" :jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}">
+										</sa-td>
+										<sa-td name="联系人" prop="driverName"></sa-td>
+										<sa-td name="联系号码" prop="driverPhone"></sa-td>
+										<sa-td name="入场时间" prop="realInTime" width=180></sa-td>
+										<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
+										<el-table-column label="预交停车费">
+											<template slot-scope="s">
+												<label>{{s.row.basePartMoney}}</label>
+											</template>
+										</el-table-column>
+										<el-table-column label="实际停车费">
+											<template slot-scope="s">
+												<label v-if="s.row.money">{{s.row.money}}</label>
+												<label v-else>未计算</label>
+											</template>
+										</el-table-column>
+									</el-table>
+								</el-collapse-item>
+							</el-collapse>
 						</el-row>
 						<el-row>
 							<el-collapse value='1'>
@@ -97,7 +122,6 @@
 											</template>
 										</el-table-column>
 									</el-table>
-
 								</el-collapse-item>
 							</el-collapse>
 						</el-row>

+ 7 - 8
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -69,13 +69,12 @@
 					<sa-td width="130" name="支付状态" prop="payStatus" type="enum"
 						:jv="{1: '未支付[#ff0000]', 2: '已支付(未确认)[#ffaa00]', 3: '已支付(已确认)[#005500]'}"></sa-td>
 					<sa-td width="160" name="支付时间" prop="payTime"></sa-td>
-					<sa-td name="支付凭证" prop="payTicket" type="img-list"></sa-td>
+					<!-- <sa-td name="支付凭证" prop="payTicket" type="img-list"></sa-td> -->
 					<!-- 	<sa-td  name="放行状态" prop="adminConfirmPay" type="enum"
 						:jv="{0: '不可放行[#ff0000]', 1: '可放行[#005500]'}"></sa-td> -->
 					<!-- <sa-td name="入场时间" width="140" prop="realInTime"></sa-td>
 					<sa-td name="离场时间" width="140" prop="outDayTime"></sa-td> -->
 					<sa-td width="160" name="录入时间" prop="createTime"></sa-td>
-					<sa-td name="账单确认" prop="confirmInput" type="enum" :jv="{0: '未确认[#ff0000]', 1: '已确认[#005500]'}">
 					</sa-td>
 					<el-table-column label="操作" width="240px" fixed="right">
 						<template slot-scope="s">
@@ -89,17 +88,17 @@
 							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
 								&&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" @click="payFn(s.row)">
 								马上支付</el-button>
-							<el-button class="c-btn" type="primary" @click="carFn(s.row)">司机
+							<el-button class="c-btn" type="primary" @click="carFn(s.row)">车辆
 							</el-button>
-							<el-button class="c-btn" type="primary"
+							<!-- <el-button class="c-btn" type="primary"
 								v-if="currentCustomerId=='1'&&(s.row.realInTime==null||s.row.chinaCarInTime==null)"
 								@click="inFn(s.row)">确认入场
-							</el-button>
-							<el-button class="c-btn" type="primary" v-if="currentCustomerId=='1'&&s.row.complete==1
+							</el-button> -->
+							<!-- <el-button class="c-btn" type="primary" v-if="currentCustomerId=='1'&&s.row.complete==1
 							 &&s.row.payStatus>1
 							 &&s.row.adminConfirmPay==1
 							 &&s.row.adminConfirmOut==0" @click="outFn(s.row)">确认离场
-							</el-button>
+							</el-button> -->
 							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
 								&&currentCustomerId=='1'
 								&&s.row.payStatus==2
@@ -290,7 +289,7 @@
 				},
 				methods: {
 					carFn(data) {
-						sa.showIframe('车辆司机', 'tb-business-car-list.html?id=' + data.id, '1050px', '90%');
+						sa.showIframe('车辆管理', '../tb-business-car/tb-business-car-list.html?id=' + data.id, '1050px', '95%');
 					},
 					blurFn() {
 						console.log(123)

+ 1 - 1
sp-admin/static/sa.js

@@ -22,7 +22,7 @@ var sa = {
 		api_url: 'https://dxkaa1.bgigc.com/pro',
 		web_url: 'http://www.baidu.com'
 	}
-	sa.cfg = cfg_prod; // 最终环境 , 上线前请选择正确的环境
+	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境
 })();
 
 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-27528
+32524

+ 3 - 2
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -48,6 +48,7 @@ public class OpenService {
     }
 
     private void handlerIn(String carNo, String channel) {
+        carNo=carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findNotInCar(carNo);
         Date now = new Date();
         if (tbBusinessCar == null) {
@@ -79,7 +80,7 @@ public class OpenService {
             return ResultJson.success();
         }
         BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now, tbBusinessCar.getCarSize());
-        double dif = price.subtract(tbBusinessCar.getBasePartMoney()).doubleValue();
+        double dif = price.subtract(tbBusinessCar.getMoney()).doubleValue();
         if (dif > 0) {
             tbBusinessCar.setPay(0);
             tbBusinessCarService.updateById(tbBusinessCar);
@@ -89,7 +90,7 @@ public class OpenService {
         if (business.getPayStatus() != 3 && business.getCustomerType() != 2) {
             return ResultJson.error("请缴纳业务费用");
         }
-        tbBusinessCar.setRealOutTime(now);
+        tbBusinessCar.setRealOutTime(now).setOutChannel(channel);
         tbBusinessCarService.updateById(tbBusinessCar);
         return ResultJson.success();
     }

+ 29 - 24
sp-server/src/main/java/com/pj/api/wx/WxService.java

@@ -63,37 +63,37 @@ public class WxService {
         String carIds = request.getParameter("carId");
         String openid = request.getParameter("openid");
         String businessId = request.getParameter("businessId");
-        BigDecimal price = new BigDecimal("0");
+        Attach atchMap = new Attach();
+        atchMap.setC(carIds).setB(businessId);
+        String out_trade_no = RandomUtil.randomString(32);
         if (StrUtil.isNotEmpty(businessId)) {
             TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-            List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
-            price = price.add(tbBusiness.getItemPrice());
-            for (TbBusinessCar car : cars) {
-                price = price.add(car.getBasePartMoney());
-            }
+            out_trade_no = tbBusiness.getNo();
         } else {
-            for (String carId : StrUtil.splitTrim(carIds, ",")) {
-                TbBusinessCar businessCar = tbBusinessCarService.getById(carId);
-                price=price.add(businessCar.getBasePartMoney());
+            for (String id : StrUtil.splitTrim(carIds, ",")) {
+                TbBusinessCar car = tbBusinessCarService.getById(id);
+                String bId = car.getBusinessId();
+                TbBusiness tbBusiness = tbBusinessService.getById(bId);
+                out_trade_no = tbBusiness.getNo();
+                break;
             }
         }
-        Attach atchMap = new Attach();
-        atchMap.setC(carIds).setB(businessId);
-        TbBusiness tbBusiness = tbBusinessService.getById(businessId);
         Map<String, String> params = new HashMap<>();
         params.put("appid", wxConfig.getAppId());
         params.put("mch_id", wxConfig.getMachId());
         params.put("openid", openid);
         params.put("nonce_str", RandomUtil.randomString(32));
         params.put("body", "支付中心-业务订单支付");
-        params.put("out_trade_no", tbBusiness.getNo());
+        params.put("out_trade_no", out_trade_no);
         params.put("attach", JSONUtil.toJsonStr(atchMap));
-//        params.put("total_fee", new BigDecimal(100).multiply(price).intValue() + "");
-        params.put("total_fee", "1");
+        String total_free = Integer.parseInt(money) * 100 + "";
+        log.info("pay free:{}", total_free);
+        params.put("total_fee", total_free);
+        // params.put("total_fee", "1");
         params.put("spbill_create_ip", getIpAddress(request));
         params.put("notify_url", myConfig.getDomain() + "/wx/notify");
         params.put("trade_type", tradeType);
-        params.put("scene_info", SceneInfoBO.getSceneInfo(myConfig.getDomain(), "场站管理系统"));
+        params.put("scene_info", SceneInfoBO.getSceneInfo(myConfig.getDomain(), wxConfig.getTitle()));
         String sign = wxUtils.sign(params, wxConfig.getKey());
         log.info("wx pay sign result:{}", sign);
         params.put("sign", sign);
@@ -152,7 +152,7 @@ public class WxService {
     public void WxNotify(HttpServletRequest request) throws Exception {
         Map<String, Object> result = wxUtils.msgToMap(request);
         String total_fee = result.get("total_fee").toString();
-        BigDecimal money=new BigDecimal(total_fee).divide(new BigDecimal(100), 2, BigDecimal.ROUND_UP);
+        BigDecimal money = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, BigDecimal.ROUND_UP);
         log.info("wx pay notify;{}", JSONUtil.toJsonStr(result));
         String tradeNo = result.get("out_trade_no").toString();
         String attachStr = result.get("attach") == null ? "" : result.get("attach").toString();
@@ -163,19 +163,24 @@ public class WxService {
             String businessId = attach.getB();
             if (StrUtil.isNotEmpty(businessId)) {
                 TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-                tbBusiness.setPayTime(now).setPayType(3).setPayStatus(3).setAdminConfirmPay(1).setPayNo(transactionId);
+                if (tbBusiness.getPayStatus()==2){
+                    return;
+                }
+                tbBusiness.setPayTime(now).setPayType(3)
+                        .setPayStatus(3).setAdminConfirmPay(1)
+                        .setConfirmInput(1).setConfirmInputTime(now)
+                        .setPayNo(transactionId);
                 tbBusinessService.updateById(tbBusiness);
+                List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
+                cars.forEach(tbBusinessCar -> tbBusinessCar.setPay(1).setPayTime(now).setMoney(tbBusinessCar.getBasePartMoney()));
+                tbBusinessCarService.updateBatchById(cars);
             }
             String carIds = attach.getC();
-            if (StrUtil.isNotEmpty(carIds)) {
+            if (StrUtil.isNotEmpty(carIds) && StrUtil.isEmpty(businessId)) {
                 StrUtil.splitTrim(carIds, ",").forEach(id -> {
                     TbBusinessCar car = tbBusinessCarService.getById(id);
                     car.setPay(1);
-                    if (StrUtil.isEmpty(businessId)){
-                        car.setMoney(car.getBasePartMoney().add(money));
-                    }else {
-                        car.setMoney(car.getBasePartMoney());
-                    }
+                    car.setMoney(car.getBasePartMoney().add(money));
                     tbBusinessCarService.updateById(car);
                 });
             }

+ 1 - 0
sp-server/src/main/java/com/pj/current/config/WxConfig.java

@@ -8,6 +8,7 @@ import org.springframework.stereotype.Component;
 @Component
 @Data
 public class WxConfig {
+    private String title;
     private String appId;
     private String machId;
     private String key;

+ 27 - 23
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -116,12 +116,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
      * 增
      */
     public AjaxJson addOrUpdate(TbBusiness t) {
-        if (checkCarNo(t.getCardNo()) != null && StrUtil.isEmpty(t.getId())) {
-            return AjaxJson.getError("该车辆【" + t.getCardNo() + "】有未完成业务");
-        }
-        if (checkCarNo(t.getChinaCarNo()) != null && StrUtil.isEmpty(t.getId())) {
-            return AjaxJson.getError("该车辆【" + t.getChinaCarNo() + "】有未完成业务");
-        }
         double carSize = t.getCardSize();
         if (carSize > carConfig.getMaxLength()) {
             return AjaxJson.getError("车辆规格不能大于" + carConfig.getMaxLength());
@@ -163,9 +157,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     .setUnit(tbItem.getUnit()).setTotal(NumberUtil.mul(num, tbItem.getPrice()));
         }
         List<TbBusinessCar> carList = JSONUtil.toList(t.getCarJson(), TbBusinessCar.class);
-        t.setChinaCarNo(carList.stream().map(TbBusinessCar::getCarNo).collect(Collectors.joining("、")));
+        String chinaCarNo=carList.stream().map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
+        t.setChinaCarNo(StrUtil.isNotEmpty(chinaCarNo)?chinaCarNo.toUpperCase():"");
         carList.forEach(tbBusinessCar -> {
-            String carNo = tbBusinessCar.getCarNo();
+            String carNo = tbBusinessCar.getCarNo().toUpperCase();
             TbBusinessCar db = tbBusinessCarService.findByBusinessIdAndCarNo(t.getId(), carNo);
             if (db != null) {
                 tbBusinessCar.setId(db.getId());
@@ -175,8 +170,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 tbBusinessCar.setId(car.getId()).setRealInTime(car.getRealInTime());
             }
             tbBusinessCar.setBusinessId(t.getId());
+            tbBusinessCar.setCarNo(carNo);
         });
-        String yueCarNo = t.getCardNo();
+        String yueCarNo = t.getCardNo().toUpperCase();
         TbBusinessCar yueCar = tbBusinessCarService.findInAndNoBusinessCar(yueCarNo);
         if (yueCar == null) {
             yueCar = new TbBusinessCar();
@@ -184,7 +180,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo);
         carList.add(yueCar);
         tbBusinessCarService.saveOrUpdateBatch(carList);
-        t.setItemPrice(price).setTotalMoney(price);
+        BigDecimal initCarPartMoney = partConfig.getBasePrice();
+        t.setItemPrice(price)
+                .setTotalMoney(price.add(initCarPartMoney.multiply(new BigDecimal(carList.size()))))
+                .setChinaPartMoney(initCarPartMoney.multiply(new BigDecimal(carList.size() - 1)))
+                .setPartMoney(initCarPartMoney);
         this.saveOrUpdate(t);
         tbBusinessItemService.saveBatch(items);
 
@@ -418,22 +418,26 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         List<Map<String, Object>> carsList = new ArrayList<>();
         final BigDecimal[] total = {new BigDecimal("0")};
         cars.forEach(tbBusinessCar -> {
-            if (tbBusinessCar.getPay() == 0 ) {
-                double partMoney = tbBusinessCar.getBasePartMoney().doubleValue();
-                if (!StrUtil.equals("STATE",state)) {
-                    BigDecimal price = this.calculationPartMoney(tbBusinessCar.getRealInTime(), now, tbBusinessCar.getCarSize());
+            double partMoney = tbBusinessCar.getBasePartMoney().doubleValue();
+            if (!StrUtil.equals("STATE", state)) {
+                Date inTime=tbBusinessCar.getRealInTime();
+                if (inTime!=null){
+                    BigDecimal price = this.calculationPartMoney(inTime, now, tbBusinessCar.getCarSize());
+                    BigDecimal money=tbBusinessCar.getMoney();
                     BigDecimal basePrice = tbBusinessCar.getBasePartMoney();
-                    partMoney = price.subtract(basePrice).doubleValue();
-                }
-                if (partMoney > 0) {
-                    total[0] = total[0].add(new BigDecimal(partMoney));
-                    Map<String, Object> carMap = new HashMap<>();
-                    carMap.put("price", partMoney);
-                    carMap.put("id", tbBusinessCar.getId());
-                    carMap.put("carNo", tbBusinessCar.getCarNo());
-                    carsList.add(carMap);
+                    partMoney =money==null? price.subtract(basePrice).doubleValue():price.subtract(money).doubleValue();
+                }else {
+                    partMoney=0D;
                 }
             }
+            if (partMoney > 0) {
+                total[0] = total[0].add(new BigDecimal(partMoney));
+                Map<String, Object> carMap = new HashMap<>();
+                carMap.put("price", partMoney);
+                carMap.put("id", tbBusinessCar.getId());
+                carMap.put("carNo", tbBusinessCar.getCarNo());
+                carsList.add(carMap);
+            }
         });
         result.put("carList", carsList);
         TbBusiness tbBusiness = this.getById(businessId);

+ 22 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -29,6 +29,28 @@ public class TbBusinessCarController {
 	TbBusinessCarService tbBusinessCarService;
 
 	/** 查 - 根据id */
+	@RequestMapping("add")
+	@SaCheckPermission(TbBusiness.PERMISSION_CODE)
+	public AjaxJson add(TbBusinessCar t) throws Exception{
+		tbBusinessCarService.add(t);
+		return AjaxJson.getSuccess();
+	}
+	/** 查 - 根据id */
+	@RequestMapping("delete")
+	@SaCheckPermission(TbBusiness.PERMISSION_CODE)
+	public AjaxJson delete(String id) {
+		tbBusinessCarService.removeById(id);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("update")
+	@SaCheckPermission(TbBusiness.PERMISSION_CODE)
+	public AjaxJson update(TbBusinessCar t){
+		tbBusinessCarService.updateCar(t);
+		return AjaxJson.getSuccess();
+	}
+	/** 查 - 根据id */
 	@RequestMapping("getById")
 	public AjaxJson getById(Long id){
 		TbBusinessCar t = tbBusinessCarService.getById(id);

+ 30 - 7
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -44,13 +44,13 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     public TbBusinessCar findByBusinessIdAndCarNo(String businessId, String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
         ew.eq("business_id", businessId)
-                .eq("car_no", carNo);
+                .eq("car_no", carNo.toUpperCase());
         return getOne(ew);
     }
 
     public TbBusinessCar findInAndNoBusinessCar(String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.eq("car_no", carNo).isNotNull("real_in_time")
+        ew.eq("car_no", carNo.toUpperCase()).isNotNull("real_in_time")
                 .isNull("real_out_time");
         return getOne(ew);
     }
@@ -69,7 +69,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public TbBusinessCar findInAndHasBusinessCar(String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.eq("car_no", carNo)
+        ew.eq("car_no", carNo.toUpperCase())
                 .isNull("real_out_time")
                 .isNotNull("real_in_time").eq("pay", "0");
         return getOne(ew);
@@ -77,23 +77,46 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public List<TbBusinessCar> searchPartCar(String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.like("car_no", carNo);
-        ew.eq("pay", "0");
+        ew.like("car_no", carNo.toUpperCase()).and(j->j.eq("pay", "0").or(i->i.isNull("real_out_time").isNotNull("real_in_time")));
         return list(ew);
     }
 
 
     public TbBusinessCar findNotInCar(String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.eq("car_no", carNo).isNull("real_in_time");
+        ew.eq("car_no", carNo.toUpperCase()).isNull("real_in_time");
         return this.getOne(ew);
     }
 
     public TbBusinessCar findNotOutCar(String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.eq("car_no", carNo)
+        ew.eq("car_no", carNo.toUpperCase())
                 .isNull("real_out_time")
                 .isNotNull("real_in_time");
         return getOne(ew);
     }
+
+    public TbBusinessCar check(String carNo){
+        QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
+        ew.eq("car_no", carNo.toUpperCase())
+                .and(i->i.isNull("real_in_time").or().isNull("real_out_time"));
+        return getOne(ew);
+    }
+
+    public void add(TbBusinessCar t) throws Exception{
+        String carNo=t.getCarNo();
+        TbBusinessCar db=  this.check(carNo);
+        if (db!=null){
+            throw new Exception("该车有未完成业务");
+        }
+        TbBusinessCar businessCar=  this.findByBusinessIdAndCarNo(t.getBusinessId(),carNo);
+        if (businessCar!=null){
+            throw new Exception("车辆已存在");
+        }
+        this.save(t);
+    }
+
+    public void updateCar(TbBusinessCar t) {
+        this.updateById(t);
+    }
 }

+ 4 - 3
sp-server/src/main/resources/application-dev.yml

@@ -12,9 +12,9 @@ spring:
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet:
-                enabled: true
+                enabled: false
             web-stat-filter:
-                enabled: true
+                enabled: false
             filter:
                 config:
                     enabled: true
@@ -57,7 +57,8 @@ car:
     max-length: 20
     max-weight: 50
 wx-config:
-    flush-second: 120 #token刷新时间 秒
+    title: 场站管理系统
+    flush-second: 12000 #token刷新时间 秒
     app-id: wxd40a34141872bf0c
     secret: 2e6a69fab1fbab60369ebd21b0882f3e
     mach-id: 1615645036