185 lines
8.9 KiB
Plaintext
185 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()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
// var params = [];
|
|||
|
|
// for (var i = 0; i < lengthStr; i++) {
|
|||
|
|
// var param = [];
|
|||
|
|
// params.push({
|
|||
|
|
// "levelId":$('#levelId'+i).val(),
|
|||
|
|
// "insideRepairTime":$('#insideRepairTime'+i).val(),
|
|||
|
|
// "materialCost":$('#materialCost'+i).val(),
|
|||
|
|
// "outsideRepairCost":$('#outsideRepairCost'+i).val(),
|
|||
|
|
// "totalCost":$('#totalCost'+i).val()
|
|||
|
|
// });
|
|||
|
|
// }
|
|||
|
|
// var json = JSON.stringify(params);
|
|||
|
|
//$('#jsonStr').val(json);//将附表数据json传到后端
|
|||
|
|
$.post(ext.contextPath + "/maintenance/libraryOverhaulContentBloc/dosave.do", $("#subForm").serialize(), function(data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
closeModal('subModal');
|
|||
|
|
$("#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 () {
|
|||
|
|
/*$.post(ext.contextPath + "/maintenance/libraryOverhaulContentBloc/getQuotaJson4Add.do", $("#subForm").serialize(), function(data) {
|
|||
|
|
if(data!=null){
|
|||
|
|
lengthStr = data.length;
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
var name = data[i].name;
|
|||
|
|
//$("#quotaId").html(i);
|
|||
|
|
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" ></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" ></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" ></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" ></div></div>';
|
|||
|
|
//将html赋值到div
|
|||
|
|
$('#quotaId').append(htmlstr);
|
|||
|
|
}
|
|||
|
|
//默认为自修
|
|||
|
|
for (var i = 0; i < lengthStr; i++) {
|
|||
|
|
$('#outsideRepairCost'+i).attr("readonly","readonly");
|
|||
|
|
$('#insideRepairTime'+i).removeAttr("readonly");
|
|||
|
|
}
|
|||
|
|
}else{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},'json'); */
|
|||
|
|
|
|||
|
|
//新增默认自修 委外禁用
|
|||
|
|
$('#outsideRepairCost').attr("readonly","readonly");
|
|||
|
|
$('#outsideRepairCost').val(0);
|
|||
|
|
//委外显示运输费 自修隐藏
|
|||
|
|
$('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");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
</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=""> -->
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<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="contentNumber" name="contentNumber" placeholder="内容编号" autocomplete="off" >
|
|||
|
|
</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="${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"></textarea>
|
|||
|
|
</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">
|
|||
|
|
</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">
|
|||
|
|
</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">
|
|||
|
|
</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">
|
|||
|
|
</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>
|