<template>
	<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.cardNo}}
				</view>
			</view>
			<view class="item">
				<view class="l">入场通道：</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" />
				</view>
			</view>
		</view>
		<u-button type="primary" @click="confirmFn">确认</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				form: {
					partMoney: 0
				},
			}
		},
		onLoad(options) {
			this.id = options.id;
		},
		onShow() {
			this.getBusinessById();
		},
		methods: {
			getBusinessById() {
				this.$api.getBusinessById({
					id: this.id
				}).then(resp => {
					this.form = resp.data;
				})
			},
			confirmFn() {
				if(!this.form.inChannel){
					this.$common.toast('请填写入场通道')
					return;
				}
				if(!this.form.realInTime){
					this.$common.toast('请选择入场时间')
					return;
				}
				this.$api.adminSetIn(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>
