Browse Source

灵活业务

qzyReal 3 years ago
parent
commit
acffc705e5
27 changed files with 945 additions and 211 deletions
  1. 1 1
      app/App.vue
  2. 7 6
      app/apis/api.js
  3. 1 0
      app/common/common.scss
  4. 14 0
      app/pages.json
  5. 1 16
      app/pages/business-entering/business-detail.vue
  6. 2 2
      app/pages/business-order/business-order.vue
  7. 290 51
      app/pages/onely-disinfect/Index.vue
  8. 1 1
      app/pages/onely-disinfect/disinfect-Index.vue
  9. 255 0
      app/pages/onely-disinfect/type-business-edit.vue
  10. 156 0
      app/pages/onely-disinfect/type-business-info.vue
  11. 44 69
      app/pages/onely-disinfect/type-business.vue
  12. 1 15
      app/pages/wx/payOrder.vue
  13. 66 4
      sp-admin/sa-frame/menu-list.js
  14. 28 2
      sp-admin/sa-view/tb-business/tb-car-disincle-add.html
  15. 20 1
      sp-admin/sa-view/tb-business/tb-car-disincle-edit.html
  16. 1 2
      sp-admin/sa-view/tb-business/tb-car-disincle-info.html
  17. 4 4
      sp-admin/sa-view/tb-business/tb-car-disincle-list.html
  18. 3 3
      sp-admin/sa-view/tb-item-type/tb-item-list.html
  19. 5 5
      sp-admin/sa-view/tb-item-type/tb-item-type-list.html
  20. 1 1
      sp-admin/sa-view/tb-item-type/tb-item.html
  21. 1 0
      sp-server/src/main/java/com/pj/api/bo/OtherBusinessBO.java
  22. 6 18
      sp-server/src/main/java/com/pj/api/h5/ApiController.java
  23. 4 0
      sp-server/src/main/java/com/pj/api/jh/service/JhService.java
  24. 1 1
      sp-server/src/main/java/com/pj/api/open/service/OpenService.java
  25. 13 8
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  26. 8 0
      sp-server/src/main/java/com/pj/api/wx/service/WxService.java
  27. 11 1
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

+ 1 - 1
app/App.vue

@@ -3,7 +3,7 @@
 		onLaunch: function() {
 		},
 		onShow: function() {
-			this.getAuth();
+			//this.getAuth();
 		},
 		onHide: function() {
 		},

+ 7 - 6
app/apis/api.js

@@ -14,10 +14,8 @@ export default {
 	getItemList(data) {
 		return ajax.get('/TbItemType/getList',data)
 	},
-	getCustomerList() {
-		return ajax.get('/TbCostomer/getList', {
-			judgeStatus: 2
-		})
+	getCustomerList(data) {
+		return ajax.get('/TbCostomer/getList', data)
 	},
 	getCurrentAuthCode(){
 		return ajax.get('/admin/getCurrentAuthCode')
@@ -190,13 +188,16 @@ export default {
 		return ajax.postJson('/api/addCarDisinfect',data)
 	},
 	editCarDisinfect(data){
-		return ajax.postForm('/api/editCarDisinfect',data)
+		return ajax.postJson('/api/editCarDisinfect',data)
 	},
 	getCarDisinFect(data){
 		return ajax.get('/TbBusiness/getCarDisincleList',data)	
 	},
 	getItemType(data){
 		return ajax.get('/TbItemType/getItemTypeById',data);
+	},
+	getOtherBusinessById(data){
+		return ajax.get('/TbBusiness/getOtherBusinessById',data)
 	}
-
+	
 }

+ 1 - 0
app/common/common.scss

@@ -8,6 +8,7 @@
 			background-color: #0080ff;
 			padding: 50rpx 0;
 			padding-top: 0;
+			margin-top: -1rpx;
 			//border-radius: 0 0 30rpx 30rpx;
 			.title{
 				font-size: 50rpx;

+ 14 - 0
app/pages.json

@@ -316,6 +316,20 @@
 				"navigationBarTitleText": ""
 			}
 		
+		},
+		{
+			"path": "pages/onely-disinfect/type-business-info",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		
+		},
+		{
+			"path": "pages/onely-disinfect/type-business-edit",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		
 		}
 
 	],

+ 1 - 16
app/pages/business-entering/business-detail.vue

@@ -19,7 +19,7 @@
 			<view class="item">
 				<view class="l">货重:</view>
 				<view class="r">
-					{{form.netWeight}}()
+					{{form.netWeight}}(kg)
 				</view>
 			</view>
 			<view class="item-line">
@@ -73,21 +73,6 @@
 					{{item.itemName}}({{item.itemPrice}}x{{item.num}}={{item.total}}元)
 				</view>
 			</view>
-			
-			<view class="item" >
-				<view class="l" style="flex: 7;">境外车停车费:</view>
-				<view class="r">
-					{{form.partMoney}}
-					<text>(元)</text>
-				</view>
-			</view>
-			<view class="item">
-				<view class="l" style="flex: 7;">中国车停车费:</view>
-				<view class="r">
-					{{form.chinaPartMoney}}
-					<text>(元)</text>
-				</view>
-			</view>
 			<view class="item">
 				<view class="l">业务费:</view>
 				<view class="r">

+ 2 - 2
app/pages/business-order/business-order.vue

@@ -58,9 +58,9 @@
 					<view class="btn b3" v-if="customemrId!=='1'" @click="fkFn(businessItem)">
 						证明</view>
 						<view class="btn b3" @click="toDetail(businessItem)">详情</view>
-					<view class="btn b1" v-if="businessItem.confirmInput==0&&perList.indexOf('tb-business-edit')!==-1" @click="editFn(businessItem)">修改</view>
+					<view class="btn b1" v-if="businessItem.adminConfirmInput==0&&perList.indexOf('tb-business-edit')!==-1" @click="editFn(businessItem)">修改</view>
 					<view class="btn b4" v-if="businessItem.payStatus==1
-								&&businessItem.confirmInput==0
+								&&businessItem.adminConfirmInput==0
 								&&perList.indexOf('tb-business-del')!==-1" @click="deleteFn(businessItem)">删除</view>
 				</view>
 			</view>

+ 290 - 51
app/pages/onely-disinfect/Index.vue

@@ -1,86 +1,325 @@
 <template>
 	<view>
 		<view class="box">
-			<view class="top">
-				<text class="title">车辆消杀</text>
+			<view class="top" style="margin-top: -1rpx;">
+				<text class="title">灵活业务</text>
 			</view>
-			<view class="add" @click="addFn">+添加</view>
 		</view>
