303 lines
13 KiB
Plaintext
303 lines
13 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.maintenance.LibraryQuotaLevel"%>
|
||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||
<%request.setAttribute("Type_Repair", LibraryQuotaLevel.Type_Repair);%>
|
||
<%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()) {//获取验证结果,如果成功,执行下面代码
|
||
swal({
|
||
text: "您确定要调整此项定额,调整后将以水厂定额为准!",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function (willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + "/maintenance/repairLibraryBranch/doupdate.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: {
|
||
adjustmentReason:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '调整原因不能为空'
|
||
}
|
||
}
|
||
},
|
||
insideRepairTime:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '自修工时不能为空'
|
||
}
|
||
}
|
||
},
|
||
outsideRepairCost:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '委外工时费不能为空'
|
||
}
|
||
}
|
||
},
|
||
materialCost:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '物资费定额不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
$(function () {
|
||
if ("${repairLibraryBranch.repairLibrary.repairPartyType }" == "${Maintain_IN}") {//自修
|
||
$("#repairPartyType1").attr("checked","checked");
|
||
$("#repairPartyType2").removeAttr("checked");
|
||
|
||
$("#insideRepairTimeDiv").show();
|
||
$("#outsideRepairCostDiv").hide();
|
||
$("#insideRepairTime_branch").prop("disabled", false);
|
||
$("#outsideRepairCost_branch").attr("disabled","disabled");
|
||
}else{//委外
|
||
$("#repairPartyType2").attr("checked","checked");
|
||
$("#repairPartyType1").removeAttr("checked");
|
||
|
||
$("#insideRepairTimeDiv").hide();
|
||
$("#outsideRepairCostDiv").show();
|
||
$("#insideRepairTime_branch").attr("disabled","disabled");
|
||
$("#outsideRepairCost_branch").prop("disabled", false);
|
||
}
|
||
|
||
if ("${repairLibraryBranch.repairLibrary.repairType }" == "${Maintain_RepairType_Small}") {
|
||
$("#repairType1").attr("checked","checked");
|
||
$("#repairType2").removeAttr("checked");
|
||
}else{
|
||
$("#repairType2").attr("checked","checked");
|
||
$("#repairType1").removeAttr("checked");
|
||
}
|
||
|
||
var levelId = $('#levelId').val();
|
||
|
||
$.post(ext.contextPath + "/maintenance/repairLibrary/getQuotaData.do", {pid:'${repairLibraryBranch.repairLibraryQuota.pid}',levelId:'${repairLibraryBranch.repairLibraryQuota.levelId}'}, function(data) {
|
||
$('#insideRepairTime').val(data[0].insideRepairTime);
|
||
$('#outsideRepairCost').val(data[0].outsideRepairCost);
|
||
$('#materialCost').val(data[0].materialCost);
|
||
$('#trunkId').val(data[0].id);
|
||
|
||
if('${repairLibraryBranch.insideRepairTime}'!= null && '${repairLibraryBranch.insideRepairTime}'!= 0){
|
||
$('#insideRepairTime_branch').val('${repairLibraryBranch.insideRepairTime}');
|
||
}else{
|
||
$('#insideRepairTime_branch').val('');
|
||
}
|
||
if('${repairLibraryBranch.outsideRepairCost}'!= null && '${repairLibraryBranch.outsideRepairCost}'!= 0){
|
||
$('#outsideRepairCost_branch').val('${repairLibraryBranch.outsideRepairCost}');
|
||
}else{
|
||
$('#outsideRepairCost_branch').val('');
|
||
}
|
||
if('${repairLibraryBranch.materialCost}'!= null && '${repairLibraryBranch.materialCost}'!= 0){
|
||
$('#materialCost_branch').val('${repairLibraryBranch.materialCost}');
|
||
}else{
|
||
$('#materialCost_branch').val('');
|
||
}
|
||
},'json');
|
||
|
||
$.post(ext.contextPath + "/maintenance/libraryQuotaLevel/getSelect.do", {type:'${Type_Repair}'}, function(data) {
|
||
$("#levelId").empty();
|
||
var selelct_ =$("#levelId").select2({
|
||
data: data,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
});
|
||
selelct_.val('${repairLibraryBranch.repairLibraryQuota.levelId}').trigger("change");
|
||
selelct_.on('change',function(){
|
||
levelId = $('#levelId').val();
|
||
$.post(ext.contextPath + "/maintenance/repairLibrary/getQuotaData.do", {pid:'${repairLibraryBranch.repairLibraryQuota.pid}',levelId:levelId}, function(data) {
|
||
$('#materialCost').val(data[0].materialCost);
|
||
$('#insideRepairTime').val(data[0].insideRepairTime);
|
||
$('#outsideRepairCost').val(data[0].outsideRepairCost);
|
||
$('#trunkId').val(data[0].id);
|
||
|
||
$('#materialCost_branch').val(data[0].materialCost);
|
||
$('#insideRepairTime_branch').val(data[0].insideRepairTime);
|
||
$('#outsideRepairCost_branch').val(data[0].outsideRepairCost);
|
||
},'json');
|
||
});
|
||
},'json');
|
||
|
||
|
||
|
||
});
|
||
</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">修改<span style="font-size:5px;color:red;"> (不调整以业务区定额为参考值,调整后将以水厂定额为参考值)</span></h4>
|
||
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
<input type="hidden" id="id" name="id" value="${repairLibraryBranch.id}">
|
||
<input type="hidden" id="trunkId" name="trunkId" 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="repairNumber" name="repairNumber" placeholder="维修编号" autocomplete="off" value="${repairLibraryBranch.repairLibrary.repairNumber}" readonly="true">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*维修名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="name" name="name" placeholder="维修名称" autocomplete="off" value="${repairLibraryBranch.repairLibrary.name}" readonly="true">
|
||
</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}" disabled> 自行维修
|
||
</label>
|
||
<label class="radio-inline">
|
||
<input type="radio" name="repairPartyType" id="repairPartyType2" value="${Maintain_OUT}" disabled> 委外维修
|
||
</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}" disabled> 小修
|
||
</label>
|
||
<label class="radio-inline">
|
||
<input type="radio" name="repairType" id="repairType2" value="${Maintain_RepairType_Medium}" disabled> 中修
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*定额等级</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="levelId" name ="levelId" style="width: 270px;" value=""></select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" >
|
||
<label class="col-sm-2 control-label"><span style="color:#00BFFF;">业务区定额</span></label>
|
||
<div class="col-sm-4">
|
||
|
||
</div>
|
||
<label class="col-sm-2 control-label"><span style="color:#00BFFF;">水厂定额</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" placeholder="自修工时定额(时)" readonly="true">
|
||
</div>
|
||
<label class="col-sm-2 control-label">自修工时(时)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="insideRepairTime_branch" name="insideRepairTime" placeholder="自修工时定额(时)" autocomplete="off" value="${repairLibraryBranch.insideRepairTime}" step="0.01">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" id="outsideRepairCostDiv">
|
||
<label class="col-sm-2 control-label">委外工时费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="outsideRepairCost" placeholder="委外工时费定额(元)" readonly="true">
|
||
</div>
|
||
<label class="col-sm-2 control-label">委外工时费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="outsideRepairCost_branch" name="outsideRepairCost" placeholder="委外工时费定额(元)" autocomplete="off" value="${repairLibraryBranch.outsideRepairCost}" 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" placeholder="物资费定额(元)" readonly="true">
|
||
</div>
|
||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="materialCost_branch" name="materialCost" placeholder="物资费定额(元)" autocomplete="off" value="${repairLibraryBranch.materialCost}" step="0.01">
|
||
</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 ="adjustmentReason" name ="adjustmentReason" placeholder="调整原因" autocomplete="off">${repairLibraryBranch.adjustmentReason}</textarea>
|
||
</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>
|