185 lines
7.4 KiB
Plaintext
185 lines
7.4 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@page import="com.sipai.tools.CommString"%>
|
||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||
|
||
<%@page import="com.sipai.entity.administration.OrganizationClass"%>
|
||
<%request.setAttribute("Type_0", OrganizationClass.Type_0); %>
|
||
<%request.setAttribute("Type_1", OrganizationClass.Type_1); %>
|
||
|
||
<%request.setAttribute("Attribute_0", OrganizationClass.Attribute_0); %>
|
||
<%request.setAttribute("Attribute_1", OrganizationClass.Attribute_1); %>
|
||
<%request.setAttribute("Attribute_2", OrganizationClass.Attribute_2); %>
|
||
<%request.setAttribute("Attribute_3", OrganizationClass.Attribute_3); %>
|
||
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single{
|
||
height:34px;
|
||
line-height: 34px;
|
||
}
|
||
.select2-selection__arrow{
|
||
margin-top:3px;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
var showOrganizationClass4SelectFun = function() {
|
||
$.post(ext.contextPath + '/administration/organizationClass/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
|
||
$("#fault4SelectDiv").html(data);
|
||
openModal('fault4SelectModal');
|
||
});
|
||
};
|
||
function doupdate() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||
$.post(ext.contextPath + "/administration/organizationClass/update.do", $("#subForm").serialize(), function(result) {
|
||
if (result == 1) {
|
||
showAlert('s','保存成功');
|
||
initTreeView();
|
||
}else{
|
||
showAlert('d','保存失败');
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
|
||
function dodel() {
|
||
swal({
|
||
text: "您确定要删除此记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function(willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/administration/organizationClass/delete.do', $("#subForm").serialize(), function(data) {
|
||
if(data>0){
|
||
initTreeView();
|
||
}else{
|
||
showAlert('d','删除失败');
|
||
}
|
||
},'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
$(function() {
|
||
$("#active").select2({minimumResultsForSearch: 10}).val("${organizationClass.active}").trigger("change");
|
||
$("#attribute").select2({minimumResultsForSearch: 10}).val("${organizationClass.attribute}").trigger("change");
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
code: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '编号不能为空'
|
||
}
|
||
}
|
||
}
|
||
/* pname: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '上级菜单不能为空'
|
||
}
|
||
}
|
||
}, */
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
<div class="box box-primary" >
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">编辑</h3>
|
||
<div class="box-tools pull-right">
|
||
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<form class="form-horizontal " id="subForm">
|
||
<input id="id" name="id" type="hidden" value="${organizationClass.id}"/>
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<div id="fault4SelectDiv"></div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${organizationClass.name }">
|
||
</div>
|
||
<label class="col-sm-2 control-label">上级菜单</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showOrganizationClass4SelectFun();" value="${organizationClass.pname}" readonly>
|
||
<input id="pid" name="pid" type="hidden" value="${organizationClass.pid}"/>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*编号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="code" name="code" placeholder="编号"
|
||
value="${organizationClass.code }">
|
||
</div>
|
||
<label class="col-sm-2 control-label">类型</label>
|
||
<div class="col-sm-4" style="padding-top:7px;">
|
||
<c:if test="${organizationClass.type==Type_0}">岗位</c:if>
|
||
<c:if test="${organizationClass.type==Type_1}">工作</c:if>
|
||
</div>
|
||
</div>
|
||
<c:if test="${organizationClass.type==Type_0}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">岗位属性</label>
|
||
<div class="col-sm-4">
|
||
<select id ="attribute" name="attribute" class="form-control select2">
|
||
<option value="${Attribute_0}" >运行</option>
|
||
<option value="${Attribute_1}" >行政</option>
|
||
<option value="${Attribute_2}" >维修</option>
|
||
<option value="${Attribute_3}" >化验</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</c:if>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">顺序</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${organizationClass.morder}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">启用</label>
|
||
<div class="col-sm-4">
|
||
<select id ="active" name="active" class="form-control select2">
|
||
<option value="${Active_True}" >启用</option>
|
||
<option value="${Active_False}" >禁用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">描述</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="描述...">${organizationClass.remarks}</textarea>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|