<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>核准阶段管理</title>
	<meta name="decorator" content="ani"/>
	<%@include file="approvalStageForm.js"%>
	<%@ include file="/webpage/include/bootstraptable.jsp" %>
	<style type="text/css">
		/* 下边两行是去掉input 输入框右边的上下箭头按钮*/
		.deal::-webkit-inner-spin-button {
			-webkit-appearance: none !important;
		}
		.deal::-webkit-outer-spin-button {
			-webkit-appearance: none !important;
		}
		input[type="number"]{
			-moz-appearance:textfield;
		}
	</style>
	<script type="text/javascript">

		$(document).ready(function() {
	        $('#dateOfApproval').datetimepicker({
				 format: "YYYY-MM-DD"
		    });
		});

		function save() {
            var isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
                return false;
			}else{
                jp.loading();
                jp.post("${ctx}/filing/approvalStage/save",$('#inputForm').serialize(),function(data){
                    if(data.success){
                        jp.getParent().refresh();
                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(dialogIndex);
                        jp.success(data.msg)

                    }else{
                        jp.error(data.msg);
                    }
                })
			}

        }

		function noFue(val){
			document.getElementById('approvedAmount').value = val >= 0 ? val : 0;
		}

	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="approvalStage" action="${ctx}/filing/basicInformation/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<table class="table table-bordered">
		   <tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目编码：</label></td>
					<td class="width-35">
						<form:input path="projectCode" readonly="true" htmlEscape="false"  class="form-control"/>
					</td>
					<td class="width-15 active"><label class="pull-right">单体编码：</label></td>
					<td class="width-35">
						<form:input path="monomerCode" readonly="true" htmlEscape="false"  class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
					<td class="width-35">
						<form:input path="entryName" readonly="true" htmlEscape="false" class="form-control"/>
					</td>
					<td class="width-15 active"><label class="pull-right">核准文号：</label></td>
					<td class="width-35">
						<form:input path="approvalNumber" htmlEscape="false" class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">核准日期：</label></td>
					<td class="width-35">
						<div class='input-group form_datetime' id='dateOfApproval'>
							<input type='text'  name="dateOfApproval" class="form-control"  value="<fmt:formatDate value="${approvalStage.dateOfApproval}" pattern="yyyy-MM-dd"/>"/>
							<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>
					</td>
					</td>
					<td class="width-15 active"><label class="pull-right">核准金额：</label></td>
					<td class="width-35">
						<form:input type="number" onblur="noFue(this.value)" path="approvedAmount" htmlEscape="false" rows="4" class="form-control"/>
					</td>
		  		</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">核准附件：</label></td>
					<td class="width-35">
						<sys:fileUpload path="approvedAnnex"  value="${approvalStage.approvedAnnex}" type="*" uploadPath="/photo"  readonly="false"/></td>
					</td>
					</td>
				</tr>
		 	</tbody>
		</table>
		</div>
		</form:form>
</body>
</html>