<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<form:form id="subForm" modelAttribute="workContentDocument" action="${ctx}/workcontent/workContentDocument/save" method="post" class="form-horizontal">
    <form:hidden path="id"/>
    <div class="form-group layui-row lw12">
        <div class="layui-item layui-col-sm6">
            <label class="layui-form-label"><span class="require-item">*</span>资料名称：</label>
            <div class="layui-input-block">
                <form:input path="name" 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 htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workContentDocument.status,'content_document_status','')}"/>
            </div>
        </div>
        <div class="layui-item layui-col-sm6">
            <label class="layui-form-label">资料保管人：</label>
            <div class="layui-input-block">
                <form:input path="manager" htmlEscape="false" readonly="true" class="form-control layui-input"/>
            </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 htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workContentDocument.style,'content_document_style','')}"/>
            </div>
        </div>
        <div class="layui-item layui-col-sm6">
            <label class="layui-form-label">是否电子化：</label>
            <div class="layui-input-block">
                <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workContentDocument.isElec,'yes_no','')}"/>
            </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 htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workContentDocument.docType, 'project_document_type', '')}"/>
            </div>
        </div>
    </div>
</form:form>
<script type="text/javascript">
    var validateForm;
    $(document).ready(function() {
        validateForm = $("#subForm").validate({
            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 genDetailStr(){
        return JSON.stringify($("#subForm").serializeJson());
    }
</script>