-		<view>
-			<uni-list>
-				<uni-list-item v-for="(item,index) in list" :title="item.carNo"
-				 :note="item.adminConfirmInput==1?'已确认':'未确认'" :rightText="item.createTime" clickable @click="toDetail(item)"/>
-			</uni-list>
+		<!-- 		<u-sticky offset-top="0">
+			<u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
+		</u-sticky> -->
+		<view class="card-box">
+			<view class="card" v-for="(businessItem,index) in businessItemList" :key="index">
+				<view class="t">
+					<image class="icon" src="../../static/home-icon-01.png"></image>
+					<text class="title">{{businessItem.customerName}}</text>
+				</view>
+				<view style="line-height: 60rpx;">
+					<view class="title">录入时间:{{businessItem.createTime}}</view>
+					<view class="title">订单号:{{businessItem.no}}</view>
+				</view>
+
+				<view class="c">
+					<view class="item car-num-item">
+						<text class="car-num">{{businessItem.carNo}}</text>
+					</view>
+
+					<view class="item">
+						<text class="p1">车型:</text>
+						<text class="p2">{{businessItem.cardSize}}(米)</text>
+					</view>
+					<view class="item">
+						<text class="p1">载重:</text>
+						<text class="p2">{{businessItem.netWeight}}(吨)</text>
+					</view>
+					<view class="item">
+						<text class="p1">账单确认:</text>
+						<text class="p2">
+							<text v-if="businessItem.confirmInput==0">未确认</text>
+							<text v-else>已确认</text>
+						</text>
+					</view>
+					<view class="item">
+						<text class="p1">支付状态:</text>
+						<text class="p2">
+							<text v-if="businessItem.payStatus==1">未支付</text>
+							<!-- <text v-if="businessItem.payStatus==2">已支付(未确认)</text> -->
+							<text v-if="businessItem.payStatus==3">已支付</text>
+						</text>
+					</view>
+				</view>
+				<view class="b">
+					<view class="btn b3" v-if="customemrId=='1'&&businessItem.adminConfirmInput==0
+								&&perList.indexOf('tb-flex-business-confirm')!=-1"
+								 @click="sureZdFn(businessItem)">
+						账单确认</view>
+						<view class="btn b3" @click="toDetail(businessItem)">详情</view>
+					<view class="btn b1" v-if="businessItem.adminConfirmInput==0&&perList.indexOf('tb-flex-business-edit')!==-1" @click="editFn(businessItem)">修改</view>
+					<view class="btn b4" v-if="businessItem.adminConfirmInput==0
+								&&perList.indexOf('tb-business-del')!==-1" @click="deleteFn(businessItem)">删除</view>
+				</view>
+			</view>
 		</view>
-		<noData v-if="list.length==0"></noData>
+		<noData v-if="businessItemList.length==0"></noData>
 		<u-loadmore style="margin: 30rpx;" :status="status" />
-	</view>
 
+	</view>
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
-				status: 'loadmore',
-				list: [],
 				p: {
-					pageNo: 1,
-					pageSize: 10,
-					dataCount: 0,
+					isCar: 1,
 					adminConfirmInput: -1,
-				}
+					pageNo: 1,
+					pageSize: 3,
+					dataCount: 0
+				},
+				customemrId: '1',
+				fk: {
+					ids: '',
+				},
+				rc: {
+					id: '',
+					inChannel: '',
+					showTime: false,
+					visible: false,
+					realInTime: ''
+				},
+				current: 0,
+				status: 'loadmore',
+				page: 0,
+				tabs: [{
+					name: '进场',
+				}, {
+					name: '出场',
+				}],
+				businessItemList: [],
+				perList: []
 			}
 		},
