<!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>
		<style type="text/css">
			.c-panel .c-label{width: 8em;}
			table {
			  font-family: arial, sans-serif;
			  border-collapse: collapse;
			  width: 90%;
			  margin-top: 22px ;
			  margin-left: auto;
			  margin-right: auto;
			}
			th {
			  border: 1px solid darkgray;
			  text-align: left;
			  height: 22px;
			  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 size="mini" v-if="m">
						<table>
							<tr>
								<th>商铺名称</th>
								<td>{{m.shopName}}</td>
								<th>商铺编码</th>
								<td>{{m.shopNo}}</td>
							</tr>
							<tr>
								<th>商铺类型</th>
								<td>
									<b v-if="m.shopType == 1">中方商铺</b>
									<b v-if="m.shopType == 2">外国商铺</b>
								</td>
								<th>店铺地址</th>
								<td>{{m.shopAddr}}</td>
							</tr>
							<tr>
								<th>互市区</th>
								<td>{{m.fieldName}}</td>
								<th>互市区编码</th>
								<td>{{m.fieldCode}}</td>
							</tr>
							<tr>
								<th>铺主姓名</th>
								<td>{{m.ownerName}}</td>
								<th>铺主联系方式</th>
								<td>{{maskPhone(m.ownerTel)}}</td>
							</tr>
							<tr>
								<th>铺主证件类型</th>
								<td>
									<b v-if="m.ownerIdtype == 01">身份证</b>
									<b v-if="m.ownerIdtype == 02">护照</b>
								</td>
								<th>经营范围</th>
								<td>{{m.bnsScope}}</td>
							</tr>
							<tr>
								<th>营业执照</th>
								<td>{{m.shopSccd}}</td>
								<th>状态</th>
								<td>
									<b v-if="m.edstatus == 1">启用</b>
									<b v-if="m.edstatus == 2">停用</b>
									<b v-if="m.edstatus == 3">注销</b>
								</td>
							</tr>
							<tr>
								<th>店铺开户行</th>
								<td>{{m.bank}}</td>
								<th>店铺开户行账号</th>
								<td>{{m.bankAccount}}</td>
							</tr>
							<tr>
								<th>铺主国籍</th>
								<td>{{m.nationality}}</td>
								<th>账户类型:是否海外</th>
								<td>{{m.abroad}}</td>
							</tr>
							
							<tr>
								<th>代理人姓名</th>
								<td>{{m.agentName}}</td>
								<th>代理人联系方式</th>
								<td>{{maskPhone(m.agentTel)}}</td>
							</tr>
							<tr>
								<th>代理人证件类型</th>
								<td>
									<b v-if="m.agentIdtype == 01">身份证</b>
									<b v-if="m.agentIdtype == 02">护照</b>
								</td>
								<th>代理人身份证</th>
								<td>{{maskId(m.agentCiphertextIdno)}}</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>{{sa.forDate(m.expiry, 2)}}</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>
						</table>
					</el-form>
				</div>
			</div>
			<!-- ------- 底部按钮 ------- -->
			<div class="s-foot">
				<el-button size="mini" type="success" @click="sa.closeCurrIframe()">确定</el-button>
				<el-button size="mini" @click="sa.closeCurrIframe()">取消</el-button>
			</div>
		</div>
		<script>
			var app = new 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/TbShop/getById?id=' + this.id, function(res) {
						this.m = res.data;
						if(res.data == null) {
							sa.alert('未能查找到 id=' + this.id + " 详细数据");
						}
					}.bind(this))
				}
			})

		</script>
	</body>
</html>
