184 lines
8.4 KiB
Plaintext
184 lines
8.4 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<%request.setAttribute("INTER_MAINTENANCE",MaintenanceCommString.INTER_MAINTENANCE); %>
|
|||
|
|
<%request.setAttribute("EXTERANL_MAINTENANCE",MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
|||
|
|
<%request.setAttribute("COMMON_MAINTENANCE",MaintenanceCommString.COMMON_MAINTENANCE); %>
|
|||
|
|
<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').data('bootstrapValidator')
|
|||
|
|
.updateStatus('solvername', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('solvername');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/maintenance/abnormity/doCreateDefectByAbnormal.do", $("#subForm").serialize()+"&ids="+'${ids}', function(data) {
|
|||
|
|
if (data > 0){
|
|||
|
|
showAlert('s','保存成功');
|
|||
|
|
closeModal('subModal')
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
|
|||
|
|
}else if(data == 0){
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d',data.res);
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
//选择接收人员
|
|||
|
|
var showUser4SelectsFun = function() {
|
|||
|
|
var userIds= $("#solver").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"solver",textId:"solvername",userIds:userIds} , function(data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
maintenanceWay: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '处理方式不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
solvername: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '维护人员不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
/* plannedenddt: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '计划完成日期不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}, */
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function(){
|
|||
|
|
//计划完成时间
|
|||
|
|
$('#plannedenddt').datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format:'yyyy-mm-dd',
|
|||
|
|
}).on('hide',function(e) {
|
|||
|
|
//当日期选择框关闭时,执行刷新校验
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('plannedenddt', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('plannedenddt');
|
|||
|
|
});
|
|||
|
|
$("#maintenanceWay").select2({placeholder:'请选择',minimumResultsForSearch: 10}).val("${INTER_MAINTENANCE}").trigger("change");
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
//选择故障类型,可多选
|
|||
|
|
var showProblemType4SelectsFun = function(formId,hiddenId,textId) {
|
|||
|
|
var problemTypeIds=$('#'+hiddenId).val();
|
|||
|
|
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultTypeForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,problemTypeIds:problemTypeIds} , function(data) {
|
|||
|
|
$("#problemTyp4SelectDiv").html(data);
|
|||
|
|
openModal("problemTyp4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
|||
|
|
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
|||
|
|
var equipmentIds=$('#equipmentId').val();
|
|||
|
|
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:'${companyId}',equipmentIds:equipmentIds,pSectionId:'${processSectionId}'} , function(data) {
|
|||
|
|
$("#equ4SelectDiv").html(data);
|
|||
|
|
openModal("equipment4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
</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">${idNumber}条异常生成
|
|||
|
|
<c:if test="${not empty equipmentIds}">维修单</c:if>
|
|||
|
|
<c:if test="${empty equipmentIds}">缺陷</c:if>
|
|||
|
|
</h4>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*处理方式</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<select class="form-control select2" id="maintenanceWay" name ="maintenanceWay" style="width: 270px;">
|
|||
|
|
<option value="${INTER_MAINTENANCE}" selected="selected">内部处理</option>
|
|||
|
|
<option value="${EXTERANL_MAINTENANCE}">外部处理</option>
|
|||
|
|
<option value="${COMMON_MAINTENANCE}">联合处理</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">计划完成日期</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<div class="input-group date">
|
|||
|
|
<div class="input-group-addon">
|
|||
|
|
<i class="fa fa-calendar"></i>
|
|||
|
|
</div>
|
|||
|
|
<input type="text" class="form-control" id="plannedenddt" name="plannedenddt" style="width: 230px;" placeholder="请选择"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">计划费用/元</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="number" class="form-control" id="planMoney" name ="planMoney" value="" step="50.01" placeholder="计划费用" >
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<c:if test="${not empty equipmentIds}">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">故障类型</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input id="problemtypeid" name="problemtypeid" type="hidden" value="" />
|
|||
|
|
<input class="form-control" id="problemname" name ="problemname" onclick="showProblemType4SelectsFun('subForm','problemtypeid','problemname');" placeholder="请点击选择">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">异常设备</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input id="equipmentId" name="equipmentId" type="hidden" value="${equipmentIds}" />
|
|||
|
|
<input class="form-control" id="equipname" name ="equipname" onclick="showEquipment4SelectsFun('subForm','equipmentId','equipname');" value="${equipmentNames}" placeholder="点击选择">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</c:if>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*接收人员</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="solvername" name ="solvername" placeholder="接收人员" onclick="showUser4SelectsFun();">
|
|||
|
|
<input id="solver" name="solver" type="hidden" />
|
|||
|
|
</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>
|