-		onLoad() {
-			this.getCarDisinFect();
+		onShow() {
+			this.customemrId = uni.getStorageSync('customerId')
+			this.getBusinessList();
+			this.perList = uni.getStorageSync('perList')
+		},
+		mounted() {
+		},
+		onBackPress() {
+			this.$common.to('/pages/index/index')
+			return true;
 		},
 		methods: {
-			toDetail(data){
-				this.$common.to('/pages/onely-disinfect/disinfect-Index?json='+JSON.stringify(data))
+			toDetail(data) {
+				this.$common.to('/pages/onely-disinfect/type-business-info?id=' + data.id)
 			},
-			addFn() {
-				this.$common.to('/pages/onely-disinfect/disinfect-Index')
+			editFn(data) {
+				this.$common.to('/pages/onely-disinfect/type-business-edit?id=' + data.id)
 			},
-			getCarDisinFect() {
+			deleteFn(data) {
+				let that = this;
+				uni.showModal({
+					title: "警告",
+					content: "是否删除该业务?",
+					success(res) {
+						if (res.confirm) {
+							that.$api.deleteBusiness({
+								id: data.id
+							}).then(resp => {
+								that.$common.toast('已删除');
+								that.getBusinessList();
+							})
+						}
+					}
+				})
+			},
+			sureZdFn(data) {
+				this.$common.to('/pages/wx/payOrderTemp?id=' + data.id)
+			},
+			getBusinessList() {
+				this.p.isCar=0;
 				this.$api.getCarDisinFect(this.p).then(resp => {
-					this.list = resp.data;
-					this.p.dataCount=resp.dataCount;
-					this.p.pageNo=resp.pageNo;
-					this.p.pageSize=resp.pageSize
+					this.status = 'loadmore';
+					this.p.pageNo = resp.pageNo;
+					this.p.pageSize = resp.pageSize;
+					this.p.dataCount = resp.dataCount;
+					this.businessItemList = resp.data;
 				})
-			}
+			},
+			//点击上方切换栏,根据点击项重新加载数据
+			change(index) {
+				this.current = index;
+				if (index == 0) {
+					//只加载进场订单
+				}
+				if (index == 1) {
+					//只加载出场订单
+				}
+			},
+			//点击按钮
+			//------------------------------------------
 
-		},
-		//上拉加载更多,分页模拟数据
-		onReachBottom() {
-			if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
-				this.status = 'loading';
-				this.p.pageSize += 5;
-				this.getCarDisinFect();
-			} else {
-				this.status = 'nomore';
+			fkconfirm() {
+				this.$api.adminConfirmPay(this.fk).then(resp => {
+					this.$refs.fkpopup.close();
+					this.getBusinessList();
+				})
+			},
+
+			rcconfirm() {
+				if (!this.rc.inChannel) {
+					this.$common.toast('请填写入场通道');
+					return false;
+				}
+				this.$api.adminConfirmIn(this.rc).then(resp => {
+					this.$refs.rcpopup.close();
+					this.getBusinessList();
+				})
+			},
+
+			ccconfirm(index) {
+				this.$refs.ccpopup.close()
+			},
+			zd() {
+				this.$refs.zdpopup.open('center')
+			},
+			zdconfirm(index) {
+				this.$refs.zdpopup.close()
+			},
+			//------------------------------------------
+			//上拉加载更多,分页模拟数据
+			onReachBottom() {
+				if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
+					this.status = 'loading';
+					this.p.pageSize += 5;
+					this.getBusinessList();
+				} else {
+					this.status = 'nomore';
+				}
 			}
 		}
-
 	}
 </script>
 
 <style lang="scss">
-	page {
-		background-color: #fff;
-	}
+	.card-box {
+		display: flex;
+		width: 100%;
+		flex-direction: column;
+
+		.card {
+			background-color: #fff;
+			border-radius: 20rpx;
+			margin: 20rpx 20rpx 0 20rpx;
+			padding: 30rpx;
+			box-sizing: border-box;
+			display: flex;
+			flex-direction: column;
+
+			.t {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				padding-bottom: 30rpx;
+				border-bottom: 1rpx solid #f5f5f5;
+
+				.icon {
+					width: 40rpx;
+					height: 40rpx;
+				}
+
+				.title {
+					font-size: 30rpx;
+					font-weight: bold;
+					margin-left: 20rpx;
+				}
+			}
+
+			.c {
+				padding: 15rpx 0 30rpx 0;
+				display: flex;
+				flex-wrap: wrap;
+				border-bottom: 1rpx solid #f5f5f5;
+
+				.item {
+					width: 50%;
+					padding: 20rpx 0;
+
+					.car-num {
+						background-color: #edf6ff;
+						color: #0080ff;
+						font-size: 44rpx;
+						padding: 15rpx 0;
+						text-align: center;
+						width: 100%;
+						border-radius: 10rpx;
+						font-weight: bold;
+						letter-spacing: 20rpx;
+					}
+
+					.p1 {
+						font-size: 28rpx;
+						color: #999;
+					}
+
+					.p2 {
+						font-size: 28rpx;
+						color: #191919;
+						font-weight: bold;
+						margin-left: 20rpx;
+					}
+				}
 
-	.add {
-		position: absolute;
-		right: 40rpx;
-		top: -60rpx;
-		z-index: 999;
-		border: 1rpx solid #359aff;
-		border-radius: 8rpx;
-		color: #c8e4ff;
-		padding: 10rpx 20rpx;
-		font-size: 28rpx;
+				.car-num-item {
+					width: 100%;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+				}
+			}
+
+			.b {
+				display: flex;
+				width: 100%;
+				align-items: center;
+				justify-content: space-between;
+
+				.btn {
+					height: 70rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: calc(50% - 15rpx);
+					margin: 30rpx 0 0 0;
+					border-radius: 10rpx;
+					border-width: 1rpx;
+					box-sizing: border-box;
+				}
+
+				.b1 {
+					background-color: #0080ff;
+					color: #fff;
+				}
+
+				.b2 {
+					background-color: #f7f7f7;
+					color: #191919;
+				}
+
+				.b3 {
+					background-color: #fff;
+					color: #0080ff;
+					border: 1rpx solid #0080ff;
+				}
+
+				.b4 {
+					background-color: #ff0000;
+					color: #fff;
+				}
+			}
+		}
 	}
 
 	@import '@/common/common.scss'

+ 1 - 1
app/pages/onely-disinfect/disinfect-Index.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view class="box">
 			<view class="top">
-				<text class="title">车辆消杀</text>
+				<text class="title">灵活业务</text>
 			</view>
 			<view class="item-line">
 				基本信息

+ 255 - 0
app/pages/onely-disinfect/type-business-edit.vue

@@ -0,0 +1,255 @@
+<template>
+	<view>
+		<view class="box">
+			<view class="top">
+				<text class="title">{{itemType.name}}</text>
+			</view>
+			<view class="item-line">
+				基本信息
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>车牌号:</view>
+				<view class="r">
+					<u-input placeholder="请填写车牌号" v-model="form.carNo" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>车辆类型:</view>
+				<view class="r">
+					<picker class="p-picker" id="qy" @change="bindPickerChange($event)" :value="type.index"
+						:range="type.list" range-key="name">
+						<text class="p-text">{{type.list[type.index]}}</text>
+						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
+					</picker>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>车辆规格:</view>
+				<view class="r">
+					<u-input placeholder="请填写车辆规格" v-model="form.carSize" />
+				</view>
+			</view>
+			<view class="item" v-if="type.index==1">
+				<view class="l">载重(kg):</view>
+				<view class="r">
+					<u-input placeholder="请填写车辆载重" v-model="form.carWeight" />
+				</view>
+			</view>
+			<view class="item-line">
+				收费明细<text style="color: red;">(总共{{totalPrice}}元)</text>
+			</view>
+			<u-checkbox-group v-model="checkList" placement="column">
+				<uni-list v-for="item in itemType.items">
+					<uni-list-item style="display: inline;" :title="item.itemName" :note="item.price+''+item.unit">
+						<template v-slot:header>
+							<u-checkbox :name="item.id" :disabled="item.need==1" style="display: inline;">
+							</u-checkbox>
+						</template>
+
+						<template v-slot:footer>
+							<div style="position: absolute;right: 230rpx;top: 65rpx;">
+								<u-number-box :disabled="item.inc==0" v-model="item.num">
+									<view slot="minus" class="minus">
+										<u-icon name="minus" size="12"></u-icon>
+									</view>
+									<text slot="input" style="width: 50px;text-align: center;"
+										class="input">{{item.num}}</text>
+									<view slot="plus" class="plus">
+										<u-icon name="plus" size="12"></u-icon>
+									</view>
+								</u-number-box>
+							</div>
+							<u-button v-show="item.needRemark" @click="openRemarkFn(item)" style="width: 50px;"
+								type="primary" size="mini" text="备注"></u-button>
+						</template>
+					</uni-list-item>
+				</uni-list>
+			</u-checkbox-group>
+		</view>
+		<view v-if="!form.adminConfirmInput">
+			<u-button type="primary" text="修改" @click="saveFn"></u-button>
+		</view>
+		<!-- ---------------------------------------------------------- -->
+		<view class="bottom-safety"></view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				showRemark: false,
+				type: {
+					index: 1,
+					list: ['空车', '载货']
+				},
+				obj: null,
+				form: {
+					carNo: '',
+					carSize: '',
+					carWeight: ''
+				},
+				list: [],
+				checkList: [],
+				businessItems: [],
+				itemType: {
+					id: '',
+					name: '',
+					items: []
+				}
+			}
+		},
+		computed: {
+			totalPrice() {
+				let items = this.itemType.items;
+				let checkList = this.checkList;
+				items = items.filter(obj => checkList.indexOf(obj.id) !== -1);
+				let price = 0;
+				for (let i in items) {
+					let item = items[i];
+					price = price + item.price * item.num;
+				}
+				return price;
+			}
+		},
+		onLoad(options) {
+			this.form.id = options.id;
+			this.getOtherBusinessById();
+			let that = this;
+			uni.$on('getRemark', data => {
+				that.$nextTick(function() {
+					let items = that.itemType.items;
+					items.filter(obj => obj.id == data.itemId)[0].remark = data.remark;
+				})
+			})
+		},
+		onBackPress() {
+			this.$common.to('/pages/onely-disinfect/Index');
+			return true;
+		},
+		methods: {
+			openRemarkFn(data) {
+				this.$common.to('/pages/onely-disinfect/add-remark?itemId=' + data.id + '&title=' + data.itemName +
+					'&remark=' + data.remark + '&mustRemark=' + data.mustRemark)
+			},
+			closeFn() {
+				this.$refs.popup.close()
+			},
+			getItemType() {
+				this.$api.getItemType({
+					id: this.itemType.id
+				}).then(resp => {
+					let data = resp.data;
+					this.itemType = data;
+					let items = data.items;
+					let businessItems = this.businessItems;
+					items.forEach(obj => {
+						businessItems.forEach(item => {
+							if (obj.id == item.itemId) {
+								obj.remark = item.remark;
+								obj.num = item.num;
+							}
+						})
+					})
+				})
+			},
+			bindPickerChange(e) {
+				let index = e.detail.value;
+				this.type.index = index //当前picker选中的值
+			},
+			saveFn() {
+				if (!this.form.carNo) {
+					this.$common.toast('请输入车牌号')
+					return;
+				}
+				if (!this.$common.isNum(this.form.carSize)) {
+					this.$common.toast('请输入正确的规格')
+					return;
+				}
+				if (this.type.index == 1 && !this.$common.isNum(this.form.carWeight)) {
+					this.$common.toast('请输正确的载重')
+					return;
+				}
+				let itemList = this.itemType.items;
+				let checkList = this.checkList;
+				let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
+				this.form.itemTypeId = this.itemType.id;
+				this.form.items = list;
+				this.form.carType = this.type.list[this.type.index]
+				let that = this;
+				let content = '确认修改该业务'
+				uni.showModal({
+					title: '提示',
+					content: content,
+					success(res) {
+						if (res.confirm) {
+							that.editFn()
+						}
+					}
+				})
+			},
+			getOtherBusinessById() {
+				this.$api.getOtherBusinessById({
+					id: this.form.id
+				}).then(resp => {
+					let data = resp.data;
+					this.form = data;
+					this.businessItems = data.items;
+					this.checkList = data.items.map(obj => obj.itemId);
+					this.itemType.id = data.itemTypeId;
+					this.type.index = this.type.list.indexOf(data.carType)
+					this.getItemType();
+				})
+			},
+			editFn() {
+				this.$api.editCarDisinfect(this.$common.removeNull(this.form)).then(resp => {
+					if (resp.code == 200) {
+						this.$common.toast('修改成功');
+						setTimeout(() => {
+							this.$common.to('/pages/onely-disinfect/Index')
+						}, 1500)
+					}
+				})
+			}
+		},
+
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.hs-item {
+		text-align: center;
+	}
+
+	.item-line {
+		color: #a2a2a2;
+		padding: 5px 0 10px 29px;
+		border-bottom: 1px solid #E5E5E5;
+	}
+
+	.hj {
+		padding: 50rpx;
+		font-size: 40rpx;
+		color: red;
+		font-weight: bold;
+	}
+
+	.save-btn {
+		background-color: #ff4200;
+		height: 88rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin: 60rpx;
+		color: #fff;
+		font-size: 30rpx;
+		font-weight: bold;
+		border-radius: 10rpx;
+	}
+
+	@import '@/common/common.scss'
+</style>

