<link rel="stylesheet" href="/css/external/enterPriseBusiness/reportAddUpdate.css" type="text/css">
<div class="modal fade businessDialog" id="myModal-updateFinanceReport" data-backdrop="static">
	<div class="modal-dialog modal-fullscreen">
		<div class="modal-header">
			<button type="button" class="close">
				<span class="headerClose" style="font-size:0.18rem">×</span><span class="sr-only">关闭</span>
			</button>
			<span class="modal-title">修改财务报表</span>
		</div>
		<div class="modal-content">
			<form id="reportUpdateForm" class="form-horizontal" action="/enterpriseFinanceReport/doUpdate" method="post">
				<input type="hidden" name="enterpriseBusinessInfo.id" class="enterId">
				<input type="hidden" name="id" th:value="${financeReport?.id}" id="reportId">
				
				<input type="hidden" th:value="${financeReport?.balanceSheet}" id="balanceSheetModelId">
				<input type="hidden" th:value="${financeReport?.profitStatement}" id="profitStatementModeld">
				<input type="hidden" th:value="${financeReport?.cashFlow}" id="cashFlowModelId">
				<div class="newTabAddUpdateBox" style="border:none;padding-left:0.2rem;padding-right:0.2rem;padding-bottom:0;">
					<span tag:token/>
					<div class="row">
						<table>
							<tr>
								<td colspan="4">
									<span class="detailContentBox-tabletitle">基本信息</span>
								</td>
							</tr>
							<tr>
								<td width="15%">
									<span class="required_fileds_star">报表类型</span>：
								</td>
								<td width="35%" class="enter">
									<select class="form-control selection" id="financeReportTimeTypeSelect" name="reportType.id" 
										tag:option="financeReportTimeType" th:value="${financeReport?.reportType?.id}"></select>
								</td>
								<td width="15%">
									<span class="required_fileds_star">报表年月</span>：
								</td>
								<td width="35%" class="enter">
									<input type="text" id="reportTimeInput" name="reportTime"
									readOnly th:value="${financeReport?.reportTime}" class="form-control form-date formdate"
									placeholder="请选择报表年月">
								</td>
							</tr>
							<tr>
								<td width="15%">
									<span class="required_fileds_star">金额单位</span>：
								</td>
								<td width="35%" class="enter">
									<select class="form-control selection" id="amountUnitSelect" name="amountUnit.id" 
										tag:option="amountUnit" 
										th:value="${financeReport?.amountUnit?.id}"></select>
								</td>
								<td width="15%">
									<span class="required_fileds_star">资产负债表</span>：
								</td>
								<td width="35%" class="enter">
									<select data-index=0 class="reportSelect form-control" id="balanceSheetSelect" name="balanceSheet">
										<option value="">请选择资产负债表模版</option>
										<option
									       	th:each="balanceSheet,balanceSheetStat:${balanceSheetList}"
									      	th:value="${balanceSheet.id}"
									      	th:text="${balanceSheet.name}"/>
									</select>
								</td>
							</tr>
							<tr>
								<td width="15%">
									<span class="required_fileds_star">利润表</span>：
								</td>
								<td width="35%" class="enter">
									<select data-index=1 class="reportSelect form-control" id="profitStatementSelect" name="profitStatement">
										<option value="">请选择利润表模版</option>
										<option
									       	th:each="profitStatment,profitStatmentStat:${profitStatementList}"
									      	th:value="${profitStatment.id}"
									      	th:text="${profitStatment.name}"/>
									</select>
								</td>
								<td width="15%">
									<span class="required_fileds_star">现金流量表</span>：
								</td>
								<td width="35%" class="enter">
									<select data-index=2 class="reportSelect form-control" id="cashFlowSelect" name="cashFlow">
										<option value="">请选择现金流量表模版</option>
										<option
									       	th:each="cashFlow,cashFlowStat:${cashFlowList}"
									      	th:value="${cashFlow.id}"
									      	th:text="${cashFlow.name}"/>
									</select>
								</td>
							</tr>
						</table>
					</div>
					<div class="row">
						<table>
							<tbody class="reportChoiceResult" data-index=0>
								<tr>
									<td colspan="7">
										<span class="detailContentBox-tabletitle">资产负债表</span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="row">
						<table>
							<tbody class="reportChoiceResult" data-index=1>
								<tr>
									<td colspan="10">
										<span class="detailContentBox-tabletitle">利润表</span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="row">
						<table>
							<tbody class="reportChoiceResult" data-index=2>
								<tr>
									<td colspan="10">
										<span class="detailContentBox-tabletitle">现金流量表</span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<ul id="hiddenHTML" style="display:none"></ul>
				</div>
			</form>
		</div>
		<div class="modal-footer reportFromfooter">
			<button type="button" class="btn btn-white btn-info closer" data-dismiss="modal">关闭</button>
			<button type="button" class="btn btn-white btn-info colorbtn add">确定</button>
		</div>
	</div>
</div>
<script th:inline="javascript">
    var balancesheetFormulaList = [[${financeReport?.balanceSheetFormulaList}]];
    var a=[];var b=[];var c=[];var d=[];var e=[];var f=[];
    var htmlPreservationTestList=[a,b,c];
    var htmlFormulaList=[d,e,f];
    htmlPreservationTestList[0] = balancesheetFormulaList;
    if(balancesheetFormulaList != null){
    	for(var i = 0;i<balancesheetFormulaList.length;i++){
    		 var foo={};
 			 foo.formula=balancesheetFormulaList[i].formula;
 			 foo.formulaHtml=balancesheetFormulaList[i].formulaHtml;
 			 htmlFormulaList[0].push(foo);
   		}
    }
    
    var profitStatementFormulaList = [[${financeReport?.profitStatementFormulaList}]];
    htmlPreservationTestList[1] = profitStatementFormulaList;
    if(profitStatementFormulaList != null){
		for(var i = 0;i<profitStatementFormulaList.length;i++){
	   		var foo={};
			foo.formula=profitStatementFormulaList[i].formula;
			foo.formulaHtml=profitStatementFormulaList[i].formulaHtml;
			htmlFormulaList[1].push(foo);
		}
    }
   
    var cashFlowFormulaList = [[${financeReport?.cashFlowFormulaList}]];
    htmlPreservationTestList[2] = cashFlowFormulaList;
    if(cashFlowFormulaList !=null){
    	 for(var i = 0;i<cashFlowFormulaList.length;i++){
    		var foo={};
 			foo.formula=cashFlowFormulaList[i].formula;
 			foo.formulaHtml=cashFlowFormulaList[i].formulaHtml;
 			htmlFormulaList[2].push(foo)
    	 }
    }
 
</script> 
<script src="/js/enterPriseBusiness/financeReport/reportAddUpdateBase.js"></script>
<script src="/js/enterPriseBusiness/financeReport/enterpriseFinanceReportUpdate.js"></script>
