<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>企业信息管理-财务报表-查看</title>
	<div th:substituteby="common/resourceMainHeader :: resourceMainHeader"></div>
	<!--[if !IE]> -->
		<script src="/js/external/jquery-2.1.4.min.js"></script>
	<!-- <![endif]-->
	<!--[if IE]>
		<script src="/js/external/jquery-1.11.3.min.js"></script>
	<![endif]-->
	<script src="/js/external/zui.min.js"></script>
	<script src="/js/external/jquery.validate.js" type="text/javascript"></script>
	<script src="/js/external/additional-methods.min.js" type="text/javascript"></script>
	<script src="/js/external/messages_zh.min.js" type="text/javascript"></script>
	<script src="/layer/layer.js"></script>
	<script src="/js/base/base.js"></script>
	<link rel="stylesheet" href="/css/external/enterPriseBusiness/reportView.css" type="text/css">
	<style>
	.base-extend .projectManagementTop .newTabAddUpdateBox table td.enter {
	    padding: 0rem;
	    padding-right:0.05rem
	}
	.base-extend .newTabAddUpdateBox table td {
		text-align: right;
	}
	textarea {
		height:0.3rem;
		line-height:0.3rem
	}
	</style>
</head>
<body>
	<div class="base-extend yk_content" style="position:relative !important;background:#fff;">
		<ol class="breadcrumb">
		  	<li>企业信息管理</li>
		  	<li>企业管理</li>
		  	<li>财务报表</li>
		  	<li>查看</li>
		</ol>
		<button class="btn btn-white btn-info colorbtn" style="position:absolute;right:0.2rem;top:0.05rem;cursor:pointer;" onclick="window.close();">关闭</button>
		<div class="detailContentBox">
			<div class="projectManagementTop historyTop">
				<div class="newTabAddUpdateBox" >
					<div class="showarea">
						<div class="nodeShow financeReport-body" style="width:100%;display:block">
							<input type="hidden" id="reportViewId" th:value="${financeReport?.id}">
							<h2 th:text="${financeReport?.reportTime}+' 资产负债表'"></h2>
							<h4 th:text="'金额单位：'+${financeReport?.amountUnit?.name}"></h4>
							<div class="row">
								<table>
									<tr class="finnanceHader">
	            						<td class="modelReportHeader" width="25%" rowspan="2">资产</td>
	            						<td class="modelReportHeader" colspan="3">期末余额</td>
	            						<td class="modelReportHeader" colspan="3">年初余额</td>
	            					</tr>
	            					<tr class="finnanceHader">
	            						<td class="modelReportHeader">原始值</td>
	            						<td class="modelReportHeader">修正值</td>
	            						<td class="modelReportHeader">确定值</td>
	            						<td class="modelReportHeader">原始值</td>
	            						<td class="modelReportHeader">修正值</td>
	            						<td class="modelReportHeader">确定值</td>
	            					</tr>
									<tr class="finnanceBody" th:each="item,itemStat:${financeReport?.balanceSheetItemList}">
										<th:block th:if="${item?.input}==false">
											<td class="enter noInputItem" th:style="${item?.style}">
												<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
											</td>
											<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
											<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
										</th:block>
										<th:block th:if="${item?.input}==true">
											<td class="enter" th:style="${item?.style}">
												<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
											</td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount2}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount3}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount4}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount5}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount6}"></td>
										</th:block>
										<th:block th:if="${item==null}">
											<td class="enter"></td><td class="enter"></td>
											<td class="enter"></td><td class="enter"></td>
											<td class="enter"></td><td class="enter"></td>
										</th:block>
									</tr>
									<tr class="finnanceHader">
	            						<td class="modelReportHeader" width="25%" rowspan="2">负债和所有者权益（或股东权益）</td>
	            						<td class="modelReportHeader" colspan="3">期末余额</td>
	            						<td class="modelReportHeader" colspan="3">年初余额</td>
	            					</tr>
	            					<tr class="finnanceHader">
	            						<td class="modelReportHeader">原始值</td>
	            						<td class="modelReportHeader">修正值</td>
	            						<td class="modelReportHeader">确定值</td>
	            						<td class="modelReportHeader">原始值</td>
	            						<td class="modelReportHeader">修正值</td>
	            						<td class="modelReportHeader">确定值</td>
	            					</tr>
	            					<tr class="finnanceBody" th:each="item,itemStat:${financeReport?.fuzhaiItemList}">
										<th:block th:if="${item?.input}==false">
											<td class="enter noInputItem" th:style="${item?.style}">
												<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
											</td>
											<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
											<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
										</th:block>
										<th:block th:if="${item?.input}==true">
											<td class="enter" th:style="${item?.style}">
												<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
											</td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount2}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount3}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount4}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount5}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount6}"></td>
										</th:block>
										<th:block th:if="${item==null}">
											<td class="enter"></td><td class="enter"></td>
											<td class="enter"></td><td class="enter"></td>
											<td class="enter"></td><td class="enter"></td>
										</th:block>
									</tr>
								</table>
							</div>
							<h2 th:text="${financeReport?.reportTime}+' 利润表'"></h2>
							<h4 th:text="'金额单位：'+${financeReport?.amountUnit?.name}"></h4>
							<div class="row">
								<table>
									<tr class="finnanceHader">
					        			<td class="modelReportHeader" width="25%" rowspan="2">项目</td>
										<td class="modelReportHeader" colspan="3">本年累计金额</td>
										<td class="modelReportHeader" colspan="3">上年同期累计金额</td>
										<td class="modelReportHeader" colspan="3">上年整年累计金额</td>
									</tr>
									<tr class="finnanceHader">
										<td class="modelReportHeader">原始值</td>
										<td class="modelReportHeader">修正值</td>
										<td class="modelReportHeader">确定值</td>
										<td class="modelReportHeader">原始值</td>
										<td class="modelReportHeader">修正值</td>
										<td class="modelReportHeader">确定值</td>
										<td class="modelReportHeader">原始值</td>
										<td class="modelReportHeader">修正值</td>
										<td class="modelReportHeader">确定值</td>
									</tr>
									<tr class="finnanceBody" th:each="item,itemStat:${financeReport?.profitStatementItemList}">
										<th:block th:if="${item?.input}==false">
											<td class="enter noInputItem" th:style="${item?.style}">
												<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
											</td>
											<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
											<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
											<td class="enter nocontent">--</td>
										</th:block>
										<th:block th:if="${item?.input}==true">
											<td class="enter" th:style="${item?.style}">
												<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
											</td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount2}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount3}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount4}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount5}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount6}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount7}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount8}"></td>
											<td class="enter insertionPoint" th:text="${item?.itemAmount9}"></td>
										</th:block>
										<th:block th:if="${item==null}">
											<td class="enter"></td><td class="enter"></td><td class="enter"></td>
											<td class="enter"></td><td class="enter"></td><td class="enter"></td>
											<td class="enter"></td><td class="enter"></td><td class="enter"></td>
										</th:block>
									</tr>
								</table>
							</div>
							<h2 th:text="${financeReport?.reportTime}+' 现金流量表'"></h2>
							<h4 th:text="'金额单位：'+${financeReport?.amountUnit?.name}"></h4>
							<div class="row">
								<table>
									<tr class="finnanceHader">
										<td class="modelReportHeader" width="25%" rowspan="2">项目</td>
										<td class="modelReportHeader" colspan="3">本年累计金额</td>
										<td class="modelReportHeader" colspan="3">上年同期累计金额</td>
										<td class="modelReportHeader" colspan="3">上年整年累计金额</td>
									</tr>
									<tr class="finnanceHader">
										<td class="modelReportHeader">原始值</td>
										<td class="modelReportHeader">修正值</td>
										<td class="modelReportHeader">确定值</td>
										<td class="modelReportHeader">原始值</td>
										<td class="modelReportHeader">修正值</td>
										<td class="modelReportHeader">确定值</td>
										<td class="modelReportHeader">原始值</td>
										<td class="modelReportHeader">修正值</td>
										<td class="modelReportHeader">确定值</td>
									</tr>
									<tr class="finnanceBody" th:each="item,itemStat:${financeReport?.cashFlowItemList}">
											<th:block th:if="${item?.input}==false">
												<td class="enter noInputItem" th:style="${item?.style}">
													<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
												</td>
												<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
												<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
												<td class="enter nocontent">--</td><td class="enter nocontent">--</td><td class="enter nocontent">--</td>
											</th:block>
											<th:block th:if="${item?.input}==true">
												<td class="enter" th:style="${item?.style}">
													<textarea th:style="${item?.style}" th:utext="${item?.name}" readonly></textarea>
												</td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount2}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount3}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount4}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount5}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount6}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount7}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount8}"></td>
												<td class="enter insertionPoint" th:text="${item?.itemAmount9}"></td>
											</th:block>
											<th:block th:if="${item==null}">
												<td class="enter"></td><td class="enter"></td><td class="enter"></td>
												<td class="enter"></td><td class="enter"></td><td class="enter"></td>
												<td class="enter"></td><td class="enter"></td><td class="enter"></td> 
											</th:block>
										</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script src="/js/external/jquery-2.1.4.min.js"></script>