+ 156 - 0
app/pages/onely-disinfect/type-business-info.vue

@@ -0,0 +1,156 @@
+<template>
+	<view>
+		<view class="box">
+			<view class="top">
+				<text class="title">业务详情</text>
+			</view>
+			<view class="item">
+				<view class="l">企业名称:</view>
+				<view class="r">
+					{{form.customerName}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">业务类型:</view>
+				<view class="r">
+					{{form.goodsName}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">货重:</view>
+				<view class="r">
+					{{form.netWeight}}(kg)
+				</view>
+			</view>
+			<view v-for="item in form.cars" :key="item.id" style="border-bottom: 1px solid #E5E5E5;">
+				<view class="item">
+					<view class="l" >车牌号:</view>
+					<view class="r">
+						{{item.carNo}}
+					</view>
+				</view>
+				<view class="item">
+					<view class="l" >规格:</view>
+					<view class="r">
+						{{item.carSize}} (米)
+					</view>
+				</view>
+				<view class="item" v-if="item.realInTime">
+					<view class="l" >入场时间:</view>
+					<view class="r">
+						{{item.realInTime}} 
+					</view>
+				</view>
+				<view class="item" v-if="item.realOutTime">
+					<view class="l" >离场时间:</view>
+					<view class="r">
+						{{item.realOutTime}} (米)
+					</view>
+				</view>
+			</view>
+			
+			<view class="item-line">
+				业务项
+			</view>
+			<view class="item" v-for="item in form.items" :key="item.id">
+				<view class="l" style="flex: 7;">{{item.itemTypeName}}:</view>
+				<view class="r">
+					{{item.itemName}}({{item.itemPrice}}x{{item.num}}={{item.total}}元)
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 7;">业务费:</view>
+				<view class="r">
+					{{form.itemPrice}}
+					<text>(元)</text>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 7;">订单状态:</view>
+				<view class="r">
+				<text v-if="form.confirmInput==0">未确认</text>
+				<text v-else>已确认</text>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 7;">支付状态:</view>
+				<view class="r">
+				<text v-if="form.payStatus==1">未支付</text>
+				<text v-if="form.payStatus==3">已支付</text>
+				</view>
+			</view>
+			<view class="hj">
+				总费用:{{form.totalMoney}}元
+			</view>
+			<u-button type="primary" text="返回" @click="backFn"></u-button>
+				<view style="height: 80rpx;"></view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				form: {}
+			}
+		},
+		onShow() {},
+
+		onLoad(options) {
+			this.id = options.id;
+		},
+		onShow() {
+			this.getBusinessById();
+		},
+		methods: {
+			backFn() {
+				this.$common.back();
+			},
+			getBusinessById() {
+				this.$api.getBusinessById({
+					id: this.id
+				}).then(resp => {
+					this.form = resp.data;
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.hs-item {
+		text-align: center;
+	}
+
+	.item-line {
+		color: #a2a2a2;
+		padding: 5px 0 10px 29px;
+		border-bottom: 1px solid #E5E5E5;
+	}
+
+	.hj {
+		padding: 50rpx;
+		font-size: 30rpx;
+		color: red;
+		font-weight: bold;
+	}
+
+	.save-btn {
+		background-color: #ff4200;
+		height: 88rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin: 60rpx;
+		color: #fff;
+		font-size: 30rpx;
+		font-weight: bold;
+		border-radius: 10rpx;
+	}
+	@import '@/common/common.scss'
+</style>

+ 44 - 69
app/pages/onely-disinfect/type-business.vue

@@ -7,6 +7,16 @@
 			<view class="item-line">
 				基本信息
 			</view>
+			<view class="item" v-if="form.customerId=='1'">
+				<view class="l"><text style="color: red;">*</text>客户:</view>
+				<view class="r">
+					<picker v-if="customer.list.length>0" class="p-picker" @change="bindPickerChange($event)"
+						:value="customer.index" :range="customer.list" range-key="name">
+						<text class="p-text">{{customer.list[customer.index].name}}</text>
+						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
+					</picker>
+				</view>
+			</view>
 			<view class="item">
 				<view class="l"><text style="color: red;">*</text>车牌号:</view>
 				<view class="r">
@@ -48,30 +58,16 @@
 
 						<template v-slot:footer>
 							<div style="position: absolute;right: 230rpx;top: 65rpx;">
-								 <u-number-box :disabled="item.inc==0" v-model="item.num">
-								        <view
-								            slot="minus"
-								            class="minus">
-								            <u-icon
-								                name="minus"
-								                size="12"
-								            ></u-icon>
-								        </view>
-								        <text
-								            slot="input"
-								            style="width: 50px;text-align: center;"
-								            class="input"
-								        >{{item.num}}</text>
-								        <view
-								            slot="plus"
-								            class="plus"
-								        >
-								            <u-icon
-								                name="plus"
-								                size="12"
-								            ></u-icon>
-								        </view>
-								    </u-number-box>
+								<u-number-box :disabled="item.inc==0" v-model="item.num">
+									<view slot="minus" class="minus">
+										<u-icon name="minus" size="12"></u-icon>
+									</view>
+									<text slot="input" style="width: 50px;text-align: center;"
+										class="input">{{item.num}}</text>
+									<view slot="plus" class="plus">
+										<u-icon name="plus" size="12"></u-icon>
+									</view>
+								</u-number-box>
 							</div>
 							<u-button v-show="item.needRemark" @click="openRemarkFn(item)" style="width: 50px;"
 								type="primary" size="mini" text="备注"></u-button>
@@ -81,8 +77,7 @@
 			</u-checkbox-group>
 		</view>
 		<view v-if="!form.adminConfirmInput">
-			<u-button type="primary" v-if="!obj" text="保存" @click="saveFn"></u-button>
-			<u-button type="primary" v-if="obj" text="确认账单" @click="confirmFn" style="margin-top: 20rpx;"></u-button>
+			<u-button type="primary" text="保存" @click="saveFn"></u-button>
 		</view>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
@@ -98,8 +93,13 @@
 					index: 1,
 					list: ['空车', '载货']
 				},
+				customer: {
+					index: 0,
+					list: []
+				},
 				obj: null,
 				form: {
+					customerId: '1',
 					carNo: '',
 					carSize: '',
 					carWeight: ''
@@ -126,10 +126,16 @@
 				return price;
 			}
 		},
+
 		onLoad(options) {
+			let customerId = uni.getStorageSync('customerId');
+			this.form.customerId = customerId;
 			let typeId = options.typeId;
 			this.itemType.id = typeId;
 			this.getItemType();
+			if (customerId == '1') {
+				this.getCustomerList();
+			}
 			let that = this;
 			uni.$on('getRemark', data => {
 				that.$nextTick(function() {
@@ -138,12 +144,14 @@
 				})
 			})
 		},
-		onBackPress() {
-			this.$common.to('/pages/onely-disinfect/Index');
-			return true;
-		},
-		methods: {
 
+		methods: {
+			getCustomerList() {
+				let p={judgeStatus: 2,pageNo:1,pageSize:30,	type: 0}
+				this.$api.getCustomerList(p).then(resp => {
+					this.customer.list = resp.data;
+				})
+			},
 			openRemarkFn(data) {
 				this.$common.to('/pages/onely-disinfect/add-remark?itemId=' + data.id + '&title=' + data.itemName +
 					'&remark=' + data.remark + '&mustRemark=' + data.mustRemark)
@@ -183,22 +191,20 @@
 				let itemList = this.itemType.items;
 				let checkList = this.checkList;
 				let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
+				if(this.customer.list.length>0){
+					this.form.customerId = this.customer.list[this.customer.index].id;
+				}
 				this.form.itemTypeId = this.itemType.id;
 				this.form.items = list;
 				this.form.carType = this.type.list[this.type.index]
 				let that = this;
-				let content = this.obj ? '确认修改该业务?' : '确认录入该车辆的业务?'
+				let content = '确认录入该车辆的业务?'
 				uni.showModal({
 					title: '提示',
 					content: content,
 					success(res) {
 						if (res.confirm) {
-							if (!that.obj) {
-								that.addFn();
-							} else {
-								that.editFn()
-							}
-
+							that.addFn();
 						}
 					}
 				})
@@ -210,37 +216,6 @@
 					}
 				})
 			},
-			confirmFn() {
-				let that = this;
-				uni.showModal({
-					title: '提示',
-					content: '是否确认该账单?',
-					success(res) {
-						if (res.confirm) {
-							that.$api.adminConfirm({
-								ids: that.form.id
-							}).then(resp => {
-								if (resp.code == 200) {
-									that.$common.toast('已确认');
-									setTimeout(() => {
-										that.$common.to('/pages/onely-disinfect/Index')
-									}, 1500)
-								}
-							})
-						}
-					}
-				})
-			},
-			editFn() {
-				this.$api.editCarDisinfect(this.$common.removeNull(this.form)).then(resp => {
-					if (resp.code == 200) {
-						this.$common.toast('修改成功');
-						setTimeout(() => {
-							this.$common.to('/pages/onely-disinfect/Index')
-						}, 1500)
-					}
-				})
-			}
 		},
 
 	}

