<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>土建上传文件页面</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
		$(document).ready(function() {
	        $('#beginDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#endDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
		});
		function save() {
		    let mdImg = $("#mdImg").val();
		    let uploadName = $("#uploadName").val();
            let isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
                return false;
			}else{
				if (mdImg != '') {
					jp.loading();
					jp.post("${ctx}/nonPower/saveUpload", $('#inputForm').serialize(), function (data) {
						if (data.success) {
							jp.getParent().refresh();
							let dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
							parent.layer.close(dialogIndex);
							jp.success(data.msg)
						} else {
							jp.error(data.msg);
						}
					});
				} else {
					jp.error("请选择文件");
				}
			}

        }
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="uploadImages" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="reserveProjectName"/>
		<form:hidden path="procInsId"/>
		<table class="table table-bordered">
			<tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>文件用途：</label></td>
					<td class="width-35">
						<form:input path="imgName" cssClass="form-control required"/>
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>上传附件：</label></td>
					<td class="width-35">
						<sys:fileUpload  path="path" fileNumLimit="50" fileSizeLimit="50"  value="${moduleBlock.mdImg}"  uploadPath="/pick"></sys:fileUpload>
					</td>
				</tr>
			</tbody>
		</table>
	</form:form>
</body>
</html>