Browse Source

灵活业务

qzyReal 3 years ago
parent
commit
04a4988bce
34 changed files with 1227 additions and 221 deletions
  1. 1 1
      app/apis/api.js
  2. 1 1
      app/manifest.json
  3. 8 0
      app/pages.json
  4. 0 1
      app/pages/business-entering/business-entering.vue
  5. 88 0
      app/pages/onely-disinfect/add-remark.vue
  6. 6 2
      app/pages/onely-disinfect/addSuccess.vue
  7. 98 71
      app/pages/onely-disinfect/type-business.vue
  8. 18 15
      sp-admin/sa-view/tb-business/tb-business-list.html
  9. 201 0
      sp-admin/sa-view/tb-business/tb-car-disincle-add.html
  10. 221 0
      sp-admin/sa-view/tb-business/tb-car-disincle-edit.html
  11. 204 0
      sp-admin/sa-view/tb-business/tb-car-disincle-info.html
  12. 62 31
      sp-admin/sa-view/tb-business/tb-car-disincle-list.html
  13. 3 3
      sp-admin/sa-view/tb-item-type/tb-item-add.html
  14. 14 23
      sp-admin/sa-view/tb-item-type/tb-item-info.html
  15. 4 1
      sp-admin/sa-view/tb-item-type/tb-item-list.html
  16. 0 14
      sp-admin/sa-view/tb-item-type/tb-item-type-add.html
  17. 0 2
      sp-admin/sa-view/tb-item-type/tb-item-type-list.html
  18. 69 6
      sp-admin/sa-view/tb-item-type/tb-item.html
  19. 1 1
      sp-server/app.pid
  20. 22 0
      sp-server/src/main/java/com/pj/api/bo/OtherBusinessBO.java
  21. 22 0
      sp-server/src/main/java/com/pj/api/bo/OtherBusinessEditBO.java
  22. 19 15
      sp-server/src/main/java/com/pj/api/h5/ApiController.java
  23. 2 1
      sp-server/src/main/java/com/pj/api/jh/api/JhController.java
  24. 10 0
      sp-server/src/main/java/com/pj/api/jh/service/JhService.java
  25. 25 13
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  26. 6 1
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItem.java
  27. 28 1
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemController.java
  28. 26 4
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemService.java
  29. 1 0
      sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java
  30. 11 0
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java
  31. 26 10
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  32. 16 0
      sp-server/src/main/java/com/pj/project/tb_item/TbItem.java
  33. 13 3
      sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.xml
  34. 1 1
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemType.java

+ 1 - 1
app/apis/api.js

@@ -187,7 +187,7 @@ export default {
 		return ajax.postForm('/TbBusiness/confirm',data)
 	},
 	addCarDisinfect(data){
-		return ajax.postForm('/api/addCarDisinfect',data)
+		return ajax.postJson('/api/addCarDisinfect',data)
 	},
 	editCarDisinfect(data){
 		return ajax.postForm('/api/editCarDisinfect',data)

+ 1 - 1
app/manifest.json

@@ -85,7 +85,7 @@
     "vueVersion" : "2",
     "h5" : {
         "router" : {
-            "base" : "/test/",
+            "base" : "/h5/",
             "mode" : "history"
         },
         "devServer" : {

+ 8 - 0
app/pages.json

@@ -308,6 +308,14 @@
 				"navigationBarTitleText": ""
 			}
 		
+		},
+		
+		{
+			"path": "pages/onely-disinfect/add-remark",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		
 		}
 
 	],

+ 0 - 1
app/pages/business-entering/business-entering.vue

@@ -349,7 +349,6 @@
 					}
 					that.handler();
 				})
-				console.log(that.form);
 			})
 		},
 		methods: {

+ 88 - 0
app/pages/onely-disinfect/add-remark.vue

@@ -0,0 +1,88 @@
+<template>
+	<view>
+		<view class="box">
+			<view class="top">
+				<text class="title">{{form.title}}</text>
+			</view>
+		</view>
+		<view class="box" style="margin-top: 50px;">
+			<view class="item">
+				<view class="l">
+					<text style="color: red;" v-if="form.mustRemark==1">*</text>
+					备注:
+				</view>
+				<view class="r">
+					<u-textarea placeholder="备注" v-model="form.remark" clearable>
+					</u-textarea>
+				</view>
+			</view>
+		</view>
+		<view style="margin-top: 50px;">
+			<u-button type="primary" text="确定" @click="saveFn"></u-button>
+			<u-button type="info" text="重置" @click="form.remark=''" style="margin-top: 20rpx;"></u-button>
+		</view>
+		<!-- ---------------------------------------------------------- -->
+		<view class="bottom-safety"></view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				form: {
+					itemId: '',
+					title: '',
+					remark: '',
+					mustRemark: 1
+				}
+			}
+		},
+		onLoad(options) {
+			this.form = options;
+		},
+		methods: {
+			saveFn() {
+				let data=this.form;
+				if(data.mustRemark==1&&!data.remark){
+					this.$common.toast('请填写备注')
+					return false;
+				}
+				uni.navigateBack({
+					delta: 1,
+					success: function(resp) {
+						uni.$emit('getRemark', data) //触发事件
+					}
+				})
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.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>

+ 6 - 2
app/pages/onely-disinfect/addSuccess.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="box">
 		<u-icon name="checkmark-circle-fill" color="#07c160" size="200"></u-icon>
-		<text class="text">申报信息提交成功!</text>
+		<text class="text">业务添加提交成功!</text>
 		<view class="count-down-box">
 			<view @click="goback">返回</view>
 		</view>
@@ -13,15 +13,19 @@
 		data() {
 			return {
 				timestamp: 3,
+				id:''
 			}
 		},
 		onBackPress() {
 			this.goback();
 			return true;
 		},
+		onLoad(options) {
+			this.id=options.typeId
+		},
 		methods: {
 			goback() {
-				this.$common.to('/pages/index/index');
+				this.$common.to('/pages/onely-disinfect/type-business?typeId='+this.id);
 			}
 		}
 	}

+ 98 - 71
app/pages/onely-disinfect/type-business.vue

@@ -8,6 +8,12 @@
 				基本信息
 			</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"
@@ -18,42 +24,57 @@
 				</view>
 			</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">
 					<u-input placeholder="请填写车辆规格" v-model="form.carSize" />
 				</view>
 			</view>
 			<view class="item" v-if="type.index==1">
-				<view class="l">车辆载重:</view>
+				<view class="l">载重(kg):</view>
 				<view class="r">
 					<u-input placeholder="请填写车辆载重" v-model="form.carWeight" />
 				</view>
 			</view>
 			<view class="item-line">
-				收费明细
-			</view>
-			<view class="item" v-for="item in itemList" :key="item.id">
-				<view class="l" style="flex: 6;">{{item.itemName}}:
-				</view>
-				<view class="r">
-					<view style="margin-left: 20rpx;">
-						{{item.price}}元
-					</view>
-				</view>
+				收费明细<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>
 
-			<u-checkbox-group v-for="item in itemType.items" placement="column">
-				<uni-list>
-					<uni-list-item :title="item.itemName" :note="item.price+''+item.unit">
 						<template v-slot:footer>
-							<u-checkbox :name="item.id" :checked="item.need">
-							</u-checkbox>
+							<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>
@@ -61,13 +82,10 @@
 		</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="saveFn"></u-button> -->
 			<u-button type="primary" v-if="obj" text="确认账单" @click="confirmFn" style="margin-top: 20rpx;"></u-button>
-			<u-button type="info" text="重置" @click="resetFn" style="margin-top: 20rpx;"></u-button>
 		</view>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
-
 	</view>
 </template>
 
@@ -75,16 +93,19 @@
 	export default {
 		data() {
 			return {
+				showRemark: false,
 				type: {
-					index: 0,
+					index: 1,
 					list: ['空车', '载货']
 				},
 				obj: null,
 				form: {
-					carNo: ''
+					carNo: '',
+					carSize: '',
+					carWeight: ''
 				},
-				itemList: [],
 				list: [],
+				checkList: [],
 				itemType: {
 					id: '',
 					name: '',
@@ -92,75 +113,81 @@
 				}
 			}
 		},
+		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) {
 			let typeId = options.typeId;
 			this.itemType.id = typeId;
 			this.getItemType();
+			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;
+				})
+			})
 		},