+ 1 - 15
app/pages/wx/payOrder.vue

@@ -24,20 +24,6 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l" style="flex: 7;">境外车停车费:</view>
-				<view class="r">
-					{{form.partMoney}}
-					<text>(元)</text>
-				</view>
-			</view>
-			<view class="item">
-				<view class="l" style="flex: 7;">中国车停车费:</view>
-				<view class="r">
-					{{form.chinaPartMoney}}
-					<text>(元)</text>
-				</view>
-			</view>
-			<view class="item">
 				<view class="l" style="flex: 7;">合计费用:</view>
 				<view class="r">
 					{{form.totalMoney}}元
@@ -112,7 +98,7 @@
 								if (resp.code == 200) {
 									that.$common.toast('已确认');
 									setTimeout(() => {
-										that.$common.to('/pages/business-order/business-order');
+										that.$common.to('/pages/index/index');
 									}, 1500)
 								}
 							})

+ 66 - 4
sp-admin/sa-frame/menu-list.js

@@ -316,8 +316,30 @@ var menuList = [{
 			},
 			{
 				id: 'tb-car-disincle-list',
-				name: '车辆消杀',
-				url: 'sa-view/tb-business/tb-car-disincle-list.html'
+				name: '灵活业务',
+				url: 'sa-view/tb-business/tb-car-disincle-list.html',
+				childList:[
+					{
+						id: 'tb-flex-business-add',
+						name: '添加业务',
+						isShow: false
+					},
+					{
+						id: 'tb-flex-business-edit',
+						name: '编辑业务',
+						isShow: false
+					},
+					{
+						id: 'tb-flex-business-del',
+						name: '删除业务',
+						isShow: false
+					},
+					{
+						id: 'tb-flex-business-confirm',
+						name: '账单确认',
+						isShow: false
+					},
+				]
 			}
 
 		]
