<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>信保管理-中信保-长银保单管理-综合险历史授信记录</title>
	<style>
		.btn-info:active,
		.btn-info:focus{
			background-color:#fff;
		}
	</style>
</head>
<body>
<div class="base-extend">
	<ol class="breadcrumb" style="margin-top:0;">
		<i class="icon-chevron-sign-left newBackBtn"></i>
	  	<li>信保管理</li>
	  	<li>中信保</li>
	  	<li>长银保单管理</li>
	  	<li>综合险历史授信记录</li>
	</ol>
	<div class="detailContentBox">
		<form class="form-horizontal" autocomplete="off">
			 <div class="newTabAddUpdateBox historic" style="top:0;bottom:0;border:none;">
				<p class="nowordTip" style="font-size:0.18rem;">暂无历史授信记录</p>
				<div class="historicContentBox"></div>
			</div>
		</form>
	</div>
</div>
</body>
<script>
	var historicScrollFlag = false,// 判断是否需要滚动加载
		historicScrollPage = 1;
	// 获取综合险历史授信信息
	function getHistoricList(page){
		$.ajax({
			url:'/inkassonPolicy/eci/doHistoricList',
			type:'get',
			data:{
				page:page,
				rows:100
			},
			async:false,
			success:function(data){
				if( data.rows.length>0 ){
					$('.nowordTip').hide();
					for( var i=0;i<data.rows.length;i++ ){
						$('.newTabAddUpdateBox.historic .historicContentBox').append('<div class="row" style="margin-bottom:0.3rem !important;"><table>'
							+'<tr><td colspan="6" style="border:none;background-color:#fff;font-size:0.18rem;padding-left:0;">'+data.rows[i].gmtCreate+'</td></tr>'
							+'<tr><td width="14%"><span>综合险额度</span>：</td>'
								+'<td width="19%" style="background-color:#fff;color:#108EE9;font-size:0.16rem;font-weight:bold;">'+commaDelimiter(data.rows[i].comprehensiveAmount.toString())+' '+data.rows[i].currencyType.code+'</td>'
								+'<td width="14%"><span>综合险余额</span>：</td>'
								+'<td width="19%" style="background-color:#fff;color:#108EE9;font-size:0.16rem;font-weight:bold;">'+commaDelimiter(data.rows[i].comprehensiveBalance.toString())+' '+data.rows[i].currencyType.code+'</td>'
								+'<td width="14%"><span>最高赔偿额</span>：</td>'
								+'<td width="20%" style="background-color:#fff;color:#108EE9;font-size:0.16rem;font-weight:bold;">'+commaDelimiter(data.rows[i].maxCompensationAmount.toString())+' '+data.rows[i].currencyType.code+'</td></tr>'
							+'<tr><td width="14%"><span>综合险生效日</span>：</td>'
								+'<td width="19%" style="background-color:#fff;color:#108EE9;font-size:0.16rem;font-weight:bold;">'+data.rows[i].effectiveDate+'</td>'
								+'<td width="14%"><span>综合险期限</span>：</td>'
								+'<td width="19%" style="background-color:#fff;color:#108EE9;font-size:0.16rem;font-weight:bold;">'+data.rows[i].timeLimit+'天</td>'
								+'<td width="14%"><span>综合险到期日</span>：</td>'
								+'<td width="20%" style="background-color:#fff;color:#108EE9;font-size:0.16rem;font-weight:bold;">'+data.rows[i].expiringDate+'</td></tr></table></div>')
					};
					i = null;
				};
				if( $('.newTabAddUpdateBox.historic .row').length == data.records ){
					historicScrollFlag = false;
				}else{
					historicScrollFlag = true;
				};
			},
			error:function(status){
				new $.zui.Messager('获取综合险历史授信信息出错:'+status, {
				    type: 'danger'
				}).show();
			}
		})
	};
	getHistoricList(historicScrollPage);

	// 滚动加载
	$('.newTabAddUpdateBox.historic').scroll(function(){
		if( historicScrollFlag ){
			// 滚动到页面底部时执行获取数据方法
		　　 if( ($('.historicContentBox').height()+0.6*100) - $(this).scrollTop() - ($('.newTabAddUpdateBox.historic').height()+0.3*100) < 20  ){
			 //当滚动到底部时,执行此代码框中的代码
		　　　	historicScrollPage++;
				getHistoricList(historicScrollPage)
		　　 };
		}
	});

	// 返回列表页
	$(".newBackBtn").click(function(){
		$(".yk_rightcontent").load('/inkassonPolicy/list?ename=exportCreditInsuranceCorp')
	})
</script>
</html>