-		mounted() {},
 		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 => {
-					this.itemType = resp.data;
+					let data = resp.data;
+					this.itemType = data;
+					let items = data.items;
+					this.checkList = items.filter(obj => obj.need == 1).map(obj => obj.id)
+
 				})
 			},
-
 			bindPickerChange(e) {
 				let index = e.detail.value;
+				console.log(index)
 				this.type.index = index //当前picker选中的值
-				if (index == 0) {
-					this.itemList = this.list.filter(obj => obj.itemName.indexOf('车头车厢') !== -1)
-				} else {
-					this.itemList = this.list.filter(obj => obj.itemName.indexOf('车头消杀') !== -1)
-				}
-			},
-			getTypeList() {
-				this.$api.getItemList({
-					business: 0
-				}).then(resp => {
-					let list = resp.data;
-					let itemList = [];
-					for (let i in list) {
-						let item = list[i];
-						itemList.push(item.items[0]);
-					}
-					this.list = itemList;
-					this.itemList = itemList.filter(obj => obj.itemName.indexOf('车头车厢') !== -1);
-					if (this.obj) {
-						this.form.carNo = this.obj.carNo;
-						this.form.businessCarId = this.obj.businessCarId;
-						this.form.adminConfirmInput = this.obj.adminConfirmInput;
-						this.form.id = this.obj.id;
-						let index = this.type.list.indexOf(this.obj.goodsName);
-						this.type.index = index
-						if (index == 0) {
-							this.itemList = this.list.filter(obj => obj.itemName.indexOf('车头车厢') !== -1)
-						} else {
-							this.itemList = this.list.filter(obj => obj.itemName.indexOf('车头消杀') !== -1)
-						}
-					}
-				})
-			},
-			resetFn() {
-				this.form.carNo = '';
-				this.type.index = 0;
-				this.itemList = this.list;
 			},
 			saveFn() {
 				if (!this.form.carNo) {
 					this.$common.toast('请输入车牌号')
 					return;
 				}
-				this.form.itemJson = JSON.stringify(this.itemList);
+				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 = this.obj ? '确认修改该业务?' : '确认录入该车辆的消杀业务?'
+				let content = this.obj ? '确认修改该业务?' : '确认录入该车辆的业务?'
 				uni.showModal({
 					title: '提示',
 					content: content,
@@ -179,7 +206,7 @@
 			addFn() {
 				this.$api.addCarDisinfect(this.$common.removeNull(this.form)).then(resp => {
 					if (resp.code == 200) {
-						this.$common.to('/pages/onely-disinfect/addSuccess')
+						this.$common.to('/pages/onely-disinfect/addSuccess?typeId=' + this.itemType.id)
 					}
 				})
 			},

+ 18 - 15
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -40,14 +40,14 @@
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
 					<sa-item type="text" name="客户名称" placeholder="客户名称" v-model="p.customerName"></sa-item>
-					<sa-item type="text" name="车牌号"  placeholder="越南车牌" v-model="p.cardNo"></sa-item>
-					<sa-item type="text" name="司机名称"  placeholder="越南司机" v-model="p.driverName"></sa-item>
+					<sa-item type="text" name="车牌号" placeholder="越南车牌" v-model="p.cardNo"></sa-item>
+					<sa-item type="text" name="司机名称" placeholder="越南司机" v-model="p.driverName"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br />
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
 				<div class="fast-btn">
-					<el-button  v-if="sa.isAuth('tb-business-add')" size="mini" type="primary" @click="add()">
+					<el-button v-if="sa.isAuth('tb-business-add')" size="mini" type="primary" @click="add()">
 						新增</el-button>
 					<el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
 					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
@@ -66,24 +66,27 @@
 					</sa-td>
 					<el-table-column label="操作" width="240px" fixed="right">
 						<template slot-scope="s">
-							<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
 								&&s.row.payStatus==1
 								&&sa.isAuth('tb-business-confirm')
 								&&currentCustomerId=='1'" @click="confirmFn(s.row)">确认账单</el-button>
-							<el-button class="c-btn" type="success"
-							v-if="sa.isAuth('tb-business-pay')
+							<el-button class="c-btn" type="success" v-if="sa.isAuth('tb-business-pay')
 								&&s.row.payStatus==1
 								&&s.row.adminConfirmInput==1
 								&&currentCustomerId!='1'" @click="payFn(s.row)">
 								马上支付</el-button>
-							<el-button class="c-btn" type="primary" @click="itemFn(s.row)" v-if="currentCustomerId=='1'">业务项</el-button>
-							<el-button v-if="sa.isAuth('tb-business-add')" class="c-btn" type="primary" @click="carFn(s.row)">车辆管理
+							<el-button class="c-btn" type="primary" @click="itemFn(s.row)"
+								v-if="currentCustomerId=='1'">业务项</el-button>
+							<el-button v-if="sa.isAuth('tb-business-add')" class="c-btn" type="primary"
+								@click="carFn(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&&sa.isAuth('tb-business-edit')" @click="update(s.row)">
+							<el-button class="c-btn" type="primary"
+								v-if="s.row.adminConfirmInput==0&&sa.isAuth('tb-business-edit')" @click="update(s.row)">
 								修改</el-button>
-							<el-button class="c-btn" type="danger" v-if="s.row.payStatus==1&&sa.isAuth('tb-business-del')&&s.row.adminConfirmInput==0" @click="del(s.row)">删除
+							<el-button class="c-btn" type="danger"
+								v-if="s.row.payStatus==1&&sa.isAuth('tb-business-del')&&s.row.adminConfirmInput==0"
+								@click="del(s.row)">删除
 							</el-button>
 						</template>
 					</el-table-column>
@@ -114,8 +117,7 @@
 						</el-col>
 						<el-col span="12">
 							<sa-info name="中国车停车费" br>{{confirm.form.chinaPartMoney}}(元)</sa-info>
-							<sa-info name="越南车停车费" br>{{confirm.form.partMoney}}(元)</sa-info>
-								<sa-info name="停车费合计" br>{{confirm.form.partMoney+confirm.form.chinaPartMoney}}(元)</sa-info>
+							<sa-info name="停车费合计" br>{{confirm.form.partMoney+confirm.form.chinaPartMoney}}(元)</sa-info>
 							<sa-info name="合计费用" br>{{confirm.form.totalMoney}}(元)</sa-info>
 						</el-col>
 					</el-row>
@@ -214,7 +216,7 @@
 						customerId: '', // 客户id 
 						customerName: '', // 客户名称 
 						no: '', // 编号 
-						isCar:0,
+						isCar: 0,
 						cardNo: '', // 车牌号 
 						cardSize: '', // 车规格 
 						netWeight: '', // 载重(kg) 
@@ -274,7 +276,8 @@
 						sa.showIframe('业务项', 'tb-business-item-list.html?businessId=' + data.id, '1050px', '95%');
 					},
 					carFn(data) {
-						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id+'&payStatus='+data.payStatus+'&confirm='+data.adminConfirmInput, '1050px', '95%');
+						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
+							.payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '95%');
 					},
 					blurFn() {
 						console.log(123)

+ 201 - 0
sp-admin/sa-view/tb-business/tb-car-disincle-add.html

@@ -0,0 +1,201 @@
+<!DOCTYPE html>
+<html>
+	<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" />
+		<!-- 所有的 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>
+		<script src="../../static/kj/upload-util.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .c-panel .el-form {
+				width: 180px;
+			}
+
+			.item-num .el-input__inner {
+				width: 100px;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m" label-position="left">
+						<el-card class="box-card">
+							<div slot="header" class="clearfix">
+								<span>基本资料</span>
+							</div>
+							<el-row>
+								<el-col :span='12'>
+									<sa-item name="车牌号" placeholder="请输入车牌号" v-model="m.carNo" br>
+									</sa-item>
+									<sa-item type="num" name="车辆规格" placeholder="请输入车辆规格" v-model="m.carSize" br>
+									</sa-item>
+								</el-col>
+								<el-col :span='12'>
+									<div class="c-item">
+										<label class="c-label">车辆类型:</label>
+										<el-select v-model="m.carType" placeholder="请选择">
+											<el-option label="空车" value="空车">
+											</el-option>
+											<el-option label="载货" value="载货">
+											</el-option>
+										</el-select>
+									</div>
+									<sa-item v-if="m.carType=='载货'" type="num" name="载重(kg)" placeholder="请输入车辆载重"
+										v-model="m.carWeight" br>
+									</sa-item>
+								</el-col>
+							</el-row>
+							<el-card class="box-card">
+								<div slot="header" class="clearfix">
+									<span>收费明细<label style="color: red;">(总共{{totalPrice}}元)</label></span>
+									<el-select v-model="m.itemTypeId" placeholder="请选择" @change="getItems"
+										style="float: right; padding: 3px 0">
+										<el-option v-for="(item,index) in itemTypeList" :label="item.name"
+											:value="item.id">
+										</el-option>
+									</el-select>
+								</div>
+								<div>
+									<el-checkbox-group v-model="checkList">
+										<el-row v-for="(item,index) in items"
+											style="border-bottom: 1px solid #E4E4E4;line-height: 90px;">
+											<el-col :span="11">
+												<el-checkbox :disabled="item.need==1" :label="item.id">
+													<div>{{item.itemName}}(<label
+															style="color: red;">{{item.price}}{{item.unit}}</label>)
+													</div>
+												</el-checkbox>
+											</el-col>
+											<el-col :span="6">
+												<el-input-number :disabled="item.inc==0" class="item-num"
+													v-model="item.num" :min="1" :max="10"></el-input-number>
+											</el-col>
+											<el-col :span="7">
+												<sa-item type="textarea" name="备注" placeholder="请输入备注"
+													v-model="item.remark" br>
+												</sa-item>
+											</el-col>
+										</el-row>
+									</el-checkbox-group>
+								</div>
+							</el-card>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-business-add')">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</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: { // 查询参数
+						business: 0,
+						pageNo: 1, // 当前页 
+						pageSize: 50, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: {
+						id: '', // 主键 
+						carNo: '',
+						carSize: '',
+						carType: '载货',
+						carWeight: '',
+						itemTypeId: ''
+					}, // 实体对象 
+					itemTypeList: [],
+					items: [],
+					checkList: []
+				},
+				computed: {
+					totalPrice() {
+						let checkList = this.checkList;
+						let items = this.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;
+					}
+				},
+				methods: {
+					getItemTypeList() {
+						sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function(res) {
+							let list = res.data;
+							if (list.length > 0) {
+								this.m.itemTypeId = list[0].id;
+								this.getItems();
+							}
+							this.itemTypeList = list;
+
+						}.bind(this));
+					},
+					getItems() {
+						sa.ajax('/TbItem/getTypeItemList', {
+							pageNo: 1,
+							pageSize: 30,
+							typeId: this.m.itemTypeId
+						}, function(resp) {
+							let list = resp.data;
+							this.checkList = list.filter(obj => obj.need == 1).map(obj => obj.id)
+							this.items = list;
+						}.bind(this))
+					},
+					ok() {
+						let m = this.m;
+						if (!m.carNo) {
+							sa.error('请输入车牌号')
+							return false;
+						}
+						if (!m.carSize) {
+							sa.error('请输入规格')
+							return false;
+						}
+						if (!m.carWeight && m.carType == '载货') {
+							sa.error('请输入车辆载重')
+							return false;
+						}
+						let checkList = this.checkList;
+						let itemList = this.items;
+						let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
+						m.itemJson = JSON.stringify(list);
+						sa.ajax('/api/addOtherBusiness', sa.removeNull(m), function(resp) {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}.bind(this))
+					}
+				},
+				mounted: function() {
+					this.getItemTypeList()
+				}
+			})
+		</script>
+	</body>
+</html>