@@ -330,12 +352,52 @@ var menuList = [{
 		childList: [{
 				id: 'tb-item-type-list',
 				name: '收费项管理',
-				url: 'sa-view/tb-item-type/tb-item-type-list.html'
+				url: 'sa-view/tb-item-type/tb-item-type-list.html',
+				childList:[
+					{
+						id: 'tb-item-type-add',
+						name: '添加收费项',
+						isShow: false
+					},
+					{
+						id: 'tb-item-type-edit',
+						name: '编辑收费项',
+						isShow: false
+					},
+					{
+						id: 'tb-item-type-relation',
+						name: '收费明细',
+						isShow: false
+					},
+					{
+						id: 'tb-item-type-del',
+						name: '删除收费项',
+						isShow: false
+					},
+					
+				]
 			},
 			{
 				id: 'tb-item-re-list',
 				name: '明细管理',
-				url: 'sa-view/tb-item-type/tb-item-list.html'
+				url: 'sa-view/tb-item-type/tb-item-list.html',
+				childList:[
+					{
+						id: 'tb-item-manager-add',
+						name: '添加明细',
+						isShow: false
+					},
+					{
+						id: 'tb-item-manager-del',
+						name: '删除明细',
+						isShow: false
+					},
+					{
+						id: 'tb-item-manager-edit',
+						name: '修改明细',
+						isShow: false
+					},
+				]
 			},
 		],
 

+ 28 - 2
sp-admin/sa-view/tb-business/tb-car-disincle-add.html

@@ -43,6 +43,14 @@
 							</div>
 							<el-row>
 								<el-col :span='12'>
+									<div class="c-item">
+										<label class="c-label"><span style="color: red;">*</span>客户:</label>
+										<el-select v-model="m.customerId" placeholder="请选择">
+											<el-option v-for="item in customerList" :key="item.id" :label="item.name"
+												:value="item.id">
+											</el-option>
+										</el-select>
+									</div>
 									<sa-item name="车牌号" placeholder="请输入车牌号" v-model="m.carNo" br>
 									</sa-item>
 									<sa-item type="num" name="车辆规格" placeholder="请输入车辆规格" v-model="m.carSize" br>
@@ -125,18 +133,20 @@
 						id: '', // 主键 
 						carNo: '',
 						carSize: '',
+						customerId:'',
 						carType: '载货',
 						carWeight: '',
 						itemTypeId: ''
 					}, // 实体对象 
 					itemTypeList: [],
 					items: [],
-					checkList: []
+					checkList: [],
+					customerList: []
 				},
 				computed: {
 					totalPrice() {
 						let checkList = this.checkList;
-						let items = this.items.filter(obj=>checkList.indexOf(obj.id)!==-1);
+						let items = this.items.filter(obj => checkList.indexOf(obj.id) !== -1);
 						let price = 0;
 						for (let i in items) {
 							let item = items[i];
@@ -146,6 +156,21 @@
 					}
 				},
 				methods: {
+					getCustomerList() {
+						sa.ajax('/TbCostomer/getList', {
+							pageNo: 1,
+							pageSize: 30,
+							type: 0,
+							judgeStatus: 2
+						}, function(res) {
+							let list=res.data;
+							if(list.length>0){
+								this.m.customerId=list[0].id;
+							}
+							this.customerList = res.data; // 数据
+							
+						}.bind(this));
+					},
 					getItemTypeList() {
 						sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function(res) {
 							let list = res.data;
@@ -193,6 +218,7 @@
 					}
 				},
 				mounted: function() {
+					this.getCustomerList();
 					this.getItemTypeList()
 				}
 			})

+ 20 - 1
sp-admin/sa-view/tb-business/tb-car-disincle-edit.html

@@ -42,6 +42,14 @@
 								<span>基本资料</span>
 							</div>
 							<el-row>
+								<div class="c-item">
+									<label class="c-label"><span style="color: red;">*</span>客户:</label>
+									<el-select v-model="m.customerId" placeholder="请选择">
+										<el-option v-for="item in customerList" :key="item.id" :label="item.name"
+											:value="item.id">
+										</el-option>
+									</el-select>
+								</div>
 								<el-col :span='12'>
 									<sa-item name="车牌号" placeholder="请输入车牌号" v-model="m.carNo" br>
 									</sa-item>
@@ -134,6 +142,7 @@
 					items: [],
 					businessItems:[],
 					checkList: [],
+					customerList:[]
 				},
 				computed: {
 					totalPrice() {
@@ -149,6 +158,16 @@
 					}
 				},
 				methods: {
+					getCustomerList() {
+						sa.ajax('/TbCostomer/getList', {
+							pageNo: 1,
+							pageSize: 30,
+							type: 0,
+							judgeStatus: 2
+						}, function(res) {
+							this.customerList = res.data; // 数据
+						}.bind(this));
+					},
 					getItemTypeList() {
 						sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function(res) {
 							let list = res.data;
@@ -207,13 +226,13 @@
 							this.m = data
 							this.businessItems=data.items;
 							this.checkList=data.items.map(obj=>obj.itemId);
-							console.log(this.checkList);
 							this.getItemTypeList();
 						}.bind(this))
 					}
 				},
 				mounted: function() {
 					this.getOtherBusinessById();
+					this.getCustomerList();
 				}
 			})
 		</script>

