<%@ 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;
        var count = 0;
        $(document).ready(function() {
            if($("#createDate").val()==null || $("#createDate").val()==''){
                $("#createDate").val(getNowFormatDate());
            }
            validateForm = $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                rules:{
                },
                messages:{
                },
                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);
                    }
                }
            });




        });

        function getNowFormatDate() {
            var date = new Date();
            var seperator1 = "-";
            var seperator2 = ":";
            var month = date.getMonth() + 1;
            var strDate = date.getDate();
            month = (month < 10)?"0"+month:month;
            strDate = (strDate < 10)?"0"+strDate:strDate;
            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
            return currentdate;
        }


	</script>
	<style>
		/*超过5个汉字，调整label的长度，以下是配套的*/
		.layui-item .layui-form-label{
			width:90px;
		}
		.form-group .layui-item .layui-input-block,
		.query .layui-input-block {
			margin-left: 116px;
		}
	</style>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="workIeaveTemplate" action="${ctx}/workieavetemplate/workIeaveTemplate/save" method="post" class="form-horizontal" >
			<form:hidden path="id"/>
			<div class="form-group layui-row first">
				<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">
						<form:input path="branchOfficeName" htmlEscape="false"  readonly="true"  class="form-control  layui-input required"/>
					</div>
				</div>

				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>创建日期：</label>
					<div class="layui-input-block">
						<input id="createDate" name="createDate" type="text"  maxlength="20" class="laydate-icondate form-control layer-date  layui-input laydate-icon"
							   value="<fmt:formatDate value="${workIeaveTemplate.createDate}" pattern="yyyy-MM-dd"/>"/>
					</div>
				</div>

			</div>

			<div class="form-group layui-row">
				<div class="form-group-label"><h2>模板详情</h2></div>

				<div class="layui-item layui-col-xs12 form-table-container" >
					<table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin">
						<thead>
						<tr>
							<th width="200px">审核部门</th>
							<th width="200px">审核人</th>
							<th width="150px">审核项目</th>
						</tr>
						</thead>
						<tbody id="workIeaveTemplateUserList">
						<c:if test="${not empty workIeaveTemplate.workIeaveTemplateUserList}">
							<c:forEach items="${workIeaveTemplate.workIeaveTemplateUserList}" var="workIeaveTemplateUser" varStatus="index">
								<tr id="workIeaveTemplateUserList${index.index}">
									<td class="hide">
										<input id="workIeaveTemplateUserList${index.index}_id" name="workIeaveTemplateUserList[${index.index}].id" type="hidden" value="${workIeaveTemplateUser.id}"/>
										<input id="workIeaveTemplateUserList${index.index}_templateId" name="workIeaveTemplateUserList[${index.index}].templateId" type="hidden" value="${workIeaveTemplateUser.templateId}"/>
										<input id="workIeaveTemplateUserList${index.index}auditor" name="workIeaveTemplateUserList[${index.index}].auditor" type="hidden" value="${workIeaveTemplateUser.auditor}"/>
										<input id="workIeaveTemplateUserList${index.index}_delFlag" name="workIeaveTemplateUserList[${index.index}].delFlag" type="hidden" value="0"/>
									</td>
									<td>
										<input id="workIeaveTemplateUserList${index.index}_1"  readonly="true"   type="text" value="${workIeaveTemplateUser.officeName}"   class="form-control "/>
									</td>
									<td>
										<input id="workIeaveTemplateUserList${index.index}_2"  readonly="true"   type="text" value="${workIeaveTemplateUser.userName}"   class="form-control "/>
									</td>
									<td>
										<input id="workIeaveTemplateUserList${index.index}_3"  readonly="true"    type="text" value="${workIeaveTemplateUser.comment}" title="${workIeaveTemplateUser.comment}"  class="form-control "/>
									</td>
								</tr>
							</c:forEach>
						</c:if>
						</tbody>
					</table>
				</div>
			</div>
			<div class="form-group layui-row page-end"></div>
		</form:form>

	</div>
</div>
</body>
</html>