confirmConfirQty.html 3.08 KB
<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>

<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-taskDetail-add" th:object="${srmDetail}">
		<input id="headerId" name="headerId" th:field="*{headerId}"  type="hidden">
		<input id="id" name="id" class="form-control"  th:field="*{id}" type="hidden">
		<div class="form-group">
			<label class="col-sm-3 control-label">物料编码:</label>
			<div class="col-sm-8">
				<input id="materialCode" name="materialCode" class="form-control" type="text" th:field="*{materialCode}" readonly="readonly">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">物料名称:</label>
			<div class="col-sm-8">
				<input id="materialName" name="materialName" class="form-control" type="text" th:field="*{materialName}" readonly="readonly">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">数量:</label>
			<div class="col-sm-8">
				<input id="qty" name="qty" class="form-control" type="text" th:field="*{qty}" readonly="readonly">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">到货数量:</label>
			<div class="col-sm-8">
				<input id="confirmQty" name="confirmQty" class="form-control" type="text" th:field="*{confirmQty}" >
			</div>
		</div>
		<div class="form-group">
			<div class="form-control-static col-sm-offset-9">
				<button type="submit" class="btn btn-primary">提交</button>
				<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
	var prefix = ctx + "srm/srmDetailNone"
	$("#form-taskDetail-add").validate({
		rules:{
			confirmQty:{
				required:true,
				min:0
			},
		},
		submitHandler: function(form) {
			$.ajax({
				cache : true,
				type : "POST",
				url : prefix + "/confirmConfirQty",
				data : $("#form-taskDetail-add").serializeArray(),
				async : false,
				error : function(request) {
					$.modal.alertError("请求失败!");
				},
				success : function(data) {
					// $.operate.saveSuccess(data);
					ajaxSuccess(data);
				}
			});
		}
	});
	function ajaxSuccess(result) {
		if (result.code == web_status.SUCCESS) {
			$.modal.msgSuccess(result.msg);
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index);
			window.parent.$.table.search();
			$(parent.$("#detail2")).click();
		} else {
			$.modal.alertError(result.msg);
		}
		// $.modal.msgSuccess(result.msg);
		$.modal.closeLoading();
		window.parent.detail2(headerId)
	}

	var headerId=$("input[name='headerId']").val();

	$(function () {
		layui.use('laydate', function() {
			var laydate = layui.laydate;
			laydate.render({ elem: '#manufactureDate', theme: 'molv', format: 'yyyy-MM-dd HH:mm:ss' });
			laydate.render({ elem: '#expirationDate', theme: 'molv', format: 'yyyy-MM-dd HH:mm:ss' });
		});
	});

</script>
</body>
</html>