<!DOCTYPE html>
<html>
	<head>
		<title>边民订单表-列表</title>
		<meta 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>
		<style>
			hr {
				border: none;
				/* 移除默认边框 */
				height: 1px;
				/* 设置高度 */
				background-color: gainsboro;
				/* 设置颜色 */
				margin: 5px 0;
				/* 设置上下外边距 */
			}
		</style>
	</head>
	<body>
		<div class="vue-box" style="display: none;" :style="'display: block;'">
			<div class="c-panel">
				<el-form v-if="bigData">
					<el-divider content-position="left">结算单信息</el-divider>
					<el-row style="margin-left: 50px;">
						<el-col span="8">
							<sa-info name="车牌号" br>{{bigData.veNo}}</sa-info>
							<sa-info name="预申报编号" br>{{bigData.platSeqNo}}</sa-info>
							<sa-info name="商品名称" br>{{bigData.goodsNames}}</sa-info>
						</el-col>
						<el-col span="8">
							<sa-info name="总毛重(kg)" br>{{bigData.sumGrossWt}}</sa-info>
							<sa-info name="总净重(kg)" br>{{bigData.sumNetWt}}</sa-info>
							<sa-info name="总金额(元)" br>{{bigData.sumAmt}}</sa-info>
						</el-col>
						<el-col span="8">
							<sa-info name="互市区" br>{{bigData.fieldName}}</sa-info>
							<sa-info name="创建时间" br>{{bigData.createTime}}</sa-info>
						</el-col>
						<el-button type="success" icon="el-icon-info" @click="sendCXB001ByVeNo()">按车推送结关</el-button>
					</el-row>
				</el-form>
				<el-divider content-position="left">边民订单</el-divider>
				<!-- ------------- 数据列表 ------------- -->
				<el-table class="data-table" ref="data-table" :data="dataList">
					<sa-td type="index" name="序号" width="80px"></sa-td>
					<sa-td name="车牌号" prop="veNo"></sa-td>
					<sa-td name="买家" prop="buyUserName"></sa-td>
					<sa-td name="商品名称" prop="goodsNames" width="200px"></sa-td>
					<sa-td name="总重量" prop="netWt"></sa-td>
					<sa-td name="总金额" prop="totalPrice"></sa-td>
					<sa-td name="上架金额(元)" prop="upPrice" width="100px"></sa-td>
					<sa-td name="订单状态" prop="upStatus">
						<template slot-scope="s">
							<div v-if="s.row.upStatus===2">已上架</div>
							<div v-else>未上架</div>
						</template>
					</sa-td>
					<sa-td name="过卡状态" prop="finishStatus">
						<template slot-scope="s">
							<div v-if="s.row.finishStatus===1">已过卡3</div>
							<div v-else>未过卡3</div>
						</template>
					</sa-td>
					<!--(一级市场)订单扣款回执状态[0=初始值 1=扣款成功 2=扣款失败]-->
					<sa-td name="扣款状态" prop="sxb010Status">
						<template slot-scope="s">
							<div v-if="s.row.sxb010Status===1">扣款成功</div>
							<div v-else-if="s.row.sxb010Status===2">扣款失败</div>
							<div v-else-if="s.row.peopleConfirmStatus===1 && s.row.applyConfirmStatus===1">已确认</div>
							<div v-else>未确认</div>
						</template>
					</sa-td>
					<sa-td name="创建时间" prop="createTime" width="140px"></sa-td>
				</el-table>
				<!-- ------------- 分页 ------------- -->
				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
					@change="f5()"></sa-item>
			</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'),
					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
				},
				el: '.vue-box',
				data: {
					veNo: sa.p('veNo', 0),
					id: sa.p('id', 0),
					p: { // 查询参数
						id: sa.p('id', 0),
						veNo: sa.p('veNo', 0), // 车牌号
						pageNo: 1, // 当前页
						pageSize: 10, // 页大小
						sortType: 0 // 排序方式
					},
					dataCount: 0,
					dataList: [], // 数据集合
					bigData: [],
				},
				methods: {
					sendCXB001ByVeNo() {
						sa.confirm('是否执行推送当前列表订单的结关信息操作', function() {
							sa.ajax('/level-one-server/TbOrder/sendCXB001ByVeNo?veNo=' + this.veNo + '&id=' +
								this.id,
								function(res) {
									sa.alert('执行成功', this.clean);
								}.bind(this))
						}.bind(this));
					},
					clean: function() {
						parent.app.f5(); // 刷新父页面列表
						sa.closeCurrIframe(); // 关闭本页
					},
					f5: function() {
						sa.ajax('/level-one-server/TbOrder/getSendCXB001ByVeNoList', sa.removeNull(this.p), function(
							res) {
							this.dataList = res.data; // 数据
							this.dataCount = res.dataCount; // 数据总数
							sa.f5TableHeight(); // 刷新表格高度
						}.bind(this));
					},
				},
				created: function() {
					this.f5();
					sa.ajax('/level-one-server/HtTradeSettlement/getById', {
						id: this.id
					}, function(res) {
						this.bigData = res.data; // 数据
						sa.f5TableHeight(); // 刷新表格高度
					}.bind(this));
					sa.onInputEnter();
				}
			})
		</script>
	</body>
</html>