218 lines
9.7 KiB
Plaintext
218 lines
9.7 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||
<%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()) {//获取验证结果,如果成功,执行下面代码
|
||
/*var params = [];
|
||
for (var i = 0; i < lengthStr; i++) {
|
||
var param = [];
|
||
params.push({
|
||
"entityId":$('#entityId'+i).val(),
|
||
"levelId":$('#levelId'+i).val(),
|
||
"insideRepairTime":$('#insideRepairTime'+i).val(),
|
||
"outsideRepairCost":$('#outsideRepairCost'+i).val(),
|
||
"materialCost":$('#materialCost'+i).val(),
|
||
"totalCost":$('#totalCost'+i).val()
|
||
});
|
||
}
|
||
var json = JSON.stringify(params);
|
||
$('#jsonStr').val(json);//将附表数据json传到后端*/
|
||
|
||
$.post(ext.contextPath + "/maintenance/libraryRepairBloc/doupdateBloc.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 () {
|
||
|
||
//委外显示运输费 自修隐藏
|
||
$('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}">
|
||
<input type="hidden" id="jsonStr" name="jsonStr" value="">
|
||
<!-- 界面提醒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="repairNumber" name="repairNumber" placeholder="维修编号" autocomplete="off" value="${libraryRepairBloc.repairNumber}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*维修名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="repairName" name="repairName" placeholder="维修名称" autocomplete="off" value="${libraryRepairBloc.repairName}">
|
||
</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">${libraryRepairBloc.repairContent}</textarea>
|
||
</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="pname" name="pname" placeholder="上级层级" value="${pname}" readonly="true">
|
||
<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">
|
||
<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>
|
||
<label class="col-sm-2 control-label">*维修类型</label>
|
||
<div class="col-sm-4">
|
||
<label class="radio-inline">
|
||
<input type="radio" name="repairType" id="repairType1" value="${Maintain_RepairType_Small}" checked> 小修
|
||
</label>
|
||
<label class="radio-inline">
|
||
<input type="radio" name="repairType" id="repairType2" value="${Maintain_RepairType_Medium}"> 中修
|
||
</label>
|
||
</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.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.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.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.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>
|