<script>
	function commaDelimiter(value,maxlength,errortipselect){//需要加逗号的值
		if( value=='' ){
			return value;
		}else{
			if( !(/^(\-|\+)?\d+(\.\d+)?$/.test(value.split(',').join(''))) ){//不符合正数或负数或小数时把逗号通通去掉
				return value.split(',').join('');
			}else{
				var lastnumber = '',prevnumber = value.split('.')[0].split(',').join('');
				lastnumber = value.indexOf('.')>0?'.'+value.split('.')[1]:'';//有小数点时,添加完逗号后需要把小数点后的内容加回来
				//对小数点前的进行操作,倒数每隔三位添加一个逗号
				return prevnumber.toString().replace(new RegExp('(\\d)(?=(\\d{3})+$)','ig'),"$1,") + lastnumber;
			}
		}
	};
	$(function(){
		$(".insertionPoint").each(function(){
			var insertionVal=$(this).text().split(',').join('');
			$(this).text(commaDelimiter(insertionVal));
		})
		$(".table").on("mouseenter","td",function(){
			if($(this).find("textarea").length){
				$(this).append('<div class="tableToolTip" style="left:80%;top:60%"><p>'+$(this).find("textarea").text()+'</p></div>');
				$(this).find(".tableToolTip").show();
			}
		})
		$(".table").on("mouseenter",".tableToolTip",function(){return false})
		$(".table").on("mouseleave",".tableToolTip",function(){$(".tableToolTip").remove();return false;});
		$(".table").on("mouseleave","td",function(){if($(this).find("textarea").length){$(this).find(".tableToolTip").remove();}})
		$(".showarea").find(".row").each(function(){
			$(this).find(".finnanceBody").each(function(){
				if($(this).find("textarea").length){
					//console.log($(this).find("textarea").get(0).scrollHeight);
					$(this).find("textarea").eq(0).height($(this).find("textarea").get(0).scrollHeight-4)
				}
			})
		})
		
		// 新窗口查看时需要计算高度
		$(".projectManagementTop.historyTop").css('height',$("body").height()-$(".breadcrumb").height()-$(".businessNavigation").height()-15 )
		$(window).bind('resize',function(){
			$(".projectManagementTop.historyTop").css('height',$("body").height()-$(".breadcrumb").height()-$(".businessNavigation").height()-15 )
		})
	})
</script>
</html>