+ 221 - 0
sp-admin/sa-view/tb-business/tb-car-disincle-edit.html

@@ -0,0 +1,221 @@
+<!DOCTYPE html>
+<html>
+	<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" />
+		<!-- 所有的 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>
+		<script src="../../static/kj/upload-util.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .c-panel .el-form {
+				width: 180px;
+			}
+
+			.item-num .el-input__inner {
+				width: 100px;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m" label-position="left">
+						<el-card class="box-card">
+							<div slot="header" class="clearfix">
+								<span>基本资料</span>
+							</div>
+							<el-row>
+								<el-col :span='12'>
+									<sa-item name="车牌号" placeholder="请输入车牌号" v-model="m.carNo" br>
+									</sa-item>
+									<sa-item type="num" name="车辆规格" placeholder="请输入车辆规格" v-model="m.carSize" br>
+									</sa-item>
+								</el-col>
+								<el-col :span='12'>
+									<div class="c-item">
+										<label class="c-label">车辆类型:</label>
+										<el-select v-model="m.carType" placeholder="请选择">
+											<el-option label="空车" value="空车">
+											</el-option>
+											<el-option label="载货" value="载货">
+											</el-option>
+										</el-select>
+									</div>
+									<sa-item v-if="m.carType=='载货'" type="num" name="载重(kg)" placeholder="请输入车辆载重"
+										v-model="m.carWeight" br>
+									</sa-item>
+								</el-col>
+							</el-row>
+							<el-card class="box-card">
+								<div slot="header" class="clearfix">
+									<span>收费明细<label style="color: red;">(总共{{totalPrice}}元)</label></span>
+									<el-select v-model="m.itemTypeId" placeholder="请选择" @change="getItems"
+										style="float: right; padding: 3px 0">
+										<el-option v-for="(item,index) in itemTypeList" :label="item.name"
+											:value="item.id">
+										</el-option>
+									</el-select>
+								</div>
+								<div>
+									<el-checkbox-group v-model="checkList">
+										<el-row v-for="(item,index) in items"
+											style="border-bottom: 1px solid #E4E4E4;line-height: 90px;">
+											<el-col :span="11">
+												<el-checkbox :disabled="item.need==1" :label="item.id">
+													<div>{{item.itemName}}(<label
+															style="color: red;">{{item.price}}{{item.unit}}</label>)
+													</div>
+												</el-checkbox>
+											</el-col>
+											<el-col :span="6">
+												<el-input-number :disabled="item.inc==0" class="item-num"
+													v-model="item.num" :min="1" :max="10"></el-input-number>
+											</el-col>
+											<el-col :span="7">
+												<sa-item type="textarea" name="备注" placeholder="请输入备注"
+													v-model="item.remark" br>
+												</sa-item>
+											</el-col>
+										</el-row>
+									</el-checkbox-group>
+								</div>
+							</el-card>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-business-add')">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</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: {
+					id: sa.p('id', ''),
+					p: { // 查询参数
+						business: 0,
+						pageNo: 1, // 当前页 
+						pageSize: 50, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: {
+						id: '', // 主键 
+						carNo: '',
+						carSize: '',
+						carType: '载货',
+						carWeight: '',
+						itemTypeId: ''
+					}, // 实体对象 
+					itemTypeList: [],
+					items: [],
+					businessItems:[],
+					checkList: [],
+				},
+				computed: {
+					totalPrice() {
+						let checkList = this.checkList;
+						let items = this.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;
+					}
+				},
+				methods: {
+					getItemTypeList() {
+						sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function(res) {
+							let list = res.data;
+							this.itemTypeList = list;
+							this.getItems();
+						}.bind(this));
+					},
+					getItems() {
+						sa.ajax('/TbItem/getTypeItemList', {
+							pageNo: 1,
+							pageSize: 30,
+							typeId: this.m.itemTypeId
+						}, function(resp) {
+							let list = resp.data;
+							this.items = list;
+							let businessItems=this.businessItems;
+							list.forEach(obj=>{
+								businessItems.forEach(item=>{
+									if(obj.id==item.itemId){
+										obj.remark=item.remark;
+										obj.num=item.num;
+									}
+								})
+							})
+						}.bind(this))
+					},
+					ok() {
+						let m = this.m;
+						if (!m.carNo) {
+							sa.error('请输入车牌号')
+							return false;
+						}
+						if (!m.carSize) {
+							sa.error('请输入规格')
+							return false;
+						}
+						if (!m.carWeight && m.carType == '载货') {
+							sa.error('请输入车辆载重')
+							return false;
+						}
+						let checkList = this.checkList;
+						let itemList = this.items;
+						let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
+						m.itemJson = JSON.stringify(list);
+						m.items=null;
+						sa.ajax('/api/editOtherBusiness', sa.removeNull(m), function(resp) {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}.bind(this))
+					},
+					getOtherBusinessById() {
+						sa.ajax('/TbBusiness/getOtherBusinessById', {
+							id: this.id
+						}, function(resp) {
+							let data=resp.data;
+							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();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 204 - 0
sp-admin/sa-view/tb-business/tb-car-disincle-info.html

@@ -0,0 +1,204 @@
+<!DOCTYPE html>
+<html>
+	<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" />
+		<!-- 所有的 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>
+		<script src="../../static/sa.js"></script>
+		<script src="../../static/kj/upload-util.js"></script>
+		<style type="text/css">
+			.c-panel .c-label {
+				width: 8em;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<el-form v-if="m">
+						<el-row>
+							<el-collapse value='1'>
+								<el-collapse-item name="1">
+									<div slot="title">
+										基础资料
+									</div>
+									<div>
+										<el-row>
+											<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.goodsName}}</sa-info>
+												<sa-info name="载重" br v-if="m.goodsName!=='空车'">{{m.netWeight}}(kg)</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>
+													<label v-if="m.chinaCarNo">{{m.chinaCarNo}}</label>
+													<label v-else>{{m.cardNo}}</label>
+												</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>
+										
+										<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>
+										<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>
+								</el-collapse-item>
+							</el-collapse>
+						</el-row>
+						<el-row>
+							<el-collapse value='1'>
+								<el-collapse-item name="1">
+									<div slot="title">
+										具体业务项
+										<label
+											style="color: red; font-weight: bold;margin-left: 20px;">合计:({{m.itemPrice}}元)</label>
+									</div>
+									<el-table :data="tableData" style="width: 100%">
+										<el-table-column prop="itemTypeName" label="业务分类" width="180">
+										</el-table-column>
+										<el-table-column prop="itemName" label="具体项目" width="180">
+										</el-table-column>
+										<el-table-column prop="itemPrice" label="单价">
+										</el-table-column>
+										<el-table-column prop="unit" label="计费标准">
+										</el-table-column>
+										<el-table-column prop="num" label="数量">
+										</el-table-column>
+										<el-table-column prop="total" label="合计">
+										</el-table-column>
+										<sa-td width="120" name="支付状态" prop="payStatus" type="enum"
+											:jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
+										</sa-td>
+										<el-table-column prop="payTime" label="支付时间">
+										</el-table-column>
+										<sa-td type="img-list" name="凭据" prop="ticket"></sa-td>
+										<el-table-column label="其他凭据">
+											<template slot-scope="s">
+												<el-button class="c-btn" type="primary" @click="uploadFn(s.row)">上传
+												</el-button>
+											</template>
+										</el-table-column>
+									</el-table>
+								</el-collapse-item>
+							</el-collapse>
+						</el-row>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<!-- <el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印单据</el-button> -->
+				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
+			</div>
+
+			<el-dialog title="上传凭据" :visible.sync="upload.visible" width="400">
+				<el-form>
+					<sa-item type="img-list" name="凭据图片" v-model="upload.form.ticket" br></sa-item>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="upload.visible=false">取 消</el-button>
+					<el-button type="primary" @click="ok()">确 定</el-button>
+				</span>
+			</el-dialog>
+
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取数据ID 
+					m: null,
+					tableData: [],
+					upload: {
+						visible: false,
+						form: {
+							id: '',
+							ticket: ''
+						}
+					}
+				},
+				methods: {
+					print: function() {
+						sa.showIframe('打印收费单据', 'print.html?id=' + this.id, '1000px', '100%');
+					},
+					uploadFn(data) {
+						Object.assign(this.upload, {
+							visible: true,
+							form: data
+						})
+					},
+					ok() {
+						if (!this.upload.form.ticket) {
+							sa.error('请上传凭据');
+							return;
+						}
+						sa.ajax('/TbBusinessItem/update', this.upload.form, function(resp) {
+							this.upload.visible = false;
+						}.bind(this))
+					},
+					getInfo() {
+						sa.ajax('/TbBusiness/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							this.tableData = res.data.items;
+						}.bind(this))
+					}
+				},
+				mounted: function() {
+					this.getInfo()
+				}
+			})
+		</script>
+	</body>
+</html>

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

