<%@ 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() {
		    var selectVersion = $("#selectVersion").val();
		    if (null==selectVersion||""==selectVersion){
                jp.error("请选择版本！");
			}else {
		        $("#version").val(selectVersion);
                var isValidate = jp.validateForm('#inputForm');//校验表单
                if(!isValidate){
                    return false;
                }else{
                    jp.loading();
                    jp.post("${ctx}/sg/managementcenter/marterialProvided/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="materialProvided" class="form-horizontal">
		<form:hidden path="id"/>	
		<table class="table table-bordered">
		   	<tbody>
				<tr>
					<input type="hidden" id="version" name="versionName" value=""/>
					<td class="width-15 active"><label class=""><font color="red">*</font>计划批次：</label></td>
					<td class="width-35">
						<form:input path="planToBatch" htmlEscape="false"    class="form-control required"/>
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>选择版本：</label></td>
					<td class="width-35">
						<%--<form:select path="versionName" items="${allVersion}" itemLabel="${list.versionName}" itemValue="${list.versionName}"></form:select>--%>
						<select id="selectVersion"  class="form-control required">
							<option value="" id="option1">请选择版本</option>
							<c:forEach items="${allVersion}" var="list">
								<option value="${list.versionName}">${list.versionName}</option>
							</c:forEach>
						</select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class=""><font color="red">*</font>物料编码：</label></td>
					<td class="width-35">
						<form:input path="materialCode" htmlEscape="false" class="form-control required "/>
					</td>
					<td class="width-15 active"><label class="">物料加扩展：</label></td>
					<td class="width-35">
						<form:input path="materialExtension" htmlEscape="false" class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">物料描述：</label></td>
					<td class="width-35">
						<form:input path="materialDescription" htmlEscape="false"    class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">扩展编码：</label></td>
					<td class="width-35">
						<form:input path="extendedCode" htmlEscape="false" class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">扩展编码描述：</label></td>
					<td class="width-35">
						<form:input path="extendedDescription" htmlEscape="false"    class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">计量单位：</label></td>
					<td class="width-35">
						<form:input path="measuringUnit" htmlEscape="false" class="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="">分标信息：</label></td>
					<td class="width-35">
						<form:input path="caseInformation" htmlEscape="false" class="form-control"/>
					</td>
					<td class="width-15 active"><label class="">参考概算价格：</label></td>
					<td class="width-35">
						<form:input path="referencePrice" 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="planToBatchName" htmlEscape="false" class="form-control"/>
					</td>
					<td class="width-15 active"></td>
					<td class="width-35">
					</td>
				</tr>
		 	</tbody>
		</table>
	</form:form>
</body>
</html>