<% layout('/layouts/default.html', {title: '咨询帮助管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> 新增咨询帮助
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${consultHelp}" action="${ctx}/consult/consultHelp/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('咨询帮助')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> ${text('咨询类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:select path="consultType" dictType="consult_type" class="form-control required " />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> 标题：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="title" maxlength="100" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> 咨询部门：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:treeselect id="testOffice" title="机构选择"
								path="deptId"
								url="${ctx}/sys/office/treeData"
								class="" allowClear="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> 网址链接：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="netUrl" maxlength="100" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> 咨询内容：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="content" rows="4" maxlength="200" style="color:red;resize: vertical;min-height:40px" class="form-control"/>
							</div>
						</div>
					</div>
				</div>

			</div>


			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('consult:consultHelp:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		//todo 提交之前校验网址是否合法


		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>