@@ -20,7 +20,7 @@
 		.complete-modal .c-label,
 		.confirm-in .c-label,
 		.confirm-info .c-label {
-			width: 140px;
+			width: 290px;
 		}
 	</style>
 	<body>
@@ -39,26 +39,20 @@
 						</el-select>
 					</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 = ''; 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>
 					<br />
 				</el-form>
-				<!-- ------------- 快捷按钮 ------------- -->
-				<!-- <div class="fast-btn">
-					<el-button  v-if="sa.isAuth('tb-business-add')" size="mini" type="primary" @click="add()">
-						新增</el-button>
-					<el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
-					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
-				</div> -->
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
+					<el-table-column type="index" width="50"></el-table-column>
 					<sa-td name="业务单号" prop="no" width="160"></sa-td>
-					<sa-td name="业务类型" prop="goodsName" ></sa-td>
-					<sa-td name="车牌号"  prop="carNo"></sa-td>
+					<sa-td name="业务类型" prop="goodsName"></sa-td>
+					<sa-td name="车牌号" prop="carNo"></sa-td>
 					<sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td>
-					<sa-td name="业务用费(元)" prop="itemPrice" width="130"></sa-td>
-					<sa-td name="停车用费(元)" prop="basePartMoney" width="130"></sa-td>
-					<sa-td name="总用费(元)" prop="totalMoney"></sa-td>
 					<sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
+					<sa-td name="用费(元)" prop="totalMoney"></sa-td>
 					<sa-td name="入场时间" prop="realInTime" width="140"></sa-td>
 					<sa-td name="离场时间" prop="realOutTime" width="140"></sa-td>
 					<sa-td width="160" name="创建时间" prop="createTime"></sa-td>
@@ -66,7 +60,17 @@
 					<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')
-								&&currentCustomerId=='1'" @click="confirmFn(s.row)">账单确认</el-button>
+								&&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"
+								@click="update(s.row)">
+								修改</el-button>
+							<el-button class="c-btn" type="danger"
+								v-if="sa.isAuth('tb-business-del')&&s.row.adminConfirmInput==0"
+								@click="del(s.row)">删除
+							</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -74,30 +78,24 @@
 				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
 				</sa-item>
 			</div>
-			<el-dialog title="业务确认" :visible.sync="confirm.visible" width="650px">
+			<el-dialog :title="confirm.title" :visible.sync="confirm.visible" width="650px">
 				<div class="confirm-info">
 					<el-row>
