237 lines
10 KiB
Plaintext
237 lines
10 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%request.setAttribute("Maintain_RepairType_Small", MaintainCommStr.Maintain_RepairType_Small);%>
|
||
<%request.setAttribute("Maintain_RepairType_Medium", MaintainCommStr.Maintain_RepairType_Medium);%>
|
||
<%request.setAttribute("Maintain_IN", MaintainCommStr.Maintain_IN);%>
|
||
<%request.setAttribute("Maintain_OUT", MaintainCommStr.Maintain_OUT);%>
|
||
<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/libraryRepairBloc/doupdateBiz.do", $("#subForm").serialize(), function(data) {
|
||
if (data.code == 1) {
|
||
closeModal('subModal');
|
||
$("#repairTable").bootstrapTable('refresh');
|
||
}else if(data.code == 0){
|
||
showAlert('d',data.msg);
|
||
}else{
|
||
showAlert('d',data.msg);
|
||
}
|
||
},'json');
|
||
}
|
||
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
repairNumber:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '维修编号不能为空'
|
||
}
|
||
}
|
||
},
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '维修名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
repairPartyType:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择自修或委外'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
$(function () {
|
||
$('#unitId').val(unitId);
|
||
|
||
//委外显示运输费 自修隐藏
|
||
$('input[type=radio][name=repairPartyType]').change(function () {
|
||
if (this.value == '${Maintain_IN}') {//自修
|
||
$('#outsideRepairCost').attr("readonly","readonly");
|
||
$('#outsideRepairCost').val(0);
|
||
$('#insideRepairTime').removeAttr("readonly");
|
||
} else {//委外
|
||
$('#insideRepairTime').attr("readonly","readonly");
|
||
$('#insideRepairTime').val(0);
|
||
$('#outsideRepairCost').removeAttr("readonly");
|
||
}
|
||
});
|
||
|
||
if ("${libraryRepairBloc.repairPartyType }" == "${Maintain_IN}") {//自修
|
||
$('#outsideRepairCost').attr("readonly","readonly");
|
||
$('#insideRepairTime').removeAttr("readonly");
|
||
$("#repairPartyType1").attr("checked","checked");
|
||
$("#repairPartyType2").removeAttr("checked");
|
||
$('#outsideRepairCost').val(0);
|
||
}else{//委外
|
||
$('#insideRepairTime').attr("readonly","readonly");
|
||
$('#outsideRepairCost').removeAttr("readonly");
|
||
$("#repairPartyType2").attr("checked","checked");
|
||
$("#repairPartyType1").removeAttr("checked");
|
||
$('#insideRepairTime').val(0);
|
||
}
|
||
|
||
if ("${libraryRepairBloc.repairType }" == "${Maintain_RepairType_Small}") {
|
||
$("#repairType1").attr("checked","checked");
|
||
$("#repairType2").removeAttr("checked");
|
||
}else{
|
||
$("#repairType2").attr("checked","checked");
|
||
$("#repairType1").removeAttr("checked");
|
||
}
|
||
|
||
});
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-lg">
|
||
<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">
|
||
<input type="hidden" id="id" name="id" value="${libraryRepairBloc.id}">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">维修编号</label>
|
||
<div class="col-sm-4">
|
||
<!-- 设备型号id -->
|
||
<input type="hidden" name="modelId" value="${param.modelId}">
|
||
<input type="hidden" id="unitId" name="unitId" value="">
|
||
|
||
<p class="form-control-static">${libraryRepairBloc.repairNumber}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">维修名称</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${libraryRepairBloc.repairName}</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">维修内容</label>
|
||
<div class="col-sm-10">
|
||
<p class="form-control-static">${libraryRepairBloc.repairContent}</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">上级层级</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${pname}</p>
|
||
<input type="hidden" id="pid" name="pid" value="${libraryRepairBloc.pid}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">维修方式</label>
|
||
<div class="col-sm-4">
|
||
<c:if test="${libraryRepairBloc.repairPartyType == Maintain_IN}">
|
||
<p class="form-control-static">自修</p>
|
||
</c:if>
|
||
<c:if test="${libraryRepairBloc.repairPartyType == Maintain_OUT}">
|
||
<p class="form-control-static">委外</p>
|
||
</c:if>
|
||
</div>
|
||
<label class="col-sm-2 control-label">维修类型</label>
|
||
<div class="col-sm-4">
|
||
<c:if test="${libraryRepairBloc.repairType == Maintain_RepairType_Small}">
|
||
<p class="form-control-static">小修</p>
|
||
</c:if>
|
||
<c:if test="${libraryRepairBloc.repairType == Maintain_RepairType_Medium}">
|
||
<p class="form-control-static">中修</p>
|
||
</c:if>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label"><span style="color:red;">标准定额:</span></label>
|
||
<div class="col-sm-4"></div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">自修工时(时)</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${libraryRepairBloc.libraryRepairModelBloc.insideRepairTime}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">委外工时费(元)</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${libraryRepairBloc.libraryRepairModelBloc.outsideRepairCost}</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${libraryRepairBloc.libraryRepairModelBloc.materialCost}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">总费用(元)</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${libraryRepairBloc.libraryRepairModelBloc.totalCost}</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label"><span style="color:red;">定额:</span></label>
|
||
<div class="col-sm-4"></div>
|
||
</div>
|
||
|
||
<div class="form-group" id="insideRepairTimeDiv">
|
||
<label class="col-sm-2 control-label">自修工时(时)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="insideRepairTime" name="insideRepairTime" placeholder="自修工时(时)" autocomplete="off" step="0.01" value="${libraryRepairBloc.libraryRepairEquBiz.insideRepairTime}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">委外工时费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="outsideRepairCost" name="outsideRepairCost" placeholder="委外工时费定额(元)" step="0.01" value="${libraryRepairBloc.libraryRepairEquBiz.outsideRepairCost}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" id="materialCostDiv">
|
||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费定额(元)" step="0.01" value="${libraryRepairBloc.libraryRepairEquBiz.materialCost}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">总费用(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="totalCost" name="totalCost" placeholder="总费用(元)" step="0.01" value="${libraryRepairBloc.libraryRepairEquBiz.totalCost}">
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div id="quotaId">
|
||
|
||
</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>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|