<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>配网物资专职审核领料单</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<meta name="decorator" content="ani"/>
	<%@ include file="/webpage/include/bootstraptable.jsp"%>
	<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 project = $("#projectId").val();
			var mdTotalAmount = $("#mdTotalAmount").val();
			var procInsId = $("#procInsId").val();
			if (null==project||""==project){
				jp.error("请选择需要添加的项目！");
			}else if(null==mdTotalAmount||""==mdTotalAmount||mdTotalAmount<=0) {
				jp.error("请填入正确的数值");
			}else {
				jp.loading();
				jp.post("${ctx}/picking/activiti/netSave",{"project":project,"mdTotalAmount":mdTotalAmount,"procInsId":procInsId},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="showList" class="form-horizontal">
		<form:hidden path="id"/>
		<input type="hidden" id="procInsId" name="procInsId" value="${showList.act.procInsId}"/>
		<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">
					<sys:itemselect url="${ctx}/sg/managementcenter/marterialProvided/searchData" id="project" name="projectId" value="${materialProvided.id}" labelName="materialProvided.materialDescription" labelValue="${materialProvided.materialDescription}"
									title="选择项目号" cssClass="form-control " fieldLabels="${fns:urlEncode('物料编码|物料描述|扩展编码|扩展编码描述|计量单位|参考概算价格|版本号')}" fieldKeys="materialCode|materialDescription|extendedCode|extendedDescription|measuringUnit|referencePrice|versionName" searchLabels="${fns:urlEncode('物料编码|物料描述')}" searchKeys="materialCode|materialDescription"  isMultiSelected="false"></sys:itemselect>
				</td>
			</tr>
			<tr>
				<td class="width-15 active"><label class="pull-right" style="float: left">添加数量：</label></td>
				<td class="width-35">
					<input type="number" id="mdTotalAmount" class="form-control">
				</td>
			</tr>
			</tbody>
		</table>
	</form:form>
</body>
</html>