فهرست منبع

h5流程修改

qzyReal 3 سال پیش
والد
کامیت
ff566bfbd5

+ 9 - 0
app/apis/api.js

@@ -63,6 +63,15 @@ export default {
 	adminSetIn(data){
 		return ajax.postForm('/TbBusiness/adminSetIn',data)
 	},
+	calJwPartMoney(data){
+		return ajax.postForm('/TbBusiness/calJwPartMoney',data)
+	},
+	calChinaPartMoney(data){
+		return ajax.postForm('/TbBusiness/calChinaPartMoney',data)
+	},
+	completeOrder(data){
+		return ajax.postForm('/TbBusiness/complete',data)
+	},
 	adminSetOut(data){
 		return ajax.postForm('/TbBusiness/adminOut',data)
 	},

+ 7 - 0
app/common/js/common.js

@@ -74,6 +74,13 @@ export default {
 		} 
 		return false;
 	},
+	isNum (str) {
+		str = str + '';
+		if((/^[0-9]*$/.test(str))||(/^[0-9]+(.[0-9]{1})?$/.test(str))){ 
+			return true; 
+		} 
+		return false;
+	},
 	removeNull(obj){
 		var newObj = {};
 		if(obj != undefined && obj != null) {

+ 8 - 0
app/pages.json

@@ -140,6 +140,14 @@
 		    
 		},
 		{
+		    "path" : "pages/business-order/createOrder",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": ""
+		    }
+		    
+		},
+		{
             "path" : "pages/business-entering/item-select",
             "style" :                                                                                    
             {

+ 135 - 161
app/pages/business-entering/business-edit.vue

@@ -4,9 +4,10 @@
 			<view class="top">
 				<text class="title">录入核酸人员</text>
 			</view>
-			<view style="display: flex;">
+			<view style="display: flex;margin-top: 40rpx;">
 				<u-button type="primary" @click="hs.visible=false" text="返回" style="width: 20px;" size="mini" />
-				<u-button type="primary" @click="showHsModal" text="添加" icon="plus" style="width: 20px;" size="mini" />
+				<u-button type="primary" @click="showHsModal" text="添加" v-show="hs.num>hs.list.length" icon="plus"
+					style="width: 20px;" size="mini" />
 			</view>
 			<u-row style="margin-top: 70rpx;">
 				<u-col span="4" style="text-align: center;">姓名</u-col>
@@ -45,80 +46,90 @@
 					</picker>
 				</view>
 			</view>
+
 			<view class="item">
 				<view class="l">境外车牌:</view>
 				<view class="r">
-					<u-input placeholder="输入车牌号" @input="carInputFn" v-model="form.cardNo" />
+					<u-input placeholder="输入车牌号"  v-model="form.cardNo" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">规格(米):</view>
+				<view class="l">境外车规格:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入车辆规格" v-model="form.cardSize" />
+					<u-input type="number" placeholder="输入车辆规格" @input="carSizeInput" v-model="form.cardSize">
+						<text slot="suffix">米</text>
+					</u-input>
 				</view>
 			</view>
+
 			<view class="item">
-				<view class="l">载重(吨):</view>
+				<view class="l">预计入场:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入载重" v-model="form.netWeight" />
+					<view class="r">
+						<uni-datetime-picker placeholder="请选择" @change="expectDayChange" :clear-icon="false" hide-second
+							:start="exprctStart" type="datetime" v-model="form.expectInDay" @close="closeFn" />
+					</view>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">货物:</view>
+				<view class="l">中国车牌号:</view>
 				<view class="r">
-					<picker v-if="goods.goodsList.length>0" class="p-picker" id="hw" @change="bindPickerChange($event)"
-						:value="goods.index" :range="goods.goodsList" range-key="name">
-						<text class="p-text">{{goods.goodsList[goods.index].name}}</text>
-						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
-					</picker>
+					<u-input placeholder="中国车牌号"  v-model="form.chinaCarNo" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">预计入场:</view>
+				<view class="l">中国司机:</view>
 				<view class="r">
-					<view class="r">
-						<uni-datetime-picker placeholder="请选择" type="datetime" v-model="form.expectInDay"
-							@close="closeFn" />
-					</view>
+					<u-input placeholder="司机姓名"  v-model="form.driverName" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">中国车牌号:</view>
+				<view class="l">联系号码:</view>
 				<view class="r">
-					<u-input placeholder="中国车牌号" @input="handler()" v-model="form.chinaCarNo" />
+					<u-input placeholder="司机联系号码"  v-model="form.driverPhone" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">中国司机:</view>
+				<view class="l">货物:</view>
 				<view class="r">
-					<u-input placeholder="司机姓名" @input="handler()" v-model="form.driverName" />
+					<picker v-if="goods.goodsList.length>0" class="p-picker" id="hw" @change="whChange($event)"
+						:value="goods.index" :range="goods.goodsList" range-key="name">
+						<text class="p-text">{{goods.goodsList[goods.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">联系号码:</view>
+				<view class="l">载重:</view>
 				<view class="r">
-					<u-input placeholder="司机联系号码" @input="handler()" v-model="form.driverPhone" />
+					<u-input type="number" placeholder="输入载重"  v-model="form.netWeight">
+						<text slot="suffix">吨</text>
+					</u-input>
 				</view>
 			</view>
 			<view class="item-line">
 				业务项
 			</view>
-			<view class="item" v-for="item in itemList" :key="item.id" v-if="item.items.length>0">
-				<view class="l">{{item.name}}:</view>
+			<view class="item" v-for="item in filterItemList" :key="item.id" v-if="item.items.length>0">
+				<view class="l"><text v-if="needTypeId.indexOf(item.id)!==-1" style="color: red;">*</text>{{item.name}}:
+				</view>
 				<view class="r">
-					<view @click="selectItemFn(item)">
-						<u-input placeholder="请选择" v-model="item.itemName" readonly clearable style="width: 120px;">
+					<view @click="selectItemFn(item)" style="width: 150px;">
+						<u-input placeholder="请选择" v-model="item.itemName" readonly clearable >
 							<u-icon name="close" v-if="item.itemName" slot="suffix" color="#E5E5E5;" size="5"
 								@click="item.itemName=''"></u-icon>
 						</u-input>
 					</view>
-					<u-input placeholder="数量" border="surround" v-model="item.num" type="number" style="width: 10px;"
-						v-if="item.itemName"></u-input>
-					<view style="margin-left: 20rpx;color: red;" v-if="item.itemName">
+					<view style="width: 20px;margin-left: 10rpx;">
+						<u-input placeholder="数量" :disabled="item.inc==0" border="surround" v-model="item.num" type="number"
+							style="width: 15px;" v-if="item.itemName"></u-input>
+					</view>
+					<view style="margin-left:30rpx;color: red;" v-if="item.itemName">
 						{{item.items.filter(obj=>obj.itemName==item.itemName)[0].price*item.num}}元
 					</view>
 					<u-icon name="plus" style="position: absolute;right: 10rpx;"
-						v-if="item.itemName&&item.name.indexOf('人员核酸检测')!==-1" @click="addHsFn(true)"></u-icon>
+						v-if="item.itemName&&item.name.indexOf('人')!==-1&&item.name.indexOf('核酸')!==-1"
+						@click="addHsFn(item.num,true)"></u-icon>
 				</view>
 			</view>
 			<view class="hj" v-show="totalPrice>0">
@@ -130,9 +141,9 @@
 		<view class="bottom-safety"></view>
 		<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
 			<view style="padding: 40rpx;line-height: 60rpx;text-align: center;">
-				<view v-for="item in car.filterList" :id="item.id"
-					style="margin-bottom: 20rpx;border-bottom: 1rpx solid #E5E5E5;" @click="selectCarNo(item)">
-					{{item.cardNo}}({{item.cardSize}})
+				<view v-for="item in filterUnitList" :id="item.id"
+					style="margin-bottom: 20rpx;border-bottom: 1rpx solid #E5E5E5;" @click="selectCarSize(item)">
+					{{item.unit}}
 				</view>
 			</view>
 		</u-popup>
@@ -177,7 +188,10 @@
 					filterList: [],
 				},
 				customerId: '1',
+				exprctStart: new Date().getTime(),
 				itemList: [],
+				filterItemList: [],
+				needTypeId: [],
 				form: {
 					customerId: '',
 					customerIndex: 0,
@@ -189,7 +203,8 @@
 					netWeight: '',
 					chinaCarNo: '',
 					driverName: '',
-					driverPhone: ''
+					driverPhone: '',
+					expectInDay: ''
 
 				},
 				show: false,
@@ -202,6 +217,8 @@
 				},
 				carList: [],
 				driverList: [],
+				unitList: [],
+				filterUnitList: [],
 				country: {
 					index: 0,
 					list: ['越南车', '中国车']
@@ -212,6 +229,7 @@
 				},
 				hs: {
 					visible: false,
+					num: 1,
 					list: []
 				},
 				modal: {
@@ -223,19 +241,17 @@
 				}
 			}
 		},
-		onLoad(optsions) {
-			this.form.id = optsions.id;
-
-		},
 		onShow() {
 			this.customerId = uni.getStorageSync('customerId');
-			if (!this.form.id) {
-				setTimeout(() => {
-					this.checkStore();
-				}, 1000)
+		},
+		onLoad(options) {
+			this.form.id = options.id;
+			this.getBusinessPeople();
+			if (this.customerId == '1') {
+				this.getCustomerList();
 			}
-
-
+			this.getGoodsList();
+			this.getUnit();
 		},
 		computed: {
 			totalPrice() {
@@ -256,24 +272,9 @@
 			}
 		},
 		created() {
-			this.getItemList();
-			if (this.customerId == '1') {
-				this.getCustomerList();
-			}
-			this.getCarList();
-			this.getDriverList();
-			this.getGoodsList();
-			if (this.form.id) {
-				this.$common.showLoading('加载中...')
-				setTimeout(() => {
-					this.getBusinessById();
-				}, 800)
-			}
+
 		},
 		methods: {
-			closeFn(data) {
-				console.log(data);
-			},
 			getBusinessById() {
 				this.$api.getBusinessById({
 					id: this.form.id
@@ -297,14 +298,12 @@
 							}
 						}
 					}
-					this.addHsFn(false)
 					setTimeout(() => {
 						this.car.carInput = false;
 					}, 50)
 				})
 			},
