<%@ 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() {
            $("#ids").val(jp.getParent().getIds());
	        $('#deliverySchedule').datetimepicker({
                format: "YYYY-MM"
            });
		});
		function save() {
		    var dateTimeId = $("#dateTimeId").val();
            var isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
                return false;
			}else{
                jp.loading();
                jp.post("${ctx}/sg/managementCenter/constructionProject/unplanned",$('#inputForm').serialize(),function(data){
                    if(data.success){
                        jp.getParent().refreshjstree();
                        jp.getParent().jstreeTime(data.mapList);//渲染
						jp.getParent().dateTimeValue(dateTimeId);
                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(dialogIndex);
                        jp.success(data.message);
                        jp.getParent().jstreeTime(data.mapList);//渲染
                    }else{
                        jp.error(data.Message);
                    }
                })
			}

        }
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="constructionProject" class="form-horizontal">
		<form:hidden path="id"/>	
		<table class="table table-bordered">
			<tbody>
				<tr>
					<td class="width-15 active"><label class="">id：</label></td>
					<td class="width-35">
						<input class="form-control" id="ids" name="ids" value=""/>
					</td>
					<td class="width-15 active"><label class="">选择计划时间：</label></td>
					<td class="width-35">
						<div class='input-group form_datetime' id='deliverySchedule'>
							<input type='text'  name="arrangeTime" class="form-control required" id="dateTimeId" value="<fmt:formatDate value="${constructionProject.arrangeTime}" pattern="yyyy-MM"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</form:form>
</body>
</html>