<%@ 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() {

	        $('#deliverySchedule').datetimepicker({
				 format: "YYYY-MM-DD"
		    });
		});
		function save() {
            var isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
                return false;
			}else{
                jp.loading();
                jp.post("${ctx}/sg/managementcenter/materialplan/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);
                    }
                })
			}

        }
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="materialPlan" class="form-horizontal">
		<form:hidden path="id"/>	
		<table class="table table-bordered">
			<tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right" style="float: left">物资编码：</label></td>
					<td class="width-35">
						<form:input path="uniqueCode" htmlEscape="false" class="form-control required"/>
					</td>
					<td class="width-15 active"><label class="pull-right">需求物资编码：</label></td>
					<td class="width-35">
						<form:input path="requireCoding" htmlEscape="false"   class="form-control required"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">物料描述：</label></td>
					<td class="width-35">
						<form:input path="description" htmlEscape="false"    class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">物料扩展编码：</label></td>
					<td class="width-35">
						<form:input path="expansionCode" htmlEscape="false"    class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">物料扩展描述：</label></td>
					<td class="width-35">
						<form:input path="expansionDescription" htmlEscape="false"    class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">大类描述：</label></td>
					<td class="width-35">
						<form:input path="bigDescribe" htmlEscape="false"    class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">中类描述：</label></td>
					<td class="width-35">
						<form:input path="moderateDescribe" htmlEscape="false"    class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">小类描述：</label></td>
					<td class="width-35">
						<form:input path="smallDescribe" htmlEscape="false"    class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">需求数量：</label></td>
					<td class="width-35">
						<form:input path="requireNumber" htmlEscape="false"    class="form-control number"/>
					</td>
					<td class="width-15 active"><label class="">单位：</label></td>
					<td class="width-35">
						<form:input path="util" htmlEscape="false"    class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">计划批次：</label></td>
					<td class="width-35">
						<form:input path="planToBatch" htmlEscape="false"    class="form-control"/>
					</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="deliverySchedule" class="form-control required"  value="<fmt:formatDate value="${materialPlan.deliverySchedule}" pattern="yyyy-MM-dd"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">是否入库：</label></td>
					<td class="width-35">
						<form:input path="flagStorage" htmlEscape="false"    class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">库存数量：</label></td>
					<td class="width-35">
						<form:input path="inventoryQuantity" htmlEscape="false"    class="form-control number"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">冻结数量：</label></td>
					<td class="width-35">
						<form:input path="numberFrozen" htmlEscape="false"    class="form-control number"/>
					</td>
					<td class="width-15 active"><label class="">供应商名称：</label></td>
					<td class="width-35">
						<form:input path="supplierName" htmlEscape="false"    class="form-control"/>
					</td>
				</tr>
			</tbody>
		</table>
	</form:form>
</body>
</html>