<!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>
							<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.goodsName}}</sa-info>
										<sa-info name="作业时间" br>{{m.operateTime}}</sa-info>
									</el-col>
									<el-col span="12">
										<sa-info type="enum" name="支付状态" :value="m.payStatus"
											:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
										<sa-info name="支付时间" br>{{m.payTime}}</sa-info>
										<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
										<sa-info name="业务费用" br>{{m.itemPrice}}（元）</sa-info>
									</el-col>
								</el-row>
								<el-row v-for="(item,index) in tableData">
									<el-divider content-position="left"><label style="font-weight: bold;">收费项：{{item.itemTypeName}}</label></el-divider>
									<el-col span="12">
										<sa-info name="收费明细" br>{{item.itemName}}</sa-info>
									</el-col>
									<el-col span="12">
										<sa-info name="计价" br>{{item.itemPrice}}/{{item.unit}}</sa-info>
									</el-col>
								</el-row>
								<el-row v-for="(item,index) in m.cars">
									<el-divider content-position="left" ><label style="font-weight: bold;">车牌号：{{item.carNo}}</label></el-divider>
									<el-col span="12">
										<div class="c-item">
											<label class="c-label">入场时间：</label>
											<el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
												v-model="item.realInTime"></el-date-picker>
										</div>
										<div class="c-item">
											<label class="c-label">离场时间：</label>
											<el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
												v-model="item.realOutTime"></el-date-picker>
										</div>
									</el-col>
									<el-col span="12">
										<sa-item name="入场通道" placeholder="请输入入场通道" v-model="item.inChannel" br>
										</sa-item>
										<sa-item name="离场通道" placeholder="请输入离场通道" v-model="item.outChannel" br>
										</sa-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col span="14" style="margin-left: 60px;">
										<label class="c-label">备注：</label>
										<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="m.remark">
										</el-input>
									</el-col>
								</el-row>
							</div>
						</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="confirmFn">确认线下收费</el-button>
			</div>


		</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: {
					confirmFn() {
						let m = this.m;
						let cars = m.cars;
						let obj = {
							id: m.id,
							cars:JSON.stringify(cars),
							remark: m.remark
						}
						sa.confirm('是否确认该业务已线下收费？', function() {
							sa.ajax('/TbBusiness/manualConfirm', obj, function(res) {
								parent.app.f5(); // 刷新父页面列表
								sa.closeCurrIframe(); // 关闭本页 
							}.bind(this))
						}.bind(this));
					},
					getInfo() {
						sa.ajax('/TbBusiness/getOtherBusinessById?id=' + this.id, function(res) {
							let data = res.data;
							data.remark = '线下收费'
							this.m = data;
							this.tableData = res.data.items;
						}.bind(this))
					}
				},
				mounted: function() {
					this.getInfo()
				}
			})
		</script>
	</body>
</html>
