183 lines
8.9 KiB
Plaintext
183 lines
8.9 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
|||
|
|
<%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/doupdate.do", $("#subForm").serialize(), function(data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
closeModal('subModal');
|
|||
|
|
// $("#contentTable").bootstrapTable('refresh');
|
|||
|
|
projectFun();
|
|||
|
|
}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 () {
|
|||
|
|
/*$.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}">
|
|||
|
|
<input type="hidden" id="unitId" name="unitId" value="${param.unitId}">
|
|||
|
|
|
|||
|
|
<!-- 界面提醒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="text" class="form-control" id="contentNumber" name="contentNumber" placeholder="内容编号" autocomplete="off" value="${libraryOverhaulContentBloc.contentNumber}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*上级层级</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="pname" name="pname" placeholder="上级层级" value="${pname}" readonly="true">
|
|||
|
|
<input type="hidden" id="pid" name="pid" value="${libraryOverhaulContentBloc.pid}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*维修方式</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<label class="radio-inline">
|
|||
|
|
<input type="radio" name="repairPartyType" id="repairPartyType1" value="${Maintain_IN}" checked> 自行维修
|
|||
|
|
</label>
|
|||
|
|
<label class="radio-inline">
|
|||
|
|
<input type="radio" name="repairPartyType" id="repairPartyType2" value="${Maintain_OUT}"> 委外维修
|
|||
|
|
</label>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*内容描述</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="2" id ="repairContent" name ="repairContent" placeholder="请输入" autocomplete="off">${libraryOverhaulContentBloc.repairContent}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group" id="materialCostDiv">
|
|||
|
|
<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" value="${libraryOverhaulContentBloc.libraryOverhaulContentModelBloc.insideRepairTime}" 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>
|