<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<script src="/${ctx}/act/rest/js/common/jquery-1.8.3.js"></script>
	<title>物料详细</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#saveInfo").click(function () {
				$.ajax({
					url: "${ctx}/sg/material/update",
					type: "post",
					data: $("form").serialize(),
					dataType: "text",
					success: function (data) {
						console.log(data);
						if (data == "修改成功") {
							jp.success("修改成功");
							jp.getParent().refresh();
							var index = parent.layer.getFrameIndex(window.name);
							jp.close(index);
						} else {
							jp.error("修改失败");
							jp.getParent().refresh();
							var index = parent.layer.getFrameIndex(window.name);
							jp.close(index)
						}
					}
				});
			})
		});
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="material" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<table class="table table-bordered" style="margin: 0 auto;text-align: center;width: 600px">
		   <tbody>
				<tr>
					<td class="width-35" style="text-align: center;margin: 0 auto">
						<form:select cssStyle="width: 300px;margin: 0 auto" path="status" cssClass="form-control" htmlEscape="false">
							<form:option value="施工单位放弃补领">施工单位放弃补领</form:option>
							<form:option value="多领物资抵扣施工费">多领物资抵扣施工费</form:option>
							<form:option value="结算审计错误">结算审计错误</form:option>
							<form:option value="自定义">自定义</form:option>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-35" style="text-align: center;margin: 0 auto">
						<form:textarea cssStyle="width: 300px;margin: 0 auto" path="info" htmlEscape="false" cssClass="form-control"/>
					</td>
				</tr>
				<tr>
					<td class="width-35" style="text-align: center;margin: 0 auto">
						<input type="button" id="saveInfo" value="保存"  class="btn btn-primary btn-block btn-lg btn-parsley"/>
					</td>
		  		</tr>
		 	</tbody>
		</table>
		</form:form>
</body>
</html>