-			addHsFn(show) {
-				this.hs.visible = show;
+			getBusinessPeople() {
 				this.$api.getBusinessPeople({
 					businessId: this.form.id
 				}).then(resp => {
@@ -323,6 +322,36 @@
 					this.hs.list = r;
 				})
 			},
+			whChange(event) {
+				let index = event.detail.value; //当前picker选中的值
+				this.goods.index = index;
+				let goods = this.goods.goodsList[index];
+				let noNeedIds = goods.noNeedIds.split(',');
+				this.needTypeId = goods.needIds.split(',')
+				this.filterItemList = this.itemList.filter(obj => noNeedIds.indexOf(obj.id) == -1);
+			},
+			carSizeInput() {
+				let carSize = this.form.cardSize;
+				let filterUnitList = this.unitList.filter(obj => obj.unit.indexOf(carSize) !== -1);
+				this.car.carInput = filterUnitList.length > 0;
+				this.filterUnitList = filterUnitList;
+			},
+			getUnit() {
+				this.$api.getUnitList().then(resp => {
+					this.unitList = resp.data;
+				})
+			},
+			selectCarSize(data) {
+				this.form.cardSize = data.unit;
+				this.car.carInput = false;
+			},
+			expectDayChange(date) {
+				this.form.expectInDay = date;
+			},
+			addHsFn(num, show) {
+				this.hs.num = num;
+				this.hs.visible = show;
+			},
 			showHsModal() {
 				Object.assign(this.modal, {
 					visible: true,
@@ -338,8 +367,8 @@
 					this.$common.toast('请输入名称');
 					return;
 				}
-				if (!this.modal.form.phone) {
-					this.$common.toast('请输入联系号码');
+				if (this.modal.form.phone && !this.$common.isPhone(this.modal.form.phone)) {
+					this.$common.toast('联系号码不正确');
 					return;
 				}
 				let dbIndex = this.modal.form.index;
@@ -351,7 +380,7 @@
 					this.hs.list.push(this.modal.form);
 				}
 				this.modal.visible = false;
-				this.handler();
+				
 			},
 			editFn(data) {
 				Object.assign(this.modal, {
@@ -370,12 +399,19 @@
 			getGoodsList() {
 				this.$api.getGoodsList().then(resp => {
 					this.goods.goodsList = resp.data;
+					let goods = resp.data[0];
+					let noNeedIds = goods.noNeedIds.split(',');
+					this.needTypeId = goods.needIds.split(',')
+					this.$api.getItemList().then(resp => {
+						let list = resp.data;
+						this.itemList = list;
+						this.filterItemList = list.filter(obj => noNeedIds.indexOf(obj.id) == -1);
+						this.getBusinessById();
+					})
 				})
 			},
-			getDriverList() {
-				this.$api.getDriverList().then(resp => {
-					this.driverList = resp.data;
-				})
+			handlerTypeItem(goods) {
+
 			},
 			idCardInput() {
 				let val = this.form.driverIdCard;
@@ -396,22 +432,6 @@
 					that.driver.show = false;
 				}, 150)
 			},
-			getCarList() {
-				this.$api.getCarList().then(resp => {
-					this.carList = resp.data;
-				})
-			},
-			carInputFn() {
-				let val = this.form.cardNo;
-				let list = this.carList.filter(obj => obj.cardNo.indexOf(val) !== -1);
-				if (list.length > 0 && val) {
-					this.car.carInput = true;
-					this.car.filterList = list;
-				} else {
-					this.car.carInput = false;
-				}
-				this.handler();
-			},
 			selectCarNo(item) {
 				this.form.cardNo = item.cardNo;
 				this.form.cardSize = item.cardSize;
@@ -421,7 +441,6 @@
 				this.goods.index = index == -1 ? 0 : index;
 				this.country.index = this.country.list.indexOf(item.countryName)
 				let that = this;
-				this.handler();
 				setTimeout(() => {
 					this.car.carInput = false;
 				}, 150)
@@ -432,11 +451,7 @@
 					this.customer.customerList = resp.data;
 				})
 			},
-			getItemList() {
-				this.$api.getItemList().then(resp => {
-					this.itemList = resp.data;
-				})
-			},
+
 			selectItemFn(item) {
 				this.item = item;
 				this.show = true;
@@ -445,76 +460,16 @@
 			itemSelectFn(data) {
 				this.show = false;
 				this.item.itemName = data;
-				this.handler();
-			},
-			handler() {
-				let goodsIndex = this.goods.index;
-				let countryIndex = this.country.index;
-				this.form.goodsName = this.goods.goodsList[goodsIndex].name;
-				this.form.countryName = this.country.list[countryIndex];
-				this.form.goodsIndex = goodsIndex;
-				this.form.countryIndex = countryIndex;
-				this.form.peopleJson = JSON.stringify(this.hs.list);
-				let customerId = this.customerId;
-				if (customerId == '1') {
-					let customerIndex = this.customer.index;
-					this.form.customerId = this.customer.customerList[customerIndex].id;
-					this.form.customerIndex = customerIndex;
-				}
-				let that = this;
-				uni.setStorage({
-					key: 'business_' + customerId,
-					data: that.form
-				})
-			},
-			checkStore() {
-				let customerId = this.customerId;
-				let data = uni.getStorageSync('business_' + customerId)
-				if (data) {
-					let that = this;
-					uni.showModal({
-						title: '提示',
-						content: '您上次录入数据未提交,是否继续?',
-						cancelText: '重新录入',
-						confirmText: '继续',
-						success(res) {
-							if (res.confirm) {
-								that.rebackStore(data);
-							} else {
-								uni.removeStorageSync('business_' + customerId)
-							}
-						}
-					})
-				}
-			},
-			rebackStore(data) {
-				this.form = data;
-
-				this.goods.index = data.goodsIndex ? data.goodsIndex : 0;
-				this.customer.index = data.customerIndex ? data.customerIndex : 0;
-				this.country.index = data.countryIndex ? data.countryIndex : 0;
-				this.hs.list = data.peopleJson ? JSON.parse(data.peopleJson) : []
-				setTimeout(() => {
-					this.car.carInput = false;
-					this.driver.show = false;
-				}, 150)
 			},
 			check() {
-				this.handler();
 				if (!this.form.cardNo) {
 					this.$common.toast('请录入境外车牌号')
 					return false;
 				}
-				if (!this.form.cardSize) {
-					this.$common.toast('请录入车辆规格')
-					return false;
-				}
-				let inDayTime=this.form.expectInDay;
-				if(!inDayTime||inDayTime.length<12){
-					this.$common.toast('入场时间不正确')
+				if (!this.$common.isNum(this.form.cardSize)) {
+					this.$common.toast('车辆规格请录入数字')
 					return false;
 				}
-			
 
 				if (!this.form.chinaCarNo) {
 					this.$common.toast('请录入中国车牌')
@@ -524,16 +479,34 @@
 					this.$common.toast('请录入中国司机')
 					return false;
 				}
-				if (!this.form.driverPhone) {
-					this.$common.toast('请录入司机联系号码')
+				if (!this.$common.isPhone(this.form.driverPhone)) {
+					this.$common.toast('司机联系号码不正确')
 					return false;
 				}
-				let typeList = this.itemList.filter(obj => obj.itemName);
+				if (!this.$common.isNum(this.form.netWeight)) {
+					this.$common.toast('载重必须输入数字')
+					return false;
+				}
+				let typeList = this.filterItemList.filter(obj => obj.itemName);
 				if (typeList.length == 0) {
 					this.$common.toast('至少选择一项业务项')
 					return false;
 				}
-				if (typeList.filter(obj => obj.name.indexOf('核酸') !== -1).length > 0 && this.hs.list.length == 0) {
+				let filterItemList = this.filterItemList;
+				for (let j in this.needTypeId) {
+					let id = this.needTypeId[j];
+					for (let i in filterItemList) {
+						let type = filterItemList[i];
+						if (id == type.id && !type.itemName) {
+							this.$common.toast('[' + type.name + ']必选')
+							return;
+						}
+					}
+				}
+				let peopleList=this.hs.list;
+				if (typeList.filter(obj => obj.name.indexOf('人') !== -1 &&
+						obj.name.indexOf('核酸') !== -1).length > 0 &&
+					peopleList.length == 0) {
 					this.$common.toast('录入核酸检测人员')
 					return false;
 				}
@@ -554,12 +527,14 @@
 					})
 				}
 				this.form.itemJson = JSON.stringify(list);
+				this.form.peopleJson=JSON.stringify(peopleList);
 				this.form.items = null;
 				if (this.customerId == '1') {
 					this.form.customerId = this.customer.customerList[this.customer.index].id;
 				} else {
 					this.form.customerId = this.customerId;
 				}
+				this.form.goodsName = this.goods.goodsList[this.goods.index].name;
 
 				return true;
 			},
@@ -592,7 +567,6 @@
 						this.country.index = value;
 						break;
 				}
-				this.handler();
 			},
 		}
 	}

