208 lines
11 KiB
Plaintext
208 lines
11 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_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">
|
||
var lengthStr = 0;
|
||
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/maintenance/libraryOverhaulContentBloc/doupdate4Biz.do", $("#subForm").serialize(), function (data) {
|
||
if (data.code == 1) {
|
||
closeModal('subModal');
|
||
projectFun();
|
||
//$("#contentTable").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: '维修编号不能为空'
|
||
// }
|
||
// }
|
||
// }
|
||
}
|
||
});
|
||
$(function () {
|
||
$('#unitId').val(unitId);
|
||
|
||
/*$.post(ext.contextPath + "/maintenance/libraryOverhaulContentBloc/getQuotaJson4Edit.do", $("#subForm").serialize(), function(data) {
|
||
if(data!=null){
|
||
lengthStr = data.length;
|
||
for (var i = 0; i < data.length; i++) {
|
||
var name = data[i].name;
|
||
var htmlstr = '<div class="form-group" ><label class="col-sm-2 control-label"><span style="color:#00BFFF;">('+name+')</span></label><div class="col-sm-4"><input type="hidden" class="form-control" id="levelId'+i+'" name="levelId'+i+'" value="'+data[i].id+'" ></div></div>';
|
||
htmlstr += '<div class="form-group"><label class="col-sm-2 control-label">*自修工时(时)</label><div class="col-sm-4"><input type="text" class="form-control" id="insideRepairTime'+i+'" name="insideRepairTime'+i+'" placeholder="自修工时" autocomplete="off" value="'+data[i].insideRepairTime+'"></div><label class="col-sm-2 control-label">*委外工时费(元)</label><div class="col-sm-4"><input type="text" class="form-control" id="outsideRepairCost'+i+'" name="outsideRepairCost'+i+'" placeholder="委外工时费(元)" autocomplete="off" value="'+data[i].outsideRepairCost+'"></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="materialCost'+i+'" name="materialCost'+i+'" placeholder="物资费定额(元)" autocomplete="off" value="'+data[i].materialCost+'"></div><label class="col-sm-2 control-label">*总大修费(元)</label><div class="col-sm-4"><input type="text" class="form-control" id="totalCost'+i+'" name="totalCost'+i+'" placeholder="总大修费" autocomplete="off" value="'+data[i].totalCost+'"></div></div>';
|
||
//将html赋值到div
|
||
//$('#quotaId').append(htmlstr);
|
||
}
|
||
//如果为自修 隐藏所有的运输费
|
||
if ("
|
||
${libraryOverhaulContentBloc.repairPartyType }" == "
|
||
${Maintain_IN}") {//自修
|
||
for (var i = 0; i < lengthStr; i++) {
|
||
$('#outsideRepairCost'+i).attr("readonly","readonly");
|
||
$('#insideRepairTime'+i).removeAttr("readonly");
|
||
}
|
||
}else{
|
||
for (var i = 0; i < lengthStr; i++) {
|
||
$('#insideRepairTime'+i).attr("readonly","readonly");
|
||
$('#outsideRepairCost'+i).removeAttr("readonly");
|
||
}
|
||
}
|
||
}else{
|
||
|
||
}
|
||
},'json');*/
|
||
|
||
//委外显示运输费 自修隐藏
|
||
$('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 ("${libraryOverhaulContentBloc.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);
|
||
}
|
||
|
||
});
|
||
</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="jsonStr" name="jsonStr" value=""> -->
|
||
<input type="hidden" id="id" name="id" value="${libraryOverhaulContentBloc.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">${libraryOverhaulContentBloc.contentNumber}</p>
|
||
</div>
|
||
<label class="col-sm-2 control-label">维修方式</label>
|
||
<div class="col-sm-4">
|
||
<c:if test="${libraryOverhaulContentBloc.repairPartyType == Maintain_IN}">
|
||
<p class="form-control-static">自修</p>
|
||
</c:if>
|
||
<c:if test="${libraryOverhaulContentBloc.repairPartyType == Maintain_OUT}">
|
||
<p class="form-control-static">委外</p>
|
||
</c:if>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">内容描述</label>
|
||
<div class="col-sm-10">
|
||
<p class="form-control-static">${libraryOverhaulContentBloc.repairContent}</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">
|
||
<label class="col-sm-2 control-label">自修工时(时)</label>
|
||
<div class="col-sm-4">
|
||
<p class="form-control-static">${libraryOverhaulContentBloc.libraryOverhaulContentModelBloc.insideRepairTime}</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">
|
||
<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"
|
||
value="${libraryOverhaulContentBloc.libraryOverhaulContentEquBiz.insideRepairTime}"
|
||
step="0.01">
|
||
</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="委外工时费定额(元)" value="${libraryOverhaulContentBloc.libraryOverhaulContentEquBiz.outsideRepairCost}" step="0.01">
|
||
</div> -->
|
||
</div>
|
||
|
||
<!-- <div class="form-group" >
|
||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费定额(元)" value="${libraryOverhaulContentBloc.libraryOverhaulContentEquBiz.materialCost}" step="0.01">
|
||
</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="总费用(元)" value="${libraryOverhaulContentBloc.libraryOverhaulContentEquBiz.totalCost}" step="0.01">
|
||
</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>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|