first commit
This commit is contained in:
180
WebRoot/jsp/command/expertDeployAdd.jsp
Normal file
180
WebRoot/jsp/command/expertDeployAdd.jsp
Normal file
@ -0,0 +1,180 @@
|
||||
<%@ 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;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/command/expertDeploy/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
/*
|
||||
提交方法
|
||||
*/
|
||||
function dosubmit() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/command/expertDeploy/submit.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d','请选择审核人员所属水厂');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
var showUnit4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {formId:"subForm",hiddenId:"bizid",textId:"_pname"} , function(data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function dolaunch() {
|
||||
$('#status').val('${Status_Start}')
|
||||
dosave();
|
||||
}
|
||||
|
||||
//选择水厂
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/user/getUnitForLevelTypeR.do", {}, function (data) {
|
||||
//console.log("sdata",data);
|
||||
var select = $("#bizid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$("#bizid").on("select2:select", function (e) {
|
||||
//validateHandover();
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });//选中元素上下居中
|
||||
if (data.length != 0) {
|
||||
// select.val(data[0].id).trigger("change");//设置选中
|
||||
selelct.val('${userbizid}').trigger("change");
|
||||
} else {
|
||||
select.val("").trigger("change");//设置选中
|
||||
}
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#approveCentrer").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"approveCentrer",textId:"approveCentrerName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//提交验收判断
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
applyuserid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '申请人'
|
||||
}
|
||||
}
|
||||
},
|
||||
applyreason: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '申请原因'
|
||||
}
|
||||
}
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核水厂'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</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 type="hidden" name="userbizid" value="${userbizid}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工单号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="worknumber" name ="worknumber" placeholder="工单号" value="${worknumber}" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请人</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="applyusername" name ="applyusername" placeholder="申请人" value="${userName}" readonly="true">
|
||||
<input type="hidden" class="form-control" id="applyuserid" name ="applyuserid" placeholder="申请人" value="${userId}"
|
||||
readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核水厂</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="_pname" name ="_pname" placeholder="审核水厂" onclick="showUnit4SelectFun();" value="${user._pname}">
|
||||
<input id="bizid" name="bizid" type="hidden" value="${user.pid}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*申请理由</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3" id="applyreason" name ="applyreason" placeholder="申请理由..."></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="approveCentrerName" name ="approveCentrerName" onfocus="this.blur();" placeholder="审核人员" onclick="showUser4SelectsFun();">
|
||||
<input id="approveCentrer" name="approveCentrer" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button> -->
|
||||
<button type="button" class="btn btn-primary" onclick="dosubmit()" id="btn_save">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user