first commit
This commit is contained in:
230
WebRoot/jsp/maintenance/workorderLibraryMaintainEditTy.jsp
Normal file
230
WebRoot/jsp/maintenance/workorderLibraryMaintainEditTy.jsp
Normal file
@ -0,0 +1,230 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType"%>
|
||||
<%request.setAttribute("Type_Ty", EquipmentPlanType.Type_Ty); %>
|
||||
<%request.setAttribute("Type_Rh", EquipmentPlanType.Type_Rh); %>
|
||||
<%request.setAttribute("Type_Ff", EquipmentPlanType.Type_Ff); %>
|
||||
<%request.setAttribute("Type_Yb", EquipmentPlanType.Type_Yb); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||||
<%request.setAttribute("Maintain_Week", MaintainCommStr.Maintain_Week);%>
|
||||
<%request.setAttribute("Maintain_TenDays", MaintainCommStr.Maintain_TenDays);%>
|
||||
<%request.setAttribute("Maintain_Month", MaintainCommStr.Maintain_Month);%>
|
||||
<%request.setAttribute("Maintain_Quarter", MaintainCommStr.Maintain_Quarter);%>
|
||||
<%request.setAttribute("Maintain_HalfYear", MaintainCommStr.Maintain_HalfYear);%>
|
||||
<%request.setAttribute("Maintain_Year", MaintainCommStr.Maintain_Year);%>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosaveMaintain() {
|
||||
$("#subFormLib").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormLib").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/workorderLibraryMaintain/doupdate.do", $("#subFormLib").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
//showAlert('s','保存成功');
|
||||
closeModal('libraryModal')
|
||||
$("#table_library_maintain").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subFormLib").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
actualWorkTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '实际工时不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#table_libraryList").bootstrapTable('destroy');
|
||||
$("#table_libraryList").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryMaintenanceCommonContent/getListJson.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [5], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
projectId: '${workorderLibraryMaintain.libraryMaintenanceCommon.id}'
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
|
||||
},
|
||||
//rowStyle:rowStyleFault,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
// {
|
||||
// checkbox: true, // 显示一个勾选框
|
||||
// },
|
||||
{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '内容代码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.code;
|
||||
}
|
||||
}, {
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.contents;
|
||||
}
|
||||
}, {
|
||||
field: 'tools', // 返回json数据中的name
|
||||
title: '方法及工具', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.tools;
|
||||
}
|
||||
}, {
|
||||
field: 'security', // 返回json数据中的name
|
||||
title: '安全措施', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.security;
|
||||
}
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// title: "操作",
|
||||
// align: 'center',
|
||||
// valign: 'middle',
|
||||
// width: '10%', // 定义列的宽度,单位为像素px
|
||||
// formatter: function (value, row, index) {
|
||||
// var buts = '';
|
||||
// buts += '<button class="btn btn-default btn-sm" onclick="editContentFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
// buts += '<button class="btn btn-default btn-sm" onclick="deleteContentFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
// buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
// return buts;
|
||||
// }
|
||||
// }
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_libraryList");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="libraryModal">
|
||||
<div class="modal-dialog">
|
||||
<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强制为subFormLib -->
|
||||
<form class="form-horizontal" id="subFormLib">
|
||||
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name ="id" value="${workorderLibraryMaintain.id}">
|
||||
<input type="hidden" class="form-control" name ="pid" value="${workorderLibraryMaintain.pid}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">维保部位</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${workorderLibraryMaintain.libraryMaintenanceCommon.equipmentClass.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">周期</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${workorderLibraryMaintain.libraryMaintenanceCommon.cycle}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">项目代码</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${workorderLibraryMaintain.libraryMaintenanceCommon.code}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">维保项目</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${workorderLibraryMaintain.libraryMaintenanceCommon.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工时定额(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${workorderLibraryMaintain.libraryMaintenanceCommon.insideRepairTime}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">实际工时(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="actualWorkTime" name="actualWorkTime" value="${workorderLibraryMaintain.actualWorkTime}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工时差异分析</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="differences" name="differences" rows="3" placeholder="工时差异分析">${workorderLibraryMaintain.differences}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">保养内容</h3>
|
||||
<div class="box-tools pull-right">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_libraryList" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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="dosaveMaintain()" >保存</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user