-						<el-col span="12">
-							<sa-info name="订单号" br>{{confirm.form.no}}</sa-info>
-							<sa-info :name="item.itemName" br v-for="item in confirm.form.items">
-								{{item.itemPrice}}x{{item.num}}={{item.total}}元
-							</sa-info>
-						</el-col>
-						<el-col span="12">
-							<sa-info name="业务费用" br>{{confirm.form.itemPrice}}(元)</sa-info>
-							<sa-info name="停车费" br>{{confirm.form.basePartMoney}}(元)</sa-info>
-							<sa-info name="合计费用" br>{{confirm.form.totalMoney}}(元)</sa-info>
-						</el-col>
+						<sa-info name="订单号" br>{{confirm.form.no}}</sa-info>
+						<sa-info :name="item.itemName" br v-for="item in confirm.form.items">
+							{{item.itemPrice}}x{{item.num}}={{item.total}}元
+						</sa-info>
+						<sa-info name="创建时间" br>{{confirm.form.createTime}}</sa-info>
+						<sa-info name="总计费用" br>{{confirm.form.itemPrice}}(元)</sa-info>
 					</el-row>
 				</div>
 				<span slot="footer" class="dialog-footer">
 					<div v-if="confirm.form.adminConfirmInput==0">
 						<el-button @click="confirm.visible = false">取 消</el-button>
-						<el-button type="primary" @click="sureConfirmFn" >确 认</el-button>
+						<el-button type="primary" @click="sureConfirmFn">确 认</el-button>
 					</div>
 					<div v-else>
 						<el-button @click="confirm.visible = false">关闭</el-button>
-						<el-button type="info">已确认</el-button>
 					</div>
 				</span>
 			</el-dialog>
@@ -115,6 +113,7 @@
 					currentCustomerId: '1',
 					confirm: {
 						visible: false,
+						title:'',
 						form: {
 							ids: ''
 						}
@@ -123,7 +122,7 @@
 						id: '', // 主键 
 						no: '', // 编号 
 						isCar: 1,
-						adminConfirmInput:-1,
+						adminConfirmInput: -1,
 						cardNo: '', // 车牌号 
 						outDayTime: '', // 离境时间 
 						partMoney: '', // 停车费用 
@@ -140,24 +139,56 @@
 					}
 				},
 				methods: {
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1050px', '90%');
+					},
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
+					},
+					update(data) {
+						sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
+					},
 					getPcodeByCurrRid() {
 						sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
 							this.perCode = resp.data;
 						}.bind(this))
 					},
 					confirmFn(data) {
-						console.log(data);
 						sa.ajax('/TbBusinessItem/getList', {
 							businessId: data.id
 						}, function(resp) {
 							data.items = resp.data;
 							Object.assign(this.confirm, {
 								visible: true,
+								title:'账单确认',
 								form: data,
 							})
 							this.confirm.form.ids = data.id;
 						}.bind(this));
 					},
