197 lines
8.1 KiB
Plaintext
197 lines
8.1 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<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 selectMPint = function(pid) {
|
||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm2',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||
$("#mpSubDiv").html(data);
|
||
openModal('mpSubModal');
|
||
});
|
||
};
|
||
function dosave() {
|
||
if($('#solution').val()==null || $('#solution').val()==''){
|
||
swal('请输入解决措施');
|
||
$('#solution').focus();
|
||
return;
|
||
}
|
||
if($('#result').val()==null || $('#result').val()==''){
|
||
swal('请输入解决措施');
|
||
$('#result').focus();
|
||
return;
|
||
}
|
||
//保存前先赋值班组
|
||
var val = $('#_deptIds').val();
|
||
var rolestr = "";
|
||
if(val!=null && val!=''){
|
||
$.each(val, function (index, value, array) {
|
||
if (rolestr != "") {
|
||
rolestr += ","
|
||
}
|
||
rolestr += value;
|
||
})
|
||
$('#deptids').val(rolestr);//赋值班组
|
||
}else{
|
||
$('#deptids').val("");//赋值班组
|
||
}
|
||
|
||
/*$("#subForm2").bootstrapValidator('validate');//提交验证
|
||
setTimeout(function(){
|
||
if ($("#subForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||
$.post(ext.contextPath + "/alarm/alarmSolution/doupdate.do", $("#subForm2").serialize(), function(data) {
|
||
if (data == 1){
|
||
closeModal('subModal');
|
||
$("#solutiontable").bootstrapTable('refresh');
|
||
}else if(data == 0){
|
||
showAlert('d','保存失败','alertDiv');
|
||
}else{
|
||
showAlert('d',data,'alertDiv');
|
||
}
|
||
},'json');
|
||
/*}
|
||
}, 100);*/
|
||
|
||
}
|
||
//输入框验证
|
||
$("#subForm2").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
mpointid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '测量点不能为空'
|
||
},
|
||
},
|
||
},
|
||
|
||
/* processsectionid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '工艺段不能为空'
|
||
}
|
||
}
|
||
}, */
|
||
}
|
||
});
|
||
|
||
$(function(){
|
||
refreshSelect();
|
||
$.post(ext.contextPath + "/alarm/alarmSolution/getOrderJson.do", {}, function(data) {
|
||
|
||
var selelct =$("#ordertype").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;} // 函数用于呈现当前的选择
|
||
});
|
||
|
||
if(data.length==1){
|
||
selelct.val(data[0].id).trigger("change");
|
||
}else{
|
||
selelct.val('${alarmSolution.ordertype}').trigger("change");
|
||
}
|
||
},'json');
|
||
});
|
||
|
||
//初始化班组
|
||
function refreshSelect() {
|
||
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", { companyId: unitId}, function (data) {
|
||
var selelct = $("#_deptIds").select2({
|
||
data: data,
|
||
placeholder: '请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
multiple: true,
|
||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||
});
|
||
var roleitems = new Array();
|
||
var roles = JSON.parse('${depts}');
|
||
for (var i = 0; i < roles.length; i++) {
|
||
roleitems.push(roles[i].id);
|
||
}
|
||
selelct.val(roleitems).trigger("change");
|
||
}, 'json');
|
||
};
|
||
</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="subForm2">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" name="alarmtypeid" value="${alarmSolution.alarmtypeid}">
|
||
<input type="hidden" name="id" value="${alarmSolution.id}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">解决措施</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="4" id="solution" name ="solution" placeholder="解决措施。。。">${alarmSolution.solution}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">预计效果</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="4" id="result" name ="result" placeholder="预计效果。。。">${alarmSolution.result}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">下发工单</label>
|
||
<div class="col-sm-2">
|
||
<label><input type="radio" name="isissueorder" value="1" <c:if test='${alarmSolution.isissueorder}'> checked="checked"</c:if> />是</label>
|
||
<label><input type="radio" name="isissueorder" value="0" <c:if test='${!alarmSolution.isissueorder}'> checked="checked"</c:if> />否</label>
|
||
</div>
|
||
<label class="col-sm-2 control-label">工单类型</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="ordertype" name="ordertype" style="width: 100%">
|
||
</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="4" id="orderdescribe" name ="orderdescribe" placeholder="工单描述。。。">${alarmSolution.orderdescribe}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">下发班组</label>
|
||
<div class="col-sm-8">
|
||
<select class="form-control select2" id="_deptIds" name="_deptIds" style="width: 100%;">
|
||
</select>
|
||
<input type="hidden" name="deptids" id="deptids" 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>
|