<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>工作流任务委托管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		var validateForm;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
            laydate.render({
                elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'datetime'
            });
            laydate.render({
                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'datetime'
            });
		});
	</script>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="activityAssignment" action="${ctx}/activityassignment/activityAssignment/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
			<div class="form-group layui-row first lw8">
				<div class="form-group-label"><h2>委托信息</h2></div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">被委托人：</label>
					<div class="layui-input-block with-icon">
						<input class="form-control layui-input" readonly="true" value="${activityAssignment.user.name}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">委托类型：</label>
					<div class="layui-input-block">
						<input class="form-control layui-input" readonly="true" value="${fns:getDictLabel(activityAssignment.type, 'assignmentType', '')}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">委托开始时间：</label>
					<div class="layui-input-block">
						<input class="form-control layui-input" readonly="true" value="<fmt:formatDate value="${activityAssignment.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">委托结束时间：</label>
					<div class="layui-input-block">
						<input class="form-control layui-input" readonly="true" value="<fmt:formatDate value="${activityAssignment.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm12 with-textarea">
					<label class="layui-form-label">备注信息：</label>
					<div class="layui-input-block">
						<textarea path="remarks" htmlEscape="false" rows="4"  style="resize:none"   class="form-control ">${activityAssignment.remarks}</textarea>
					</div>
				</div>
			</div>
		</form:form>
	</div>
</div>
</body>
</html>