+ 1 - 2
sp-admin/sa-view/tb-business/tb-car-disincle-info.html

@@ -39,8 +39,7 @@
 											<el-col span="12">
 												<sa-info name="客户名称" br v-if="m.customerName">{{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.cardSize}}(米)</sa-info>
 												<sa-info name="业务类型" br>{{m.goodsName}}</sa-info>
 												<sa-info name="载重" br v-if="m.goodsName!=='空车'">{{m.netWeight}}(kg)</sa-info>
 												<sa-info type="enum" name="支付状态" :value="m.payStatus"

+ 4 - 4
sp-admin/sa-view/tb-business/tb-car-disincle-list.html

@@ -40,7 +40,7 @@
 					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<el-button type="info" icon="el-icon-search" @click="p.cardNo = '';p.adminConfirmInput=-1; f5()">重置</el-button>
-					<el-button v-if="sa.isAuth('tb-business-add')" size="mini" type="primary" @click="add()">
+					<el-button v-if="sa.isAuth('tb-flex-business-add')" size="mini" type="primary" @click="add()">
 						新增</el-button>
 					<br />
 				</el-form>
@@ -59,16 +59,16 @@
 					</sa-td>
 					<el-table-column label="操作" width="240px" fixed="right">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-confirm')
+							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
 								&&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认</el-button>
 								<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-confirm')
 									&&currentCustomerId=='1'&&s.row.adminConfirmInput==1" @click="checkConfirmFn(s.row)">查看账单</el-button>
 							<el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
-							<el-button class="c-btn" type="primary" v-if="s.row.adminConfirmInput==0"
+							<el-button class="c-btn" type="primary" v-if="s.row.adminConfirmInput==0&&sa.isAuth('tb-flex-business-edit')"
 								@click="update(s.row)">
 								修改</el-button>
 							<el-button class="c-btn" type="danger"
-								v-if="sa.isAuth('tb-business-del')&&s.row.adminConfirmInput==0"
+								v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0"
 								@click="del(s.row)">删除
 							</el-button>
 						</template>

+ 3 - 3
sp-admin/sa-view/tb-item-type/tb-item-list.html

@@ -24,7 +24,7 @@
 					<sa-item type="text" name="名称" v-model="p.itemName"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<sa-item type="fast-btn" show="reset" style="display: inline;"></sa-item>
-					<el-button type="primary" icon="el-icon-plus" @click="add()">新增
+					<el-button v-if="sa.isAuth('tb-item-manager-add')" type="primary" icon="el-icon-plus" @click="add()">新增
 					</el-button>
 					<br />
 				</el-form>
@@ -49,10 +49,10 @@
 						<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"
+							<el-button v-if="sa.isAuth('tb-item-manager-edit')" 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"
+							<el-button v-if="sa.isAuth('tb-item-manager-del')" class="c-btn" type="danger" icon="el-icon-delete"
 								@click="del(s.row)">删除
 							</el-button>
 						</template>

+ 5 - 5
sp-admin/sa-view/tb-item-type/tb-item-type-list.html

@@ -24,7 +24,7 @@
 					<sa-item type="text" name="项目名称" v-model="p.name"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<sa-item type="fast-btn" show="reset" style="display: inline;"></sa-item>
-					<el-button type="primary" icon="el-icon-plus" @click="add()">新增
+					<el-button v-if="sa.isAuth('tb-item-type-add')" type="primary" icon="el-icon-plus" @click="add()">新增
 					</el-button>
 					<br />
 				</el-form>
@@ -34,7 +34,7 @@
 					<sa-td name="项目名称" prop="name" width="200px"></sa-td>
 					<sa-td name="业务分类" prop="businessType" width="200px">
 						<template slot-scope="s">
-							<el-select :disabled="!sa.isAuth('tb-item-list-edit-type')" multiple v-model="s.row.type"
+							<el-select :disabled="!sa.isAuth('tb-item-type-edit')" multiple v-model="s.row.type"
 								placeholder="收费项" @change="businessChange(s.row)">
 								<el-option v-for="item in businessTypeList" :key="item.value" :value="item.value"
 									:label="item.name">
@@ -48,11 +48,11 @@
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success"  @click="get(s.row)">二维码
 							</el-button>
-							<el-button class="c-btn" type="success" @click="itemFn(s.row)">收费明细
+							<el-button v-if="sa.isAuth('tb-item-type-relation')" class="c-btn" type="success" @click="itemFn(s.row)">收费明细
 							</el-button>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+							<el-button v-if="sa.isAuth('tb-item-type-edit')" 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 v-if="sa.isAuth('tb-item-type-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
 							</el-button>
 						</template>
 					</el-table-column>

+ 1 - 1
sp-admin/sa-view/tb-item-type/tb-item.html

@@ -42,7 +42,7 @@
 							<label>{{s.row.minWeight}}—{{s.row.maxWeight}}</label>
 						</template>
 					</sa-td>
-					<sa-td name="明细数量" prop="inc" type="switch" :jv="{1: '多个[#005500]', 0: '单个[#ff0000]'}"
+					<sa-td name="明细数量" prop="inc" type="switch" :jv="{1: '多个[#005500]', 0: '单个[#ff0000]'}"
 						@change="s => updateNum(s.row)"></sa-td>
 					<sa-td name="是否必须" prop="need" type="switch" :jv="{1: '是[#005500]', 0: '否[#ff0000]'}"
 						@change="s => updateStatus(s.row)"></sa-td>

+ 1 - 0
sp-server/src/main/java/com/pj/api/bo/OtherBusinessBO.java