+ 123 - 72
app/pages/business-entering/business-entering.vue

@@ -4,9 +4,10 @@
 			<view class="top">
 				<text class="title">录入核酸人员</text>
 			</view>
-			<view style="display: flex;">
+			<view style="display: flex;margin-top: 40rpx;">
 				<u-button type="primary" @click="hs.visible=false" text="返回" style="width: 20px;" size="mini" />
-				<u-button type="primary" @click="showHsModal" text="添加" icon="plus" style="width: 20px;" size="mini" />
+				<u-button type="primary" @click="showHsModal" text="添加" v-show="hs.num>hs.list.length" icon="plus"
+					style="width: 20px;" size="mini" />
 			</view>
 			<u-row style="margin-top: 70rpx;">
 				<u-col span="4" style="text-align: center;">姓名</u-col>
@@ -45,45 +46,28 @@
 					</picker>
 				</view>
 			</view>
-			<view class="item">
-				<view class="l">货物:</view>
-				<view class="r">
-					<picker v-if="goods.goodsList.length>0" class="p-picker" id="hw"
-						@change="whChange($event)" :value="goods.index" :range="goods.goodsList"
-						range-key="name">
-						<text class="p-text">{{goods.goodsList[goods.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">境外车牌:</view>
 				<view class="r">
-					<u-input placeholder="输入车牌号"  v-model="form.cardNo" />
+					<u-input placeholder="输入车牌号" @input="handler()" v-model="form.cardNo" />
 				</view>
 			</view>
 			<view class="item">
 				<view class="l">境外车规格:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入车辆规格" @input="carSizeInput" v-model="form.cardSize" > 
-					<text slot="suffix">米</text>
-					</u-input>
-				</view>
-			</view>
-			<view class="item">
-				<view class="l">载重:</view>
-				<view class="r">
-					<u-input type="number" placeholder="输入载重" v-model="form.netWeight" >
-							<text slot="suffix">吨</text>
+					<u-input type="number" placeholder="输入车辆规格" @input="carSizeInput" v-model="form.cardSize">
+						<text slot="suffix">米</text>
 					</u-input>
 				</view>
 			</view>
+
 			<view class="item">
 				<view class="l">预计入场:</view>
 				<view class="r">
 					<view class="r">
-						<uni-datetime-picker placeholder="请选择" type="datetime" v-model="form.expectInDay"
-							@close="closeFn" />
+						<uni-datetime-picker placeholder="请选择" @change="expectDayChange" :clear-icon="false" hide-second
+							:start="exprctStart" type="datetime" v-model="form.expectInDay" @close="closeFn" />
 					</view>
 				</view>
 			</view>
@@ -105,11 +89,30 @@
 					<u-input placeholder="司机联系号码" @input="handler()" v-model="form.driverPhone" />
 				</view>
 			</view>
+			<view class="item">
+				<view class="l">货物:</view>
+				<view class="r">
+					<picker v-if="goods.goodsList.length>0" class="p-picker" id="hw" @change="whChange($event)"
+						:value="goods.index" :range="goods.goodsList" range-key="name">
+						<text class="p-text">{{goods.goodsList[goods.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">载重:</view>
+				<view class="r">
+					<u-input type="number" placeholder="输入载重" @input="handler()" v-model="form.netWeight">
+						<text slot="suffix">吨</text>
+					</u-input>
+				</view>
+			</view>
 			<view class="item-line">
 				业务项
 			</view>
 			<view class="item" v-for="item in filterItemList" :key="item.id" v-if="item.items.length>0">
-				<view class="l"><text v-if="needTypeId.indexOf(item.id)!==-1" style="color: red;">*</text>{{item.name}}:</view>
+				<view class="l"><text v-if="needTypeId.indexOf(item.id)!==-1" style="color: red;">*</text>{{item.name}}:
+				</view>
 				<view class="r">
 					<view @click="selectItemFn(item)">
 						<u-input placeholder="请选择" v-model="item.itemName" readonly clearable style="width: 120px;">
@@ -117,13 +120,14 @@
 								@click="item.itemName=''"></u-icon>
 						</u-input>
 					</view>
-					<u-input placeholder="数量" border="surround" v-model="item.num" type="number" style="width: 10px;"
-						v-if="item.itemName"></u-input>
+					<u-input placeholder="数量" :disabled="item.inc==0" border="surround" v-model="item.num" type="number"
+						style="width: 10px;" v-if="item.itemName"></u-input>
 					<view style="margin-left: 20rpx;color: red;" v-if="item.itemName">
 						{{item.items.filter(obj=>obj.itemName==item.itemName)[0].price*item.num}}元
 					</view>
 					<u-icon name="plus" style="position: absolute;right: 10rpx;"
-						v-if="item.itemName&&item.name.indexOf('人员核酸检测')!==-1" @click="addHsFn(item.itemName)"></u-icon>
+						v-if="item.itemName&&item.name.indexOf('人')!==-1&&item.name.indexOf('核酸')!==-1"
+						@click="addHsFn(item.itemName,item.num)"></u-icon>
 				</view>
 			</view>
 			<view class="hj" v-show="totalPrice>0">
@@ -135,9 +139,9 @@
 		<view class="bottom-safety"></view>
 		<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
 			<view style="padding: 40rpx;line-height: 60rpx;text-align: center;">
-				<view v-for="item in car.filterList" :id="item.id"
-					style="margin-bottom: 20rpx;border-bottom: 1rpx solid #E5E5E5;" @click="selectCarNo(item)">
-					{{item.cardSize}}
+				<view v-for="item in filterUnitList" :id="item.id"
+					style="margin-bottom: 20rpx;border-bottom: 1rpx solid #E5E5E5;" @click="selectCarSize(item)">
+					{{item.unit}}
 				</view>
 			</view>
 		</u-popup>
@@ -182,9 +186,10 @@
 					filterList: [],
 				},
 				customerId: '1',
+				exprctStart: new Date().getTime(),
 				itemList: [],
 				filterItemList: [],
-				needTypeId:[],
+				needTypeId: [],
 				form: {
 					customerId: '',
 					customerIndex: 0,
@@ -196,7 +201,8 @@
 					netWeight: '',
 					chinaCarNo: '',
 					driverName: '',
-					driverPhone: ''
+					driverPhone: '',
+					expectInDay: ''
 
 				},
 				show: false,
@@ -209,6 +215,8 @@
 				},
 				carList: [],
 				driverList: [],
+				unitList: [],
+				filterUnitList: [],
 				country: {
 					index: 0,
 					list: ['越南车', '中国车']
@@ -219,6 +227,7 @@
 				},
 				hs: {
 					visible: false,
+					num: 1,
 					list: []
 				},
 				modal: {
@@ -230,19 +239,8 @@
 				}
 			}
 		},
-		onLoad(optsions) {
-			this.form.id = optsions.id;
-
-		},
 		onShow() {
 			this.customerId = uni.getStorageSync('customerId');
-			if (!this.form.id) {
-				setTimeout(() => {
-					this.checkStore();
-				}, 1000)
-			}
-
-
 		},
 		computed: {
 			totalPrice() {
@@ -271,26 +269,38 @@
 		},
 		methods: {
 			whChange(event) {
-				let  index = event.detail.value; //当前picker选中的值
-				this.goods.index=index;
-				let goods=this.goods.goodsList[index];
+				let index = event.detail.value; //当前picker选中的值
+				this.goods.index = index;
+				let goods = this.goods.goodsList[index];
 				let noNeedIds = goods.noNeedIds.split(',');
-				this.needTypeId=goods.needIds.split(',')
+				this.needTypeId = goods.needIds.split(',')
 				this.filterItemList = this.itemList.filter(obj => noNeedIds.indexOf(obj.id) == -1);
+				this.handler();
 			},
-			carSizeInput(){
-				
+			carSizeInput() {
+				let carSize = this.form.cardSize;
+				let filterUnitList = this.unitList.filter(obj => obj.unit.indexOf(carSize) !== -1);
+				this.car.carInput = filterUnitList.length > 0;
+				this.filterUnitList = filterUnitList;
+				this.handler();
 			},
-			getUnit(){
-				this.$api.getUnitList().then(resp=>{
-					
+			getUnit() {
+				this.$api.getUnitList().then(resp => {
+					this.unitList = resp.data;
 				})
 			},
-			closeFn(data) {
-				console.log(data);
+			selectCarSize(data) {
+				this.form.cardSize = data.unit;
+				this.car.carInput = false;
+				this.handler();
+			},
+			expectDayChange(date) {
+				this.form.expectInDay = date;
+				this.handler();
 			},
-			addHsFn() {
+			addHsFn(itemName, num) {
 				this.hs.visible = true;
+				this.hs.num = num;
 			},
 			showHsModal() {
 				Object.assign(this.modal, {
@@ -307,8 +317,8 @@
 					this.$common.toast('请输入名称');
 					return;
 				}
-				if (!this.modal.form.phone) {
-					this.$common.toast('请输入联系号码');
+				if (this.modal.form.phone && !this.$common.isPhone(this.modal.form.phone)) {
+					this.$common.toast('联系号码不正确');
 					return;
 				}
 				let dbIndex = this.modal.form.index;
@@ -341,11 +351,12 @@
 					this.goods.goodsList = resp.data;
 					let goods = resp.data[0];
 					let noNeedIds = goods.noNeedIds.split(',');
-					this.needTypeId=goods.needIds.split(',')
+					this.needTypeId = goods.needIds.split(',')
 					this.$api.getItemList().then(resp => {
 						let list = resp.data;
 						this.itemList = list;
 						this.filterItemList = list.filter(obj => noNeedIds.indexOf(obj.id) == -1);
+						this.checkStore();
 					})
 				})
 			},
@@ -419,6 +430,14 @@
 					this.form.customerId = this.customer.customerList[customerIndex].id;
 					this.form.customerIndex = customerIndex;
 				}
+				let inputItem = this.filterItemList.filter(obj => obj.itemName).map(o => {
+					return {
+						typeId: o.id,
+						itemName: o.itemName,
+						num: o.num
+					}
+				});
+				this.form.inputItemJson = JSON.stringify(inputItem);
 				let that = this;
 				uni.setStorage({
 					key: 'business_' + customerId,
@@ -447,15 +466,27 @@
 			},
 			rebackStore(data) {
 				this.form = data;
-
 				this.goods.index = data.goodsIndex ? data.goodsIndex : 0;
 				this.customer.index = data.customerIndex ? data.customerIndex : 0;
-				this.country.index = data.countryIndex ? data.countryIndex : 0;
-				this.hs.list = data.peopleJson ? JSON.parse(data.peopleJson) : []
+				this.hs.list = data.peopleJson ? JSON.parse(data.peopleJson) : [];
+				if (data.inputItemJson) {
+					let inputItemList = JSON.parse(data.inputItemJson);
+					let filterList = this.filterItemList;
+					for (let i in filterList) {
+						let type = filterList[i];
+						for (let j in inputItemList) {
+							let s = inputItemList[j];
+							if (type.id == s.typeId) {
+								type.itemName = s.itemName;
+								type.num = s.num;
+								break;
+							}
+						}
+					}
+				}
 				setTimeout(() => {
 					this.car.carInput = false;
-					this.driver.show = false;
-				}, 150)
+				}, 100)
 			},
 			check() {
 				this.handler();
@@ -463,8 +494,8 @@
 					this.$common.toast('请录入境外车牌号')
 					return false;
 				}
-				if (!this.form.cardSize) {
-					this.$common.toast('请录入车辆规格')
+				if (!this.$common.isNum(this.form.cardSize)) {
+					this.$common.toast('车辆规格请录入数字')
 					return false;
 				}
 
@@ -476,16 +507,34 @@
 					this.$common.toast('请录入中国司机')
 					return false;
 				}
-				if (!this.form.driverPhone) {
-					this.$common.toast('请录入司机联系号码')
+				if (!this.$common.isPhone(this.form.driverPhone)) {
+					this.$common.toast('司机联系号码不正确')
+					return false;
+				}
+				if (!this.$common.isNum(this.form.netWeight)) {
+					this.$common.toast('载重必须输入数字')
 					return false;
 				}
-				let typeList = this.itemList.filter(obj => obj.itemName);
+				let typeList = this.filterItemList.filter(obj => obj.itemName);
 				if (typeList.length == 0) {
 					this.$common.toast('至少选择一项业务项')
 					return false;
 				}
-				if (typeList.filter(obj => obj.name.indexOf('核酸') !== -1).length > 0 && this.hs.list.length == 0) {
+				let filterItemList = this.filterItemList;
+				for (let j in this.needTypeId) {
+					let id = this.needTypeId[j];
+					for (let i in filterItemList) {
+						let type = filterItemList[i];
+						if (id == type.id && !type.itemName) {
+							this.$common.toast('[' + type.name + ']必选')
+							return;
+						}
+					}
+				}
+				let peopleList=this.hs.list;
+				if (typeList.filter(obj => obj.name.indexOf('人') !== -1 &&
+						obj.name.indexOf('核酸') !== -1).length > 0 &&
+					peopleList.length == 0) {
 					this.$common.toast('录入核酸检测人员')
 					return false;
 				}
@@ -506,12 +555,14 @@
 					})
 				}
 				this.form.itemJson = JSON.stringify(list);
+				this.form.peopleJson=JSON.stringify(peopleList);
 				this.form.items = null;
 				if (this.customerId == '1') {
 					this.form.customerId = this.customer.customerList[this.customer.index].id;
 				} else {
 					this.form.customerId = this.customerId;
 				}
+				this.form.goodsName = this.goods.goodsList[this.goods.index].name;
 
 				return true;
 			},

+ 54 - 37
app/pages/business-order/business-order.vue

@@ -5,7 +5,7 @@
 				<text class="title">业务订单</text>
 			</view>
 		</view>
-<!-- 		<u-sticky offset-top="0">
+		<!-- 		<u-sticky offset-top="0">
 			<u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
 		</u-sticky> -->
 		<view class="card-box">
@@ -57,6 +57,10 @@
 					</view>
 				</view>
 				<view class="b">
+					<view class="btn b3" v-if="businessItem.realInTime!=null
+								&&businessItem.complete==0
+								&&customemrId=='1'" @click="completeFn(businessItem)">
+						生成账单</view>
 					<view class="btn b3" v-if="businessItem.confirmInput==0
 								&&businessItem.payStatus==1
 								&&businessItem.outDayTime!=null
@@ -66,16 +70,14 @@
 					<view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1
 								&&businessItem.payStatus==1&&businessItem.confirmInput==1&&customemrId!='1'" @click="fkFn(businessItem)">
 						马上支付</view>
-						<view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1&&
+					<view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1&&
 									customemrId=='1'&&businessItem.payStatus<3&&businessItem.outDayTime!=null" @click="fkFn(businessItem)">
-							确认支付</view>
+						确认支付</view>
 					<view class="btn b1" v-if="customemrId=='1'&&businessItem.realInTime==null"
 						@click="rcFn(businessItem)">确认入场</view>
-					<view class="btn b1" v-if="customemrId=='1'&&businessItem.outDayTime==null&&businessItem.realInTime!=null" @click="cc(businessItem)">确认出场</view>
-					<view class="btn b1" v-if="customemrId=='1'
-							&&businessItem.confirmInput==0
-							&&businessItem.realInTime==null
-							&&businessItem.outDayTime==null" @click="editFn(businessItem)">修改</view>
+					<view class="btn b1" v-if="customemrId=='1'&&businessItem.complete==1&&businessItem.payStatus>1"
+						@click="cc(businessItem)">确认离场</view>
+					<view class="btn b1" v-if="businessItem.confirmInput==0" @click="editFn(businessItem)">修改</view>
 					<view class="btn b3" @click="toDetail(businessItem)">详情</view>
 					<view class="btn b4" v-if="businessItem.payStatus==1
 								&&businessItem.confirmInput==0
@@ -85,9 +87,9 @@
 				</view>
 			</view>
 		</view>
-			<noData v-if="businessItemList.length==0"></noData>
+		<noData v-if="businessItemList.length==0"></noData>
 		<u-loadmore style="margin: 30rpx;" :status="status" />
-	
+
 	</view>
 </template>
 
@@ -120,49 +122,63 @@
 					name: '出场',
 				}],
 				businessItemList: [],
-				perList:[]
+				perList: []
 			}
 		},
 		created() {
 			this.customemrId = uni.getStorageSync('customerId')
-			this.perList=uni.getStorageSync('perList')
+			this.perList = uni.getStorageSync('perList')
+			console.log('create')
 		},
 		onShow() {
 			this.getBusinessList();
+			console.log('show')
+		},
+		mounted() {
+			console.log('mounted')
+		},
+		onBackPress() {
+			this.$common.to('/pages/index/index')
+			return false;
 		},
 		methods: {
-			toDetail(data){
-				this.$common.to('/pages/business-entering/business-detail?id='+data.id)
+			toDetail(data) {
+				this.$common.to('/pages/business-entering/business-detail?id=' + data.id)
 			},
-			editFn(data){
-				this.$common.to('/pages/business-entering/business-edit?id='+data.id)
+			editFn(data) {
+				this.$common.to('/pages/business-entering/business-edit?id=' + data.id)
 			},
-			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();
-						})
+			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/business-order/sureOrder?id='+data.id)
+			completeFn(data) {
+				this.$common.to('/pages/business-order/createOrder?id=' + data.id)
+			},
+			sureZdFn(data) {
+				this.$common.to('/pages/business-order/sureOrder?id=' + data.id)
 			},
 			fkFn(data) {
-				this.$common.to('/pages/business-order/surePay?id='+data.id)
+				this.$common.to('/pages/business-order/surePay?id=' + data.id)
 			},
 			rcFn(data) {
-				this.$common.to('/pages/business-order/sureIn?id='+data.id)
+				this.$common.to('/pages/business-order/sureIn?id=' + data.id)
 			},
 			cc(data) {
-			this.$common.to('/pages/business-order/sureOut?id='+data.id)
+				this.$common.to('/pages/business-order/sureOut?id=' + data.id)
 			},
 			getBusinessList() {
 				this.$api.getBusinessList(this.p).then(resp => {
@@ -185,14 +201,14 @@
 			},
 			//点击按钮
 			//------------------------------------------
-			
+
 			fkconfirm() {
 				this.$api.adminConfirmPay(this.fk).then(resp => {
 					this.$refs.fkpopup.close();
 					this.getBusinessList();
 				})
 			},
-		
+
 			rcconfirm() {
 				if (!this.rc.inChannel) {
 					this.$common.toast('请填写入场通道');
@@ -203,7 +219,7 @@
 					this.getBusinessList();
 				})
 			},
-		
+
 			ccconfirm(index) {
 				console.log('出场')
 				this.$refs.ccpopup.close()
@@ -339,6 +355,7 @@
 					color: #0080ff;
 					border: 1rpx solid #0080ff;
 				}
+
 				.b4 {
 					background-color: #ff0000;
 					color: #fff;

+ 156 - 0
app/pages/business-order/createOrder.vue

@@ -0,0 +1,156 @@
+<template>
+	<view>
+		<view class="box">
+			<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.no}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">业务费用:</view>
+				<view class="r">
+					{{form.itemPrice}}元
+
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 6;">境外车入场:</view>
+				<view class="r">
+					{{form.realInTime}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 6;">境外车预计离场:</view>
+				<view class="r">
+					<uni-datetime-picker placeholder="离场时间" :start="new Date().getTime()" type="datetime" @change="jwCaroTimeChange"
+						v-model="form.outDayTime" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">停车费用:</view>
+				<view class="r">
+					{{form.partMoney}}
+					<text v-if="form.partMoney">元</text>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 6;">中国车入场:</view>
+				<view class="r">
+					{{form.chinaCarInTime}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 6;">中国车预计离场:</view>
+				<view class="r">
+					<uni-datetime-picker placeholder="离场时间" :start="new Date().getTime()" type="datetime" @change="chinaCaroTimeChange"
+						v-model="form.chinaCarOutTime" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">停车费用:</view>
+				<view class="r">
+					{{form.chinaPartMoney}}
+					<text v-if="form.chinaPartMoney">元</text>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">总计费用:</view>
+				<view class="r">
+					{{form.totalMoney}}
+				</view>
+			</view>
+		</view>
+		<u-button type="primary" @click="confirmFn">确认生成</u-button>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id: '',
+				form: {
+					partMoney: 0,
+					outDayTime: '',
+					chinaCarOutTime: ''
+				},
+			}
+		},
+		onLoad(options) {
+			this.id = options.id;
+		},
+		onShow() {
+			this.getBusinessById();
+		},
+		methods: {
+			jwCaroTimeChange(date) {
+				if (!date || date.length <= 12) {
+					this.form.outDayTime = '';
+					this.form.partMoney = 0;
+					this.$common.toast('境外车离场时间不正确');
+					return;
+				}
+				this.form.outDayTime = date;
+				let o = Object.assign(this.form);
+				o.items = null;
+				o.outDayTime = date;
+				this.$api.calJwPartMoney(this.$common.removeNull(o)).then(resp => {
+					this.form = resp.data;
+				})
+			},
+			chinaCaroTimeChange(date) {
+				if (!date) {
+					this.form.chinaCarOutTime = '';
+					this.form.chinaPartMoney = 0;
+					this.$common.toast('请选择离场时间');
+					return;
+				}
+				if (date.length <= 12) {
+					this.$common.toast('请选择时间');
+					return;
+				}
+				this.form.chinaCarOutTime = date;
+				let o = Object.assign(this.form);
+				o.items = null;
+				this.$api.calChinaPartMoney(this.$common.removeNull(o)).then(resp => {
+					this.form = resp.data;
+				})
+			},
+			getBusinessById() {
+				this.$api.getBusinessById({
+					id: this.id
+				}).then(resp => {
+					this.form = resp.data;
+				})
+			},
+			confirmFn() {
+				if (!this.form.chinaCarOutTime || !this.form.outDayTime) {
+					this.$common.toast('请选择时间')
+					return;
+				}
+				this.form.items = null;
+				this.$api.completeOrder(this.$common.removeNull(this.form)).then(Resp => {
+					this.$common.toast('操作成功');
+					setTimeout(() => {
+						this.$common.back()
+					}, 500)
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	@import '@/common/common.scss';
+</style>

+ 12 - 16
app/pages/business-order/sureIn.vue

@@ -8,22 +8,15 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">车牌号:</view>
+				<view class="l" style="flex: 6;">境外车入场时间:</view>
 				<view class="r">
-					{{form.cardNo}}
+					<uni-datetime-picker placeholder="入场时间" type="datetime" v-model="form.realInTime" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">入场通道:</view>
+				<view class="l" style="flex: 6;">中国车入场时间:</view>
 				<view class="r">
-					<u-input  placeholder="入场通道" v-model="form.inChannel" />
-				</view>
-			</view>
-			<view class="item">
-				<view class="l">入场时间:</view>
-				<view class="r">
-					<uni-datetime-picker placeholder="入场时间" type="datetime" v-model="form.realInTime" start="2021-11-30"
-						end="2090-6-20" />
+					<uni-datetime-picker placeholder="入场时间" type="datetime" v-model="form.chinaCarInTime" />
 				</view>
 			</view>
 		</view>
@@ -37,7 +30,8 @@
 			return {
 				id: '',
 				form: {
-					partMoney: 0
+					realInTime: new Date(),
+					chinaCarInTime: new Date()
 				},
 			}
 		},
@@ -56,12 +50,14 @@
 				})
 			},
 			confirmFn() {
-				if(!this.form.inChannel){
-					this.$common.toast('请填写入场通道')
+				let realInTime = this.form.realInTime;
+				let chinaCarInTime = this.form.chinaCarInTime;
+				if (!realInTime||realInTime.length<=12) {
+					this.$common.toast('境外车入场时间不正确')
 					return;
 				}
-				if(!this.form.realInTime){
-					this.$common.toast('请选择入场时间')
+				if (!chinaCarInTime||chinaCarInTime.length<=12) {
+					this.$common.toast('中国车入场时间不正确')
 					return;
 				}
 				this.$api.adminSetIn(this.form).then(Resp => {

+ 16 - 13
app/pages/business-order/sureOut.vue

@@ -2,28 +2,29 @@
 	<view>
 		<view class="box">
 			<view class="item">
-				<view class="l">订单号:</view>
+				<view class="l">客户名称:</view>
 				<view class="r">
-					{{form.no}}
+					{{form.customerName}}
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">车牌号:</view>
+				<view class="l">订单号:</view>
 				<view class="r">
-					{{form.cardNo}}
+					{{form.no}}
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">离场通道:</view>
+				<view class="l" style="flex: 6;">境外车离场:</view>
 				<view class="r">
-					<u-input  placeholder="离场通道" v-model="form.outChannel" />
+					<uni-datetime-picker placeholder="离场时间" :start="new Date().getTime()" type="datetime" 
+						v-model="form.outDayTime" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">离场时间:</view>
+				<view class="l" style="flex: 6;">中国车离场:</view>
 				<view class="r">
-					<uni-datetime-picker placeholder="离场时间" type="datetime" v-model="form.outDayTime" start="2021-11-30"
-						end="2090-6-20" />
+					<uni-datetime-picker placeholder="离场时间" :start="new Date().getTime()" type="datetime"
+						v-model="form.chinaCarOutTime" />
 				</view>
 			</view>
 		</view>
@@ -53,15 +54,17 @@
 					id: this.id
 				}).then(resp => {
 					this.form = resp.data;
+					this.form.outDayTime='';
+					this.form.chinaCarOutTime='';
 				})
 			},
 			confirmFn() {
-				if(!this.form.inChannel){
-					this.$common.toast('请填写离场通道')
+				if(!this.form.outDayTime||this.form.outDayTime.length<=12){
+					this.$common.toast('请选择境外车出场时间')
 					return;
 				}
-				if(!this.form.outDayTime){
-					this.$common.toast('请选择出场时间')
+				if(!this.form.chinaCarOutTime||this.form.chinaCarOutTime.length<=12){
+					this.$common.toast('请选择中国车出场时间')
 					return;
 				}
 				this.$api.adminSetOut(this.form).then(Resp => {

+ 58 - 4
app/pages/business-order/surePay.vue

@@ -2,6 +2,12 @@
 	<view>
 		<view class="box">
 			<view class="item">
+				<view class="l">订单号:</view>
+				<view class="r">
+					{{form.no}}
+				</view>
+			</view>
+			<view class="item">
 				<view class="l">业务费用:</view>
 				<view class="r">
 					{{form.itemPrice}}元
@@ -10,8 +16,7 @@
 			<view class="item">
 				<view class="l">停车费用:</view>
 				<view class="r">
-					<text v-if="form.partMoney">{{form.partMoney}}</text>
-					<text v-else>-</text>
+					<text >{{form.partMoney+form.chinaPartMoney}}元</text>
 				</view>
 			</view>
 			<view class="item">
@@ -24,7 +29,9 @@
 				<view class="l">支付凭据:</view>
 				<view class="r">
 					<view class="img">
-						<u-upload max-count="3" ref="license" :file-list="imgList" :action="uploadImageUrl" width="300" height="200"></u-upload>
+						<uni-file-picker v-model="imageValue" fileMediatype="image" mode="grid" limit="1"
+							@select="select" @progress="progress" @success="success" @fail="fail"
+							@delete="form.payTicket=''" :image-styles="imageStyles" />
 					</view>
 				</view>
 			</view>
@@ -39,6 +46,17 @@
 		data() {
 			return {
 				id: '',
+				imageValue: [],
+				imageStyles: {
+					width: 150,
+					height: 100,
+					border: {
+						color: "#eee",
+						width: 1,
+						style: 'dashed',
+						radius: '5px'
+					}
+				},
 				form: {
 					partMoney: 0
 				},
@@ -53,15 +71,51 @@
 			this.getBusinessById();
 		},
 		methods: {
+			// 获取上传状态
+			select(e) {
+				let that = this;
+				uni.uploadFile({
+					url: that.uploadImageUrl,
+					filePath: e.tempFilePaths[0],
+					name: 'file',
+					success: (resp => {
+						that.form.payTicket=JSON.parse(resp.data).data;
+					})
+				})
+			},
+			deleteFn(v){
+				console.log(v)
+			},
+			// 获取上传进度
+			progress(e) {
+				console.log('上传进度:', e)
+			},
+			
+			// 上传成功
+			success(e) {
+				console.log('上传成功')
+			},
+			
+			// 上传失败
+			fail(e) {
+				console.log('上传失败:', e)
+			},
 			getBusinessById() {
 				this.$api.getBusinessById({
 					id: this.id
 				}).then(resp => {
 					this.form = resp.data;
+					if(this.form.payTicket){
+						this.imageValue=[{
+							'name':'payTicket.png',
+							'extname':'.png',
+							'url':this.form.payTicket
+						}]
+					}
 				})
 			},
 			confirmFn(){
-				this.$api.confirmPay({id:this.form.id}).then(Resp=>{
+				this.$api.confirmPay(this.$common.removeNull(this.form)).then(Resp=>{
 					this.$common.toast('已支付');
 					setTimeout(()=>{
 						this.$common.back()

+ 34 - 17
app/pages/customer-management/customer-info.vue

@@ -39,8 +39,9 @@
 				<view class="l">营业执照:</view>
 				<view class="r">
 					<view class="img">
-						<u-upload max-count="1" ref="license" :file-list="imgList" :action="uploadImageUrl" width="300"
-							height="200"></u-upload>
+						<uni-file-picker v-model="imageValue" fileMediatype="image" mode="grid" limit="1"
+							@select="select"
+							@delete="form.businessLicence=''" :image-styles="imageStyles" />
 					</view>
 				</view>
 			</view>
@@ -55,6 +56,17 @@
 		data() {
 			return {
 				imgList: [],
+				imageValue: [],
+				imageStyles: {
+					width: 150,
+					height: 100,
+					border: {
+						color: "#eee",
+						width: 1,
+						style: 'dashed',
+						radius: '5px'
+					}
+				},
 				uploadImageUrl: request.server + '/upload/image',
 				form: {
 					name: '',
@@ -70,11 +82,29 @@
 			this.getCustomerById(id);
 		},
 		methods: {
+			select(e) {
+				let that = this;
+				uni.uploadFile({
+					url: that.uploadImageUrl,
+					filePath: e.tempFilePaths[0],
+					name: 'file',
+					success: (resp => {
+						that.form.businessLicence = JSON.parse(resp.data).data;
+					})
+				})
+			},
 			getCustomerById(id) {
 				this.$api.getCustomerById({
 					id: id
 				}).then(resp => {
 					this.form = resp.data;
+					if(this.form.businessLicence){
+						this.imageValue=[{
+							'name':'payTicket.png',
+							'extname':'.png',
+							'url':this.form.businessLicence
+						}]
+					}
 				})
 			},
 			payChange(e) {
@@ -89,23 +119,10 @@
 					this.$common.toast('请录入联系人');
 					return false;
 				}
-				if (!this.form.phone) {
-					this.$common.toast('请录入联系号码');
+				if (!this.$common.isPhone(this.form.phone)) {
+					this.$common.toast('联系号码不正确');
 					return false;
 				}
-				let licenseFiles = this.$refs.license.lists.filter(val => {
-					return val.progress == 100;
-				})
-				if (licenseFiles.length > 0) {
-					this.form.businessLicence = licenseFiles.map(obj => {
-						if (obj.response) {
-							return obj.response.data;
-						} else if (obj.url) {
-							return obj.url;
-						}
-					}).join(',');
-				}
-
 				return true;
 			},
 			confirm() {

+ 8 - 2
app/pages/customer-management/customer-list.vue

@@ -1,6 +1,6 @@
 <template>
-	<management v-if="customerId=='1'"></management>
-	<info v-else></info>
+	<management v-if="customerId=='1'" ref="manage"></management>
+	<info v-else ref="sel"></info>
 </template>
 
 <script>
@@ -15,6 +15,12 @@
 				customerId:''
 			}
 		},
+		onReachBottom() {
+			let customerId=this.customerId;
+			if(customerId=='1'){
+				this.$refs.manage.loadMore();
+			}
+		},
 		onShow() {
 			this.customerId=uni.getStorageSync('info').customerId;
 		},

+ 17 - 24
app/pages/customer-management/customer-management.vue

@@ -60,7 +60,7 @@
 			return {
 				current: 0,
 				pageNo: 1,
-				pageSize: 3,
+				pageSize:3,
 				dataCount: 0,
 				status: 'loadmore',
 				page: 0,
@@ -92,6 +92,15 @@
 		},
 
 		methods: {
+			loadMore() {
+				this.status = 'loading';
+				if (this.dataCount > this.pageSize * this.pageNo) {
+					this.pageSize = parseInt(this.pageSize) + 3;
+					this.getCustomerList();
+				} else {
+					this.status = 'nomore';
+				}
+			},
 			getCustomerList() {
 				this.$api.getCustomerList({
 					current: this.current,
@@ -126,18 +135,6 @@
 				console.log(obj);
 				this.current = obj.index;
 				this.getCustomerList();
-				// if(index==0){
-				// 	//加载全部
-				// }
-				// if(index==1){
-				// 	//加载未审核
-				// }
-				// if(index==2){
-				// 	//只加载审核通过
-				// }
-				// if(index==3){
-				// 	//只加载禁用
-				// }
 			},
 			//点击按钮
 			//------------------------------------------
@@ -156,22 +153,18 @@
 
 			//------------------------------------------
 			//上拉加载更多,分页模拟数据
-			onReachBottom() {
-				this.status = 'loading';
-				if (this.dataCount > this.pageSize * this.pageNo) {
-					this.pageSize = parseInt(this.pageSize) + 3;
-					this.getCustomerList();
-				} else {
-					this.status = 'nomore';
-				}
-			}
+			
 		},
 		onLoad() {
-			this.getCustomerList();
+			console.log(222)
 		},
-		onShow() {
+		created() {
 			this.perList = uni.getStorageSync('perList');
 			console.log(this.perList)
+			this.getCustomerList();
+		},
+		onShow() {
+
 		},
 	}
 </script>

+ 0 - 5
app/pages/enterprise-reg/enterprise-reg.vue

@@ -86,9 +86,6 @@
 			}
 		},
 		methods: {
-			payChange(e) {
-				this.form.payType = e.detail.value
-			},
 			// 获取上传状态
 			select(e) {
 				let that = this;
@@ -97,11 +94,9 @@
 					filePath: e.tempFilePaths[0],
 					name: 'file',
 					success: (resp => {
-						console.log(JSON.parse(resp.data).data)
 						that.form.businessLicence = JSON.parse(resp.data).data;
 					})
 				})
-				console.log('选择文件:', e)
 			},
 			// 获取上传进度
 			progress(e) {

+ 4 - 1
app/pages/index/index.vue

@@ -57,6 +57,10 @@
 			this.getStoreInfo();
 			this.setList();
 		},
+		onBackPress() {
+			this.$common.to('/pages/index/index')
+			return false;
+		},
 		methods: {
 			setList(){
 				this.indexItemList=[
@@ -98,7 +102,6 @@
 			},
 			getStoreInfo() {
 				let info = uni.getStorageSync('info');
-				console.log(info.customerId)
 				if(info){
 					this.isLogin=true;
 					this.userName=info.name;

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

@@ -446,7 +446,8 @@
 								num: type.num
 							})
 						}
-						if (typeList.filter(obj => obj.itemId == 4 || obj.itemId == 9).length > 0 && this.modal.list
+						if (typeList.filter(obj => obj.name.indexOf('人')!==-1&&obj.name.indexOf('核酸')!==-1).length > 0 
+						&& this.modal.list
 							.length == 0) {
 							sa.error('请添加核酸检测人员');
 							return false;

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

@@ -59,8 +59,8 @@
 						:jv="{1: '未支付[#ff0000]', 2: '已支付(未确认)[#ffaa00]', 3: '已支付(已确认)[#005500]'}"></sa-td>
 						<sa-td width="160" name="支付时间" prop="payTime"></sa-td>
 					<sa-td name="支付凭证" prop="payTicket" type="img-list"></sa-td>
-					<sa-td  name="放行状态" prop="adminConfirmPay" type="enum"
-						:jv="{0: '不可放行[#ff0000]', 1: '可放行[#005500]'}"></sa-td>
+				<!-- 	<sa-td  name="放行状态" prop="adminConfirmPay" type="enum"
+						:jv="{0: '不可放行[#ff0000]', 1: '可放行[#005500]'}"></sa-td> -->
 					<!-- <sa-td name="入场时间" width="140" prop="realInTime"></sa-td>
 					<sa-td name="离场时间" width="140" prop="outDayTime"></sa-td> -->
 					<sa-td width="160" name="录入时间" prop="createTime"></sa-td>
@@ -75,8 +75,10 @@
 								&&s.row.complete==1
 								&&perCode.indexOf('tb-business-confirm')!=-1
 								&&currentCustomerId!='1'" @click="confirmFn(s.row)">确认账单</el-button>
-							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
-								&&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" @click="payFn(s.row)">
+							<el-button class="c-btn" type="success" 
+							v-if="perCode.indexOf('tb-business-pay')!=-1
+								&&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" 
+								@click="payFn(s.row)">
 								马上支付</el-button>
 							<el-button class="c-btn" type="primary"
 								v-if="currentCustomerId=='1'&&(s.row.realInTime==null&&s.row.chinaCarInTime==null)"
@@ -87,11 +89,14 @@
 								@click="outFn(s.row)">确认离场
 							</el-button>
 							<el-button class="c-btn" type="success"
-								v-if="currentCustomerId=='1'&&s.row.payStatus<3&&s.row.outDayTime!=null"
+								v-if="perCode.indexOf('tb-business-pay')!=-1
+								&&currentCustomerId=='1'
+								&&s.row.payStatus==2
+								&&s.row.outDayTime!=null
+								&&s.row.adminConfirmPay==0"
 								@click="adminSurePayFn(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="currentCustomerId=='1'
-							&&s.row.confirmInput==0" @click="update(s.row)">修改</el-button>
+							<el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0" @click="update(s.row)">修改</el-button>
 							<el-button class="c-btn" type="danger" v-if="s.row.payStatus==1
 								&&s.row.confirmInput==0
 								&&s.row.realInTime==null
@@ -289,7 +294,8 @@
 						})
 					},
 					sureCompleteFn() {
-						sa.ajax('/TbBusiness/complete', this.complete.form, function(resp) {
+						this.complete.form.items=null;
+						sa.ajax('/TbBusiness/complete', sa.removeNull(this.complete.form), function(resp) {
 							this.complete.visible = false;
 							this.f5();
 						}.bind(this))

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-4296
+18268

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

@@ -119,7 +119,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     /**
      * 预计进边境日期
      */
-    private Date expectInDay;
+    private String expectInDay;
 
     /**
      * 实际进边境日期

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

@@ -194,9 +194,9 @@ public class TbBusinessController {
         tbBusinessService.updateById(tbBusiness);
 
         //更新放行记录
-        TbPassRecord record = tbPassRecordService.getByBusinessId(tbBusiness.getId());
-        record.setStatus(2).setInTime(tbBusiness.getRealInTime()).setUpdateTime(new Date());
-        tbPassRecordService.saveOrUpdate(record);
+//        TbPassRecord record = tbPassRecordService.getByBusinessId(tbBusiness.getId());
+//        record.setStatus(2).setInTime(tbBusiness.getRealInTime()).setUpdateTime(new Date());
+//        tbPassRecordService.saveOrUpdate(record);
 
         return AjaxJson.getSuccess();
     }

+ 49 - 44
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -143,11 +143,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         tbBusinessItemService.saveBatch(items);
 
         //增加一条放行记录
-        TbPassRecord record = new TbPassRecord();
-        record.setBusinessId(t.getId()).setCustomerId(t.getCustomerId())
-                .setCardNo(t.getCardNo()).setCustomerName(t.getCustomerName())
-                .setStatus(1).setUpdateTime(new Date());
-        tbPassRecordService.saveOrUpdate(record);
+//        TbPassRecord record = new TbPassRecord();
+//        record.setBusinessId(t.getId()).setCustomerId(t.getCustomerId())
+//                .setCardNo(t.getCardNo()).setCustomerName(t.getCustomerName())
+//                .setStatus(1).setUpdateTime(new Date());
+//        tbPassRecordService.saveOrUpdate(record);
 
         return AjaxJson.getSuccess();
     }
@@ -163,7 +163,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         TbUnit tbUnit = tbUnitService.findByUnit(t.getCardSize());
         if (tbUnit == null) {
             tbUnit = new TbUnit();
-            tbUnit.setUnit(t.getCardNo());
+            tbUnit.setUnit(t.getCardSize() + "");
             tbUnitService.save(tbUnit);
         }
     }
@@ -223,9 +223,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     public void confirm(List<String> ids) {
         ids.forEach(id -> {
             TbBusiness business = this.getById(id);
-            if (business.getCustomerType()==2){
-                business.setAdminConfirmPay(1).setPayStatus(3);
-            }
             business.setConfirmInput(1).setConfirmInputTime(new Date()).setConfirmInputBy(StpUserUtil.getAdmin().getName());
             this.updateById(business);
         });
@@ -259,11 +256,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         tbPassRecordService.saveOrUpdate(record);
     }
 
-    public void adminOut(String id, Date outDayTime, String outChannel,String carType)  {
+    public void adminOut(String id, Date outDayTime, String outChannel, String carType) {
         TbBusiness tbBusiness = this.getById(id);
         tbBusiness.setOutDayTime(outDayTime).setOutChannel(outChannel);
-       calculationPartMoney(carType,tbBusiness);
-       this.updateById(tbBusiness);
+        calculationPartMoney(carType, tbBusiness);
+        this.updateById(tbBusiness);
 
         //更新放行记录
         TbPassRecord record = tbPassRecordService.getByBusinessId(tbBusiness.getId());
@@ -272,53 +269,61 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     }
 
-    public void calculationPartMoney(String itemType,TbBusiness tbBusiness)  {
-        Date iTime=tbBusiness.getRealInTime();
-        Date oTime=tbBusiness.getOutDayTime();
-        if (itemType.contains("中国")){
-            iTime=tbBusiness.getChinaCarInTime();
-            oTime=tbBusiness.getChinaCarOutTime();
+    public void calculationPartMoney(String itemType, TbBusiness tbBusiness) {
+        Date iTime = tbBusiness.getRealInTime();
+        Date oTime = tbBusiness.getOutDayTime();
+        if (itemType.contains("中国")) {
+            iTime = tbBusiness.getChinaCarInTime();
+            oTime = tbBusiness.getChinaCarOutTime();
         }
-       LocalDateTime inDayTime=iTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
-        LocalDateTime outDayTime=oTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+        LocalDateTime inDayTime = iTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+        LocalDateTime outDayTime = oTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
         long minutes = ChronoUnit.MINUTES.between(inDayTime, outDayTime);
         if (minutes < 0) {
-            return ;
+            return;
         }
-        double carSize=tbBusiness.getCardSize();
+        double carSize = tbBusiness.getCardSize();
         if (carSize < partConfig.getFreeCarLength() || minutes <= partConfig.getFreeMinutes()) {
-            return ;
-        }
-        String businessId=tbBusiness.getId();
-        TbBusinessItem businessItem=tbBusinessItemService.findByBusinessIdAndTypeName(businessId,itemType);
-        if (businessItem==null){
-            businessItem=new TbBusinessItem();
+            return;
         }
+        String businessId = tbBusiness.getId();
+//        TbBusinessItem businessItem = tbBusinessItemService.findByBusinessIdAndTypeName(businessId, itemType);
+//        if (businessItem == null) {
+//            businessItem = new TbBusinessItem();
+//        }
         LocalTime zero = LocalTime.of(0, 0, 0);
         long days = ChronoUnit.DAYS.between(inDayTime.toLocalDate(), outDayTime.toLocalDate());
         BigDecimal basePrice = partConfig.getBasePrice();
         BigDecimal extraPrice = partConfig.getExtraPrice();
-        BigDecimal price = basePrice.add(basePrice.multiply(new BigDecimal(days)));
+        BigDecimal price = basePrice;
         LocalTime outTime = outDayTime.toLocalTime();
-        if (outTime.isBefore(LocalTime.parse(partConfig.getNightEnd(), DateTimeFormatter.ofPattern("HH:mm:ss")))
-                && outTime.isAfter(zero)) {
-            price = price.add(extraPrice);
+        LocalTime nigthEnd = LocalTime.parse(partConfig.getNightEnd(), DateTimeFormatter.ofPattern("HH:mm:ss"));
+        if (days >= 1) {
+            price = basePrice.add(basePrice.multiply(new BigDecimal(days - 1)));
+            if (outTime.isAfter(nigthEnd)){
+                price = basePrice.add(basePrice.multiply(new BigDecimal(days)));
+            }
+            if (outTime.isAfter(zero)&&outTime.isBefore(nigthEnd)){
+                price=price.add(extraPrice);
+            }
         }
-        long hour=ChronoUnit.HOURS.between(zero,outTime);
-        if (days==0){
-            hour=ChronoUnit.HOURS.between(inDayTime,outDayTime);
+        long hour = ChronoUnit.HOURS.between(zero, outTime);
+        if (days == 0) {
+            hour = ChronoUnit.HOURS.between(inDayTime, outDayTime);
         }
-        String num=days+"天"+hour+"小时";
-        if (hour==0){
-            num=minutes+"分钟";
+        String num = days + "天" + hour + "小时";
+        if (hour == 0) {
+            num = minutes + "分钟";
         }
-        businessItem.setTotal(price).setUnit("天").setItemTypeName(itemType).setItemPrice(partConfig.getBasePrice())
-                .setBusinessId(businessId).setItemName("停车费").setNum(num);
-        tbBusinessItemService.saveOrUpdate(businessItem);
-        if (itemType.contains("中国")){
+
+//        businessItem.setTotal(price).setUnit("天").setItemTypeName(itemType).setItemPrice(partConfig.getBasePrice())
+//                .setBusinessId(businessId).setItemName("停车费").setNum(num);
+//        tbBusinessItemService.saveOrUpdate(businessItem);
+        if (itemType.contains("中国")) {
             tbBusiness.setChinaPartMoney(price).setChinaCarPartTime(minutes);
-        }else {
-            tbBusiness.setPartMoney(price).setPartTime(minutes);;
+        } else {
+            tbBusiness.setPartMoney(price).setPartTime(minutes);
+            ;
         }
         tbBusiness.setTotalMoney(tbBusiness.getItemPrice().add(tbBusiness.getChinaPartMoney()).add(tbBusiness.getPartMoney()));
     }