+					checkConfirmFn(data){
+						sa.ajax('/TbBusinessItem/getList', {
+							businessId: data.id
+						}, function(resp) {
+							data.items = resp.data;
+							Object.assign(this.confirm, {
+								visible: true,
+								title:'查看账单',
+								form: data,
+							})
+						}.bind(this));
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbBusiness/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
 					sureConfirmFn() {
 						sa.ajax('/TbBusiness/confirm', {
 							ids: this.confirm.form.ids

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

@@ -46,12 +46,12 @@
 								></el-input-number>
 						</div>
 						<div>
-							<label>适用载重():</label>
+							<label>适用载重(kg):</label>
 							<div style="display: inline;margin-left: 20px;">
-								<el-input-number class="item-num" v-model="m.minWeight" :step="1" :min="0" :max="9999"
+								<el-input-number class="item-num" v-model="m.minWeight" :step="1" :min="0" :max="999999"
 									></el-input-number>
-								<el-input-number class="item-num" v-model="m.maxWeight" :step="1" :min="0" :max="9999"
+								<el-input-number class="item-num" v-model="m.maxWeight" :step="1" :min="0" :max="9999999"
 									></el-input-number>
 							</div>
 						</div>

+ 14 - 23
sp-admin/sa-view/tb-item-type/tb-item-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>
@@ -24,21 +27,11 @@
 				<div class="c-panel">
 					<el-form v-if="m">
 						<el-row>
-							<el-col span="12">
-								<sa-info name="项目编号" br>{{m.itemCode}}</sa-info>
-								<sa-info name="项目名称" br>{{m.itemName}}</sa-info>
-								<sa-info name="项目类型" br>{{m.typeName}}</sa-info>
-								<sa-info name="项目金额(元)" br>{{m.price}}</sa-info>
-							</el-col>
-							<el-col span="12">
-								<sa-info name="金额单位" br>{{m.unit}}</sa-info>
-								<sa-info name="车长(米)" br>{{m.carLength}}</sa-info>
-								<sa-info name="最大载重(吨)" br>{{m.maxWeight}}</sa-info>
-								<sa-info name="状态" br>
-									<span v-if="m.status == 1">启用</span>
-									<span v-if="m.status == 0">禁用</span>
-								</sa-info>
-							</el-col>
+							<sa-info name="明细名称" br>{{m.itemName}}</sa-info>
+							<sa-info name="计价单位" br>{{m.unit}}</sa-info>
+							<sa-info name="计费金额" br>{{m.price}}</sa-info>
+							<sa-info name="适用载重" br>{{m.minWeight}}kg 至 {{m.maxWeight}}kg</sa-info>
+							<sa-info name="适用车长" br>{{m.minLength}}米 至 {{m.carLength}}米</sa-info>
 						</el-row>
 					</el-form>
 				</div>
@@ -46,7 +39,7 @@
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
 				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
-<!--				<el-button @click="sa.closeCurrIframe()">取消</el-button>-->
+				<!--				<el-button @click="sa.closeCurrIframe()">取消</el-button>-->
 			</div>
 		</div>
 		<script>
@@ -56,21 +49,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('/TbItem/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>

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

@@ -34,7 +34,7 @@
 					</el-table-column>
 					<sa-td name="明细名称" prop="itemName" width="300px"></sa-td>
 					<sa-td name="价格" prop="price"></sa-td>
-					<sa-td name="单位" prop="unit"></sa-td>
+					<sa-td name="计价单位" prop="unit"></sa-td>
 					<sa-td name="适合规格(米)">
 						<template slot-scope="s">
 							<label>{{s.row.minLength}}—{{s.row.carLength}}</label>
@@ -108,6 +108,9 @@
 					add: function(data) {
 						sa.showIframe('新增数据', 'tb-item-add.html?id=-1', '600px', '60%');
 					},
+					get(data){
+						sa.showIframe('数据详情', 'tb-item-info.html?id=' + data.id, '600px', '60%');
+					},
 					// 删除
 					del: function(data) {
 						sa.confirm('是否删除,此操作不可撤销', function() {

+ 0 - 14
sp-admin/sa-view/tb-item-type/tb-item-type-add.html

@@ -47,20 +47,6 @@
 							</el-select>
 						</div>
 						<div class="c-item">
-							<label class="c-label">业务数量:</label>
-							<el-radio-group v-model="m.inc">
-								<el-radio :label="0">单个</el-radio>
-								<el-radio :label="1">可多个</el-radio>
-							</el-radio-group>
-						</div>
-						<div class="c-item">
-							<label class="c-label">备注:</label>
-							<el-radio-group v-model="m.needRemark">
-								<el-radio :label="0">选填</el-radio>
-								<el-radio :label="1">必填</el-radio>
-							</el-radio-group>
-						</div>
-						<div class="c-item">
 							<label class="c-label">税率(%):</label>
 							<el-input-number class="item-num" v-model="m.taxRate" :step="0.1" :min="0" :max="100"
 								></el-input-number>

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

@@ -42,10 +42,8 @@
 							</el-select>
 						</template>
 					</sa-td>
-					<sa-td name="业务数量" prop="inc" type="enum" :jv="{0: '单个', 1: '可多个'}"></sa-td>
 					<sa-td name="税率" prop="taxRate"></sa-td>
 					<sa-td name="排序" prop="sort"></sa-td>
-					<sa-td name="备注" prop="needRemark" type="enum" :jv="{0: '选填', 1: '必填'}"></sa-td>
 					<el-table-column label="操作" fixed="right" width="260px">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success"  @click="get(s.row)">二维码

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

@@ -42,12 +42,17 @@
 							<label>{{s.row.minWeight}}—{{s.row.maxWeight}}</label>
 						</template>
 					</sa-td>
+					<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>
+					<sa-td name="备注" prop="needRemark" type="switch" :jv="{1: '有[#005500]', 0: '无[#ff0000]'}"
+						@change="s => updateRemarkNeed(s.row)"></sa-td>
+					<sa-td name="备注状态" prop="mustRemark" type="switch" :jv="{1: '必填[#005500]', 0: '选填[#ff0000]'}"
+						@change="s => updateRemarkMust(s.row)"></sa-td>
 					<el-table-column label="操作" fixed="right">
 						<template slot-scope="s">
-							<el-button  class="c-btn" type="danger"
-								@click="del(s.row)">移除
+							<el-button class="c-btn" type="danger" @click="del(s.row)">移除
 							</el-button>
 						</template>
 					</el-table-column>
@@ -67,7 +72,7 @@
 				data: {
 					p: { // 查询参数  
 						id: '', // 主键
-						typeId:sa.p('id',''),
+						typeId: sa.p('id', ''),
 						pageNo: 1, // 当前页 
 						pageSize: 20, // 页大小 
 						sortType: 0 // 排序方式 
@@ -76,13 +81,70 @@
 					dataList: [], // 数据集合
 				},
 				methods: {
+					updateRemarkNeed: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.need;
+						var ajax = sa.ajax('/RelationTypeItem/updateRemarkNeed', {
+							itemId: data.id,
+							typeId: data.typeId,
+							needRemark: data.needRemark
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.needRemark = oldValue;
+							}
+						})
+					},
+					updateNum: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.inc;
+						var ajax = sa.ajax('/RelationTypeItem/updateNum', {
+							itemId: data.id,
+							typeId: data.typeId,
+							inc: data.inc
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.inc = oldValue;
+							}
+						})
+					},
+					updateRemarkMust: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.need;
+						var ajax = sa.ajax('/RelationTypeItem/updateRemarkMust', {
+							itemId: data.id,
+							typeId: data.typeId,
+							mustRemark: data.mustRemark
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.mustMark = oldValue;
+							}
+						})
+					},
 					updateStatus: function(data) {
 						// 声明变量记录是否成功 
 						var isOk = false;
 						var oldValue = data.need;
 						var ajax = sa.ajax('/RelationTypeItem/updateStatus', {
 							itemId: data.id,
-							typeId:data.typeId,
+							typeId: data.typeId,
 							need: data.need
 						}, function(res) {
 							isOk = true;
@@ -97,8 +159,9 @@
 					},
 					// 新增
 					add: function(data) {
-						let ids=this.dataList.map(obj=>obj.id).join(',');
-						sa.showIframe('选择明细', 'tb-item-select.html?typeId='+this.p.typeId+'&ids='+ids, '900px', '90%');
+						let ids = this.dataList.map(obj => obj.id).join(',');
+						sa.showIframe('选择明细', 'tb-item-select.html?typeId=' + this.p.typeId + '&ids=' + ids, '900px',
+							'90%');
 					},
 					// 删除
 					del: function(data) {

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-14748
+28208

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

@@ -0,0 +1,22 @@
+package com.pj.api.bo;
+
+import com.pj.project.tb_item.TbItem;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+public class OtherBusinessBO implements Serializable {
+    private String id;
+    private String carNo;
+    private Double carSize;
+    private String itemTypeId;
+    private String carType;
+    private Double carWeight;
+    private List<TbItem>items=new ArrayList<>();
+    private String itemJson;
+}

+ 22 - 0
sp-server/src/main/java/com/pj/api/bo/OtherBusinessEditBO.java

@@ -0,0 +1,22 @@
+package com.pj.api.bo;
+
+import com.pj.project.tb_business_item.TbBusinessItem;
+import com.pj.project.tb_item.TbItem;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+public class OtherBusinessEditBO implements Serializable {
+    private String id;
+    private String carNo;
+    private Double carSize;
+    private String itemTypeId;
+    private String carType;
+    private Double carWeight;
+    private List<TbBusinessItem>items=new ArrayList<>();
+}

+ 19 - 15
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -2,8 +2,10 @@ package com.pj.api.h5;
 
 
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
 import com.pj.api.bo.InOutRecordBO;
+import com.pj.api.bo.OtherBusinessBO;
 import com.pj.api.service.ApiService;
 import com.pj.constants.RoleEnum;
 import com.pj.constants.UserTypeEnum;
@@ -18,6 +20,7 @@ import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_declare.TbDeclare;
 import com.pj.project.tb_disinfect.TbDisinfect;
 import com.pj.project.tb_district.TbDistrict;
+import com.pj.project.tb_item.TbItem;
 import com.pj.project4sp.admin4login.SpAccAdminService;
 import com.pj.project4sp.global.BusinessException;
 import com.pj.utils.sg.AjaxJson;
@@ -199,23 +202,24 @@ public class ApiController {
     }
 
     @RequestMapping(value = "addCarDisinfect")
-    public AjaxJson addCarDisinfect() {
-        SoMap so = SoMap.getRequestSoMap();
-        String carNo = so.getString("carNo");
-        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.addCarDisinfect(carNo,itemJson,carType);
+    public AjaxJson addCarDisinfect(@RequestBody OtherBusinessBO otherBusinessBO) {
+        apiService.addCarDisinfect(otherBusinessBO);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("addOtherBusiness")
+    public AjaxJson addOtherBusiness(OtherBusinessBO otherBusinessBO) {
+        otherBusinessBO.setItems(JSONUtil.toList(otherBusinessBO.getItemJson(), TbItem.class));
+        apiService.addCarDisinfect(otherBusinessBO);
         return AjaxJson.getSuccess();
     }
+    @RequestMapping("editOtherBusiness")
+    public AjaxJson editOtherBusiness(OtherBusinessBO otherBusinessBO) {
+        otherBusinessBO.setItems(JSONUtil.toList(otherBusinessBO.getItemJson(), TbItem.class));
+        apiService.editOtherBusiness(otherBusinessBO);
+        return AjaxJson.getSuccess();
+    }
+
+
     @RequestMapping(value = "editCarDisinfect")
     public AjaxJson editCarDisinfect(CarDisincle carDisincle) {
         SoMap so = SoMap.getRequestSoMap();

+ 2 - 1
sp-server/src/main/java/com/pj/api/jh/api/JhController.java

@@ -53,7 +53,8 @@ public class JhController {
 
     @RequestMapping(value = "refund")
     public AjaxJson refund(@RequestParam String outTradeNo) {
-        return AjaxJson.getSuccessData(jhService.checkPayResult(outTradeNo));
+        jhService.refund(outTradeNo);
+        return AjaxJson.getSuccess();
     }
 
 }

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

@@ -158,4 +158,14 @@ public class JhService {
                 .setTransactionId(bo.getBankTrxNo())
                 .setCompleteDate(bo.getSuccessTime());
     }
+
+    public void refund(String outTradeNo) {
+        String url=jhConfig.getServerUrl()+"/uaps-web-gateway/refund/initRefund";
+        Map<String, Object> params = new HashMap<>();
+        params.put("businessMerchantNo", jhConfig.getBusinessMerchantNo());
+        params.put("outTradeNo", outTradeNo);
+        params.put("businessMerchantNo", jhConfig.getBusinessMerchantNo());
+        params.put("businessMerchantNo", jhConfig.getBusinessMerchantNo());
+
+    }
 }

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

@@ -8,6 +8,7 @@ import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.pj.api.bo.InOutRecordBO;
+import com.pj.api.bo.OtherBusinessBO;
 import com.pj.api.wx.bo.MsgDataBO;
 import com.pj.api.wx.service.WxService;
 import com.pj.constants.UserTypeEnum;
@@ -46,6 +47,7 @@ import com.pj.utils.cache.RedisUtil;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import lombok.extern.slf4j.Slf4j;
+import org.aspectj.weaver.ast.Or;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -265,8 +267,8 @@ public class ApiService {
         return tbBusinessItemService.getList(startPage);
     }
 
-    public void addCarDisinfect(String carNo, String itemJson, String carType) {
-        carNo = carNo.toUpperCase();
+    public void addCarDisinfect(OtherBusinessBO otherBusinessBO) {
+        String carNo = otherBusinessBO.getCarNo().trim().toUpperCase();
         TbBusinessCar db = tbBusinessCarService.checkCar(carNo);
         if (db != null) {
             throw new BusinessException("该车辆有未完成作业");
@@ -281,29 +283,31 @@ public class ApiService {
             TbCostomer tbCostomer = tbCostomerService.getById(customerId);
             tbBusiness.setCustomerId(customerId).setCustomerName(tbCostomer.getName());
         }
-        db.setPay(0).setCarSize(12D);
-        List<TbItem> tbItems = JSONUtil.toList(itemJson, TbItem.class);
+        db.setPay(0).setCarSize(otherBusinessBO.getCarSize()).setTimeUpdate(new Date());
+        List<TbItem> tbItems = otherBusinessBO.getItems();
         BigDecimal price = new BigDecimal("0");
         List<TbBusinessItem> itemList = new ArrayList<>();
         String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4);
         int index = 1;
         for (TbItem tbItem : tbItems) {
             TbBusinessItem item = new TbBusinessItem();
+            int num = tbItem.getNum();
+            BigDecimal itemTotalPrice = tbItem.getPrice().multiply(new BigDecimal(num));
             item.setNo(no + "0" + index)
                     .setBusinessType(TbCostomer.CustomerEnum.DISINFECT_TYPE.getType());
-            item.setItemCode(tbItem.getItemCode()).setNum("1")
-                    .setItemName(tbItem.getItemName()).setItemPrice(tbItem.getPrice())
+            item.setItemCode(tbItem.getItemCode()).setNum("1").setNum(num + "").setItemId(tbItem.getId()).setItemCode(tbItem.getItemCode())
+                    .setItemTypeName(tbItem.getTypeName())
+                    .setItemName(tbItem.getItemName()).setItemPrice(tbItem.getPrice()).setRemark(tbItem.getRemark())
                     .setItemTypeId(tbItem.getTypeId()).setItemTypeName(tbItem.getTypeName())
-                    .setUnit(tbItem.getUnit()).setTotal(tbItem.getPrice()).setCreateTime(new Date());
-            price = price.add(item.getItemPrice());
+                    .setUnit(tbItem.getUnit()).setTotal(itemTotalPrice).setCreateTime(new Date());
+            price = price.add(itemTotalPrice);
             itemList.add(item);
             index++;
         }
-//        BigDecimal initCarPartMoney = partConfig.getBasePrice();
-        tbBusiness
-                .setNo(no).setGoodsName(carType)
+        tbBusiness.setCardSize(otherBusinessBO.getCarSize()).setNetWeight(otherBusinessBO.getCarWeight())
+                .setNo(no).setGoodsName(otherBusinessBO.getCarType()).setItemTypeId(otherBusinessBO.getItemTypeId())
                 .setCreateTime(new Date()).setBusinessType(TbBusiness.BusinessType.CAR_DISINCLE.getCode())
-                .setItemPrice(price);
+                .setItemPrice(price).setTotalMoney(price);
         String prefix = carNo.substring(0, 1);
         if (CAR_LIST.contains(prefix)) {
             tbBusiness.setChinaCarNo(carNo);
@@ -317,7 +321,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();
         TbBusinessCar businessCar = tbBusinessCarService.getById(carId);
@@ -330,4 +334,12 @@ public class ApiService {
 
         });
     }
+
+    public void editOtherBusiness(OtherBusinessBO otherBusinessBO) {
+        String businessId = otherBusinessBO.getId();
+        tbBusinessItemService.removeByBusinessId(businessId);
+        tbBusinessCarService.removeByBusinessId(businessId);
+        this.addCarDisinfect(otherBusinessBO);
+    }
+
 }

+ 6 - 1
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItem.java

@@ -47,7 +47,12 @@ public class RelationTypeItem extends Model<RelationTypeItem> implements Seriali
 	/**
 	 * 是否必须 
 	 */
-	private String need;	
+	private int need;
+
+	private int needRemark;
+
+	private int mustRemark;
+	private int inc;
 
 	/**
 	 * 明细ID 

+ 28 - 1
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemController.java

@@ -69,10 +69,37 @@ public class RelationTypeItemController {
         SoMap so = SoMap.getRequestSoMap();
         String typeId = so.getString("typeId");
         String itemId = so.getString("itemId");
-        String need = so.getString("need");
+        int need = so.getInt("need");
         relationTypeItemService.updateStatus(typeId, itemId,need);
         return AjaxJson.getSuccess();
     }
+    @RequestMapping("updateNum")
+    public AjaxJson updateNum() {
+        SoMap so = SoMap.getRequestSoMap();
+        String typeId = so.getString("typeId");
+        String itemId = so.getString("itemId");
+        int inc = so.getInt("inc");
+        relationTypeItemService.updateNum(typeId, itemId,inc);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("updateRemarkMust")
+    public AjaxJson updateRemarkMust() {
+        SoMap so = SoMap.getRequestSoMap();
+        String typeId = so.getString("typeId");
+        String itemId = so.getString("itemId");
+        int mustRemark = so.getInt("mustRemark");
+        relationTypeItemService.updateRemarkMust(typeId, itemId,mustRemark);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("updateRemarkNeed")
+    public AjaxJson updateRemarkNeed() {
+        SoMap so = SoMap.getRequestSoMap();
+        String typeId = so.getString("typeId");
+        String itemId = so.getString("itemId");
+        int needRemark = so.getInt("needRemark");
+        relationTypeItemService.updateRemarkNeed(typeId, itemId,needRemark);
+        return AjaxJson.getSuccess();
+    }
 
 
 }

+ 26 - 4
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemService.java

@@ -55,7 +55,7 @@ public class RelationTypeItemService extends ServiceImpl<RelationTypeItemMapper,
         itemIdList.stream().filter(id -> !dbItemIdList.contains(id)).
                 forEach(id -> {
                     RelationTypeItem relationTypeItem = new RelationTypeItem();
-                    relationTypeItem.setItemId(id).setTypeId(typeId).setNeed("1");
+                    relationTypeItem.setItemId(id).setTypeId(typeId).setNeed(1);
                     this.save(relationTypeItem);
                 });
 
@@ -69,16 +69,38 @@ public class RelationTypeItemService extends ServiceImpl<RelationTypeItemMapper,
 
     public void setSingle(String typeId, String itemId) {
         RelationTypeItem relationTypeItem = new RelationTypeItem();
-        relationTypeItem.setNeed("1").setItemId(itemId).setTypeId(typeId);
+        relationTypeItem.setNeed(1).setItemId(itemId).setTypeId(typeId);
         this.save(relationTypeItem);
     }
 
-    public void updateStatus(String typeId, String itemId, String need) {
+    public RelationTypeItem findByTypeIdAndItemId(String typeId, String itemId){
         QueryWrapper<RelationTypeItem>ew=new QueryWrapper<>();
         ew.eq("type_id",typeId);
         ew.eq("item_id",itemId);
-        RelationTypeItem relationTypeItem= this.getOne(ew);
+        return getOne(ew);
+    }
+
+    public void updateStatus(String typeId, String itemId, int need) {
+        RelationTypeItem relationTypeItem= this.findByTypeIdAndItemId(typeId,itemId);
         relationTypeItem.setNeed(need);
         this.updateById(relationTypeItem);
     }
+
+    public void updateRemarkMust(String typeId, String itemId, int mustRemark) {
+        RelationTypeItem relationTypeItem= this.findByTypeIdAndItemId(typeId,itemId);
+        relationTypeItem.setMustRemark(mustRemark);
+        this.updateById(relationTypeItem);
+    }
+
+    public void updateRemarkNeed(String typeId, String itemId, int needRemark) {
+        RelationTypeItem relationTypeItem= this.findByTypeIdAndItemId(typeId,itemId);
+        relationTypeItem.setNeedRemark(needRemark);
+        this.updateById(relationTypeItem);
+    }
+
+    public void updateNum(String typeId, String itemId, int inc) {
+        RelationTypeItem relationTypeItem= this.findByTypeIdAndItemId(typeId,itemId);
+        relationTypeItem.setInc(inc);
+        this.updateById(relationTypeItem);
+    }
 }

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java

@@ -223,6 +223,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
      * 业务类型(1=车辆消杀,2=录入业务)
      */
     private Integer businessType=2;
+    private String itemTypeId;
 
     private transient String itemJson;
     private transient String peopleJson;

+ 11 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -6,6 +6,8 @@ import java.util.List;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.pj.api.bo.OtherBusinessBO;
 import com.pj.constants.UserTypeEnum;
 import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
@@ -13,6 +15,7 @@ import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.project.tb_declare.TbDeclare;
 import com.pj.project.tb_declare.TbDeclareService;
+import com.pj.project.tb_item.TbItem;
 import com.pj.project.tb_notices.TbNoticesService;
 import com.pj.project.tb_pass_record.TbPassRecord;
 import com.pj.project.tb_pass_record.TbPassRecordService;
@@ -303,6 +306,14 @@ public class TbBusinessController {
         tbBusinessService.uploadReport(tbBusiness);
         return AjaxJson.getSuccess();
     }
+    @RequestMapping("getOtherBusinessById")
+    public AjaxJson getOtherBusinessById(String id) {
+        return AjaxJson.getSuccessData(tbBusinessService.getOtherBusinessById(id));
+    }
+
+
+
+
 
     // ------------------------- 前端接口 -------------------------
 

+ 26 - 10
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -19,6 +19,8 @@ import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.api.bo.OtherBusinessBO;
+import com.pj.api.bo.OtherBusinessEditBO;
 import com.pj.api.open.ResultJson;
 import com.pj.api.wx.bo.MsgDataBO;
 import com.pj.api.wx.service.WxService;
@@ -218,9 +220,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             TbCar tbCar = tbCarService.findByCardNo(carNo);
             tbBusinessCar.setBusinessId(t.getId());
-            tbBusinessCar.setCarNo(carNo).setCarCompany(tbCar!=null?tbCar.getCustomerName():"临时");
+            tbBusinessCar.setCarNo(carNo).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时");
             tbBusinessCar.setBusinessId(t.getId()).setCustomerId(t.getCustomerId());
-            if(StrUtil.isEmpty(tbBusinessCar.getNo())){
+            if (StrUtil.isEmpty(tbBusinessCar.getNo())) {
                 tbBusinessCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
             }
 
@@ -234,7 +236,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
         }
         yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
-        if(StrUtil.isEmpty(yueCar.getNo())){
+        if (StrUtil.isEmpty(yueCar.getNo())) {
             yueCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
         }
         carList.add(yueCar);
@@ -498,8 +500,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             BigDecimal partMoney = new BigDecimal("0");
             String carNo = tbBusinessCar.getCarNo().substring(0, 1);
             if (inTime != null && CAR_LIST.contains(carNo)) {
-                if (tbBusinessCar.getPay()==1&&tbBusinessCar.getPayTime()!=null){
-                    inTime=tbBusinessCar.getPayTime();
+                if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getPayTime() != null) {
+                    inTime = tbBusinessCar.getPayTime();
                 }
                 partMoney = this.calculationPartMoney(inTime, now);
             }
@@ -510,7 +512,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 List<String> colorList = freeList.stream().map(f -> f.getCarNoColor().substring(0, 1)).collect(Collectors.toList());
                 String color = tbBusinessCar.getColor().substring(0, 1);
                 if (colorList.contains(color)) {
-                    partMoney=new BigDecimal("0");
+                    partMoney = new BigDecimal("0");
                 }
             }
             Map<String, Object> carMap = new HashMap<>();
@@ -524,9 +526,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             carsList.add(carMap);
         }
-        if (StrUtil.isNotEmpty(businessId)){
-            TbBusiness tbBusiness=this.getById(businessId);
-            if (tbBusiness!=null){
+        if (StrUtil.isNotEmpty(businessId)) {
+            TbBusiness tbBusiness = this.getById(businessId);
+            if (tbBusiness != null) {
                 result.put("type", tbBusiness.getBusinessType());
             }
         }
@@ -541,7 +543,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             for (TbBusinessItem item : items) {
                 Map<String, Object> itemMap = new HashMap<>();
                 itemMap.put("id", item.getId());
-                itemMap.put("name", item.getItemName()+"("+item.getItemTypeName()+")");
+                itemMap.put("name", item.getItemName() + "(" + item.getItemTypeName() + ")");
                 itemMap.put("price", item.getItemPrice().multiply(new BigDecimal(item.getNum())));
                 itemMap.put("pay", item.getPayStatus());
                 itemList.add(itemMap);
@@ -567,4 +569,18 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     public List<CarDisincle> getCarDisincleList(SoMap soMap) {
         return tbBusinessMapper.getCarDisincleList(soMap);
     }
+
+    public OtherBusinessEditBO getOtherBusinessById(String id) {
+        TbBusiness tbBusiness = this.getById(id);
+        List<TbBusinessItem> tbBusinessItems = tbBusinessItemService.findByBusinessId(id);
+        List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(id);
+        OtherBusinessEditBO otherBusinessBO = new OtherBusinessEditBO();
+        otherBusinessBO.setId(tbBusiness.getId());
+        otherBusinessBO.setCarNo(cars.get(0)
+                .getCarNo()).setCarWeight(tbBusiness.getNetWeight())
+                .setCarSize(tbBusiness.getCardSize()).setCarType(tbBusiness.getGoodsName())
+                .setItemTypeId(tbBusiness.getItemTypeId());
+        otherBusinessBO.setItems(tbBusinessItems);
+        return otherBusinessBO;
+    }
 }

+ 16 - 0
sp-server/src/main/java/com/pj/project/tb_item/TbItem.java

@@ -66,9 +66,25 @@ public class TbItem extends Model<TbItem> implements Serializable {
     private String killId;
 
     @TableField(exist = false)
+    private String remark;
+
+    @TableField(exist = false)
     private String typeName;
 
     @TableField(exist = false)
     private Integer need;
 
+    @TableField(exist = false)
+    private int needRemark;
+
+    @TableField(exist = false)
+    private int mustRemark;
+
+    @TableField(exist = false)
+    private int num=1;
+
+    @TableField(exist = false)
+    private int inc;
+
+
 }

+ 13 - 3
sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.xml

@@ -59,8 +59,8 @@
             a.min_length,
             a.min_weight,
             a.max_weight,
-            b.need,b.type_id,
-            a.unit
+            b.need,b.type_id,b.need_remark,b.must_remark,
+            a.unit,b.inc
         FROM
             tb_item a,
             relation_type_item b
@@ -68,9 +68,19 @@
             a.id = b.item_id
            	and b.type_id=#{typeId}
            	and a.status=1
+           	order by b.need desc
     </select>
 	<select id="getItemTypeById" resultType="com.pj.project.tb_item.TbItem">
-        select a.*,b.need as need from tb_item a ,relation_type_item b where a.id=b.item_id and b.type_id=#{typeId} and a.status=1
+        select a.*,b.need as need,
+        b.need_remark as needRemark,
+        b.must_remark as mustRemark,
+        b.inc,
+        '' as remark
+        from tb_item a ,relation_type_item b
+        where a.id=b.item_id
+        and b.type_id=#{typeId}
+        and a.status=1
+        order by b.need desc
     </select>
 
 

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemType.java

@@ -67,7 +67,6 @@ public class TbItemType extends Model<TbItemType> implements Serializable {
 	private String businessType="0";
 	private Integer business=1;
 	private Integer sort;
-	private Integer needRemark;
 
 	@TableField(exist = false)
 	private List<TbItem>items=new ArrayList<>();
@@ -82,6 +81,7 @@ public class TbItemType extends Model<TbItemType> implements Serializable {
 
 
 
+