<%@ 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);
					}
				}
			});
            //只做查看时，禁用掉以下标签
            $('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);
		});
	</script>
</head>
<body>
<div class="single-form">
    <div class="container view-form">
		<form:form id="inputForm" modelAttribute="companyinfo" action="${ctx}/sys/company/companyinfoView" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>

            <div class="form-group layui-row first lw12">
                <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">
                        <c:choose>
                            <c:when test="${!disabled}">
                                <form:input path="companyId" htmlEscape="false" value="${office.name}" class="form-control layui-input "/>
                            </c:when>
                            <c:otherwise>
                                <input readonly="true" class="form-control layui-input required" value="${office.name}"/>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6">
                    <label class="layui-form-label">用户名称：</label>
                    <div class="layui-input-block">
                        <c:choose>
                            <c:when test="${!disabled}">
                                <form:input path="joinUserId" htmlEscape="false"  value="${user.name}"   class="form-control layui-input"/>
                            </c:when>
                            <c:otherwise>
                                <input readonly="true" class="form-control layui-input required" value="${user.name}"/>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6">
                    <label class="layui-form-label">公司管理员：</label>
                    <div class="layui-input-block">
                        <c:choose>
                            <c:when test="${!disabled}">
                                <form:input path="masterName" htmlEscape="false" class="form-control layui-input"/>
                            </c:when>
                            <c:otherwise>
                                <input readonly="true" class="form-control layui-input required" value="${companyinfo.masterName}"/>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6">
                    <label class="layui-form-label">加入状态：</label>
                    <div class="layui-input-block">
                        <c:choose>
                            <c:when test="${!disabled}">
                                <form:input path="status" htmlEscape="false"  value="${fns:getDictLabel(companyinfo.status, 'companyStatus', '')}"  class="form-control layui-input" />
                            </c:when>
                            <c:otherwise>
                                <input readonly="true" class="form-control layui-input required" value="${fns:getDictLabel(companyinfo.status, 'companyStatus', '')}"/>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
                <div class="layui-item layui-col-sm12 with-textarea">
                    <label class="layui-form-label">备注信息：</label>
                    <div class="layui-input-block">
                        <c:choose>
                            <c:when test="${!disabled}">
                                <form:textarea path="remarks" htmlEscape="false" rows="4"    class="form-control "/>
                            </c:when>
                            <c:otherwise>
                                <textarea htmlEscape="false" rows="4" readonly="true" class="form-control ">
                                        ${companyinfo.remarks}
                                </textarea>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>

            </div>
	    </form:form>
    </div>
</div>
</body>
</html>