163 lines
6.5 KiB
Plaintext
163 lines
6.5 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<style type="text/css">
|
|||
|
|
.select2-container .select2-selection--single{
|
|||
|
|
height:34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
}
|
|||
|
|
.select2-selection__arrow{
|
|||
|
|
margin-top:3px;
|
|||
|
|
}
|
|||
|
|
/* .file-border{
|
|||
|
|
padding-top :10px;
|
|||
|
|
padding-bottom :1px;
|
|||
|
|
margin-left :17%;
|
|||
|
|
padding-right :0px;
|
|||
|
|
padding-left :0px;
|
|||
|
|
border-color :#D2D6DE;
|
|||
|
|
border-style: solid;
|
|||
|
|
border-width: 1px 1px 1px 1px;
|
|||
|
|
border-top-left-radius:10px;
|
|||
|
|
border-top-right-radius:10px;
|
|||
|
|
border-bottom-left-radius:10px;
|
|||
|
|
border-bottom-right-radius:10px;
|
|||
|
|
} */
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/user/mobileManagement/saveMobileManagement.do", $("#subForm").serialize(), function(data) {
|
|||
|
|
if (data.res == 1){
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
}else if(data.res == 0){
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d',data.res);
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '设备名称不能为空'
|
|||
|
|
},
|
|||
|
|
/* remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
|||
|
|
url: ext.contextPath + '/equipment/maintenancePlan/checkExist.do',//验证地址
|
|||
|
|
message: '计划编号已存在',//提示消息
|
|||
|
|
type: 'POST',//请求方式
|
|||
|
|
data: function(validator) {
|
|||
|
|
return {
|
|||
|
|
planNumber: $('#planNumber').val()
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
}, */
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
deviceid: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '设备编号不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
status: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '启用不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function() {
|
|||
|
|
$("#unitId").val(unitId);
|
|||
|
|
$("#status").select2({
|
|||
|
|
minimumResultsForSearch: 10
|
|||
|
|
}).val('${mobileManagement.status}').trigger("change");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
//选择审核人
|
|||
|
|
var showUser4AuditSelectsFun = function() {
|
|||
|
|
var userIds= $("#userId").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"userId",textId:"auditMan",userIds:userIds} , function(data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<div class="modal-content">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|||
|
|
<span aria-hidden="true">×</span></button>
|
|||
|
|
<h4 class="modal-title">新增移动设备管理</h4>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input name="id" id="id" type="hidden" value="${mobileManagement.id}"/>
|
|||
|
|
<input name="unitId" id="unitId" type="hidden" value="${mobileManagement.unitId}"/>
|
|||
|
|
<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="${mobileManagement.name}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*设备编号</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="deviceid" name ="deviceid" placeholder="设备编号" value="${mobileManagement.deviceid}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*启用</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select type="text" id="status" class="form-control pull-right" name="status" >
|
|||
|
|
<option value="启用">启用</option>
|
|||
|
|
<option value="禁用">禁用</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 ="remark" name ="remark" placeholder="备注">${mobileManagement.remark}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">人员</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="">
|
|||
|
|
<input id="userId" name="userId" type="hidden" value="" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|