<!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="https://unpkg.com/element-ui@2.13.0/lib/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 .c-label {
				width: 8em;
			}
			.c-item .image-box-2 {
				height: 90px;
			}
			table {
			  font-family: arial, sans-serif;
			  border-collapse: collapse;
			  width: 90%;
			  margin-top: 26px ;
			  margin-left: auto;
			  margin-right: auto;
			}
			th {
			  border: 1px solid darkgray;
			  text-align: left;
			  height: 26px;
			  padding: 8px;
			  background-color: #dddddd;
			}
			td {
			  border: 1px solid darkgray;
			  text-align: left;
			  padding: 8px;
			}
		</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">
						<table>
							<tr>
								<th>姓名</th>
								<td>{{m.name}}</td>
								<th>性别</th>
								<td>
									<b v-if="m.sex == 1">男</b>
									<b v-if="m.sex == 2">女</b>
								</td>
							</tr>
							<tr>
								<th>互市区</th>
								<td>{{m.tradeAreaName}}</td>
								<th>手机号码</th>
								<td>{{maskPhone(m.phone)}}</td>
							</tr>
							<tr>
								<th>身份证</th>
								<td>{{maskId(m.idCard)}}</td>
								<th>开户行</th>
								<td>{{m.bankName}}</td>
							</tr>
							<tr>
								<th>所属互助组</th>
								<td>{{m.groupName}}</td>
								<th>银行卡号</th>
								<td>{{m.bankCode}}</td>
							</tr>
							<tr>
								<th>场所编码</th>
								<td>{{m.fieldCode}}</td>
								<th>当天剩余额度</th>
								<td>{{m.leftPrice}}</td>
							</tr>
							<tr>
								<th>角色</th>
								<td>
									<b v-if="m.role == 1">普通边民</b>
									<b v-if="m.role == 2">兼组长</b>
								</td>
								<th>备案状态</th>
								<td>
									<b v-if="m.filingStatus == 0">待申报</b>
									<b v-if="m.filingStatus == 1">已申报</b>
									<b v-if="m.filingStatus == 2">备案通过</b>
									<b v-if="m.filingStatus == 3">备案失败</b>
								</td>
							</tr>
							<tr>
								<th>关区代码</th>
								<td>{{m.customsCode}}</td>
								<th>业务编号</th>
								<td>{{m.platSeqNo}}</td>
							</tr>
							<tr>
								<th>备案编号</th>
								<td>{{m.putrecNo}}</td>
								<th>地方政府编号</th>
								<td>{{m.localGovernmentNo}}</td>
							</tr>
							<tr>
								<th>身份证发证机关</th>
								<td>{{m.idcdGcertPgoffNm}}</td>
								<th>户籍地址</th>
								<td>{{m.birplAddr}}</td>
							</tr>
							<tr>
								<th>身份证有效期起</th>
								<td>{{sa.forDate(m.startDate, 2)}}</td>
								<th>身份证有效期止</th>
								<td>{{sa.forDate(m.endDate, 2)}}</td>
							</tr>
							<tr>
								<th>有效截止时间</th>
								<td>{{sa.forDate(m.expiry, 2)}}</td>
								<th>创建时间</th>
								<td>{{sa.forDate(m.createTime, 2)}}</td>
							</tr>
						</table>
					</el-form>
				</div>
			</div>
			<!-- ------- 底部按钮 ------- -->
			<div class="s-foot">
				<el-button type="success" @click="sa.closeCurrIframe()">确定</el-button>
				<el-button @click="sa.closeCurrIframe()">取消</el-button>
			</div>
		</div>
		<script>
			var app = new Vue({
				components: {
					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
				},
				el: '.vue-box',
				data: {
					id: sa.p('id', 0), // 获取数据ID
					m: null
				},
				methods: {
					maskId:function (id) {
					    return id.replace(/^(.{6})(.*)(.{4})$/,'$1********$3');
					},
					maskPhone:function (phone) {
					    return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
					},
				},
				mounted: function() {
					sa.ajax('/level-one-server/TbPeople/getById?id=' + this.id, function(res) {
						this.m = res.data;
						if (res.data == null) {
							sa.alert('未能查找到 id=' + this.id + " 详细数据");
						}
					}.bind(this))
				}
			})
		</script>
	</body>
</html>