first commit
This commit is contained in:
295
WebRoot/jsp/maintenance/repairEdit.jsp
Normal file
295
WebRoot/jsp/maintenance/repairEdit.jsp
Normal file
@ -0,0 +1,295 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.Repair"%>
|
||||
<% request.setAttribute("PlanType_IN", Repair.PlanType_IN);%>
|
||||
<% request.setAttribute("PlanType_OUT", Repair.PlanType_OUT);%>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType"%>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
|
||||
<jsp:include page="/jsp/maintenance/workorderConsume.jsp"></jsp:include>
|
||||
|
||||
<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 + "/maintenance/repair/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function initDate() {
|
||||
//定义locale汉化插件
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#planDate').daterangepicker({
|
||||
singleDatePicker: true,//设置为单个的datepicker,而不是有区间的datepicker 默认false
|
||||
showDropdowns: true,//当设置值为true的时候,允许年份和月份通过下拉框的形式选择 默认false
|
||||
autoUpdateInput: false,//1.当设置为false的时候,不给与默认值(当前时间)2.选择时间时,失去鼠标焦点,不会给与默认值 默认true
|
||||
timePicker24Hour : true,//设置小时为24小时制 默认false
|
||||
timePicker : false,//可选中时分 默认false
|
||||
locale: locale
|
||||
}, function(start) {
|
||||
if(!this.startDate){
|
||||
this.element.val('');
|
||||
}else{
|
||||
this.element.val(this.startDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
initDate();
|
||||
|
||||
var selectType = $("#repairTypeName").select2({minimumResultsForSearch: 10});
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code:'${Code_Type_Wx}'}, function(data) {
|
||||
$("#repairTypeName").empty();
|
||||
var selelct_ =$("#repairTypeName").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${repair.repairType}').trigger("change");
|
||||
selelct_.on('change',function(e){
|
||||
$('#repairType').val(e.target.value);
|
||||
})
|
||||
},'json');
|
||||
|
||||
$('#planDate').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('planDate', 'NOT_VALIDATED',null)
|
||||
.validateField('planDate');
|
||||
});
|
||||
$('#planDate').datepicker('setDate','${repair.planDate.substring(0, 10)}');
|
||||
|
||||
//加载维修库table
|
||||
getWorkContentRepair('${repair.id}','${repair.unitId}','${repair.equipmentId}');
|
||||
//加载消耗品table
|
||||
getWorkConsume('${repair.id}','${repair.unitId}');
|
||||
//加载绩效table
|
||||
getWorkAchievements('${repair.id}','${repair.unitId}');
|
||||
})
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#receiveUserIds").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"receiveUserIds",textId:"receiveUserIdsName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var selectEquipmentCard = function() {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:unitId, equipmentId:$("#equipid").val()} ,
|
||||
function(data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// fullName: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '维护商名不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// selectType: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '运维商类别不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// }
|
||||
// });
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content" >
|
||||
<div id="mainAlertdiv2"></div>
|
||||
<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 -->
|
||||
<input type="hidden" id="id" name ="id" value="${repair.id}" >
|
||||
<div id="alertDiv"></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="jobNumber" name ="jobNumber" placeholder="工单编号" value="${repair.jobNumber}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工单名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="jobName" name ="jobName" placeholder="工单名称" value="${repair.jobName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划类型</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >
|
||||
<c:if test="${repair.planType==PlanType_IN}">计划内</c:if>
|
||||
<c:if test="${repair.planType==PlanType_OUT}">计划外</c:if>
|
||||
</p>
|
||||
<input type="hidden" class="form-control" id="planType" name ="planType" value="${repair.planType}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">维修类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="repairTypeName" name ="repairTypeName" style="width: 170px;"></select>
|
||||
<input type="hidden" class="form-control" id="repairType" name="repairType" value="${repair.repairType}"/>
|
||||
</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="receiveUserIds" name ="receiveUserIds" placeholder="点击选择" readonly>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">计划完成日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="planDate" name="planDate" style="width: 132px;" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipid" name="equipmentId" type="hidden" value="${repair.equipmentId}" />
|
||||
<input type="text" class="form-control" id="equipmentNumber" name ="equipmentNumber" placeholder="点击选择" value="${repair.equipmentCard.equipmentcardid}" onclick="selectEquipmentCard()" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipname" name ="equipname" value="${repair.equipmentCard.equipmentname}" readonly>
|
||||
</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="equipmentmodelname" name ="equipmentmodelname" value="${repair.equipmentCard.equipmentmodelname}" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">安装位置</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="processectionname" name ="processectionname" value="${repair.equipmentCard.processSection.name}" readonly>
|
||||
</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="receiveUserIdsName" name ="receiveUserIdsName" placeholder="请选择接收人员" onclick="showUser4SelectsFun();" value="${repair.receiveUsersName}" readonly>
|
||||
<input id="receiveUserIds" name="receiveUserIds" type="hidden" value="${repair.receiveUserIds}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">故障现象描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="faultDescribe" name ="faultDescribe" placeholder="故障现象描述">${repair.faultDescribe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">方案/要求简述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="schemeDescription" name ="schemeDescription" placeholder="方案/要求简述">${repair.schemeDescription}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">维修内容</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doLibraryRepairAdd('${repair.equipmentId}','${repair.unitId}')" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deleteLibraryRepairsFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_library_repair" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">消耗品明细</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doConsumeAdd('${repair.id}')" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deleteConsumesFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_consume" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参与人员绩效</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doAchievementAdd('${repair.id}')" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deleteAchievementFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_achievements" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user