@@ -12,6 +12,7 @@ import java.util.List;
 @Accessors(chain = true)
 public class OtherBusinessBO implements Serializable {
     private String id;
+    private String customerId;
     private String carNo;
     private Double carSize;
     private String itemTypeId;

+ 6 - 18
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -206,6 +206,11 @@ public class ApiController {
         apiService.addCarDisinfect(otherBusinessBO);
         return AjaxJson.getSuccess();
     }
+    @RequestMapping(value = "editCarDisinfect")
+    public AjaxJson editCarDisinfect(@RequestBody OtherBusinessBO otherBusinessBO) {
+        apiService.editOtherBusiness(otherBusinessBO);
+        return AjaxJson.getSuccess();
+    }
     @RequestMapping("addOtherBusiness")
     public AjaxJson addOtherBusiness(OtherBusinessBO otherBusinessBO) {
         otherBusinessBO.setItems(JSONUtil.toList(otherBusinessBO.getItemJson(), TbItem.class));
@@ -220,22 +225,5 @@ public class ApiController {
     }
 
 
-    @RequestMapping(value = "editCarDisinfect")
-    public AjaxJson editCarDisinfect(CarDisincle carDisincle) {
-        SoMap so = SoMap.getRequestSoMap();
-        String carNo = carDisincle.getCarNo();
-        if (StrUtil.isEmpty(carNo)){
-            throw new BusinessException("请录入车牌号");
-        }
-        String itemJson = so.getString("itemJson");
-        if (StrUtil.isEmpty(itemJson)){
-            throw new BusinessException("业务类型错误");
-        }
-        String carType = so.getString("carType");
-        if (StrUtil.isEmpty(carType)){
-            throw new BusinessException("请选车业务类型");
-        }
-        apiService.editCarDisinfect(carDisincle,itemJson,carType);
-        return AjaxJson.getSuccess();
-    }
+
 }

+ 4 - 0
sp-server/src/main/java/com/pj/api/jh/service/JhService.java

@@ -21,6 +21,7 @@ import com.pj.current.config.PartConfig;
 import com.pj.current.task.TaskService;
 import com.pj.project.tb_order.TbOrder;
 import com.pj.project.tb_order.TbOrderService;
+import com.pj.project4sp.global.BusinessException;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -65,6 +66,9 @@ public class JhService {
             return wxService.prePay(request);
         }
         String money = request.getParameter("money");
+        if (Integer.parseInt(money)<=0){
+            throw new BusinessException("金额不正确");
+        }
         String openid = request.getParameter("openid");
         String desc = request.getParameter("desc");
         String businessId = request.getParameter("b");

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

@@ -125,7 +125,7 @@ public class OpenService {
     private ResultJson handlerOut(String carNo, String channel, String image) {
         carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
-        if (tbBusinessCar == null) {
+        if (tbBusinessCar == null||tbBusinessCar.getRealInTime()==null) {
             return ResultJson.error("未查询到入场记录");
         }
         Date now = new Date();

+ 13 - 8
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -269,21 +269,25 @@ public class ApiService {
 
     public void addCarDisinfect(OtherBusinessBO otherBusinessBO) {
         String carNo = otherBusinessBO.getCarNo().trim().toUpperCase();
-        TbBusinessCar db = tbBusinessCarService.checkCar(carNo);
+        TbBusinessCar db = tbBusinessCarService.findInAndHasBusinessCar(carNo);
         if (db != null) {
-            throw new BusinessException("该车辆有未完成作业");
+            throw new BusinessException(carNo + "有未完成作业");
+        }
+        db = tbBusinessCarService.findInAndNoBusinessCar(carNo);
+        if (db == null) {
+            db = new TbBusinessCar();
+            db.setPay(0).setTimeUpdate(new Date());
         }
-        db = new TbBusinessCar();
         TbCar tbCar = tbCarService.findByCardNo(carNo);
         db.setCarNo(carNo).setIsLock(0).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时");
         TbBusiness tbBusiness = new TbBusiness();
-        if (StpUserUtil.isLogin()) {
-            String customerId = StpUserUtil.getCustomerId();
-            db.setCustomerId(customerId);
-            TbCostomer tbCostomer = tbCostomerService.getById(customerId);
+        String customerId = otherBusinessBO.getCustomerId();
+        db.setCustomerId(customerId);
+        TbCostomer tbCostomer = tbCostomerService.getById(customerId);
+        if (tbCostomer!=null){
             tbBusiness.setCustomerId(customerId).setCustomerName(tbCostomer.getName());
         }
-        db.setPay(0).setCarSize(otherBusinessBO.getCarSize()).setTimeUpdate(new Date());
+        db.setCarSize(otherBusinessBO.getCarSize());
         List<TbItem> tbItems = otherBusinessBO.getItems();
         BigDecimal price = new BigDecimal("0");
         List<TbBusinessItem> itemList = new ArrayList<>();
@@ -321,6 +325,7 @@ public class ApiService {
         itemList.forEach(tbBusinessItem -> tbBusinessItem.setBusinessId(tbBusiness.getId()));
         tbBusinessItemService.saveBatch(itemList);
     }
+
     @Deprecated
     public void editCarDisinfect(CarDisincle carDisincle, String itemJson, String type) {
         String carId = carDisincle.getBusinessCarId();

+ 8 - 0
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -34,6 +34,7 @@ import com.pj.project.tb_fee_statistics.TbFeeStatisticsService;
 import com.pj.project.tb_order.TbOrderService;
 import com.pj.project.tb_pay_record.TbPayRecord;
 import com.pj.project.tb_pay_record.TbPayRecordService;
+import com.pj.project4sp.global.BusinessException;
 import com.pj.utils.cache.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Lazy;
@@ -84,6 +85,9 @@ public class WxService {
     public Map<String, String> prePay(HttpServletRequest request) throws Exception {
         String tradeType = request.getParameter("tradeType");
         String money = request.getParameter("money");
+        if (Integer.parseInt(money)<=0){
+            throw new BusinessException("金额不正确");
+        }
         String openid = request.getParameter("openid");
         String desc = request.getParameter("desc");
 //        String openid = "oDWvn5w-hVkzUuKeY7OBXBV_l1rU";
@@ -200,6 +204,10 @@ public class WxService {
             for (PriceBO bo1 : cars) {
                 TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
                 BigDecimal price = bo1.getP();
+                if (price.doubleValue()<=0){
+                    log.error("付款金额不正确:{}",JSONUtil.toJsonStr(notifyBO));
+                    continue;
+                }
                 car.setPay(1).setMoney(car.getMoney().add(price)).setPayTime(now);
                 tbBusinessCarService.updateById(car);
                 TbBusiness business = tbBusinessService.getById(car.getBusinessId());

+ 11 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -121,7 +121,17 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public TbBusinessCar findInAndNoBusinessCar(String carNo) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.eq("car_no", carNo.toUpperCase()).isNotNull("real_in_time")
+        ew.eq("car_no", carNo.toUpperCase())
+                .isNotNull("real_in_time")
+                .isNull("business_id")
+                .isNull("real_out_time");
+        return getOne(ew);
+    }
+    public TbBusinessCar findInAndHasBusinessCar(String carNo) {
+        QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
+        ew.eq("car_no", carNo.toUpperCase())
+                .isNotNull("real_in_time")
+                .isNotNull("business_id")
                 .isNull("real_out_time");
         return getOne(ew);
     }