first commit
This commit is contained in:
322
src/main/webapp/jsp/maintenance/abnormityAdd.jsp
Normal file
322
src/main/webapp/jsp/maintenance/abnormityAdd.jsp
Normal file
@ -0,0 +1,322 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%request.setAttribute("Wait", MaintenanceDetail.Status_Wait); %>
|
||||
<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 masterId = '${id}';
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId: masterId, tbName: tbName}, function (data) {
|
||||
//console.info(data)
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
} else {
|
||||
$('#maintenanceDetailFile').hide();
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
var fileinput = function () {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
nameSpace: nameSpace
|
||||
}, function (data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
closeModal('subModalAbnorm')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
bizId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
processSectionId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常类型不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
abnormityDescription: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常描述不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
var companyId = "${company.id}";
|
||||
$(function () {
|
||||
getFileList();
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||||
$("#processSectionId").empty();
|
||||
var selelct_ = $("#processSectionId").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('').trigger("change");
|
||||
selelct_.on('change', function () {
|
||||
//工艺段选择后,清空原有工艺段选择的设备
|
||||
$("#equipmentIds").val("");
|
||||
$("#equipname").val("");
|
||||
})
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var equipmentIds = $('#' + hiddenId).val();
|
||||
var pSectionId = $("#processSectionId").val();
|
||||
if (companyId == "" || pSectionId == "" || companyId == null || pSectionId == null) {
|
||||
showAlert('d', '请先选择工艺段');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
companyId: companyId,
|
||||
equipmentIds: equipmentIds,
|
||||
pSectionId: pSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//选择故障库
|
||||
var showFaultLibrary = function (formId, hiddenId, textId) {
|
||||
var libraryId = $('#' + hiddenId).val();
|
||||
var equipmentIds = $("#equipmentIds").val();
|
||||
if (companyId == "" || equipmentIds == "" || companyId == null || equipmentIds == null) {
|
||||
showAlert('d', '请先选择设备');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/showFaultLibrary4Equpment.do', {
|
||||
libraryId: libraryId,
|
||||
companyId: companyId,
|
||||
equipmentIds: equipmentIds
|
||||
}, function (data) {
|
||||
$("#library4SelectDiv").html(data);
|
||||
openModal('library4SelectModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalAbnorm">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${id}">
|
||||
<input type="hidden" name="status" value="${Wait}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*所属厂区</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="bizId" id="bizId" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static">${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工艺段</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="processSectionId" name="processSectionId"
|
||||
style="width: 270px;" value="${processSectionId}">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常类型</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="type" name ="type" style="width: 270px;">
|
||||
<option value="0">设备异常</option>
|
||||
<option value="1">非设备异常</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden" value=""/>
|
||||
<input class="form-control" id="equipname" name="equipname"
|
||||
onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipname');"
|
||||
placeholder="请先选择厂区和工艺段">
|
||||
</div>
|
||||
<!-- <div class="col-sm-2" style="padding-left:0;">
|
||||
<button type="button" class="btn btn-primary" onclick="inputEquFun()" >手输设备</button>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="libraryId" name="libraryId" type="hidden" value=""/>
|
||||
<textarea class="form-control " id="abnormityDescription" name="abnormityDescription"
|
||||
rows="2"
|
||||
ondblclick="showFaultLibrary('subForm','libraryId','abnormityDescription');"
|
||||
placeholder="异常描述"></textarea>
|
||||
<%-- <textarea class="form-control " id="abnormityDescription" name="abnormityDescription" rows="2" ondblclick="showFaultLibrary('subForm','libraryId','abnormityDescription');" placeholder="异常描述"></textarea>--%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="libraryId" name="libraryId" type="hidden" value="" />
|
||||
<input class="form-control" id="abnormityDescription" name ="abnormityDescription" onclick="showFaultLibrary('subForm','libraryId','abnormityDescription');" placeholder="请先选择设备">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="remark" name="remark" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile" id="maintenanceDetailFile" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
346
src/main/webapp/jsp/maintenance/abnormityAdd_new.jsp
Normal file
346
src/main/webapp/jsp/maintenance/abnormityAdd_new.jsp
Normal file
@ -0,0 +1,346 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Abnormity" %>
|
||||
<%request.setAttribute("Type_Run", Abnormity.Type_Run); %>
|
||||
<%request.setAttribute("Type_Equipment", Abnormity.Type_Equipment); %>
|
||||
<%request.setAttribute("Type_Facilities", Abnormity.Type_Facilities); %>
|
||||
|
||||
<%@ page import="com.sipai.entity.activiti.ProcessType" %>
|
||||
<%request.setAttribute("Workorder_Abnormity_Run", ProcessType.Workorder_Abnormity_Run); %>
|
||||
<%request.setAttribute("Workorder_Abnormity_Equipment", ProcessType.Workorder_Abnormity_Equipment); %>
|
||||
<%request.setAttribute("Workorder_Abnormity_Facilities", ProcessType.Workorder_Abnormity_Facilities); %>
|
||||
|
||||
<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 masterId = '${id}';
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('solvername', 'NOT_VALIDATED', null)
|
||||
.validateField('solvername');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipmentNames', 'NOT_VALIDATED', null)
|
||||
.validateField('equipmentNames');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/start.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
closeModal('subModalAbnorm')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
processSectionId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
abnormityDescription: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常描述不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipmentNames: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常设备不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
solvername: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接收人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//加载文件
|
||||
getFileListMinioPic('abnormityFileId', 'edit', '${id}', previews, previewConfigs);
|
||||
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${param.unitId}'}, function (data) {
|
||||
$("#processSectionId").empty();
|
||||
var selelct_ = $("#processSectionId").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('${param.processSectionCode}').trigger("change");
|
||||
selelct_.on('change', function () {
|
||||
//工艺段选择后,清空原有工艺段选择的设备
|
||||
$("#equipmentIds").val("");
|
||||
$("#equipmentNames").val("");
|
||||
})
|
||||
}, 'json');
|
||||
|
||||
var selelct_type = $("#type").select2({
|
||||
placeholder: '请选择',
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct_type.on('change', function () {
|
||||
var type = $('#type').val();
|
||||
if ('${Type_Equipment}' == type) {
|
||||
$("#equipmentIdsDiv").attr("style", "display:block;");
|
||||
// $("#processSectionDiv").attr("style", "display:none;");
|
||||
} else {
|
||||
$("#equipmentIdsDiv").attr("style", "display:none;");
|
||||
// $("#processSectionDiv").attr("style", "display:block;");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//选择设备弹窗
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
// var equipmentIds = $('#' + hiddenId).val();
|
||||
var processSectionId = $("#processSectionId").val();
|
||||
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
unitId: '${param.unitId}',
|
||||
equipmentIds: '',
|
||||
processSectionId: processSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//保存选择设备 datas为id
|
||||
var doFinishSelectEquipment = function (datas_id, datas_name) {
|
||||
if (datas_id.indexOf(",") != -1 || datas_id.indexOf(",") != -1) {
|
||||
alert('无法选择多台设备!');
|
||||
} else {
|
||||
|
||||
$.get(ext.contextPath + '/equipment/getEquipmentSimple.do', {
|
||||
id: datas_id
|
||||
}, function (data) {
|
||||
var obj = $.parseJSON(data);
|
||||
var processSectionId = $("#processSectionId").val();
|
||||
//如果选择的设备工艺段和外面的工艺段不一样的话 给与提示 然后将外面的工艺段修改掉
|
||||
if (obj.processsectionid != unitId + '_' + processSectionId) {
|
||||
layer.open({
|
||||
title: '提示'
|
||||
, content: '已修改为设备所在工艺段!'
|
||||
});
|
||||
//由于设备台账关联的是工艺段的id 这边关联的是工艺段的code 如果需要处理下
|
||||
var processCode = obj.processsectionid.replace(unitId + "_", "")
|
||||
//修改外面选择的工艺段
|
||||
$("#processSectionId").select2().val(processCode).trigger("change");
|
||||
}
|
||||
$('#equipmentIds').val(datas_id);
|
||||
$('#equipmentNames').val(datas_name);
|
||||
closeModal("equipment4SelectModal");
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//选择故障库
|
||||
var showFaultLibrary = function (formId, hiddenId, textId) {
|
||||
var libraryId = $('#' + hiddenId).val();
|
||||
var equipmentIds = $("#equipmentIds").val();
|
||||
|
||||
var type = $('#type').val();
|
||||
//设备故障才弹窗故障库
|
||||
if ('${Type_Equipment}' == type) {
|
||||
if ('${param.unitId}' == "" || equipmentIds == "" || '${param.unitId}' == null || equipmentIds == null) {
|
||||
showAlert('d', '未选择设备');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/showFaultLibrary4Equpment.do', {
|
||||
libraryId: libraryId,
|
||||
companyId: '${param.unitId}',
|
||||
equipmentIds: equipmentIds
|
||||
}, function (data) {
|
||||
$("#library4SelectDiv").html(data);
|
||||
openModal('library4SelectModal');
|
||||
});
|
||||
}
|
||||
//其余故障类型没有弹窗列表
|
||||
} else {
|
||||
showAlert('d', '仅设备故障可选择故障库');
|
||||
}
|
||||
};
|
||||
|
||||
//选人
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#solver").val();
|
||||
var type = $("#type").val();
|
||||
var typeId = '';
|
||||
if(type == 'run'){
|
||||
typeId = '${Workorder_Abnormity_Run}';
|
||||
}
|
||||
if(type == 'equipment'){
|
||||
typeId = '${Workorder_Abnormity_Equipment}';
|
||||
}
|
||||
$.post(ext.contextPath + '/user/layerUser.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "solver",
|
||||
textId: "solvername",
|
||||
userIds: userIds,
|
||||
unitId: unitId, //获取右上角的厂id
|
||||
type: typeId
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalAbnorm">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${id}">
|
||||
<input type="hidden" name="status" value="${Wait}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="bizId" id="bizId" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static">${company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上报人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${userName}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="type" name="type" style="width: 470px;">
|
||||
<option value="run">运行异常</option>
|
||||
<option value="equipment">设备异常</option>
|
||||
<%--<option value="facilities">设施异常</option>--%>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="processSectionDiv">
|
||||
<label class="col-sm-2 control-label">*工艺段</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="processSectionId" name="processSectionId"
|
||||
style="width: 470px;" value="${processSectionId}">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="equipmentIdsDiv" style="display: none;">
|
||||
<label class="col-sm-2 control-label">*异常设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden" value=""/>
|
||||
<input class="form-control" id="equipmentNames" name="equipmentNames"
|
||||
onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipmentNames');" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="libraryId" name="libraryId" type="hidden" value=""/>
|
||||
<textarea class="form-control " id="abnormityDescription" name="abnormityDescription"
|
||||
rows="2" autocomplete="off"
|
||||
ondblclick="showFaultLibrary('subForm','libraryId','abnormityDescription');"
|
||||
placeholder="异常描述">${param.abnormityDescription}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="remark" name="remark"
|
||||
rows="2">${param.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接收人员</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="solvername" name="solvername"
|
||||
placeholder="请选择接收人员" onclick="showUser4SelectsFun();" autocomplete="off">
|
||||
<input id="solver" name="receiveUserId" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('abnormityFileId')"
|
||||
id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="abnormityFileId" id="abnormityFileId" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
183
src/main/webapp/jsp/maintenance/abnormityCreateDefect.jsp
Normal file
183
src/main/webapp/jsp/maintenance/abnormityCreateDefect.jsp
Normal file
@ -0,0 +1,183 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%request.setAttribute("INTER_MAINTENANCE",MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE",MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE",MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<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').data('bootstrapValidator')
|
||||
.updateStatus('solvername', 'NOT_VALIDATED',null)
|
||||
.validateField('solvername');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doCreateDefectByAbnormal.do", $("#subForm").serialize()+"&ids="+'${ids}', function(data) {
|
||||
if (data > 0){
|
||||
showAlert('s','保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
//选择接收人员
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#solver").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"solver",textId:"solvername",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
maintenanceWay: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '处理方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
solvername: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维护人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* plannedenddt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划完成日期不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
//计划完成时间
|
||||
$('#plannedenddt').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('plannedenddt', 'NOT_VALIDATED',null)
|
||||
.validateField('plannedenddt');
|
||||
});
|
||||
$("#maintenanceWay").select2({placeholder:'请选择',minimumResultsForSearch: 10}).val("${INTER_MAINTENANCE}").trigger("change");
|
||||
})
|
||||
|
||||
//选择故障类型,可多选
|
||||
var showProblemType4SelectsFun = function(formId,hiddenId,textId) {
|
||||
var problemTypeIds=$('#'+hiddenId).val();
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultTypeForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,problemTypeIds:problemTypeIds} , function(data) {
|
||||
$("#problemTyp4SelectDiv").html(data);
|
||||
openModal("problemTyp4SelectModal");
|
||||
});
|
||||
};
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
var equipmentIds=$('#equipmentId').val();
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:'${companyId}',equipmentIds:equipmentIds,pSectionId:'${processSectionId}'} , function(data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">${idNumber}条异常生成
|
||||
<c:if test="${not empty equipmentIds}">维修单</c:if>
|
||||
<c:if test="${empty equipmentIds}">缺陷</c:if>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*处理方式</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="maintenanceWay" name ="maintenanceWay" style="width: 270px;">
|
||||
<option value="${INTER_MAINTENANCE}" selected="selected">内部处理</option>
|
||||
<option value="${EXTERANL_MAINTENANCE}">外部处理</option>
|
||||
<option value="${COMMON_MAINTENANCE}">联合处理</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划完成日期</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="plannedenddt" name="plannedenddt" style="width: 230px;" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划费用/元</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" id="planMoney" name ="planMoney" value="" step="50.01" placeholder="计划费用" >
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${not empty equipmentIds}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">故障类型</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="problemtypeid" name="problemtypeid" type="hidden" value="" />
|
||||
<input class="form-control" id="problemname" name ="problemname" onclick="showProblemType4SelectsFun('subForm','problemtypeid','problemname');" placeholder="请点击选择">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="equipmentId" name="equipmentId" type="hidden" value="${equipmentIds}" />
|
||||
<input class="form-control" id="equipname" name ="equipname" onclick="showEquipment4SelectsFun('subForm','equipmentId','equipname');" value="${equipmentNames}" placeholder="点击选择">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接收人员</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="solvername" name ="solvername" placeholder="接收人员" onclick="showUser4SelectsFun();">
|
||||
<input id="solver" name="solver" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" 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>
|
||||
298
src/main/webapp/jsp/maintenance/abnormityEdit.jsp
Normal file
298
src/main/webapp/jsp/maintenance/abnormityEdit.jsp
Normal file
@ -0,0 +1,298 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<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 masterId='${abnormity.id}';
|
||||
var tbName='tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace='MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:''
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#maintenancefile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
}else{
|
||||
$('#maintenanceDetailFile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
var fileinput = function() {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
showAlert('s','保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
bizId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
processSectionId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常类型不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
abnormityDescription: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '异常描述不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
//初始化工艺段
|
||||
var refreshSelect = function(companyId) {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#pSectionId").empty();
|
||||
var selelct_ =$("#pSectionId").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${abnormity.processSectionId}').trigger("change");
|
||||
},'json');
|
||||
};
|
||||
var companyId = "${abnormity.bizId}";
|
||||
$(function(){
|
||||
getFileList();
|
||||
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#pSectionId").empty();
|
||||
var selelct_ =$("#pSectionId").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
if(data!=null && data.length>0){
|
||||
selelct_.val('${abnormity.processSectionId}').trigger("change");
|
||||
}
|
||||
selelct_.on('change',function(){
|
||||
//工艺段选择后,清空原有工艺段选择的设备
|
||||
$("#equipmentIds").val("");
|
||||
$("#equipname").val("");
|
||||
})
|
||||
},'json');
|
||||
|
||||
})
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
var equipmentIds=$('#'+hiddenId).val();
|
||||
var pSectionId = $("#pSectionId").val();
|
||||
console.info(companyId)
|
||||
console.info(pSectionId)
|
||||
if(companyId == "" || pSectionId == "" || companyId == null || pSectionId == null){
|
||||
showAlert('d','请先选择厂区和工艺段');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:companyId,equipmentIds:equipmentIds,pSectionId:pSectionId} , function(data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//选择故障库
|
||||
var showFaultLibrary = function(formId,hiddenId,textId) {
|
||||
var libraryId=$('#'+hiddenId).val();
|
||||
var equipmentIds = $("#equipmentIds").val();
|
||||
if(companyId == "" || equipmentIds == "" || companyId == null || equipmentIds == null){
|
||||
showAlert('d','请先选择设备');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/showFaultLibrary4Equpment.do', {libraryId:libraryId,companyId:companyId,equipmentIds:equipmentIds} , function(data) {
|
||||
$("#library4SelectDiv").html(data);
|
||||
openModal('library4SelectModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${abnormity.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*所属厂区</label>
|
||||
<!-- <div class="col-sm-6">
|
||||
<select class="form-control select2" id="bizId" name ="bizId" style="width: 270px;">
|
||||
</select>-->
|
||||
<!-- <input class="form-control" id="input_bizId" style="border: none;background: transparent;"> -->
|
||||
<div class="col-sm-6">
|
||||
<input type="hidden" id="bizId" name ="bizId" value="${abnormity.bizId}">
|
||||
<p class="form-control-static" >${abnormity.company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工艺段</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="pSectionId" name ="processSectionId" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden" value="${abnormity.equipmentIds}" />
|
||||
<input class="form-control" id="equipname" name ="equipname" value="${abnormity.equipmentNames}" onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipname');" placeholder="请先选择厂区和工艺段">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="libraryId" name="libraryId" type="hidden" value="${abnormity.libraryId}" />
|
||||
<textarea class="form-control " id="abnormityDescription" name="abnormityDescription" rows="2" ondblclick="showFaultLibrary('subForm','libraryId','abnormityDescription');" placeholder="双击可选择故障库">${abnormity.abnormityDescription}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="remark" name="remark" rows="2">${abnormity.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传图片</button>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile" id="maintenanceDetailFile" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
314
src/main/webapp/jsp/maintenance/abnormityHandle.jsp
Normal file
314
src/main/webapp/jsp/maintenance/abnormityHandle.jsp
Normal file
@ -0,0 +1,314 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.Abnormity" %>
|
||||
<%request.setAttribute("Type_Run", Abnormity.Type_Run); %>
|
||||
<%request.setAttribute("Type_Equipment", Abnormity.Type_Equipment); %>
|
||||
<%request.setAttribute("Type_Facilities", Abnormity.Type_Facilities); %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<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 masterId = '${entity.id}'; //数据表
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
function doSubmit() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED', null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var cancel = $('#cancel').val();
|
||||
if (cancel == '${Active_True}') {
|
||||
//销单
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcessCancel1.do",
|
||||
{id: $('#id').val()},
|
||||
function (data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcessCancel2.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModalHandle')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else {
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcess.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModalHandle')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var showUser4Handle = function () {
|
||||
var userIds = $("#targetusers").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
var id = '${entity.id}';
|
||||
|
||||
//加载文件
|
||||
getFileListMinioPic('abnormityFileId', 'edit', masterId, previews, previewConfigs);
|
||||
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '提交人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showProcessView.do', {
|
||||
id: id,
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
|
||||
var selelct_ = $("#type").select2({placeholder: '请选择', minimumResultsForSearch: 10,});
|
||||
selelct_.val('${entity.type}').trigger("change")
|
||||
|
||||
//初始化销单
|
||||
var selelct_cancel = $("#cancel").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct_cancel.on('change', function () {
|
||||
var cancel = $('#cancel').val();
|
||||
if ('${Active_True}' == cancel) {//切换到销单
|
||||
$("#cancelDiv").attr("style", "display:none;");
|
||||
}
|
||||
if ('${Active_False}' == cancel) {//切换到非销单
|
||||
$("#cancelDiv").attr("style", "display:block;");
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var equipmentIds = $('#' + hiddenId).val();
|
||||
var bizId = $("#bizId").val();
|
||||
var processSectionId = $("#processSectionId").val();
|
||||
if (processSectionId == "" || processSectionId == null) {
|
||||
showAlert('d', '请先选择工艺段');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
companyId: bizId,
|
||||
equipmentIds: equipmentIds,
|
||||
pSectionId: processSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalHandle">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">异常处理(${taskName})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" id="id" value="${entity.id}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<%-- <input type="hidden" class="form-control" id="id" name="id" value="${entity.id}">--%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="bizId" id="bizId" type="hidden" value="${entity.bizId}"/>
|
||||
<p class="form-control-static">${entity.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="processSectionId" id="processSectionId" type="hidden"
|
||||
value="${entity.processSectionId}"/>
|
||||
<p class="form-control-static">${entity.processSection.sname}</p>
|
||||
</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="type" name="type"
|
||||
style="width: 170px;" disabled="disabled">
|
||||
<option value="run">运行异常</option>
|
||||
<option value="equipment">设备异常</option>
|
||||
<option value="facilities">设施异常</option>
|
||||
</select>
|
||||
</div>
|
||||
<c:if test="${entity.type == Type_Equipment}">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden"
|
||||
value="${entity.equipmentIds}"/>
|
||||
<input class="form-control" id="equipname" name="equipname"
|
||||
onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipname');"
|
||||
placeholder="请先选择厂区和工艺段" value="${entity.equipmentNames}">
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="libraryId" name="libraryId" type="hidden" value=""/>
|
||||
<textarea class="form-control " id="abnormityDescription"
|
||||
name="abnormityDescription"
|
||||
rows="2" placeholder="异常描述"
|
||||
readonly>${entity.abnormityDescription}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="remark" name="remark" rows="2"
|
||||
readonly>${entity.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="form-control" name="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name="processid"
|
||||
value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name="taskid"
|
||||
value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name="businessid"
|
||||
value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name="taskdefinitionkey"
|
||||
value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<input type="hidden" class="form-control" name="unitid"
|
||||
value="${businessUnitHandle.unitid}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">销单</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="cancel" name="cancel"
|
||||
style="width: 270px;">
|
||||
<option value="${Active_True}">是</option>
|
||||
<option value="${Active_False}" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="cancelDiv">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name="routeNum"
|
||||
style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="reject" class="form-group">
|
||||
<label class="col-sm-2 control-label">*处理意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="auditopinion" name="auditopinion"
|
||||
placeholder="处理意见"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName"
|
||||
name="targetUsersName"
|
||||
placeholder="下一级人员" onclick="showUser4Handle();" autocomplete="off">
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="abnormityFileId" id="abnormityFileId" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-xs-12" id="showView"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
656
src/main/webapp/jsp/maintenance/abnormityHandleIssue.jsp
Normal file
656
src/main/webapp/jsp/maintenance/abnormityHandleIssue.jsp
Normal file
@ -0,0 +1,656 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.Abnormity" %>
|
||||
<%request.setAttribute("Type_Run", Abnormity.Type_Run); %>
|
||||
<%request.setAttribute("Type_Equipment", Abnormity.Type_Equipment); %>
|
||||
<%request.setAttribute("Type_Facilities", Abnormity.Type_Facilities); %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<%@ page import="com.sipai.entity.activiti.ProcessType" %>
|
||||
<%request.setAttribute("B_Maintenance", ProcessType.B_Maintenance.getId()); %>
|
||||
<%request.setAttribute("Workorder_Repair", ProcessType.Workorder_Repair.getId()); %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("FILE_TYPE_IMAGE", CommString.FILE_TYPE_IMAGE); %>
|
||||
<%request.setAttribute("FILE_TYPE_VIDEO", CommString.FILE_TYPE_VIDEO); %>
|
||||
<%request.setAttribute("FILE_TYPE_AUDIO", CommString.FILE_TYPE_AUDIO); %>
|
||||
|
||||
<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 masterId = '${entity.id}'; //数据表
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
function doSubmit() {
|
||||
var cancel = $('#cancel').val();
|
||||
if (cancel == '${Active_True}') {
|
||||
//销单
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcessCancel1.do",
|
||||
{id: $('#id').val()},
|
||||
function (data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcessCancel2.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModalHandle')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else {
|
||||
//非销单
|
||||
var compete = $('#compete').val();
|
||||
if (compete == '${Active_True}') {
|
||||
dohandle_y();
|
||||
} else {
|
||||
dohandle_n();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定班组执行 -- 抢单
|
||||
*/
|
||||
function dohandle_y() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetTeamsName', 'NOT_VALIDATED', null)
|
||||
.validateField('targetTeamsName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcessCompete.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModalHandle')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定人员执行 -- 非抢单
|
||||
*/
|
||||
function dohandle_n() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED', null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/abnormity/doHandleProcess.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModalHandle')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//弹出人员列表
|
||||
var showUser4Handle = function () {
|
||||
/*var userIds = $("#targetusers").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect4FirstActiviti.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
type: 'repair'
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});*/
|
||||
|
||||
|
||||
var typeStr = '';
|
||||
if($('#type').val() == 'run'){
|
||||
typeStr = '${B_Maintenance}';
|
||||
}
|
||||
if($('#type').val() == 'equipment'){
|
||||
typeStr = '${Workorder_Repair}';
|
||||
}
|
||||
|
||||
var userIds = $("#targetusers").val();
|
||||
$.post(ext.contextPath + '/user/layerUser.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
unitId: unitId, //获取右上角的厂id
|
||||
type: typeStr,
|
||||
num: '-3'//公司运维下面的 缺陷工单
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//弹出班组列表
|
||||
var showTeam4Handle = function () {
|
||||
var userIds = $("#targetusers").val();
|
||||
var jobIds = '';
|
||||
$.post(ext.contextPath + '/user/teamForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetTeamsName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_IMAGE}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = 'data:image/png;base64,' + data[i].streamFile;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfig['showRemove'] = false;//不显示移除按钮
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("abnormityFileId");
|
||||
} else {
|
||||
$('#abnormityFileId').hide();
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
//查看视频
|
||||
var videoPreview = function () {
|
||||
|
||||
var w = '350px';
|
||||
var h = '600px';
|
||||
if (window.screen.width > 2500) {
|
||||
w = '700px';
|
||||
h = '1000px';
|
||||
} else if (window.screen.width > 2000) {
|
||||
w = '600px';
|
||||
h = '900px';
|
||||
} else if (window.screen.width > 1366) {
|
||||
w = '450px';
|
||||
h = '750px';
|
||||
} else if (window.screen.width <= 1366) {
|
||||
w = '350px';
|
||||
h = '600px';
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
var path = '';
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_VIDEO}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
path = data[0].streamFile;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '视频',
|
||||
skin: 'layui-layer-rim', //加上边框
|
||||
area: [w, h], //宽高
|
||||
shadeClose: true,
|
||||
content: '<video controls="" width="100%" height="90%" preload="" src="' + 'data:video/mp4;base64,' + path + '"></video>'
|
||||
});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//查看音频
|
||||
var audioPreview = function (){
|
||||
//查询是否存在音频
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_AUDIO}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
var path = 'data:audio/mpeg;base64,' + data[0].streamFile;
|
||||
//存在音频
|
||||
|
||||
// 设置语音源文件
|
||||
document.getElementById('audioPlayer').src = path;
|
||||
// 控制播放
|
||||
document.getElementById('audioPlayer').play();
|
||||
// 控制暂停
|
||||
document.getElementById('audioPlayer').pause();
|
||||
// 控制停止
|
||||
document.getElementById('audioPlayer').pause();
|
||||
document.getElementById('audioPlayer').currentTime = 0;
|
||||
}else{
|
||||
//不存在音频
|
||||
document.getElementById("audioDiv").style.display = "none";
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
var id = '${entity.id}';
|
||||
getFileList();//获取图片
|
||||
audioPreview();//获取音频
|
||||
|
||||
//加载文件
|
||||
// getFileListMinioPic('abnormityFileId', 'view', masterId, previews, previewConfigs);
|
||||
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接单人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
targetTeamsName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '抢单班组不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showProcessView.do', {
|
||||
id: id,
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
|
||||
//初始化异常类型
|
||||
var selelct_ = $("#type").select2({
|
||||
placeholder: '请选择',
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct_.val('${entity.type}').trigger("change")
|
||||
typeButton('');
|
||||
//默认下发给人员 隐藏班组
|
||||
$("#selectDepts").attr("style", "display:none;");
|
||||
|
||||
//初始化抢单
|
||||
var selelct_compete = $("#compete").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
//初始化销单
|
||||
var selelct_cancel = $("#cancel").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
|
||||
selelct_compete.on('change', function () {
|
||||
var compete = $('#compete').val();
|
||||
if ('${Active_True}' == compete) {//切换到抢单
|
||||
$("#selectUsers").attr("style", "display:none;");
|
||||
$("#selectDepts").attr("style", "display:block;");
|
||||
|
||||
$("#targetUsersName").val('');
|
||||
}
|
||||
if ('${Active_False}' == compete) {//切换到非抢单
|
||||
$("#selectUsers").attr("style", "display:block;");
|
||||
$("#selectDepts").attr("style", "display:none;");
|
||||
|
||||
$("#targetTeamsName").val('');
|
||||
}
|
||||
})
|
||||
|
||||
selelct_cancel.on('change', function () {
|
||||
var cancel = $('#cancel').val();
|
||||
if ('${Active_True}' == cancel) {//切换到销单
|
||||
$("#cancelDiv").attr("style", "display:none;");
|
||||
typeButton('销单');
|
||||
}
|
||||
if ('${Active_False}' == cancel) {//切换到非销单
|
||||
$("#cancelDiv").attr("style", "display:block;");
|
||||
typeButton('');
|
||||
}
|
||||
})
|
||||
|
||||
$('#planDate').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
// $('#subForm').data('bootstrapValidator')
|
||||
// .updateStatus('planDate', 'NOT_VALIDATED', null)
|
||||
// .validateField('planDate');
|
||||
});
|
||||
$('#planDate').datepicker('setDate', '${nowDate.substring(0, 10)}');
|
||||
|
||||
|
||||
//查询是否存在视频
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_VIDEO}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
//存在视频
|
||||
}else{
|
||||
//不存在视频
|
||||
document.getElementById("videoDiv").style.display = "none";
|
||||
}
|
||||
}, 'json');
|
||||
})
|
||||
|
||||
// 按钮文字
|
||||
function typeButton(data) {
|
||||
if (data === '') {
|
||||
if ('${entity.type}' === 'run') {
|
||||
document.getElementById('typeButtonName').innerHTML = '下发运行异常'
|
||||
} else {
|
||||
document.getElementById('typeButtonName').innerHTML = '下发设备异常'
|
||||
}
|
||||
} else {
|
||||
document.getElementById('typeButtonName').innerHTML = data
|
||||
}
|
||||
}
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var equipmentIds = $('#' + hiddenId).val();
|
||||
var bizId = $("#bizId").val();
|
||||
var processSectionId = $("#processSectionId").val();
|
||||
if (processSectionId == "" || processSectionId == null) {
|
||||
showAlert('d', '请先选择工艺段');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
companyId: bizId,
|
||||
equipmentIds: equipmentIds,
|
||||
pSectionId: processSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalHandle">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">异常处理(${taskName})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" class="form-control" id="id" value="${entity.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="bizId" id="bizId" type="hidden" value="${entity.bizId}"/>
|
||||
<p class="form-control-static">${entity.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="processSectionId" id="processSectionId" type="hidden"
|
||||
value="${entity.processSectionId}"/>
|
||||
<p class="form-control-static">${entity.processSection.sname}</p>
|
||||
</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="type" name="type" style="width: 170px;"
|
||||
disabled="disabled">
|
||||
<option value="run">运行异常</option>
|
||||
<option value="equipment">设备异常</option>
|
||||
<option value="facilities">设施异常</option>
|
||||
</select>
|
||||
</div>
|
||||
<c:if test="${entity.type == Type_Equipment}">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden"
|
||||
value="${entity.equipmentIds}"/>
|
||||
<input class="form-control" id="equipname" name="equipname"
|
||||
onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipname');"
|
||||
placeholder="请先选择厂区和工艺段" value="${entity.equipmentNames}">
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="libraryId" name="libraryId" type="hidden" value=""/>
|
||||
<textarea class="form-control " id="abnormityDescription"
|
||||
name="abnormityDescription"
|
||||
rows="2" placeholder="异常描述"
|
||||
readonly>${entity.abnormityDescription}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="remark" name="remark" rows="2"
|
||||
readonly>${entity.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="form-control" name="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name="processid"
|
||||
value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name="taskid"
|
||||
value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name="businessid"
|
||||
value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name="taskdefinitionkey"
|
||||
value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<input type="hidden" class="form-control" name="unitid"
|
||||
value="${businessUnitHandle.unitid}">
|
||||
|
||||
<c:if test="${entity.type == Type_Equipment}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划完成日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="planDate" name="planDate"
|
||||
style="width: 232px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${compete == '0'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*是否抢单</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="compete" name="compete"
|
||||
style="width: 270px;">
|
||||
<option value="${Active_True}">是</option>
|
||||
<option value="${Active_False}" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">销单</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="cancel" name="cancel"
|
||||
style="width: 270px;">
|
||||
<option value="${Active_True}">是</option>
|
||||
<option value="${Active_False}" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name="routeNum"
|
||||
style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="cancelDiv">
|
||||
<div id="selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">下发至</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName"
|
||||
name="targetUsersName"
|
||||
placeholder="工单接收人员" onclick="showUser4Handle();" autocomplete="off">
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="selectDepts" class="form-group">
|
||||
<label class="col-sm-2 control-label">抢单班组:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetTeamsName"
|
||||
name="targetTeamsName"
|
||||
placeholder="参与抢单班组" onclick="showTeam4Handle();" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="videoDiv">
|
||||
<label class="col-sm-2 control-label">视频</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" style="cursor: pointer;color: #00c0ef;"
|
||||
onclick="videoPreview();">存在视频,可点击查看</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="audioDiv">
|
||||
<label class="col-sm-2 control-label">语音</label>
|
||||
<div class="col-sm-4">
|
||||
<audio id="audioPlayer" src="" controls=""></audio>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="abnormityFileId" id="abnormityFileId" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-xs-12" id="showView"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" id="typeButtonName" class="btn btn-primary" onclick="doSubmit()"
|
||||
id="btn_update"></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
304
src/main/webapp/jsp/maintenance/abnormityHandleList4ZK.jsp
Normal file
304
src/main/webapp/jsp/maintenance/abnormityHandleList4ZK.jsp
Normal file
@ -0,0 +1,304 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
|
||||
<!--2021.09.03 异常上报流程 3个共用 BusinessUnit -->
|
||||
<%@page import="com.sipai.entity.activiti.ProcessType" %>
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit" %>
|
||||
<% request.setAttribute("Workorder_Abnormity_Run", ProcessType.Workorder_Abnormity_Run.getId());%>
|
||||
<% request.setAttribute("Workorder_Abnormity_Equipment", ProcessType.Workorder_Abnormity_Equipment.getId());%>
|
||||
<% request.setAttribute("Workorder_Abnormity_Facilities", ProcessType.Workorder_Abnormity_Facilities.getId());%>
|
||||
<% request.setAttribute("UNIT_WORKORDER_ABNORMITY_HANDLE_RUN", BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_RUN);%>
|
||||
<% request.setAttribute("UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN", BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN);%>
|
||||
<% request.setAttribute("UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment", BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment);%>
|
||||
<% request.setAttribute("UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment", BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment);%>
|
||||
<% request.setAttribute("UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities", BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities);%>
|
||||
<% request.setAttribute("UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities", BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities);%>
|
||||
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
|
||||
<%--引入文件--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
|
||||
//签收
|
||||
var claimFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/activiti/workflow/task/claim.do', {taskId: id}, function (data) {
|
||||
if (data == 1) {
|
||||
showAlert('s', '签收成功', 'mainAlertdiv');
|
||||
$("#table").bootstrapTable('refresh')
|
||||
} else {
|
||||
showAlert('d', '签收失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var gotoTaskFun = function (type, status, processInstanceId, taskId, businessKey) {
|
||||
stopBubbleDefaultEvent();
|
||||
if (type.indexOf('${Workorder_Abnormity_Run}') != -1) {
|
||||
switch (status) {
|
||||
case '${UNIT_WORKORDER_ABNORMITY_HANDLE_RUN}'://处理
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showHandle.do', {
|
||||
processInstanceId: processInstanceId, taskId: taskId, subscribeId: businessKey,
|
||||
unitId: status
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModalHandle');
|
||||
});
|
||||
break;
|
||||
case '${UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN}'://处理_下发
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showHandleIssue.do', {
|
||||
processInstanceId: processInstanceId, taskId: taskId, subscribeId: businessKey,
|
||||
unitId: status
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModalHandle');
|
||||
});
|
||||
break;
|
||||
default:
|
||||
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
||||
}
|
||||
} //设备异常
|
||||
else if (type.indexOf('${Workorder_Abnormity_Equipment}') != -1) {
|
||||
switch (status) {
|
||||
case '${UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment}'://处理
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showHandle.do', {
|
||||
processInstanceId: processInstanceId, taskId: taskId, subscribeId: businessKey,
|
||||
unitId: status
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModalHandle');
|
||||
});
|
||||
break;
|
||||
case '${UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment}'://处理_下发
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showHandleIssue.do', {
|
||||
processInstanceId: processInstanceId, taskId: taskId, subscribeId: businessKey,
|
||||
unitId: status
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModalHandle');
|
||||
});
|
||||
break;
|
||||
default:
|
||||
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
||||
}
|
||||
}//设施异常
|
||||
else if (type.indexOf('${Workorder_Abnormity_Facilities}') != -1) {
|
||||
switch (status) {
|
||||
case '${UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities}'://处理
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showHandle.do', {
|
||||
processInstanceId: processInstanceId, taskId: taskId, subscribeId: businessKey,
|
||||
unitId: status
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModalHandle');
|
||||
});
|
||||
break;
|
||||
case '${UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities}'://处理_下发
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showHandleIssue.do', {
|
||||
processInstanceId: processInstanceId, taskId: taskId, subscribeId: businessKey,
|
||||
unitId: status
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModalHandle');
|
||||
});
|
||||
break;
|
||||
default:
|
||||
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
||||
}
|
||||
} else {
|
||||
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/abnormity/getList4ZK.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'client', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
type: '${param.type}',
|
||||
unitId: unitId
|
||||
}
|
||||
},
|
||||
sortName: 'rptdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '任务名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row) {
|
||||
return row.name;
|
||||
}
|
||||
}, {
|
||||
field: 'createTime', // 返回json数据中的name
|
||||
title: '上步处理时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row) {
|
||||
return row.task.createTime;
|
||||
}
|
||||
}, {
|
||||
field: 'companyname', // 返回json数据中的name
|
||||
title: '厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row) {
|
||||
if (row.business != null && row.business != '') {
|
||||
if (row.business.company != null && row.business.company != '') {
|
||||
return row.business.company.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'problem', // 返回json数据中的name
|
||||
title: '问题描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row) {
|
||||
return row.business == null ? '' : row.business.problem;
|
||||
}
|
||||
}, {
|
||||
field: 'taskName', // 返回json数据中的name
|
||||
title: '任务节点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row) {
|
||||
return row.task.name;
|
||||
}
|
||||
}, {
|
||||
field: 'op',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 80, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
if (!row.task.assignee) {
|
||||
str += '<button class="btn btn-default btn-sm" onclick="claimFun(\'' + row.task.id + '\')" data-toggle="tooltip" title="签收"><i class="fa fa-tag"></i><span class="hidden-md hidden-lg"> 签收</span></button>';
|
||||
} else {
|
||||
if (row.business != null) {
|
||||
str += '<button class="btn btn-default btn-sm" onclick="gotoTaskFun(\'' + row.type + '\',\'' + row.business.status + '\',\'' + row.processInstance.id + '\',\'' + row.task.id + '\',\'' + row.processInstance.businessKey + '\');" data-toggle="tooltip" title="处理">' +
|
||||
'<i class="fa fa-play"></i><span class="hidden-md hidden-lg"> 处理</span></button>';
|
||||
}
|
||||
}
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<input type="hidden" id="type" value="${type}">
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDiv4equipmentAdjustmentDetail"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<%--<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
删除
|
||||
</button>--%>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
395
src/main/webapp/jsp/maintenance/abnormityList.jsp
Normal file
395
src/main/webapp/jsp/maintenance/abnormityList.jsp
Normal file
@ -0,0 +1,395 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%request.setAttribute("Finish", MaintenanceDetail.Status_Finish); %>
|
||||
<%request.setAttribute("Start", MaintenanceDetail.Status_Start); %>
|
||||
<%request.setAttribute("Wait", MaintenanceDetail.Status_Wait); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
if(companyId == ""){
|
||||
showAlert('d','请先选择厂区','mainAlertdiv');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doadd.do', {companyId:companyId} , function(data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModalAbnorm');
|
||||
});
|
||||
}
|
||||
};
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doedit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subAbnormalModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewMaintenanceDetailFun = function(type,id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/viewMaintain.do', {id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
if(type == '2'){
|
||||
openModal('subRepairModal');
|
||||
}else{
|
||||
openModal('subModal');
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/abnormity/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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/abnormity/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//生成缺陷
|
||||
var createDefectFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
var status = 0;
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(item.status != '${Wait}'){
|
||||
status++;
|
||||
}
|
||||
datas+=item.id+",";
|
||||
});
|
||||
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else if(status > 0){
|
||||
showAlert('d','你选择的记录中有处理中或已完成的异常,请重新选择','mainAlertdiv');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showAbnormityCreateDefect.do', {ids:datas} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = unitId;
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
initFun();
|
||||
});
|
||||
var initFun = function(){
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
var statusSelect = $("#statusSelect").select2({minimumResultsForSearch: 10,placeholder:'请选择', }).val('').trigger("change");
|
||||
statusSelect.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/abnormity/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
companyId: companyId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
statusSelect:$("#statusSelect").val(),
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '上报时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '${Wait}':
|
||||
return "待处理";
|
||||
case '${Start}':
|
||||
return "处理中";
|
||||
case '${Finish}':
|
||||
return "已完成";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'abnormityDescription', // 返回json数据中的name
|
||||
title: '异常描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
|
||||
if(row.maintenanceDetail != null && row.maintenanceDetail != '' && row.maintenanceDetail != undefined){
|
||||
// buts+= '<security:authorize buttonUrl="maintenance/abnormity/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="查看" onclick="viewMaintenanceDetailFun(\'' + row.maintenanceDetail.type + '\',\'' + row.maintenanceDetail.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||||
// buts+= '</security:authorize>';
|
||||
}
|
||||
|
||||
if(row.status == '${Wait}'){
|
||||
buts+= '<security:authorize buttonUrl="maintenance/abnormity/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
}
|
||||
buts+= '<security:authorize buttonUrl="maintenance/abnormity/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="library4SelectDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div >
|
||||
<%--<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" />
|
||||
<span id="companyName" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>--%>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/abnormity/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
<button type="button" class="btn btn-default btn-sm" title="异常中有设备的生成维修,没设备的生成缺陷" onclick="createDefectFun();"><i class="fa fa-send-o"></i>生成缺陷或维修单</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="form-group">
|
||||
<label class="form-label">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 160px;"></select>
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2 " id="statusSelect" name ="statusSelect" style="width: 160px;">
|
||||
<option value= "${Wait}">待处理</option>
|
||||
<option value= "${Start}">处理中</option>
|
||||
<option value= "${Finish}">已完成</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" style="height:34px;" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height:34px;" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
</html>
|
||||
115
src/main/webapp/jsp/maintenance/abnormityListView.jsp
Normal file
115
src/main/webapp/jsp/maintenance/abnormityListView.jsp
Normal file
@ -0,0 +1,115 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<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 viewFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doview.do', {id:id} , function(data) {
|
||||
$("#subAbnormalDiv").html(data);
|
||||
openModal('subAbnormalModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/abnormity/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
ids : '${ids}'
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
/*{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'bizId', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},/* {
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '异常类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0':
|
||||
return "设备异常";
|
||||
case '1':
|
||||
return "非设备异常";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}, */{
|
||||
field: 'abnormityDescription', // 返回json数据中的name
|
||||
title: '异常描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
956
src/main/webapp/jsp/maintenance/abnormityList_new.jsp
Normal file
956
src/main/webapp/jsp/maintenance/abnormityList_new.jsp
Normal file
@ -0,0 +1,956 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ page import="com.sipai.entity.maintenance.Abnormity" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%request.setAttribute("Start", Abnormity.Status_Start); %>
|
||||
<%request.setAttribute("Processing", Abnormity.Status_Processing); %>
|
||||
<%request.setAttribute("Finish", Abnormity.Status_Finish); %>
|
||||
<%request.setAttribute("Clear", Abnormity.Status_Clear); %>
|
||||
|
||||
<%request.setAttribute("Type_Run", Abnormity.Type_Run); %>
|
||||
<%request.setAttribute("Type_Equipment", Abnormity.Type_Equipment); %>
|
||||
<%request.setAttribute("Type_Facilities", Abnormity.Type_Facilities); %>
|
||||
|
||||
<%@page import="com.sipai.entity.activiti.ProcessType" %>
|
||||
<%request.setAttribute("Workorder_Abnormity_Run", ProcessType.Workorder_Abnormity_Run.getId());%>
|
||||
<%request.setAttribute("Workorder_Abnormity_Equipment", ProcessType.Workorder_Abnormity_Equipment.getId());%>
|
||||
<%request.setAttribute("Workorder_Abnormity_Facilities", ProcessType.Workorder_Abnormity_Facilities.getId());%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.contentAPPTitle .col-xs-3, .contentAPPTitle .col-xs-4 {
|
||||
padding-right: 5px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.contentAPPTitle .select2-container .select2-selection--single {
|
||||
font-size: 12px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.contentAPPTitle .select2-selection__arrow {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.contentAPPTitle .select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
color: #444;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
#contentAPPBody .col-xs-3, #contentAPPBody .col-xs-6, #contentAPPBody .col-xs-12 {
|
||||
padding-right: 0px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#contentAPP .panel {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#contentAPP .row {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#contentAPP .panel-body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#contentAPP .app-fontSize-18 {
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#contentAPP .app-title, .app-datetime {
|
||||
color: #9f9f9f;
|
||||
}
|
||||
|
||||
#contentAPP .app-content {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.status {
|
||||
color: #ff9d2b;
|
||||
border: 2px solid #ff9d2b;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc" + "ript>")
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc" + "ript>")
|
||||
</script>
|
||||
|
||||
<%--文件上传 minio--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var company_id;
|
||||
var aryData = "";
|
||||
var statusData = "";
|
||||
$(function () {
|
||||
if ('${param.unitId}' != null && '${param.unitId}' != '') {
|
||||
//上位机请求
|
||||
company_id = '${param.unitId}';
|
||||
} else {
|
||||
//平台正常请求
|
||||
company_id = unitId;
|
||||
}
|
||||
var flag = IsApp();
|
||||
//var flag = true;
|
||||
if (flag == true) {
|
||||
$("#contentAPP").removeClass("hidden");
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: company_id}, function (data) {
|
||||
$("#processSectionAPP").empty();
|
||||
var selelct_ = $("#processSectionAPP").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '工艺段',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
initAPPFun();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
var statusSelect = $("#statusSelectAPP").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '上报人',
|
||||
}).val('${Start}').trigger("change");
|
||||
statusSelect.on("change", function (e) {
|
||||
initAPPFun();
|
||||
});
|
||||
|
||||
var insuserSelect = $("#insuserSelectAPP").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '状态',
|
||||
}).val('all').trigger("change");
|
||||
insuserSelect.on("change", function (e) {
|
||||
initAPPFun();
|
||||
});
|
||||
initAPPFun();
|
||||
} else {
|
||||
$("#contentWEB").removeClass("hidden");
|
||||
initFun();
|
||||
}
|
||||
});
|
||||
|
||||
var initAPPFun = function () {
|
||||
if ($('#contentAPPBody').length > 0) {
|
||||
var htmlStr = '<div class="panel panel-default">' +
|
||||
'<div class="panel-body text-center">正在努力加载的数据中,请稍后......</div>' +
|
||||
'</div>';
|
||||
$("#contentAPPBody").html(htmlStr);
|
||||
var list = {
|
||||
/*rows: 10000, // 每页要显示的数据条数
|
||||
page: 1, // 每页显示数据的开始页码
|
||||
unitId: company_id,
|
||||
pSectionId: $("#processSectionAPP").val(),
|
||||
statusSelect: $("#statusSelectAPP").val(),
|
||||
insuserSelect: $("#insuserSelectAPP").val(),
|
||||
insdt: $('#reservationtimeD').val(),
|
||||
type: $('#typeSelect').val(),*/
|
||||
|
||||
|
||||
rows: 10000, // 每页要显示的数据条数
|
||||
page: 1, // 每页显示数据的开始页码
|
||||
// sort: 'insdt', // 要排序的字段
|
||||
// order: 'desc',
|
||||
search_name: $('#search_name').val(),
|
||||
unitId: company_id,
|
||||
pSectionId: $("#processSection").val(),
|
||||
statusSelect: $("#statusSelect").val(),
|
||||
insuserSelect: $("#insuserSelect").val(),
|
||||
insdt: $('#reservationtimeD').val(),
|
||||
// type: $('#typeSelect').val(),
|
||||
};
|
||||
$.ajax({
|
||||
//请求方式
|
||||
type: "POST",
|
||||
//请求地址
|
||||
url: ext.contextPath + '/maintenance/abnormity/getList_new.do',
|
||||
//数据,json字符串
|
||||
data: list,
|
||||
dataType: "json",
|
||||
//请求成功
|
||||
success: function (result) {
|
||||
if (result.rows.length > 0) {
|
||||
htmlStr = '';
|
||||
$.each(result.rows, function (key, value) {
|
||||
var status = value.status;
|
||||
switch (status) {
|
||||
case '${Start}':
|
||||
status = "待处理";
|
||||
break;
|
||||
case '${Processing}':
|
||||
status = "处理中";
|
||||
break;
|
||||
case '${Clear}':
|
||||
status = "已销单";
|
||||
break;
|
||||
case '${Finish}':
|
||||
status = "已完成";
|
||||
break;
|
||||
default :
|
||||
status = status;
|
||||
}
|
||||
var type = value.type;
|
||||
switch (type) {
|
||||
case '${Type_Run}':
|
||||
type = "运行异常";
|
||||
break;
|
||||
case '${Type_Equipment}':
|
||||
type = "设备异常";
|
||||
break;
|
||||
case '${Type_Facilities}':
|
||||
type = "设施异常";
|
||||
break;
|
||||
default :
|
||||
type = "";
|
||||
}
|
||||
var sname = "";
|
||||
if (value.processSection != null && value.processSection.sname != null) {
|
||||
sname = value.processSection.sname;
|
||||
}
|
||||
var str = '<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\'' + value.id + '\')"><i class="fa fa fa-eye"></i><span class="hidden-md hidden-lg">查看</span></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" onclick="viewDetailFun(\'' + value.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
htmlStr += '<div class="panel panel-default">' +
|
||||
'<div class="panel-body app-title">' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">上报时间:</div>' +
|
||||
'<div class="col-xs-6 app-datetime">' + value.insdt.substring(0, 19) + '</div>' +
|
||||
'<div class="col-xs-3"><span class="status">' + status + '</span></div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">上报人:</div><div class="col-xs-3">' + value.insertUser.caption + '</div>' +
|
||||
'<div class="col-xs-3">类型:</div><div class="col-xs-3">' + type + '</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">工艺段:</div><div class="col-xs-9">' + sname + '</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-12 app-content app-fontSize-18">' + value.abnormityDescription + '</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">操作:</div><div class="col-xs-9"><div class="btn-group app-content" >' + str + '</div></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
})
|
||||
} else {
|
||||
htmlStr = '<div class="panel panel-default">' +
|
||||
'<div class="panel-body text-center">没有找到匹配的记录</div>' +
|
||||
'</div>';
|
||||
}
|
||||
$("#contentAPPBody").html(htmlStr);
|
||||
},
|
||||
//请求失败,包含具体的错误信息
|
||||
error: function (e) {
|
||||
console.log(e.status);
|
||||
console.log(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var addFun = function () {
|
||||
if (company_id == "") {
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doadd_new.do', {unitId: company_id}, function (data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModalAbnorm');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doedit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doview_new.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subAbnormalModal');
|
||||
});
|
||||
};
|
||||
|
||||
//流程详情
|
||||
var viewDetailFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showProcessView.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('processViewModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewMaintenanceDetailFun = function (type, id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/viewMaintain.do', {id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
if (type == '2') {
|
||||
openModal('subRepairModal');
|
||||
} else {
|
||||
openModal('subModal');
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/abnormity/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
//进入流程的不能删除
|
||||
/*if (item.status == null || item.status == '0' || item.status == '') {
|
||||
datas += item.id + ",";
|
||||
}*/
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/abnormity/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//生成缺陷
|
||||
var createDefectFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
var status = 0;
|
||||
$.each(checkedItems, function (index, item) {
|
||||
if (item.status != '${Wait}') {
|
||||
status++;
|
||||
}
|
||||
datas += item.id + ",";
|
||||
});
|
||||
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else if (status > 0) {
|
||||
showAlert('d', '你选择的记录中有处理中或已完成的异常,请重新选择', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showAbnormityCreateDefect.do', {ids: datas}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function () {
|
||||
aryData = "";
|
||||
statusData = "";
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
//跳转至待办
|
||||
function TaskListFun4Type(taskType,id) {
|
||||
if(taskType == 'run'){
|
||||
window.parent.addTab('taskList', '待办事项', 'activiti/workflow/taskList.do?modelKey=${Workorder_Abnormity_Run}-'+unitId+'&businessKey='+id);
|
||||
}
|
||||
if(taskType == 'equipment'){
|
||||
window.parent.addTab('taskList', '待办事项', 'activiti/workflow/taskList.do?modelKey=${Workorder_Abnormity_Equipment}-'+unitId+'&businessKey='+id);
|
||||
}
|
||||
}
|
||||
|
||||
var initFun = function () {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: company_id}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
// dosearch();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
var statusSelect = $("#statusSelect").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '请选择',
|
||||
allowClear: true,//允许清空
|
||||
}).val('${Start}').trigger("change");
|
||||
statusSelect.on("change", function (e) {
|
||||
// dosearch();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
var insuserSelect = $("#insuserSelect").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '请选择',
|
||||
allowClear: true,//允许清空
|
||||
}).val('all').trigger("change");
|
||||
insuserSelect.on("change", function (e) {
|
||||
// dosearch();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
var type = $("#typeSelect").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '请选择',
|
||||
allowClear: true,//允许清空
|
||||
}).val('all').trigger("change");
|
||||
type.on("change", function (e) {
|
||||
// dosearch();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/abnormity/getList_new.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50, 100, 200, 500], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
unitId: company_id,
|
||||
pSectionId: $("#processSection").val(),
|
||||
statusSelect: $("#statusSelect").val(),
|
||||
insuserSelect: $("#insuserSelect").val(),
|
||||
insdt: $('#reservationtimeD').val(),
|
||||
type: $('#typeSelect').val(),
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: function (value, row, index) {
|
||||
/*if (row.status == null || row.status == '0' || row.status == '') {
|
||||
return {disabled: true,}
|
||||
} else if (row.status === "finish") {
|
||||
aryData += row.id + ",";
|
||||
statusData += row.status;
|
||||
return {disabled: false,}
|
||||
} else {
|
||||
return {disabled: true,}
|
||||
}*/
|
||||
return {disabled: false,}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'abnormityDescription', // 返回json数据中的name
|
||||
title: '异常描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '32%'
|
||||
},
|
||||
{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '${Type_Run}':
|
||||
return "运行异常";
|
||||
case '${Type_Equipment}':
|
||||
return "设备异常";
|
||||
case '${Type_Facilities}':
|
||||
return "设施异常";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'insertUser.caption', // 返回json数据中的name
|
||||
title: '上报人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '上报时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '${Start}':
|
||||
return "待处理";
|
||||
case '${Processing}':
|
||||
return "处理中";
|
||||
case '${Clear}':
|
||||
return "已销单";
|
||||
case '${Finish}':
|
||||
return "已完成";
|
||||
default :
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')" data-toggle="tooltip" title="浏览"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>'
|
||||
|
||||
//流程中的显示 快捷跳转
|
||||
if(row.status != '${FINISH}'){
|
||||
buts += '<button type="button" class="btn btn-default btn-sm" title="处理" onclick="TaskListFun4Type(\'' + row.type + '\',\'' + row.id + '\')"><i class="fa fa-play"></i><span class="hidden-md hidden-lg"> 处理</span></button>';
|
||||
}
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function downloadPost() {
|
||||
if (unitId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
/*if (statusData === "") {//Finish
|
||||
showAlert('d', '只可导出状态为已完成的数据', 'mainAlertdiv');
|
||||
} else {
|
||||
var checkedItems = $("#table").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas === "") {
|
||||
datas = aryData;
|
||||
}
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {}, function (res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
window.open(ext.contextPath + "/maintenance/abnormity/doExport.do?unitId=" + unitId
|
||||
+ "&ids=" + datas);
|
||||
} else {
|
||||
showAlert('d', resp.msg, 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}*/
|
||||
var checkedItems = $("#table").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas === "") {
|
||||
datas = aryData;
|
||||
}
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {}, function (res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
window.open(ext.contextPath + "/maintenance/abnormity/doExport.do?unitId=" + unitId
|
||||
+ "&ids=" + datas);
|
||||
} else {
|
||||
showAlert('d', resp.msg, 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initDate1();
|
||||
$(".daterangepicker").css({'width': '680px'});
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
$('#reservationtimeD').val('');
|
||||
initFun();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="library4SelectDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<%-- <div id="doview_qx_div"></div>--%>
|
||||
<div id="doview_wx_div"></div>
|
||||
<div class="hidden" id="contentWEB">
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 180px;padding-bottom:10px;">
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
|
||||
<c:if test="${userId == 'emp01'}">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</c:if>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadPost();"><i
|
||||
class="fa fa-file-excel-o"></i> 导出
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">类型:</label>
|
||||
<select class="form-control select2" id="typeSelect" name="typeSelect"
|
||||
style="width: 120px;">
|
||||
<option value="run">运行异常</option>
|
||||
<option value="equipment">设备异常</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label text-center">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name="processSection"
|
||||
style="width: 120px;">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2 " id="statusSelect" name="statusSelect"
|
||||
style="width: 120px;">
|
||||
<option value="${Start}">待处理</option>
|
||||
<option value="${Processing}">处理中</option>
|
||||
<option value="${Clear}">已销单</option>
|
||||
<option value="${Finish}">已完成</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">上报人员:</label>
|
||||
<select class="form-control select2 " id="insuserSelect" name="insuserSelect"
|
||||
style="width: 120px;">
|
||||
<option value="all">全部</option>
|
||||
<option value="oneself">本人</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group">
|
||||
<label class="form-label">日期:</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; width: 200px; border-radius: 4px;" id="reservationtimeD"
|
||||
style="width:320px;"
|
||||
placeholder="请选择日期">
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; border-radius: 5px;"
|
||||
id="reservationtimeD" placeholder="请选择日期">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 220px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
style="height:34px;" placeholder="异常描述">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height:34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
<div class="hidden" id="contentAPP">
|
||||
<div class="row contentAPPTitle">
|
||||
<div class="col-xs-12">
|
||||
<div class="col-xs-4">
|
||||
<select class="form-control select2 input-sm " id="processSectionAPP"
|
||||
name="processSectionAPP"></select>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<select class="form-control select2 input-sm " id="insuserSelectAPP"
|
||||
name="insuserSelectAPP">
|
||||
<option value="all">全部</option>
|
||||
<option value="oneself">本人</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<select class="form-control select2 input-sm " id="statusSelectAPP" name="statusSelectAPP">
|
||||
<option value="${Start}">待处理</option>
|
||||
<option value="${Processing}">处理中</option>
|
||||
<option value="${Clear}">已销单</option>
|
||||
<option value="${Finish}">已完成</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-left" id="contentAPPBody">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body text-center">正在努力加载的数据中,请稍后......</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
153
src/main/webapp/jsp/maintenance/abnormityView.jsp
Normal file
153
src/main/webapp/jsp/maintenance/abnormityView.jsp
Normal file
@ -0,0 +1,153 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<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 masterId='${abnormity.id}';
|
||||
var tbName='tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace='MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
showRemove:false, //显示移除按钮,跟随文本框的那个
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDelete:''
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#maintenancefile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
}else{
|
||||
$('#maintenanceDetailFile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
$(function(){
|
||||
getFileList();
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subAbnormalModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${abnormity.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="bizId" name ="bizId" value ="${abnormity.company.name}" disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" value ="${abnormity.processSection.name}" disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常类型</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="type" name ="type" value ="" disabled="disabled">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="abnormityDescription" name="abnormityDescription" rows="2" disabled="disabled">${abnormity.abnormityDescription}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="equipment">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" id="equipmentIds" name ="equipmentIds" value="${abnormity.equipmentNames}" disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="remark" name="remark" rows="2" disabled="disabled">${abnormity.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">图片</label>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile" id="maintenanceDetailFile" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
447
src/main/webapp/jsp/maintenance/abnormityView_new.jsp
Normal file
447
src/main/webapp/jsp/maintenance/abnormityView_new.jsp
Normal file
@ -0,0 +1,447 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Abnormity" %>
|
||||
|
||||
<%request.setAttribute("Start", Abnormity.Status_Start); %>
|
||||
<%request.setAttribute("Processing", Abnormity.Status_Processing); %>
|
||||
<%request.setAttribute("Finish", Abnormity.Status_Finish); %>
|
||||
<%request.setAttribute("Clear", Abnormity.Status_Clear); %>
|
||||
|
||||
<%request.setAttribute("Type_Run", Abnormity.Type_Run); %>
|
||||
<%request.setAttribute("Type_Equipment", Abnormity.Type_Equipment); %>
|
||||
<%request.setAttribute("Type_Facilities", Abnormity.Type_Facilities); %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("FILE_TYPE_IMAGE", CommString.FILE_TYPE_IMAGE); %>
|
||||
<%request.setAttribute("FILE_TYPE_VIDEO", CommString.FILE_TYPE_VIDEO); %>
|
||||
<%request.setAttribute("FILE_TYPE_AUDIO", CommString.FILE_TYPE_AUDIO); %>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var masterId = '${abnormity.id}';
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_IMAGE}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = 'data:image/png;base64,' + data[i].streamFile;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfig['showRemove'] = false;//不显示移除按钮
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("abnormityFileId");
|
||||
} else {
|
||||
$('#abnormityFileId').hide();
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
/**
|
||||
* 查看缺陷单
|
||||
* @param id
|
||||
*/
|
||||
function doview_qx(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/getWorkId4Type.do', {
|
||||
id: id,
|
||||
type: '${Type_Run}'
|
||||
}, function (data) {
|
||||
var json = $.parseJSON(data);
|
||||
$.post(ext.contextPath + '/maintenance/doview_defect.do', {id: json.id, qxCount: 1}, function (data) {
|
||||
$("#doview_wx_div").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看维修单
|
||||
* @param id
|
||||
*/
|
||||
function doview_wx(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/getWorkId4Type.do', {
|
||||
id: id,
|
||||
type: '${Type_Equipment}'
|
||||
}, function (data) {
|
||||
var json = $.parseJSON(data);
|
||||
$.post(ext.contextPath + '/workorder/workorderDetail/doViewRepair.do', {
|
||||
id: json.id,
|
||||
wxCount: 1
|
||||
}, function (data) {
|
||||
$("#doview_wx_div").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看是否存在权限单
|
||||
*/
|
||||
function check_qx() {
|
||||
var id = $('#id').val();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/getWorkId4Type.do', {
|
||||
id: id,
|
||||
type: '${Type_Run}'
|
||||
}, function (data) {
|
||||
var json = $.parseJSON(data);
|
||||
if (json.id != null && json.id != '') {
|
||||
|
||||
} else {
|
||||
$("#button_qx").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看是否存在维修单
|
||||
*/
|
||||
function check_wx() {
|
||||
var id = $('#id').val();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/getWorkId4Type.do', {
|
||||
id: id,
|
||||
type: '${Type_Equipment}'
|
||||
}, function (data) {
|
||||
var json = $.parseJSON(data);
|
||||
if (json.id != null && json.id != '') {
|
||||
|
||||
} else {
|
||||
$("#button_wx").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//异常视频播放
|
||||
var videoPreview = function () {
|
||||
|
||||
var w = '350px';
|
||||
var h = '600px';
|
||||
if (window.screen.width > 2500) {
|
||||
w = '700px';
|
||||
h = '1000px';
|
||||
} else if (window.screen.width > 2000) {
|
||||
w = '600px';
|
||||
h = '900px';
|
||||
} else if (window.screen.width > 1366) {
|
||||
w = '450px';
|
||||
h = '750px';
|
||||
} else if (window.screen.width <= 1366) {
|
||||
w = '350px';
|
||||
h = '600px';
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
var path = '';
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_VIDEO}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
path = data[0].streamFile;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '视频',
|
||||
skin: 'layui-layer-rim', //加上边框
|
||||
area: [w, h], //宽高
|
||||
shadeClose: true,
|
||||
content: '<video controls="" width="100%" height="90%" preload="" src="' + 'data:video/mp4;base64,' + path + '"></video>'
|
||||
});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
getFileList();
|
||||
check_qx();
|
||||
check_wx();
|
||||
//显示流程详情
|
||||
var id = '${abnormity.id}';
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/showProcessView.do', {
|
||||
id: id,
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView_view").html(data);
|
||||
});
|
||||
|
||||
//用于判断是否显示维修或缺陷的按钮
|
||||
if ('${ycCount}' === '1') {
|
||||
document.getElementById("button_wx").style.display = "none";
|
||||
}
|
||||
|
||||
//查询是否存在视频
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_VIDEO}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
//存在视频
|
||||
}else{
|
||||
//不存在视频
|
||||
document.getElementById("videoDiv").style.display = "none";
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
|
||||
|
||||
//查询是否存在音频
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName,
|
||||
type: '${FILE_TYPE_AUDIO}'
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
var path = 'data:audio/mpeg;base64,' + data[0].streamFile;
|
||||
//存在音频
|
||||
|
||||
// 设置语音源文件
|
||||
document.getElementById('audioPlayer').src = path;
|
||||
// 控制播放
|
||||
document.getElementById('audioPlayer').play();
|
||||
// 控制暂停
|
||||
document.getElementById('audioPlayer').pause();
|
||||
// 控制停止
|
||||
document.getElementById('audioPlayer').pause();
|
||||
document.getElementById('audioPlayer').currentTime = 0;
|
||||
}else{
|
||||
//不存在音频
|
||||
document.getElementById("audioDiv").style.display = "none";
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subAbnormalModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${abnormity.id}">
|
||||
<input type="hidden" name="status" value="${Wait}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${abnormity.company.sname}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${abnormity.processSection.sname}</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">
|
||||
<c:if test="${abnormity.type == Type_Run}">运行异常</c:if>
|
||||
<c:if test="${abnormity.type == Type_Equipment}">设备异常</c:if>
|
||||
<c:if test="${abnormity.type == Type_Facilities}">设施异常</c:if>
|
||||
</p>
|
||||
</div>
|
||||
<c:if test="${abnormity.type == Type_Equipment}">
|
||||
<label class="col-sm-2 control-label">异常设备</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${abnormity.equipmentNames}</p>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">上报人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${abnormity.insertUser.caption}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上报时间</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${fn:substring(abnormity.insdt, 0, 19)}</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">${abnormity.statusText}</p>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常描述</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${abnormity.abnormityDescription}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${abnormity.remark}</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">${abnormity._receiveUserName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${abnormity.status == Start}">
|
||||
<p class="form-control-static">待处理</p>
|
||||
</c:if>
|
||||
<c:if test="${abnormity.status == Processing}">
|
||||
<p class="form-control-static">处理中</p>
|
||||
</c:if>
|
||||
<c:if test="${abnormity.status == Clear}">
|
||||
<p class="form-control-static">已销单</p>
|
||||
</c:if>
|
||||
<c:if test="${abnormity.status == Finish}">
|
||||
<p class="form-control-static">已完成</p>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="videoDiv">
|
||||
<label class="col-sm-2 control-label">视频</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" style="cursor: pointer;color: #00c0ef;"
|
||||
onclick="videoPreview();">存在视频,可点击查看</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="audioDiv">
|
||||
<label class="col-sm-2 control-label">语音</label>
|
||||
<div class="col-sm-4">
|
||||
<audio id="audioPlayer" src="" controls=""></audio>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="abnormityFileId" id="abnormityFileId" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
|
||||
<%--<div class="video_main dw">
|
||||
<video id="videoPlay1" width="262" height="195"
|
||||
src="http://132.120.132.77:9000/maintenance/test.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=sipai%2F20220908%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220908T031243Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=634cb54e05da3f7d2db432436a1d5954ed4ef3ce9c0a1421221fd0e17e83bfb9"
|
||||
poster="img/video.jpg" loop="loop" x-webkit-airplay="true"
|
||||
webkit-playsinline="true">
|
||||
您的浏览器暂不支持播放该视频,请升级至最新版浏览器。
|
||||
</video>
|
||||
</div>--%>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView_view"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<c:if test="${abnormity.type == Type_Run}">
|
||||
<button type="button" class="btn btn-default" onclick="doview_qx('${abnormity.id}');"
|
||||
id="button_qx">
|
||||
<%--查看缺陷工单--%>
|
||||
查看实施单
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${abnormity.type == Type_Equipment}">
|
||||
<button type="button" class="btn btn-default" onclick="doview_wx('${abnormity.id}');"
|
||||
id="button_wx">
|
||||
<%--查看维修单--%>
|
||||
查看实施单
|
||||
</button>
|
||||
</c:if>
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
219
src/main/webapp/jsp/maintenance/abnormity_processView.jsp
Normal file
219
src/main/webapp/jsp/maintenance/abnormity_processView.jsp
Normal file
@ -0,0 +1,219 @@
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%request.setAttribute("Status_Finish", Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT", Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE", Maintenance.TYPE_MAINTENANCE);%>
|
||||
<%request.setAttribute("UNIT_HANDLE", BusinessUnit.UNIT_HANDLE);%>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//var masterId=$('#maintenanceId').val();
|
||||
var tbName_problem = 'tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance = 'tb_maintenance_file'; //数据表
|
||||
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'MaintenanceProblem';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
resizeImage: true,
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: '',
|
||||
actionDelete: ''
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
var viewHandleDetailFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailView.do', {id: id}, function (data) {
|
||||
$("#handleDetailDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${param.id}';//业务Id
|
||||
var tbName_process = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace_process = 'maintenance';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
|
||||
$(function () {
|
||||
|
||||
getFileList_process_minio(masterId, tbName, bucketName, status);
|
||||
|
||||
$("#judgemaintainerstaff").rating('refresh', {showClear: false, showCaption: false, readonly: true});
|
||||
$("#judgeresult").rating('refresh', {showClear: false, showCaption: false, readonly: true});
|
||||
var result = '${businessUnitRecords}';
|
||||
result = result.replace(new RegExp("\r\n", "gm"), "");
|
||||
var json = JSON.parse(result);
|
||||
$.each(json, function (index, item) {
|
||||
if (item.id != null && item.id != "") {
|
||||
previews = new Array();
|
||||
$('#' + item.id).show();
|
||||
var data = item.files;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '30px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput(item.id);
|
||||
}
|
||||
});
|
||||
})
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
var printpage = function (myDiv) {
|
||||
$('.printContent').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print();
|
||||
wind.close();
|
||||
$('.printContent').hide();
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<c:choose>
|
||||
<c:when test='${finishFlag && status.last}'>
|
||||
<i class="fa fa-check bg-blue"></i>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body" style="padding-left:5px;padding-right:5px;">
|
||||
<div>
|
||||
${item.record}
|
||||
<c:if test="${UNIT_HANDLE==item.type}">
|
||||
<%-- <a style="cursor:pointer" onclick="viewHandleDetailFun('${item.id}')">查看详情</a>--%>
|
||||
<a style="cursor:pointer" onclick="viewHandleDetailFun('${item.id}')"></a>
|
||||
</c:if>
|
||||
</div>
|
||||
<c:if test="${item.id!=''}">
|
||||
<div style="padding-top:5px;">
|
||||
<input type="file" id='${item.id}' multiple class="file-loading"/>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<%--<c:forEach items="${item.files}" var="file">
|
||||
<img src="${file.abspath.substring(file.abspath.indexOf('webapps')+7,file.abspath.length())}"
|
||||
height="200" width="200" class="margin">
|
||||
</c:forEach>--%>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!--
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
|
||||
<!-- 流程打印布局 开始-->
|
||||
<div id="maintenanceDetail">
|
||||
<div class="printContent" style="display:none">
|
||||
<h4 style="text-align:center;">流程处理详情</h4>
|
||||
</div>
|
||||
<div class="printContent" style="display:none">
|
||||
<table style="border-collapse:collapse;margin:0 auto">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">时间</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">发起人</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">任务</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">流程内容详情</td>
|
||||
</tr>
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:150px;text-align: center;">${item.insdt.substring(0,16)}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.user.caption}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.taskName}</td>
|
||||
<td style="border:1px solid black;width:300px;">${item.record}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<!-- <label class="col-sm-2 control-label">文件附件:</label> -->
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<%--<div class="file-border" id="fileArea"></div>--%>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 流程打印布局 结束-->
|
||||
194
src/main/webapp/jsp/maintenance/abnormity_processView_alone.jsp
Normal file
194
src/main/webapp/jsp/maintenance/abnormity_processView_alone.jsp
Normal file
@ -0,0 +1,194 @@
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%request.setAttribute("Status_Finish", Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT", Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE", Maintenance.TYPE_MAINTENANCE);%>
|
||||
<%request.setAttribute("UNIT_HANDLE", BusinessUnit.UNIT_HANDLE);%>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//var masterId=$('#maintenanceId').val();
|
||||
var tbName_problem = 'tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance = 'tb_maintenance_file'; //数据表
|
||||
var nameSpace = 'MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
resizeImage: true,
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: '',
|
||||
actionDelete: ''
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
var viewHandleDetailFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailView.do', {id: id}, function (data) {
|
||||
$("#handleDetailDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${param.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
|
||||
$(function () {
|
||||
|
||||
})
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
var printpage = function (myDiv) {
|
||||
$('.printContent').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
/*
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.rel = 'stylesheet';
|
||||
style.appendChild(document.createTextNode(ss));
|
||||
wind.document.head.appendChild(style);
|
||||
*/
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
//console.log(wind.document);
|
||||
wind.print();
|
||||
wind.close();
|
||||
$('.printContent').hide();
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="modal fade" id="processViewModal">
|
||||
<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 " style="padding-left:0;padding-right:0;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<c:choose>
|
||||
<c:when test='${finishFlag && status.last}'>
|
||||
<i class="fa fa-check bg-blue"></i>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i
|
||||
class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a
|
||||
href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body" style="padding-left:5px;padding-right:5px;">
|
||||
<div>
|
||||
${item.record}
|
||||
</div>
|
||||
<c:if test="${item.id!=''}">
|
||||
<%--<div style="padding-top:5px;">
|
||||
<input type="file" id='${item.id}' multiple class="file-loading"/>
|
||||
</div>--%>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 流程打印布局 开始 -->
|
||||
<div id="inStockExcuteDetail">
|
||||
<div class="printContent" style="display:none">
|
||||
<h4 style="text-align:center;">流程处理详情</h4>
|
||||
</div>
|
||||
<div class="printContent" style="display:none">
|
||||
<table style="border-collapse:collapse;margin:0 auto">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">时间</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">发起人</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">任务</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">流程内容详情</td>
|
||||
</tr>
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:150px;text-align: center;">${item.insdt.substring(0,16)}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.user.caption}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.taskName}</td>
|
||||
<td style="border:1px solid black;width:300px;">${item.record}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 流程打印布局 结束-->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="printpage('inStockExcuteDetail');"><i
|
||||
class="fa fa-print"></i>打印
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
225
src/main/webapp/jsp/maintenance/anticorrosiveLibraryAdd.jsp
Normal file
225
src/main/webapp/jsp/maintenance/anticorrosiveLibraryAdd.jsp
Normal file
@ -0,0 +1,225 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
|
||||
<% request.setAttribute("Maintain_IN", com.sipai.entity.maintenance.MaintainCommStr.Maintain_IN); %>
|
||||
<% request.setAttribute("Maintain_OUT", com.sipai.entity.maintenance.MaintainCommStr.Maintain_OUT); %>
|
||||
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/anticorrosiveLibrary/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").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: {
|
||||
projectName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cycle: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '防腐周期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
times: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工时定额不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cost: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人工费不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reason: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '委外原因不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '防腐内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
qualityRequirement: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '质量要求不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#timesDiv').show();
|
||||
$('#costDiv').hide();
|
||||
$('#reasonDiv').hide();
|
||||
|
||||
$("#times").prop("disabled", false);
|
||||
$("#cost").attr("disabled","disabled");
|
||||
|
||||
$('input[type=radio][name=mode]').change(function () {
|
||||
if (this.value == '${Maintain_IN}') {
|
||||
$('#timesDiv').show();
|
||||
$('#costDiv').hide();
|
||||
$('#reasonDiv').hide();
|
||||
|
||||
$("#times").prop("disabled", false);
|
||||
$("#cost").attr("disabled","disabled");
|
||||
|
||||
} else {
|
||||
$('#timesDiv').hide();
|
||||
$('#costDiv').show();
|
||||
$('#reasonDiv').show();
|
||||
|
||||
$("#cost").prop("disabled", false);
|
||||
$("#times").attr("disabled","disabled");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input name="id" type="hidden" value="${id}" />
|
||||
<input name="unitId" type="hidden" value="${param.unitId}" />
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*项目名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="projectName" name="projectName" autocomplete="off" placeholder="项目名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*防腐周期</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="cycle" name="cycle">
|
||||
<option value="">请选择</option>
|
||||
<option value="${Maintain_Week}">一周</option>
|
||||
<option value="${Maintain_TenDays}">旬</option>
|
||||
<option value="${Maintain_Month}">月度</option>
|
||||
<option value="${Maintain_Quarter}">季度</option>
|
||||
<option value="${Maintain_HalfYear}">半年度</option>
|
||||
<option value="${Maintain_Year}">年度</option>
|
||||
</select>
|
||||
</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="mode" id="mode1" value="${Maintain_IN}" checked> 自行防腐
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="mode" id="mode2" value="${Maintain_OUT}"> 委外防腐
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="timesDiv">
|
||||
<label class="col-sm-2 control-label">*工时定额(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="times" name="times" autocomplete="off" min="0" step="1"
|
||||
placeholder="工时定额">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="costDiv">
|
||||
<label class="col-sm-2 control-label">*人工费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="cost" name="cost" autocomplete="off" min="0" step="1"
|
||||
placeholder="人工费">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="reasonDiv">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*委外理由说明</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="reason" name="reason" rows="3"
|
||||
placeholder="委外理由说明"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*防腐内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="contents" name="contents" rows="3"
|
||||
placeholder="防腐内容"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*质量要求</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="qualityRequirement" name="qualityRequirement" rows="3"
|
||||
placeholder="质量要求"></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>
|
||||
560
src/main/webapp/jsp/maintenance/anticorrosiveLibraryEdit.jsp
Normal file
560
src/main/webapp/jsp/maintenance/anticorrosiveLibraryEdit.jsp
Normal file
@ -0,0 +1,560 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
|
||||
<% request.setAttribute("Maintain_IN", com.sipai.entity.maintenance.MaintainCommStr.Maintain_IN); %>
|
||||
<% request.setAttribute("Maintain_OUT", com.sipai.entity.maintenance.MaintainCommStr.Maintain_OUT); %>
|
||||
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/anticorrosiveLibrary/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").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: {
|
||||
projectName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cycle: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '防腐周期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
times: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工时定额不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cost: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人工费不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
reason: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '委外原因不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '防腐内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
qualityRequirement: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '质量要求不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$('#timesDiv').show();
|
||||
$('#costDiv').hide();
|
||||
$('#reasonDiv').hide();
|
||||
// $("#times").prop("disabled", false);
|
||||
// $("#cost").attr("disabled","disabled");
|
||||
|
||||
$('input[type=radio][name=mode]').change(function () {
|
||||
if (this.value == '${Maintain_IN}') {
|
||||
$('#timesDiv').show();
|
||||
$('#costDiv').hide();
|
||||
$('#reasonDiv').hide();
|
||||
|
||||
$("#times").prop("disabled", false);
|
||||
$("#cost").attr("disabled","disabled");
|
||||
} else {
|
||||
$('#timesDiv').hide();
|
||||
$('#costDiv').show();
|
||||
$('#reasonDiv').show();
|
||||
|
||||
$("#cost").prop("disabled", false);
|
||||
$("#times").attr("disabled","disabled");
|
||||
}
|
||||
});
|
||||
|
||||
//防腐周期
|
||||
//$("#cycle").select2({minimumResultsForSearch: 10}).val("${anticorrosiveLibrary.cycle}").trigger("change");
|
||||
$("#cycle").val("${anticorrosiveLibrary.cycle}");
|
||||
|
||||
$('#times').val(parseFloat($('#times').val()).toFixed(2));
|
||||
$('#cost').val(parseFloat($('#cost').val()).toFixed(2));
|
||||
|
||||
|
||||
if ("${anticorrosiveLibrary.mode }" == "${Maintain_IN}") {//自修
|
||||
document.getElementById('timesDiv').style.display = '';
|
||||
document.getElementById('costDiv').style.display = 'none';
|
||||
document.getElementById('reasonDiv').style.display = 'none';
|
||||
$("#mode1").attr("checked","checked");
|
||||
$("#mode2").removeAttr("checked");
|
||||
}else{//委外
|
||||
document.getElementById('timesDiv').style.display = 'none';
|
||||
document.getElementById('costDiv').style.display = '';
|
||||
document.getElementById('reasonDiv').style.display = '';
|
||||
$("#mode2").attr("checked","checked");
|
||||
$("#mode1").removeAttr("checked");
|
||||
}
|
||||
|
||||
$("#table_Material").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/anticorrosiveLibraryMaterial/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
anticorrosiveLibraryId: '${anticorrosiveLibrary.id}',
|
||||
unitId: '${anticorrosiveLibrary.unitId}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
responseHandler: function(res){
|
||||
return res.result
|
||||
},
|
||||
// onClickCell:function(field, value, row, $element){
|
||||
// alert(JSON.stringify(value));
|
||||
// },
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '材料名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.anticorrosiveMaterial.name;
|
||||
}
|
||||
}, {
|
||||
field: 'cost', // 返回json数据中的name
|
||||
title: '材料单价(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.anticorrosiveMaterial.cost == null || row.anticorrosiveMaterial.cost == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return (row.anticorrosiveMaterial.cost * 1).toFixed(2);//toFixed()指定保留小数点后几位数
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'num', // 返回json数据中的name
|
||||
title: '数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.num;
|
||||
}
|
||||
}, {
|
||||
field: 'costall', // 返回json数据中的name
|
||||
title: '价格(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.anticorrosiveMaterial.cost == null || row.anticorrosiveMaterial.cost == 0 || row.num == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return (row.anticorrosiveMaterial.cost * row.num).toFixed(2);//toFixed()指定保留小数点后几位数
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 40, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="dodel_material(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa 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_Material");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
|
||||
$("#table_Equipment").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/anticorrosiveLibraryEquipment/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
anticorrosiveLibraryId: '${anticorrosiveLibrary.id}',
|
||||
unitId: '${anticorrosiveLibrary.unitId}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
responseHandler: function(res){
|
||||
return res.result
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '50%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '50%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentCard.equipmentname;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 40, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="dodel_equipment(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa 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_Equipment");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//获取设备ids
|
||||
function getEquipments(){
|
||||
var allTableData = $("#table_Equipment").bootstrapTable('getData');
|
||||
var equipmentCardIds = "";
|
||||
$.each(allTableData, function (index, item) {
|
||||
if (equipmentCardIds != "") {
|
||||
equipmentCardIds += ",";
|
||||
}
|
||||
equipmentCardIds += item.equipmentCard.id;
|
||||
})
|
||||
$.post(ext.contextPath + '/equipment/getEquipmentCardIdsForSelect.do', {
|
||||
equipmentCardIds: equipmentCardIds,
|
||||
bizId: '${anticorrosiveLibrary.unitId}', processSectionId: $('#processSectionId').val()
|
||||
}, function (data) {
|
||||
$("#subModal_Equipment").html(data);
|
||||
openModal('equipmentCardModal');
|
||||
});
|
||||
}
|
||||
//修改设备ids
|
||||
var doFinishSelectEquipmentCard = function (data) {
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveLibraryEquipment/updateEquipmentCards.do', {
|
||||
anticorrosiveLibraryId: '${anticorrosiveLibrary.id}',
|
||||
equipmentCardIds: data
|
||||
}, function (data) {
|
||||
if (data.res) {
|
||||
$("#table_Equipment").bootstrapTable('refresh');
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
//删除关联设备
|
||||
function dodel_equipment(id){
|
||||
stopBubbleDefaultEvent();
|
||||
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/anticorrosiveLibraryEquipment/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Equipment").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//获取材料ids
|
||||
function getMaterials(){
|
||||
var allTableData = $("#table_Material").bootstrapTable('getData');
|
||||
var materialIds = "";
|
||||
$.each(allTableData, function (index, item) {
|
||||
if (materialIds != "") {
|
||||
materialIds += ",";
|
||||
}
|
||||
materialIds += item.anticorrosiveMaterial.id;
|
||||
})
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveMaterial/getAnticorrosiveMaterialIdsForSelect.do', {
|
||||
materialIds: materialIds
|
||||
}, function (data) {
|
||||
$("#subModal_Equipment").html(data);
|
||||
openModal('materialModal');
|
||||
});
|
||||
}
|
||||
|
||||
//修改材料ids
|
||||
var doFinishSelectMaterial = function (data) {
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveLibraryMaterial/updateMaterials.do', {
|
||||
anticorrosiveLibraryId: '${anticorrosiveLibrary.id}',
|
||||
materialIds: data
|
||||
}, function (data) {
|
||||
if (data.res) {
|
||||
$("#table_Material").bootstrapTable('refresh');
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
//删除关联材料
|
||||
function dodel_material(id){
|
||||
stopBubbleDefaultEvent();
|
||||
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/anticorrosiveLibraryMaterial/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Material").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input name="id" type="hidden" value="${anticorrosiveLibrary.id}" />
|
||||
<input name="unitId" type="hidden" value="${anticorrosiveLibrary.unitId}" />
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*项目名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="projectName" name="projectName" autocomplete="off" placeholder="项目名称" value="${anticorrosiveLibrary.projectName}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*防腐周期</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="cycle" name="cycle">
|
||||
<option value="">请选择</option>
|
||||
<option value="${Maintain_Week}">一周</option>
|
||||
<option value="${Maintain_TenDays}">旬</option>
|
||||
<option value="${Maintain_Month}">月度</option>
|
||||
<option value="${Maintain_Quarter}">季度</option>
|
||||
<option value="${Maintain_HalfYear}">半年度</option>
|
||||
<option value="${Maintain_Year}">年度</option>
|
||||
</select>
|
||||
</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="mode" id="mode1" value="${Maintain_IN}" checked> 自行防腐
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="mode" id="mode2" value="${Maintain_OUT}"> 委外防腐
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="timesDiv">
|
||||
<label class="col-sm-2 control-label">*工时定额(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="times" name="times" autocomplete="off" min="0" step="0.01"
|
||||
placeholder="工时定额" value="${anticorrosiveLibrary.times}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="costDiv">
|
||||
<label class="col-sm-2 control-label">*人工费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="cost" name="cost" autocomplete="off" min="0" step="0.01"
|
||||
placeholder="人工费" value="${anticorrosiveLibrary.cost}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="reasonDiv">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*委外理由说明</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="reason" name="reason" rows="3"
|
||||
placeholder="委外理由说明">${anticorrosiveLibrary.reason}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*防腐内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="contents" name="contents" rows="3"
|
||||
placeholder="防腐内容">${anticorrosiveLibrary.contents}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*质量要求</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="qualityRequirement" name="qualityRequirement" rows="3"
|
||||
placeholder="质量要求">${anticorrosiveLibrary.qualityRequirement}</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">
|
||||
<a onclick="getEquipments()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i
|
||||
class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Equipment"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 材料列表 -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">使用材料</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="getMaterials()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i
|
||||
class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Material"></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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
402
src/main/webapp/jsp/maintenance/anticorrosiveLibraryList.jsp
Normal file
402
src/main/webapp/jsp/maintenance/anticorrosiveLibraryList.jsp
Normal file
@ -0,0 +1,402 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
|
||||
<% request.setAttribute("Maintain_IN", com.sipai.entity.maintenance.MaintainCommStr.Maintain_IN); %>
|
||||
<% request.setAttribute("Maintain_OUT", com.sipai.entity.maintenance.MaintainCommStr.Maintain_OUT); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveLibrary/doadd.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveLibrary/doedit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveLibrary/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/anticorrosiveLibrary/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/anticorrosiveLibrary/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
var statusSelect = $("#statusSelect").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '请选择',
|
||||
}).val('').trigger("change");
|
||||
statusSelect.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/anticorrosiveLibrary/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
unitId: unitId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
statusSelect: $("#statusSelect").val(),
|
||||
}
|
||||
},
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
responseHandler: function (res) {
|
||||
return res.result
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'projectName',
|
||||
title: '项目名称',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.projectName;
|
||||
}
|
||||
}, {
|
||||
field: 'cycle',
|
||||
title: '周期',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.cycle == '${Maintain_Week}') {
|
||||
return '周';
|
||||
}
|
||||
if (row.cycle == '${Maintain_TenDays}') {
|
||||
return '旬';
|
||||
}
|
||||
if (row.cycle == '${Maintain_Month}') {
|
||||
return '月度';
|
||||
}
|
||||
if (row.cycle == '${Maintain_Quarter}') {
|
||||
return '季度';
|
||||
}
|
||||
if (row.cycle == '${Maintain_HalfYear}') {
|
||||
return '半年度';
|
||||
}
|
||||
if (row.cycle == '${Maintain_Year}') {
|
||||
return '年度';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'company.name',
|
||||
title: '防腐内容',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.contents;
|
||||
}
|
||||
}, {
|
||||
field: 'mode',
|
||||
title: '防腐方式',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.mode == '${Maintain_IN}') {
|
||||
return '自行维护';
|
||||
}
|
||||
if (row.mode == '${Maintain_OUT}') {
|
||||
return '委外维护';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'qualityRequirement',
|
||||
title: '质量要求',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.qualityRequirement;
|
||||
}
|
||||
}, {
|
||||
field: 'totalCost',
|
||||
title: '总费用',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.totalCost;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<security:authorize buttonUrl="maintenance/anticorrosiveLibrary/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="maintenance/anticorrosiveLibrary/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function materialFun() {
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveMaterial/showlist.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||||
<div id="addDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="subModal_Equipment"></div>
|
||||
<div id="subModal_Material"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div>
|
||||
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/anticorrosiveLibrary/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="materialFun();"><i
|
||||
class="glyphicon glyphicon-th-list"></i> 防腐材料
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
style="height:34px;" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height:34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
105
src/main/webapp/jsp/maintenance/anticorrosiveMaterialAdd.jsp
Normal file
105
src/main/webapp/jsp/maintenance/anticorrosiveMaterialAdd.jsp
Normal file
@ -0,0 +1,105 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
|
||||
<% request.setAttribute("Maintain_IN", com.sipai.entity.maintenance.MaintainCommStr.Maintain_IN); %>
|
||||
<% request.setAttribute("Maintain_OUT", com.sipai.entity.maintenance.MaintainCommStr.Maintain_OUT); %>
|
||||
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/anticorrosiveMaterial/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subDivMaterial');
|
||||
$("#table_Material").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: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '材料名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cost: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '材料单价不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subDivMaterial">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input name="id" type="hidden" value="${id}" />
|
||||
<input name="unitId" type="hidden" value="${param.unitId}" />
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*材料名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" autocomplete="off"
|
||||
placeholder="材料名称">
|
||||
</div>
|
||||
<div id="costDiv">
|
||||
<label class="col-sm-2 control-label">*材料单价(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="cost" name="cost" autocomplete="off" min="0" step="1"
|
||||
placeholder="材料单价">
|
||||
</div>
|
||||
</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>
|
||||
104
src/main/webapp/jsp/maintenance/anticorrosiveMaterialEdit.jsp
Normal file
104
src/main/webapp/jsp/maintenance/anticorrosiveMaterialEdit.jsp
Normal file
@ -0,0 +1,104 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
|
||||
<% request.setAttribute("Maintain_IN", com.sipai.entity.maintenance.MaintainCommStr.Maintain_IN); %>
|
||||
<% request.setAttribute("Maintain_OUT", com.sipai.entity.maintenance.MaintainCommStr.Maintain_OUT); %>
|
||||
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/anticorrosiveMaterial/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subDivMaterial');
|
||||
$("#table_Material").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: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '材料名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cost: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '材料单价不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subDivMaterial">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input name="id" type="hidden" value="${anticorrosiveMaterial.id}" />
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*材料名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" autocomplete="off"
|
||||
placeholder="材料名称" value="${anticorrosiveMaterial.name}">
|
||||
</div>
|
||||
<div id="costDiv">
|
||||
<label class="col-sm-2 control-label">*材料单价(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="cost" name="cost" autocomplete="off" min="0" step="0.01"
|
||||
placeholder="材料单价" value="${anticorrosiveMaterial.cost}">
|
||||
</div>
|
||||
</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>
|
||||
@ -0,0 +1,262 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearch = function () {
|
||||
$("#table_MaterialForSelect").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect() {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
datas_name = "";
|
||||
$.each(selectionIds, function (index, item) {
|
||||
if (datas != "") {
|
||||
datas += ",";
|
||||
}
|
||||
console.log(item);
|
||||
datas += item;
|
||||
});
|
||||
//调用上一界面方法完成选择
|
||||
doFinishSelectMaterial(datas);
|
||||
closeModal("materialModal");
|
||||
};
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
$.each(eval('${anticorrosiveMaterials}'), function (index, item) {
|
||||
if (row.id == item.id) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds() {
|
||||
var check_array = eval('${anticorrosiveMaterials}');
|
||||
if (check_array != null && check_array.length > 0) {
|
||||
selectionIds = new Array(check_array.length);
|
||||
for (var i = 0; i < check_array.length; i++) {
|
||||
selectionIds[i] = check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds() {
|
||||
var ids = "";
|
||||
var check_array = eval('${anticorrosiveMaterials}');
|
||||
$.each(check_array, function (index, item) {
|
||||
if (ids != "") {
|
||||
ids += ",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
};
|
||||
var status = $('#switchBtn').bootstrapSwitch('state');
|
||||
if (status) {
|
||||
temp.checkedIds = getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function () {
|
||||
$("#searchForm_Equ").attr("onsubmit", "return false;");
|
||||
$("#search_name_equ").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearch();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
})
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
|
||||
initialSelectionIds();
|
||||
$table = $("#table_MaterialForSelect").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/anticorrosiveMaterial/getlist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler: responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
responseHandler: function(res){
|
||||
return res.result
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked: true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '材料名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '50%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.name;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'cost', // 返回json数据中的name
|
||||
title: '材料单价(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '50%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.cost;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_MaterialForSelect");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if ('check' == e.type) {
|
||||
obj.parent().addClass("checked");
|
||||
} else {
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = { "union": union, "difference": difference };
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="materialModal">
|
||||
<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 " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse">
|
||||
<form class="form-horizontal " id="searchForm_Equ">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="col-sm-2 control-label">部门</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name" name="search_name"
|
||||
class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
|
||||
<button type="button" class="btn btn-default btn-sm pull-right"
|
||||
onclick="doSearch();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_MaterialForSelect" style="height:230px;overflow:auto;width:100%"></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="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
170
src/main/webapp/jsp/maintenance/anticorrosiveMaterialList.jsp
Normal file
170
src/main/webapp/jsp/maintenance/anticorrosiveMaterialList.jsp
Normal file
@ -0,0 +1,170 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("PatrolPlan_Weekly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Weekly); %>
|
||||
<% request.setAttribute("PatrolPlan_Daily", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Daily); %>
|
||||
<% request.setAttribute("PatrolPlan_Monthly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Monthly); %>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$("#table_Material").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/anticorrosiveMaterial/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [5, 10], // 设置页面可以显示的数据条数
|
||||
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
|
||||
}
|
||||
},
|
||||
responseHandler: function(res){
|
||||
return res.result
|
||||
},
|
||||
sortName: 'name', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '材料名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '45%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.name;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'cost', // 返回json数据中的name
|
||||
title: '材料单价(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '45%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.cost == null || row.cost == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return (row.cost * 1).toFixed(2);//toFixed()指定保留小数点后几位数
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="maintenance/anticorrosiveMaterial/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="doedit_Material(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
buts+= '<security:authorize buttonUrl="maintenance/anticorrosiveMaterial/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="dodelete_Material(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Material");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
|
||||
function donew_Material(){
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveMaterial/doadd.do', {} , function(data) {
|
||||
$("#subModal_Material").html(data);
|
||||
openModal('subDivMaterial');
|
||||
});
|
||||
}
|
||||
|
||||
function doedit_Material(id){
|
||||
$.post(ext.contextPath + '/maintenance/anticorrosiveMaterial/doedit.do', {id:id} , function(data) {
|
||||
$("#subModal_Material").html(data);
|
||||
openModal('subDivMaterial');
|
||||
});
|
||||
}
|
||||
|
||||
function dodelete_Material(id){
|
||||
stopBubbleDefaultEvent();
|
||||
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/anticorrosiveMaterial/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Material").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</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">
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">材料列表</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="donew_Material()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_Material"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
354
src/main/webapp/jsp/maintenance/businessUnit_Audit.jsp
Normal file
354
src/main/webapp/jsp/maintenance/businessUnit_Audit.jsp
Normal file
@ -0,0 +1,354 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%request.setAttribute("Status_Launch",Maintenance.Status_Launch);%>
|
||||
<%request.setAttribute("Status_Edit",Maintenance.Status_Edit);%>
|
||||
|
||||
<% request.setAttribute("UNIT_AUDIT", BusinessUnit.UNIT_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_BASE_AUDIT", BusinessUnit.UNIT_BASE_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_PRODUCT_AUDIT", BusinessUnit.UNIT_PRODUCT_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_MIDDLE_AUDIT", BusinessUnit.UNIT_MIDDLE_AUDIT);%>
|
||||
<% request.setAttribute("PASS", CommString.ACTI_Condition_PASS);%>
|
||||
<% request.setAttribute("FATL", CommString.ACTI_Condition_FAIL);%>
|
||||
<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 showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var fileinput = function() {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
function doPass(routeNum) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#detailForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#passstatus").val(true);
|
||||
$.post(ext.contextPath + "/maintenance/doAuditDetail.do", $("#subForm").serialize()+"&routeNum="+routeNum, function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','操作执行失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
function doBack(routeNum) {
|
||||
swal({
|
||||
title: "退回!",
|
||||
text: "请输入审核不通过理由:",
|
||||
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
|
||||
}
|
||||
},
|
||||
content: {
|
||||
element: "input",
|
||||
attributes: {
|
||||
placeholder: "审核不通过理由...",
|
||||
},
|
||||
},
|
||||
})
|
||||
.then(function(value){
|
||||
if(value){
|
||||
$("#auditopinion").val(value);
|
||||
$("#passstatus").val(false);
|
||||
$.post(ext.contextPath + "/maintenance/doAuditDetail.do", $("#subForm").serialize()+"&routeNum="+routeNum, function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','退回失败,请重试!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
var masterId='${businessUnitHandle.businessid}';
|
||||
var tbName='tb_maintenance_file'; //数据表
|
||||
var nameSpace='MaintenanceFile';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:''
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#maintenancefile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenancefile");
|
||||
}else{
|
||||
$('#maintenancefile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
$(function() {
|
||||
//计划费用保留两位小数
|
||||
$("#planMoney").html(parseFloat('${maintenanceDetail.planMoney}').toFixed(2)+"元")
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '下一级人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">${taskName }</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#Tab1" data-toggle="tab" index="0">任务详情</a></li>
|
||||
<li><a href="#Tab2" data-toggle="tab" index="1">处理详情</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="Tab1">
|
||||
<form class="form-horizontal" id="detailForm" enctype="multipart/form-data" >
|
||||
<input type="hidden" class="form-control" name ="id" value="${maintenanceDetail.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${maintenanceDetail.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">任务编号:</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${maintenanceDetail.detailNumber}</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" >${maintenanceDetail.equipmentNames}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划费用:</label>
|
||||
<div class="col-sm-4">
|
||||
<p id = "planMoney" class="form-control-static" ></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">处理内容:</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" >${maintenanceDetail.problemcontent}</p>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${UNIT_AUDIT == businessUnitAudit.unitid }">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备专责意见:</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="equipmentOpinion" name="equipmentOpinion" rows="2" >${maintenanceDetail.equipmentOpinion}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${UNIT_BASE_AUDIT == businessUnitAudit.unitid }">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">基层领导意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="baseOpinion" name="baseOpinion" rows="2" >${maintenanceDetail.baseOpinion}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${UNIT_PRODUCT_AUDIT == businessUnitAudit.unitid }">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">生产运营中心意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="productOpinion" name="productOpinion" rows="2" >${maintenanceDetail.productOpinion}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${UNIT_MIDDLE_AUDIT == businessUnitAudit.unitid }">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">中层领导意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="middleOpinion" name="middleOpinion" rows="2" >${maintenanceDetail.middleOpinion}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitAudit.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitAudit.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitAudit.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitAudit.businessid}">
|
||||
<input type="hidden" class="form-control" name ="unitid" value="${businessUnitAudit.unitid}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
|
||||
<input type="hidden" class="form-control" id ="passstatus" name ="passstatus" value=true>
|
||||
<input type="hidden" class="form-control" id ="auditopinion" name ="auditopinion" >
|
||||
<c:if test='${showTargetUsersFlag }'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="Tab2" >
|
||||
<div class="chart" id="tab_detail" style="position: relative;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body">
|
||||
${item.record}
|
||||
<c:forEach items="${item.files}" var="file" >
|
||||
<img src="${localIp}${file.abspath.substring(file.abspath.indexOf('webapps')+7,file.abspath.length())}" height="200" width="200" class="margin">
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
<!-- timeline time label -->
|
||||
<!-- <li class="time-label">
|
||||
<span class="bg-red">
|
||||
10 Feb. 2014
|
||||
</span>
|
||||
</li> -->
|
||||
<!-- /.timeline-label -->
|
||||
<!-- timeline item -->
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- END timeline item -->
|
||||
</div>
|
||||
</div>
|
||||
</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-danger" onclick="processExecute(doBack,${businessUnitAudit.taskid},false)" >驳回</button>
|
||||
<button type="button" class="btn btn-primary" onclick="processExecute(doPass,${businessUnitAudit.taskid},true)" >通过</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
627
src/main/webapp/jsp/maintenance/businessUnit_Handle.jsp
Normal file
627
src/main/webapp/jsp/maintenance/businessUnit_Handle.jsp
Normal file
@ -0,0 +1,627 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%request.setAttribute("Status_Launch",Maintenance.Status_Launch);%>
|
||||
<%request.setAttribute("Status_Edit",Maintenance.Status_Edit);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.problem-bg{
|
||||
margin-bottom:5px;
|
||||
padding-top :5px;
|
||||
padding-bottom :1px;
|
||||
padding-right :10px;
|
||||
padding-left :10px;
|
||||
border-color :#3c8dbc ;
|
||||
border-style: solid;
|
||||
border-width: 2px 2px 2px 2px;
|
||||
border-top-left-radius:10px;
|
||||
border-top-right-radius:10px;
|
||||
border-bottom-left-radius:10px;
|
||||
border-bottom-right-radius:10px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var fileinput = function() {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {masterId:masterId,tbName:tbName,nameSpace:nameSpace} , function(data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
function dolaunch() {
|
||||
var details=getHandleDetailJson();
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$("#detailForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#detailForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var routeNum = $("#routeNum").val();
|
||||
$.post(ext.contextPath + "/maintenance/doHandleDetail.do", $("#subForm").serialize()+"&details="+details+"&routeNum="+routeNum, function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#moneyForm").serialize(), function(result) {
|
||||
if (result.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
}else if(result.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',result.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','处理结果保存失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function dosave() {
|
||||
var details=getHandleDetailJson();
|
||||
$.post(ext.contextPath + "/maintenance/saveHandleDetail.do", $("#subForm").serialize()+"&details="+details, function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#moneyForm").serialize(), function(result) {
|
||||
if (result.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
}else if(result.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',result.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','提交失败');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','处理结果保存失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
function getHandleDetailJson() {
|
||||
var array = "";
|
||||
for(var i=0;i<number;i++){
|
||||
/* if($('#problem'+i).length<=0 ||( $('#problem'+i).val()=="" && $('#handleDetail'+i).val()=="")){
|
||||
continue;
|
||||
} */
|
||||
if($('#handleDetail'+i).length<=0 || $('#handleDetail'+i).val()==""){
|
||||
continue;
|
||||
}
|
||||
var item = {};
|
||||
item['id']=$('#detailId'+i).val();
|
||||
item['problem']=$('#problem'+i).val();
|
||||
item['handledetail']=$('#handleDetail'+i).val();
|
||||
item['detailsupplement']=$('#detailSupplement'+i).val();
|
||||
item['handledt']=$('#handledt'+i).val();
|
||||
item['processsectionid']=$('#processSectionId'+i).val();
|
||||
item['equipmentids']=$('#equipmentIds'+i).val();
|
||||
item['faultlibraryid']=$('#faultLibraryId'+i).val();
|
||||
if(array!=""){
|
||||
array+=","
|
||||
}
|
||||
array+=JSON.stringify(item);
|
||||
}
|
||||
array="["+array+"]";
|
||||
console.info(array)
|
||||
return array;
|
||||
}
|
||||
var masterId='${businessUnitHandle.id}';
|
||||
var tbName='tb_maintenance_file'; //数据表
|
||||
var nameSpace='MaintenanceFile';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:''
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#maintenancefile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenancefile");
|
||||
}else{
|
||||
$('#maintenancefile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
var number=1;
|
||||
function addHandleDetailFun() {
|
||||
var detailId="detailId" +number;
|
||||
var problem ="problem"+number;
|
||||
var handleDetail = "handleDetail"+number;
|
||||
var detailSupplement = "detailSupplement"+number;
|
||||
var handledt ="handledt"+number;
|
||||
var processSectionId ="processSectionId"+number;
|
||||
var equipmentIds="equipmentIds"+number;
|
||||
var equipmentName="equipmentName"+number;
|
||||
var faultLibraryId ="faultLibraryId"+number;
|
||||
|
||||
var handleDetails= JSON.parse('${businessUnitHandleDetails}')
|
||||
var len =handleDetails.length;
|
||||
var detailId_content="";
|
||||
var problem_content="";
|
||||
var handledetail_content="";
|
||||
var detailsupplement_content="";
|
||||
var equipmentNames_content="";
|
||||
var equipmentids_content="";
|
||||
var processsectionid_content="";
|
||||
var handledt_content="";
|
||||
var faultlibraryid_content="";
|
||||
if(len>number){
|
||||
detailId_content=handleDetails[number].id;
|
||||
problem_content=handleDetails[number].problem;
|
||||
handledetail_content=handleDetails[number].handledetail;
|
||||
detailsupplement_content=handleDetails[number].detailsupplement;
|
||||
equipmentNames_content=handleDetails[number].equipmentNames;
|
||||
equipmentids_content=handleDetails[number].equipmentids;
|
||||
processsectionid_content=handleDetails[number].processsectionid;
|
||||
handledt_content=handleDetails[number].handledt;
|
||||
faultlibraryid_content=handleDetails[number].faultlibraryid;
|
||||
}
|
||||
$('#handleDetailList').before(
|
||||
'<div class="problem-bg">'+
|
||||
'<input type="hidden" class="form-control" id ="'+detailId+'" value="'+detailId_content+'">'+
|
||||
'<div class="form-group">'+
|
||||
' <label class="col-sm-2 control-label">*问题描述</label>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <textarea class="form-control" rows="2" id ="'+problem+'" name ="'+problem+'" placeholder="问题描述...">'+problem_content+'</textarea>'+
|
||||
' </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 ="'+handleDetail+'" name ="'+handleDetail+'" placeholder="处理方式...">'+handledetail_content+'</textarea>'+
|
||||
' </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 ="'+detailSupplement+'" name ="'+detailSupplement+'" placeholder="保养材料...">'+detailsupplement_content+'</textarea>'+
|
||||
' </div>'+
|
||||
'</div>'+
|
||||
'<div class="form-group " >'+
|
||||
' <div class="col-sm-2">'+
|
||||
' <label class="control-label">*维护日期</label>'+
|
||||
' </div>'+
|
||||
' '+
|
||||
' <div class="col-sm-10">'+
|
||||
' <div class="input-group date">'+
|
||||
' <div class="input-group-addon">'+
|
||||
' <i class="fa fa-calendar"></i>'+
|
||||
' </div>'+
|
||||
' <input type="text" class="form-control" id="'+handledt+'" name="'+handledt+'" style="width: 182px;">'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
/* ' <div class="form-group " >'+
|
||||
' <label class="control-label col-sm-2">工艺段</label>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <select class="form-control select2" id="'+processSectionId+'" name ="'+processSectionId+'" style="width: 220px;" >'+
|
||||
' </select>'+
|
||||
' </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="'+equipmentName+'" name ="'+equipmentName+'" placeholder="选择相关设备..." onclick="showEquipment4SelectsFun(\'detailForm\',\''+equipmentIds+'\',\''+equipmentName+'\');">'+equipmentNames_content+'</textarea>'+
|
||||
' <input type="hidden" id="'+equipmentIds+'" name ="'+equipmentIds+'" value="'+equipmentids_content+'" ></input>'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
' <div class="form-group " >'+
|
||||
' <label class="control-label col-sm-2">故障类型</label>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <select class="form-control select2" id="'+faultLibraryId+'" name ="'+faultLibraryId+'" style="width: 220px;" >'+
|
||||
' </select>'+
|
||||
' </div>'+
|
||||
' </div>'+ */
|
||||
|
||||
'<div class="form-group ">'+
|
||||
/* '<label class="control-label col-sm-2"></label>'+ */
|
||||
'<div class="col-sm-10 pull-right">'+
|
||||
'<button type="button" class="btn btn-default pull-right" onclick="deleteHandleDetailFun(\''+detailId_content+'\',this);"><i class="fa fa-trash-o"></i> 删除</button>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
);
|
||||
|
||||
initialProcessSection(processSectionId,processsectionid_content);
|
||||
initialHandleDt('detailForm',handledt,handledt_content)
|
||||
initialFaultLibrary(faultLibraryId,faultlibraryid_content);
|
||||
//新增的输入框添加验证
|
||||
$("#detailForm").bootstrapValidator();
|
||||
/* $("#detailForm").data('bootstrapValidator').addField(problem,{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '问题描述不能为空'
|
||||
},
|
||||
}
|
||||
}); */
|
||||
$("#detailForm").data('bootstrapValidator').addField(handleDetail,{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '处理方式不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
$("#detailForm").data('bootstrapValidator').addField(handledt,{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维护日期不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
//console.log(solver);
|
||||
|
||||
//selectSolvetime(solvetime);
|
||||
number++;
|
||||
};
|
||||
function deleteHandleDetailFun(detailId_content,obj) {
|
||||
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) {
|
||||
if(detailId_content!=""){
|
||||
$.post(ext.contextPath + "/maintenance/deleteHandleDetail.do", {id:detailId_content}, function(data) {
|
||||
if(data.res==1){
|
||||
$(obj).parent().parent().parent().remove();
|
||||
}else{
|
||||
showAlert('d','删除失败');
|
||||
}
|
||||
|
||||
},'json');
|
||||
}else{
|
||||
$(obj).parent().parent().parent().remove();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
//初始化工艺段
|
||||
function initialProcessSection(objId,id){
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:'${companyId}'}, function(data) {
|
||||
var selelct_ =$("#"+objId).select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val(id).trigger("change");
|
||||
},'json');
|
||||
};
|
||||
//选择时间
|
||||
function initialHandleDt(formId,objId,dt) {
|
||||
$('#'+objId).datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
$('#'+formId).data('bootstrapValidator')
|
||||
.updateStatus(objId, 'NOT_VALIDATED',null)
|
||||
.validateField(objId);
|
||||
});
|
||||
|
||||
//日期格式需对齐,不然会不准
|
||||
if(dt==null|| dt==""){
|
||||
$('#'+objId).datepicker('setDate','${nowDate.substring(0, 10)}');
|
||||
}else{
|
||||
$('#'+objId).datepicker('setDate',dt.substring(0, 10));
|
||||
}
|
||||
}
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
var companyId='${companyId}';
|
||||
var equipmentIds=$('#'+hiddenId).val();;
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:companyId,equipmentIds:equipmentIds} , function(data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
//初始故障类型
|
||||
function initialFaultLibrary(objId,id){
|
||||
$.post(ext.contextPath + "/maintenance/faultLibrary/getFaultTypesActive.do", function(data) {
|
||||
var selelct_ =$("#"+objId).select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val(id).trigger("change");
|
||||
},'json');
|
||||
};
|
||||
$(function() {
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
|
||||
initialProcessSection('processSectionId0','${businessUnitHandleDetails[0].processsectionid}');
|
||||
initialHandleDt('detailForm','handledt0','${businessUnitHandleDetails[0].handledt}')
|
||||
initialFaultLibrary('faultLibraryId0','${businessUnitHandleDetails[0].faultlibraryid}');
|
||||
var handleDetails= JSON.parse('${businessUnitHandleDetails}')
|
||||
var len =handleDetails.length;
|
||||
while(len>number){
|
||||
addHandleDetailFun();
|
||||
}
|
||||
getFileList();
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '目标人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#moneyForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
actualMoney: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '实际费用不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#detailForm").bootstrapValidator();
|
||||
})
|
||||
//选择出库单
|
||||
var showOutStock4SelectsFun = function() {
|
||||
var companyId='${companyId}';
|
||||
var outStockIds=$('#problem0').val();;
|
||||
$.post(ext.contextPath + '/sparepart/outStockRecord/showOutStockForSelects.do', {
|
||||
formId:"detailForm",textId:"problem0",companyId:companyId,outStockIds:outStockIds,
|
||||
detailSupplement:"detailSupplement0",moneyFormId:"moneyForm",actualMoneyId:"actualMoney"
|
||||
} , function(data) {
|
||||
$("#outStock4SelectDiv").html(data);
|
||||
openModal("outStock4SelectModal");
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">${taskName }</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="detailForm" >
|
||||
<div id="alertDiv"></div>
|
||||
<div class="problem-bg" >
|
||||
<input type="hidden" class="form-control" id ="detailId0" value="${businessUnitHandleDetails[0].id}">
|
||||
<%-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*问题描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="problem0" name ="problem0" placeholder="问题描述...">${businessUnitHandleDetails[0].problem}</textarea>
|
||||
</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 ="handleDetail0" name ="handleDetail0" placeholder="处理内容...">${businessUnitHandleDetails[0].handledetail}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">出库单</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="problem0" name ="problem0" placeholder="请点击选择需要关联的出库单" onclick="showOutStock4SelectsFun();" value="${businessUnitHandleDetails[0].problem}">
|
||||
</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 ="detailSupplement0" name ="detailSupplement0" placeholder="使用材料...">${businessUnitHandleDetails[0].detailsupplement}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group " >
|
||||
<div class="col-sm-2">
|
||||
<label class="control-label">*维护日期</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="handledt0" name="handledt0" style="width: 182px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group " >
|
||||
<label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="processSectionId0" name ="processSectionId0" style="width: 220px;" >
|
||||
</select>
|
||||
</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="equipmentName0" name ="equipmentName0" placeholder="选择相关设备..." onclick="showEquipment4SelectsFun('detailForm','equipmentIds0','equipmentName0');">${businessUnitHandleDetails[0].equipmentNames}</textarea>
|
||||
<input type="hidden" id="equipmentIds0" name ="equipmentIds0" value="${businessUnitHandleDetails[0].equipmentids}" ></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group " >
|
||||
<label class="control-label col-sm-2">故障类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="faultLibraryId0" name ="faultLibraryId0" style="width: 220px;" >
|
||||
</select>
|
||||
</div>
|
||||
</div> --%>
|
||||
</div>
|
||||
<!-- <div class="form-group " id="handleDetailList" >
|
||||
<label class="control-label col-sm-2"></label>
|
||||
<div class="col-sm-10 pull-right" >
|
||||
<button type="button" class="btn btn-default pull-right " onclick="addHandleDetailFun();"><i class="fa fa-plus"></i>添加条目</button>
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
<form class="form-horizontal" id="moneyForm" >
|
||||
<input type="hidden" class="form-control" name ="id" value="${maintenanceDetail.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">实际费用/元</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="actualMoney" name ="actualMoney" placeholder="实际产生费用" value="${maintenanceDetail.actualMoney}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test='${showTargetUsersFlag }'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" value="${targetUsersName}">
|
||||
<input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传证明</button>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenancefile" id="maintenancefile" multiple class="file-loading" />
|
||||
</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()" >保存</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dolaunch()" >提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,318 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT",Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE",Maintenance.TYPE_MAINTENANCE);%>
|
||||
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var showMaintenanceDetailList = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailList4SubList.do', {maintenanceId:id} , function(data) {
|
||||
$("#maintenanceDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
var viewMaintenanceFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceView.do', {id:id} , function(data) {
|
||||
$("#maintenanceDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
function searchFault(){
|
||||
$("#table_handleDetail").bootstrapTable('refresh');
|
||||
//每月故障次数,故障日期
|
||||
$.post(ext.contextPath +"/maintenance/getFaultNumberByEquipmentId.do",{equipmentId: '${param.equipmentId}',yearNum:$('#selectYear').val()},function(data){
|
||||
var jsonBar = data;
|
||||
//console.info(data);
|
||||
var myChart = echarts.init(document.getElementById('faultLine'));
|
||||
// 指定图表的配置项和数据
|
||||
var optionLine = {
|
||||
backgroundColor: '#B9D3EE',
|
||||
title : {
|
||||
text: '设备故障日期',
|
||||
x: 'center'
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'axis',
|
||||
padding: 10,
|
||||
backgroundColor: '#222',
|
||||
borderColor: '#777',
|
||||
borderWidth: 1,
|
||||
formatter: function (obj) {
|
||||
var toolView = obj[0].data;
|
||||
//console.info(toolView);
|
||||
return toolView.name + '<br>'
|
||||
+ '故障次数'+ ':' + toolView.value +'次'+ '<br>'
|
||||
+ '故障日期' + ':' +toolView.timestr + '<br>';
|
||||
}
|
||||
},
|
||||
/* legend: {
|
||||
data:['设备故障次数']
|
||||
}, */
|
||||
toolbox: {
|
||||
show : true,
|
||||
feature : {
|
||||
mark : {show: true},
|
||||
dataView : {show: true, readOnly: false},
|
||||
magicType : {show: true, type: ['line', 'bar']},
|
||||
restore : {show: true},
|
||||
saveAsImage : {show: true}
|
||||
}
|
||||
},
|
||||
calculable : true,
|
||||
xAxis : [
|
||||
{
|
||||
name : '月份',
|
||||
type : 'category',
|
||||
data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#0F0F0F',//左边线的颜色
|
||||
width:'2'//坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#0F0F0F',//坐标值得具体的颜色
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
yAxis : [
|
||||
{ name : '次数',
|
||||
type : 'value',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#0F0F0F',//左边线的颜色
|
||||
width:'2'//坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#0F0F0F',//坐标值得具体的颜色
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series : [
|
||||
{
|
||||
name:'故障次数',
|
||||
type:'line',
|
||||
data:jsonBar,
|
||||
markLine : {
|
||||
data : [
|
||||
{type : 'average',name : '平均值'}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
myChart.setOption(optionLine);
|
||||
},'json');
|
||||
|
||||
|
||||
//故障类型分类饼图
|
||||
$.post(ext.contextPath +"/maintenance/getFaultTypeByEquipmentId.do",{equipmentId: '${param.equipmentId}',yearNum:$('#selectYear').val()},function(data){
|
||||
var faultTypePie;
|
||||
var json = data;
|
||||
var legend = [];
|
||||
$.each(data,function(index,value){
|
||||
legend.push(value.name);
|
||||
});
|
||||
//var date = new Date();
|
||||
var option = {
|
||||
backgroundColor: '#B9D3EE',
|
||||
title: {
|
||||
text: '设备故障类型统计',
|
||||
x: 'center'
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'item',
|
||||
formatter: "{b} : {c} 次"
|
||||
},
|
||||
legend: {
|
||||
orient : 'vertical',
|
||||
x : 'left',
|
||||
data:legend
|
||||
},
|
||||
calculable : true,
|
||||
series : [
|
||||
{
|
||||
|
||||
type:'pie',
|
||||
radius : '55%',//饼图的半径大小
|
||||
center: ['50%', '50%'],//饼图的位置
|
||||
data:json
|
||||
}
|
||||
],
|
||||
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
|
||||
};
|
||||
faultTypePie = echarts.init(document.getElementById('faultTypePie'));
|
||||
faultTypePie.setOption(option);
|
||||
},'json');
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table_handleDetail").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function() {
|
||||
$("#table_handleDetail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getHandleDetailListByEquipmentId.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name:$('#search_name').val(),
|
||||
equipmentId: '${param.equipmentId}',
|
||||
yearNum:$('#selectYear').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'problem', // 返回json数据中的name
|
||||
title: '问题描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'handledt', // 返回json数据中的name
|
||||
title: '处理日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
},{
|
||||
field: 'insuserName', // 返回json数据中的name
|
||||
title: '处理人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'handledetail', // 返回json数据中的name
|
||||
title: '处理详情', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'faultLibraryName', // 返回json数据中的name
|
||||
title: '故障类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}
|
||||
/* ,{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str="";
|
||||
|
||||
str+='<button class="btn btn-default btn-sm" onclick="viewMaintenanceFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||||
//运维流程才能查看详细
|
||||
if(row.type =='${ TYPE_MAINTENANCE}'){
|
||||
str+='<security:authorize buttonUrl="maintenance/showDetail.do">';
|
||||
str+='<button class="btn btn-default btn-sm" onclick="showMaintenanceDetailList(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-file-text-o"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>';
|
||||
str+='</security:authorize>';
|
||||
}
|
||||
str='<div class="btn-group" >'+str+'</div>';
|
||||
return str;
|
||||
}
|
||||
} */
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
setDataCardView("table_handleDetail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#selectYear').datepicker({
|
||||
startView: 'decade',
|
||||
minView: 'decade',
|
||||
format: 'yyyy',
|
||||
maxViewMode: 2,
|
||||
minViewMode:2,
|
||||
autoclose: true
|
||||
}).on('changeDate',function(){
|
||||
searchFault();
|
||||
});
|
||||
$('#selectYear').datepicker('setDate', new Date());
|
||||
//searchFault();
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="handleDetailModal">
|
||||
<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> -->
|
||||
<h4 class="modal-title">设备运维情况</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-inline pull-left" >
|
||||
<label class="input-label">年份:</label>
|
||||
<div class="input-group " >
|
||||
<div class="input-group pull-right input-group-sm" >
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="selectYear" style="width:150px;font-size:15px;">
|
||||
<!-- <div class="input-group-btn ">
|
||||
<button type="button" class="btn btn-default" onclick="searchFault();" ><i class="fa fa-search"></i> 查询</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" >
|
||||
<div id="faultTypePie" style="height:250px;"></div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="box-body" >
|
||||
<div id="faultLine" style="height:400px;"></div>
|
||||
</div>
|
||||
<div class="form-group " >
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="问题描述">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table_handleDetail"></table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,389 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT",Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE",Maintenance.TYPE_MAINTENANCE);%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.problem-bg{
|
||||
margin-bottom:5px;
|
||||
padding-top :5px;
|
||||
padding-bottom :1px;
|
||||
padding-right :10px;
|
||||
padding-left :10px;
|
||||
border-color :#3c8dbc ;
|
||||
border-style: solid;
|
||||
border-width: 2px 2px 2px 2px;
|
||||
border-top-left-radius:10px;
|
||||
border-top-right-radius:10px;
|
||||
border-bottom-left-radius:10px;
|
||||
border-bottom-right-radius:10px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var masterId=$('#maintenanceId').val();
|
||||
var tbName_problem='tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance='tb_maintenance_file'; //数据表
|
||||
var nameSpace='MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDelete:''
|
||||
},
|
||||
deleteUrl:ext.contextPath+"/base/deleteInputFile.do",
|
||||
deleteExtraData:function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function() {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName_problem} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#problemfile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("problemfile");
|
||||
}else{
|
||||
$('#problemfile').hide();
|
||||
}
|
||||
},'json');
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId:masterId,tbName:tbName_maintenance} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#maintenancefile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenancefile");
|
||||
}else{
|
||||
$('#maintenancefile').hide();
|
||||
$('#label_maintenancefile').hide();
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
var number=0;
|
||||
function addHandleDetailFun() {
|
||||
var detailId="detailId" +number;
|
||||
var problem ="problem"+number;
|
||||
var handleDetail = "handleDetail"+number;
|
||||
var handledt ="handledt"+number;
|
||||
var processSectionId ="processSectionId"+number;
|
||||
var equipmentIds="equipmentIds"+number;
|
||||
var equipmentName="equipmentName"+number;
|
||||
var faultLibraryId ="faultLibraryId"+number;
|
||||
|
||||
var handleDetails= JSON.parse('${businessUnitHandleDetails}')
|
||||
var len =handleDetails.length;
|
||||
var detailId_content="";
|
||||
var problem_content="";
|
||||
var handledetail_content="";
|
||||
var equipmentNames_content="";
|
||||
var equipmentids_content="";
|
||||
var processsectionid_content="";
|
||||
var handledt_content="";
|
||||
var faultlibraryid_content="";
|
||||
if(len>number){
|
||||
detailId_content=handleDetails[number].id;
|
||||
problem_content=handleDetails[number].problem;
|
||||
handledetail_content=handleDetails[number].handledetail;
|
||||
equipmentNames_content=handleDetails[number].equipmentNames;
|
||||
equipmentids_content=handleDetails[number].equipmentids;
|
||||
processsectionid_content=handleDetails[number].processsectionid;
|
||||
handledt_content=handleDetails[number].handledt;
|
||||
faultlibraryid_content=handleDetails[number].faultlibraryid;
|
||||
}
|
||||
$('#handleDetailList').append(
|
||||
'<div class="problem-bg">'+
|
||||
'<input type="hidden" class="form-control " id ="'+detailId+'" value="'+detailId_content+'">'+
|
||||
'<div class="form-group">'+
|
||||
' <label class="col-sm-2 ">问题描述</label>'+
|
||||
' <div class="col-sm-10 ">'+
|
||||
' <span >'+problem_content+'</span>'+
|
||||
' </div>'+
|
||||
'</div>'+
|
||||
'<div class="form-group">'+
|
||||
' <label class="col-sm-2 ">处理方式</label>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <span class="">'+handledetail_content+'</span>'+
|
||||
' </div>'+
|
||||
'</div>'+
|
||||
'<div class="form-group " >'+
|
||||
' <div class="col-sm-2">'+
|
||||
' <label class="control-label">维护日期</label>'+
|
||||
' </div>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <div class="input-group date">'+
|
||||
' <div class="input-group-addon">'+
|
||||
' <i class="fa fa-calendar"></i>'+
|
||||
' <input type="text" class="form-control" id="'+handledt+'" name="'+handledt+'" style="width: 182px;">'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
' <div class="col-sm-2">'+
|
||||
' <label class="control-label">*维护日期</label>'+
|
||||
' </div>'+
|
||||
' '+
|
||||
' <div class="col-sm-10">'+
|
||||
' <div class="input-group date">'+
|
||||
' <div class="input-group-addon">'+
|
||||
' <i class="fa fa-calendar"></i>'+
|
||||
' </div>'+
|
||||
' <input type="text" class="form-control" id="'+handledt+'" name="'+handledt+'" style="width: 182px;">'+handledt_content+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
' <div class="form-group " >'+
|
||||
' <label class="control-label col-sm-2">工艺段</label>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <select class="form-control select2" id="'+processSectionId+'" name ="'+processSectionId+'" style="width: 220px;" >'+
|
||||
' </select>'+
|
||||
' </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="'+equipmentName+'" name ="'+equipmentName+'" placeholder="选择相关设备..." onclick="showEquipment4SelectsFun(\'detailForm\',\''+equipmentIds+'\',\''+equipmentName+'\');">'+equipmentNames_content+'</textarea>'+
|
||||
' <input type="hidden" id="'+equipmentIds+'" name ="'+equipmentIds+'" value="'+equipmentids_content+'" ></input>'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
' <div class="form-group " >'+
|
||||
' <label class="control-label col-sm-2">故障类型</label>'+
|
||||
' <div class="col-sm-10">'+
|
||||
' <select class="form-control select2" id="'+faultLibraryId+'" name ="'+faultLibraryId+'" style="width: 220px;" >'+
|
||||
' </select>'+
|
||||
' </div>'+
|
||||
' </div>'+
|
||||
|
||||
'</div>'
|
||||
);
|
||||
|
||||
initialProcessSection(processSectionId,processsectionid_content);
|
||||
//initialHandleDt('detailForm',handledt,handledt_content)
|
||||
initialFaultLibrary(faultLibraryId,faultlibraryid_content);
|
||||
number++;
|
||||
};
|
||||
//初始化工艺段
|
||||
function initialProcessSection(objId,id){
|
||||
$.post(ext.contextPath + "/work/mpoint/getProcessSectionList4Select.do", {companyId:'${companyId}'}, function(data) {
|
||||
var selelct_ =$("#"+objId).select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val(id).trigger("change");
|
||||
},'json');
|
||||
};
|
||||
//选择时间
|
||||
function initialHandleDt(formId,objId,dt) {
|
||||
$('#'+objId).datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
}).on('hide',function(e) {
|
||||
$('#'+formId).data('bootstrapValidator')
|
||||
.updateStatus(objId, 'NOT_VALIDATED',null)
|
||||
.validateField(objId);
|
||||
});
|
||||
|
||||
//日期格式需对齐,不然会不准
|
||||
if(dt==null|| dt==""){
|
||||
$('#'+objId).datepicker('setDate','${nowDate.substring(0, 10)}');
|
||||
}else{
|
||||
$('#'+objId).datepicker('setDate',dt.substring(0, 10));
|
||||
}
|
||||
}
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
var companyId='${companyId}';
|
||||
var equipmentIds=$('#'+hiddenId).val();;
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:companyId,equipmentIds:equipmentIds} , function(data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
//初始故障类型
|
||||
function initialFaultLibrary(objId,id){
|
||||
$.post(ext.contextPath + "/maintenance/faultLibrary/getFaultTypesActive.do", function(data) {
|
||||
var selelct_ =$("#"+objId).select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val(id).trigger("change");
|
||||
},'json');
|
||||
};
|
||||
$(function() {
|
||||
/* var handleDetails= JSON.parse('${businessUnitHandleDetails}')
|
||||
var len =handleDetails.length;
|
||||
while(len>number){
|
||||
//addHandleDetailFun();
|
||||
} */
|
||||
getFileList();
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="handleDetailModal">
|
||||
<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" >
|
||||
<form class="form-horizontal" id="detailForm" >
|
||||
<c:forEach items="${businessUnitHandleDetails}" var="item" varStatus="status">
|
||||
<div class="problem-bg" >
|
||||
<%-- <div class="form-group">
|
||||
<label class="col-sm-2 ">问题描述</label>
|
||||
<div class="col-sm-10">
|
||||
<span >${item.problem}</textarea>
|
||||
</div>
|
||||
</div> --%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">处理内容</label>
|
||||
<div class="col-sm-10">
|
||||
<span >${item.handledetail}</span>
|
||||
</div>
|
||||
</div>
|
||||
<security:authorize buttonUrl="maintenance/showSupplement.do">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">使用材料</label>
|
||||
<div class="col-sm-10">
|
||||
<span >${item.detailsupplement}</span>
|
||||
</div>
|
||||
</div>
|
||||
</security:authorize>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">实际费用</label>
|
||||
<div class="col-sm-10">
|
||||
<span >${maintenanceDetail.actualMoney}元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group " >
|
||||
<div class="col-sm-2">
|
||||
<label >处理日期</label>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<span ><c:if test="${item.handledt!=''}">${item.handledt.substring(0,10)}</c:if></span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<label >处理人员</label>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<span >${item.insuserName}</span>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group " >
|
||||
<label class=" col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<span >${item.processSectionName}</span>
|
||||
</div>
|
||||
<label class=" col-sm-2">故障类型</label>
|
||||
<div class="col-sm-4">
|
||||
<span >${item.faultLibraryName}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">关联设备</label>
|
||||
<div class="col-sm-10">
|
||||
<span >${item.equipmentNames}</span>
|
||||
</div>
|
||||
</div> --%>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
234
src/main/webapp/jsp/maintenance/consume4Selects.jsp
Normal file
234
src/main/webapp/jsp/maintenance/consume4Selects.jsp
Normal file
@ -0,0 +1,234 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchDetail = function() {
|
||||
$("#table_outStockRecordDetail").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectDetail() {
|
||||
//var checkItems = $("#table_outStockRecordDetail").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
doFinishSelects(datas,'${param.workorderId}');
|
||||
closeModal("subPDetailModal");
|
||||
};
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
var dosearchTable = function() {
|
||||
$("#table_outStockRecordDetail").bootstrapTable('refresh');
|
||||
};
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${consumeIds}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${consumeIds}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${consumeIds}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
$(function() {
|
||||
//选择部门
|
||||
// $.post(ext.contextPath + "/user/getDeptByBizId4Select.do", {companyId:'${param.companyId}'}, function(data) {
|
||||
// var selelct = $("#search_code").select2({
|
||||
// data: data,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: false,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
// selelct.val('').trigger("change");
|
||||
// selelct.on("change",function(e){
|
||||
// dosearchTable();
|
||||
// });
|
||||
// },'json');
|
||||
initialSelectionIds();
|
||||
$table=$("#table_outStockRecordDetail").bootstrapTable({
|
||||
url: ext.contextPath + '/maintenance/WorkorderConsume/getOutStockDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
insuser:'insuser'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'goods.name', // 返回json数据中的name
|
||||
title: '物品名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.model', // 返回json数据中的name
|
||||
title: '规格型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'goods.brand', // 返回json数据中的name
|
||||
title: '品牌', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'goods.unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'outNumber', // 返回json数据中的name
|
||||
title: '出库数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: '**', // 返回json数据中的name
|
||||
title: '剩余数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return row.outNumber-row.consumeNumber
|
||||
}
|
||||
}/*,{
|
||||
field: 'totalMoney', // 返回json数据中的name
|
||||
title: '合计/元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_outStockRecordDetail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subPDetailModal">
|
||||
<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 " style="width:100%">
|
||||
<div id="alertDetailDiv"></div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="form-group form-inline" >
|
||||
<!-- <div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="物品名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_outStockRecordDetail" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelectDetail()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
328
src/main/webapp/jsp/maintenance/defectEndRecordAdd.jsp
Normal file
328
src/main/webapp/jsp/maintenance/defectEndRecordAdd.jsp
Normal file
@ -0,0 +1,328 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<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 masterId = '${id}';
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId: masterId, tbName: tbName}, function (data) {
|
||||
//console.info(data)
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
} else {
|
||||
$('#maintenanceDetailFile').hide();
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
var fileinput = function () {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
nameSpace: nameSpace
|
||||
}, function (data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#solver").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "solver",
|
||||
textId: "solvername",
|
||||
userIds: userIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showContacts4SelectsFun = function () {
|
||||
var userIds = $("#contactids").val();
|
||||
var companyId = $("#companyid").val();
|
||||
//alert(companyId)
|
||||
if (null == companyId || '' == companyId) {
|
||||
showAlert('d', "请先选择厂区!");
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "contactids",
|
||||
textId: "contactname",
|
||||
userIds: userIds,
|
||||
companyId: companyId
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('actualFinishDate', 'NOT_VALIDATED', null)
|
||||
.validateField('actualFinishDate');
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var serialData = $("#subForm").serialize();
|
||||
$.post(ext.contextPath + "/maintenance/saveDetail.do", serialData, function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal')
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
solvername: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维护人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
actualFinishDate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '完成日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
problemcontent: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '问题详情不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障设备不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
//初始化日期控件
|
||||
createDatetimepicker('actualFinishDate', 'H');
|
||||
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: "${company.id}"}, function (data) {
|
||||
var selelct_ = $("#processSectionId").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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
getFileList();
|
||||
})
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var equipmentIds = $('#' + hiddenId).val();
|
||||
var pSectionId = $("#processSectionId").val();
|
||||
var companyId = '${company.id}';
|
||||
if (null == companyId || '' == companyId || null == pSectionId || '' == pSectionId) {
|
||||
showAlert('d', "请先选择厂区和工艺段!");
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
companyId: companyId,
|
||||
equipmentIds: equipmentIds,
|
||||
pSectionId: pSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
//选择故障类型,可多选
|
||||
var showProblemType4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var problemTypeIds = $('#' + hiddenId).val();
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultTypeForSelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
problemTypeIds: problemTypeIds
|
||||
}, function (data) {
|
||||
$("#problemTyp4SelectDiv").html(data);
|
||||
openModal("problemTyp4SelectModal");
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name="id" value="${id}">
|
||||
<input type="hidden" class="form-control" name="type" value="${type}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="companyid" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static">${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="processSectionId" name="processSectionId" class="form-control select2"
|
||||
style="width: 270px;" value="">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工单号</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="detailNumber" name="detailNumber" type="hidden"
|
||||
value="${detailNumber}" readonly>
|
||||
<p class="form-control-static">${detailNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*完成日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="actualFinishDate" name="actualFinishDate"
|
||||
style="width: 232px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常详情</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3" id="problemcontent" name="problemcontent"
|
||||
placeholder="异常详情...">${problem }</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile" id="maintenanceDetailFile" multiple
|
||||
class="file-loading"/>
|
||||
</div>--%>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
546
src/main/webapp/jsp/maintenance/defectEndRecordList.jsp
Normal file
546
src/main/webapp/jsp/maintenance/defectEndRecordList.jsp
Normal file
@ -0,0 +1,546 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
|
||||
<%request.setAttribute("Status_Start", MaintenanceDetail.Status_Start);%>
|
||||
<%request.setAttribute("Status_Finish", MaintenanceDetail.Status_Finish);%>
|
||||
<%request.setAttribute("Status_Wait", MaintenanceDetail.Status_Wait);%>
|
||||
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_OVERHAUL", MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_DEFECT", MaintenanceCommString.MAINTENANCE_TYPE_DEFECT);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/editProblem.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewDetailFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('maintenanceDetailModal');
|
||||
});
|
||||
};
|
||||
//维修单
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/doview_defect.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//刷新表格
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
//加载完厂区后,初始化工艺段和表格
|
||||
function initFun() {
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val("").trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
$table = $("#table").bootstrapTable({
|
||||
url: ext.contextPath + '/maintenance/getMaintenanceDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50, 100, 200, 500], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_code: companyId,
|
||||
processSectionId: $('#processSection').val(),
|
||||
type: '${MAINTENANCE_TYPE_DEFECT}',
|
||||
status: '${Status_Finish}',
|
||||
date: $('#reservationtimeD').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px',
|
||||
formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked: true// 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'detailNumber', // 返回json数据中的name
|
||||
title: '工单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '异常情况描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '发起时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'actualFinishDate', // 返回json数据中的name
|
||||
title: '完成时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: '_solverName', // 返回json数据中的name
|
||||
title: '处理人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
/*{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '${Status_Start}' && row.type == '${TYPE_SUPPLEMENT}') {
|
||||
return '处理中';
|
||||
} else if (value == '${Status_Start}') {
|
||||
return '已下发';
|
||||
} else if (value == '${Status_Finish}') {
|
||||
return '已完成';
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}, */
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 80, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')" data-toggle="tooltip" title="浏览"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>'
|
||||
// buts += '<button class="btn btn-default btn-sm" onclick="viewDetailFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
var getExs = function () {
|
||||
var datas = selectionIds;
|
||||
if (datas == 0) {
|
||||
showAlert('d', '请选中之后导出', 'mainAlertdiv');
|
||||
} else {
|
||||
// window.open(ext.contextPath + "/maintenance/downloadListExcel.do?ids=" + datas);
|
||||
var params = {
|
||||
responseType: 'blob',
|
||||
ids: datas
|
||||
};
|
||||
postExcelFile(params, ext.contextPath + '/maintenance/downloadListExcel.do');
|
||||
}
|
||||
}
|
||||
|
||||
function postExcelFile(params, url) { //params是post请求需要的参数,url是请求url地址
|
||||
var form = document.createElement("form");
|
||||
form.style.display = 'none';
|
||||
form.action = url;
|
||||
form.method = "post";
|
||||
document.body.appendChild(form);
|
||||
for (var key in params) {
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = key;
|
||||
input.value = params[key];
|
||||
form.appendChild(input);
|
||||
}
|
||||
form.submit();
|
||||
form.remove();
|
||||
}
|
||||
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union": union, "difference": difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/addEndDefect.do', {bizId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
//进入流程的不能删除
|
||||
/*if (item.status == null || item.status == '') {
|
||||
datas += item.id + ",";
|
||||
}*/
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/deleteDetails.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function () {
|
||||
companyId = unitId;
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
initFun();
|
||||
initDate1();
|
||||
$('#reservationtimeD').val('');
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="handleDetailDiv"></div>
|
||||
<div id="maintainPlanDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div>
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/supplement_defect.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 补录
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<c:if test="${userId == 'emp01'}">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</c:if>
|
||||
|
||||
<security:authorize buttonUrl="maintenance/export_defect.do.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="getExs();"><i
|
||||
class="fa fa-file-excel-o" aria-hidden="true"></i> 批量导出
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline hidden-xs">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label ">工艺段:</label>
|
||||
<select id="processSection" class="form-control select2 " style="width: 160px;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; border-radius: 5px;"
|
||||
id="reservationtimeD" placeholder="请选择日期">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" style="height: 34px;"
|
||||
class="form-control pull-right"
|
||||
placeholder="问题描述">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height: 34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc" + "ript>")
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc" + "ript>")
|
||||
</script>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<%--文件上传 minio--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
</html>
|
||||
150
src/main/webapp/jsp/maintenance/defectListView.jsp
Normal file
150
src/main/webapp/jsp/maintenance/defectListView.jsp
Normal file
@ -0,0 +1,150 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%request.setAttribute("Status_Start",MaintenanceDetail.Status_Start);%>
|
||||
<%request.setAttribute("Status_Finish",MaintenanceDetail.Status_Finish);%>
|
||||
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR",MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_OVERHAUL",MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN",MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN);%>
|
||||
<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 viewDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('maintenanceDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getDefectList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
ids : '${ids}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow:function(row){
|
||||
viewDetailFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
/*{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'companyName', // 返回json数据中的name
|
||||
title: '厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' ,
|
||||
formatter:function(value,row,index){
|
||||
//新数据直接保存维护公司信息,老数据只含有运维信息
|
||||
if(row.company!=null){
|
||||
return row.company.name;
|
||||
}else if(row.maintenance!=null){
|
||||
return row.maintenance.company.name;
|
||||
}else{
|
||||
return "--";
|
||||
}
|
||||
|
||||
}
|
||||
}, */ {
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '问题描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '发起时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '${MAINTENANCE_TYPE_REPAIR}':
|
||||
return '缺陷';
|
||||
case '${MAINTENANCE_TYPE_OVERHAUL}':
|
||||
return '检修';
|
||||
case '${MAINTENANCE_TYPE_MAINTAIN}':
|
||||
return '保养';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '问题状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index){
|
||||
if(value == '${Status_Start}' && row.type == '${TYPE_SUPPLEMENT}'){
|
||||
return '处理中';
|
||||
}else if(value == '${Status_Start}'){
|
||||
return '已下发';
|
||||
}else if(value == '${Status_Finish}'){
|
||||
return '已完成';
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
378
src/main/webapp/jsp/maintenance/defectRecordAdd.jsp
Normal file
378
src/main/webapp/jsp/maintenance/defectRecordAdd.jsp
Normal file
@ -0,0 +1,378 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<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 masterId = '${id}';
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();*/
|
||||
|
||||
var masterId = '${id}';
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
/*function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}*/
|
||||
|
||||
//名称定义不可修改
|
||||
/*var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId: masterId, tbName: tbName}, function (data) {
|
||||
//console.info(data)
|
||||
/!*if(data.length>0){
|
||||
previews=new Array();
|
||||
$('#maintenancefile').show();
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");;
|
||||
previews.push(path);
|
||||
previewConfig['width']= '50px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
}*!/
|
||||
|
||||
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
} else {
|
||||
$('#maintenanceDetailFile').hide();
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
};*/
|
||||
|
||||
var fileinput = function () {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
nameSpace: nameSpace
|
||||
}, function (data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#solver").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "solver",
|
||||
textId: "solvername",
|
||||
userIds: userIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showContacts4SelectsFun = function () {
|
||||
var userIds = $("#contactids").val();
|
||||
var companyId = $("#companyid").val();
|
||||
//alert(companyId)
|
||||
if (null == companyId || '' == companyId) {
|
||||
showAlert('d', "请先选择厂区!");
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "contactids",
|
||||
textId: "contactname",
|
||||
userIds: userIds,
|
||||
companyId: companyId
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
/* function dolaunch() {
|
||||
$('#status').val('${Status_Launch}')
|
||||
dosave();
|
||||
} */
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('solvername', 'NOT_VALIDATED', null)
|
||||
.validateField('solvername');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
//select置为disable后不能返回值到后台
|
||||
$("#companyid").removeAttr("disabled");
|
||||
var serialData = $("#subForm").serialize();
|
||||
$("#companyid").attr("disabled", "disabled");
|
||||
$.post(ext.contextPath + "/maintenance/startDetail.do", serialData, function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal')
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else if (data.res == 2) {
|
||||
showAlert('d', '未检测到缺陷处理流程,请先部署维修处理路线!');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
solvername: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维护人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
plannedenddt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '预计完成日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
problemcontent: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '问题详情不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障设备不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
//加载文件
|
||||
getFileListMinioPic('abnormityFileId', 'edit', '${id}', previews, previewConfigs);
|
||||
|
||||
$('#plannedenddt').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('plannedenddt', 'NOT_VALIDATED', null)
|
||||
.validateField('plannedenddt');
|
||||
});
|
||||
$('#plannedenddt').datepicker('setDate', '${nowDate.substring(0, 10)}');
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: "${company.id}"}, function (data) {
|
||||
var selelct_ = $("#processSectionId").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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
// getFileList();
|
||||
})
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var equipmentIds = $('#' + hiddenId).val();
|
||||
var pSectionId = $("#processSectionId").val();
|
||||
var companyId = '${company.id}';
|
||||
if (null == companyId || '' == companyId || null == pSectionId || '' == pSectionId) {
|
||||
showAlert('d', "请先选择厂区和工艺段!");
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
companyId: companyId,
|
||||
equipmentIds: equipmentIds,
|
||||
pSectionId: pSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
//选择故障类型,可多选
|
||||
var showProblemType4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var problemTypeIds = $('#' + hiddenId).val();
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultTypeForSelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
problemTypeIds: problemTypeIds
|
||||
}, function (data) {
|
||||
$("#problemTyp4SelectDiv").html(data);
|
||||
openModal("problemTyp4SelectModal");
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name="id" value="${id}">
|
||||
<input type="hidden" class="form-control" name="type" value="${type}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="companyid" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static">${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="processSectionId" name="processSectionId" class="form-control select2"
|
||||
style="width: 270px;" value="">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工单号</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" id="detailNumber" name="detailNumber" type="text"
|
||||
value="${detailNumber}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常详情</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3" id="problemcontent" name="problemcontent"
|
||||
placeholder="异常详情...">${problem }</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接收人员</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="solvername" name="solvername"
|
||||
placeholder="请选择接收人员" onclick="showUser4SelectsFun();">
|
||||
<input id="solver" name="solver" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile" id="maintenanceDetailFile" multiple
|
||||
class="file-loading"/>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('maintenanceDetailFile')"
|
||||
id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="abnormityFileId" id="abnormityFileId" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">发起</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
377
src/main/webapp/jsp/maintenance/defectRecordAudit.jsp
Normal file
377
src/main/webapp/jsp/maintenance/defectRecordAudit.jsp
Normal file
@ -0,0 +1,377 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%request.setAttribute("Status_Launch", Maintenance.Status_Launch);%>
|
||||
<%request.setAttribute("Status_Edit", Maintenance.Status_Edit);%>
|
||||
|
||||
<% request.setAttribute("UNIT_AUDIT", BusinessUnit.UNIT_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_BASE_AUDIT", BusinessUnit.UNIT_BASE_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_PRODUCT_AUDIT", BusinessUnit.UNIT_PRODUCT_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_CENTER_AUDIT", BusinessUnit.UNIT_CENTER_AUDIT);%>
|
||||
<% request.setAttribute("PASS", CommString.ACTI_Condition_PASS);%>
|
||||
<% request.setAttribute("FATL", CommString.ACTI_Condition_FAIL);%>
|
||||
<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 masterId = '${maintenanceDetail.id}';
|
||||
var tbName = 'tb_maintenance_file'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var status = 'view';//不可删除
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#targetusers").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var fileinput = function () {
|
||||
$.post(ext.contextPath + '/base/fileinputMinio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
nameSpace: nameSpace
|
||||
}, function (data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
|
||||
function doSubmit() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED', null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#detailForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/maintenance/doAuditDetail.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
/*var getFileList = function () {
|
||||
// $.post(ext.contextPath + '/base/getInputFileList.do', {
|
||||
$.post(ext.contextPath + '/base/getInputFileList_minio.do', {
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
bucketName: bucketName
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfig['showRemove'] = true;//不显示移除按钮
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput("maintenanceDetailFile");
|
||||
} else {
|
||||
$('#maintenanceDetailFile').hide();
|
||||
}
|
||||
}, 'json');
|
||||
};*/
|
||||
|
||||
$(function () {
|
||||
// getFileList();
|
||||
|
||||
//加载文件
|
||||
getFileListMinioPic('maintenanceDetailFile', 'view', masterId, previews, previewConfigs);
|
||||
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNode("${businessUnitAudit.taskid}");
|
||||
|
||||
$('#plannedenddt').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('plannedenddt', 'NOT_VALIDATED', null)
|
||||
.validateField('plannedenddt');
|
||||
});
|
||||
|
||||
//计划费用保留两位小数
|
||||
$("#planMoney").val(parseFloat('${maintenanceDetail.planMoney}').toFixed(2))
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '下一级人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//显示流程详情
|
||||
var id = '${maintenanceDetail.id}';
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {
|
||||
id: id,
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${maintenanceDetail.company.id}'}, function (data) {
|
||||
var selelct_ = $("#processSectionId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${maintenanceDetail.processSectionId}').trigger("change");
|
||||
selelct_.on("change", function () {
|
||||
$("#equipmentIds").val("");
|
||||
$("#equipname").val("");
|
||||
})
|
||||
}, 'json');
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">${taskName}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<form class="form-horizontal" id="detailForm" enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" name="id" value="${maintenanceDetail.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="companyid" id="companyid" type="hidden"
|
||||
value="${maintenanceDetail.company.id}"/>
|
||||
<p class="form-control-static">${maintenanceDetail.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工单号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${maintenanceDetail.detailNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<%--<select id="processSectionId" name="processSectionId" class="form-control select2"
|
||||
style="width: 205px;" value="" >
|
||||
</select>--%>
|
||||
<p class="form-control-static">${maintenanceDetail.processSection.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">完成日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<%--<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>--%>
|
||||
<%--<input type="text" class="form-control" id="submittime" name="submittime"
|
||||
style="width: 165px;"
|
||||
value="${maintenanceDetail.submittime.substring(0,10)}">--%>
|
||||
<p class="form-control-static">${maintenanceDetail.submittime.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<%--<input class="form-control" id="planMoney" name="planMoney" type="number"
|
||||
value="${maintenanceDetail.planMoney}" min="0" step="50.01"
|
||||
placeholder="请输入">--%>
|
||||
<p class="form-control-static">${maintenanceDetail.planMoney}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">实际费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<%--<input class="form-control" id="actualMoney" name="actualMoney" type="number"
|
||||
value="${maintenanceDetail.actualMoney}" min="0" step="50.01"
|
||||
placeholder="请输入">--%>
|
||||
<p class="form-control-static">${maintenanceDetail.actualMoney}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">异常详情</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3" id="problemcontent" name="problemcontent"
|
||||
placeholder="异常详情..." readonly>${maintenanceDetail.problemcontent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name="id" value="${businessUnitAudit.id}">
|
||||
<input type="hidden" class="form-control" name="processid"
|
||||
value="${businessUnitAudit.processid}">
|
||||
<input type="hidden" class="form-control" name="taskid" value="${businessUnitAudit.taskid}">
|
||||
<input type="hidden" class="form-control" name="businessid"
|
||||
value="${businessUnitAudit.businessid}">
|
||||
<input type="hidden" class="form-control" name="unitid" value="${businessUnitAudit.unitid}">
|
||||
<input type="hidden" class="form-control" name="taskdefinitionkey"
|
||||
value="${businessUnitAudit.taskdefinitionkey}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核结果</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="passstatus" name="passstatus"
|
||||
style="width: 270px;">
|
||||
<option value=true>通过</option>
|
||||
<option value=false>驳回</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name="routeNum"
|
||||
style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="reject" class="form-group">
|
||||
<label class="col-sm-2 control-label">*处理意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="auditopinion" name="auditopinion"
|
||||
placeholder="处理意见"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName"
|
||||
placeholder="下一级人员" onclick="showUser4SelectsFun();">
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()"
|
||||
id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile" id="maintenanceDetailFile" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-xs-12" id="showView"></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="doSubmit()" id="btn_submit">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
367
src/main/webapp/jsp/maintenance/defectRecordHandle.jsp
Normal file
367
src/main/webapp/jsp/maintenance/defectRecordHandle.jsp
Normal file
@ -0,0 +1,367 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%request.setAttribute("Status_Launch", Maintenance.Status_Launch);%>
|
||||
<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 masterId = '${maintenanceDetail.id}';
|
||||
var tbName = 'tb_maintenance_file'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var status = 'delete';//可删除
|
||||
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
//保养任务提交审核
|
||||
function submitFun() {
|
||||
$('#subUnitForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED', null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#subForm").serialize(), function (data) {
|
||||
var routeNum = $("#routeNum").val();
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/maintenance/doHandleAdjust.do", $("#subUnitForm").serialize() + "&routeNum=" + routeNum, function (unitdata) {
|
||||
if (unitdata.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (unitdata.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var equipmentIds = $('#' + hiddenId).val();
|
||||
var pSectionId = $("#processSectionId").val();
|
||||
var companyId = '${maintenanceDetail.company.id}';
|
||||
if (null == companyId || '' == companyId || null == pSectionId || '' == pSectionId) {
|
||||
showAlert('d', "请先选择厂区和工艺段!");
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForAbnormitySelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
companyId: companyId,
|
||||
equipmentIds: equipmentIds,
|
||||
pSectionId: pSectionId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
//选择故障类型,可多选
|
||||
var showProblemType4SelectsFun = function (formId, hiddenId, textId) {
|
||||
var problemTypeIds = $('#' + hiddenId).val();
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultTypeForSelects.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId,
|
||||
problemTypeIds: problemTypeIds
|
||||
}, function (data) {
|
||||
$("#problemTyp4SelectDiv").html(data);
|
||||
openModal("problemTyp4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function () {
|
||||
|
||||
//加载文件
|
||||
getFileListMinioPic('abnormityFileId', 'edit', masterId, previews, previewConfigs);
|
||||
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
problemcontent: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '保养内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$("#subUnitForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$('#submittime').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('submittime', 'NOT_VALIDATED', null)
|
||||
.validateField('submittime');
|
||||
});
|
||||
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${maintenanceDetail.company.id}'}, function (data) {
|
||||
var selelct_ = $("#processSectionId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${maintenanceDetail.processSectionId}').trigger("change");
|
||||
selelct_.on("change", function () {
|
||||
$("#equipmentIds").val("");
|
||||
$("#equipname").val("");
|
||||
})
|
||||
}, 'json');
|
||||
|
||||
//计划保养费用保留两位小数
|
||||
$("#planMoney").val(parseFloat('${maintenanceDetail.planMoney}').toFixed(2))
|
||||
|
||||
//显示流程详情
|
||||
var id = '${maintenanceDetail.id}';
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {
|
||||
id: id,
|
||||
inModal: 'inModal',
|
||||
}, function (data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#targetusers").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subUnitForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">${taskName}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${maintenanceDetail.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="companyid" id="companyid" type="hidden"
|
||||
value="${maintenanceDetail.company.id}"/>
|
||||
<p class="form-control-static">${maintenanceDetail.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工单号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${maintenanceDetail.detailNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="processSectionId" name="processSectionId" class="form-control select2"
|
||||
style="width: 205px;"
|
||||
value="">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">完成日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="submittime" name="submittime"
|
||||
style="width: 165px;"
|
||||
value="${nowTime}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="planMoney" name="planMoney" type="number"
|
||||
value="${maintenanceDetail.planMoney}" min="0" step="50.01" placeholder="请输入"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">实际费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="actualMoney" name="actualMoney" type="number"
|
||||
value="${maintenanceDetail.actualMoney}" min="0" step="50.01"
|
||||
placeholder="请输入"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*异常详情</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3" id="problemcontent" name="problemcontent"
|
||||
placeholder="问题详情...">${maintenanceDetail.problemcontent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic()"
|
||||
id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenanceDetailFile_handle" id="maintenanceDetailFile_handle" multiple
|
||||
class="file-loading"/>
|
||||
</div>--%>
|
||||
|
||||
<div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file"
|
||||
onclick="fileinputPic('abnormityFileId')"
|
||||
id="btn_save"><i
|
||||
class="fa fa-paperclip"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="abnormityFileId" id="abnormityFileId" multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!--维修审核退回后显示 -->
|
||||
<form class="form-horizontal" id="subUnitForm" enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" name="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name="processid"
|
||||
value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name="taskid"
|
||||
value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name="businessid"
|
||||
value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name="taskdefinitionkey"
|
||||
value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<%-- <input type="hidden" class="form-control" id= "targetusers" name ="targetusers" value="${businessUnitHandle.targetusers}"> --%>
|
||||
<input type="hidden" class="form-control" name="unitid"
|
||||
value="${businessUnitHandle.unitid}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">处理内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="handledetail" name="handledetail" rows="2"
|
||||
placeholder="处理内容">${businessUnitHandle.handledetail}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name="routeNum"
|
||||
style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName"
|
||||
placeholder="下一级人员"
|
||||
onclick="showUser4SelectsFun();" autocomplete="off">
|
||||
<input id="targetusers" name="targetusers" type="hidden"
|
||||
value="${businessUnitHandle.targetusers}"/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView"></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="doupdate()" id="btn_update">保存</button>--%>
|
||||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
481
src/main/webapp/jsp/maintenance/defectRecordList.jsp
Normal file
481
src/main/webapp/jsp/maintenance/defectRecordList.jsp
Normal file
@ -0,0 +1,481 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%request.setAttribute("Status_Start", MaintenanceDetail.Status_Start);%>
|
||||
<%request.setAttribute("Status_Finish", MaintenanceDetail.Status_Finish);%>
|
||||
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_OVERHAUL", MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_DEFECT", MaintenanceCommString.MAINTENANCE_TYPE_DEFECT);%>
|
||||
|
||||
<%@page import="com.sipai.entity.activiti.ProcessType" %>
|
||||
<%request.setAttribute("B_Maintenance", ProcessType.B_Maintenance.getId());%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<%--文件上传 minio--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//跳转至待办
|
||||
function TaskListFun4Type() {
|
||||
// 厂id后面的-3是 缺陷单的意思
|
||||
window.parent.addTab('taskList', '待办事项', 'activiti/workflow/taskList.do?modelKey=${B_Maintenance}-' + unitId + '-3');
|
||||
}
|
||||
/**
|
||||
新增缺陷处理
|
||||
*/
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/addDefect.do', {bizId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/editProblem.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewDetailFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('maintenanceDetailModal');
|
||||
});
|
||||
};
|
||||
//维修单
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
/*$.post(ext.contextPath + '/maintenance/viewMaintain.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});*/
|
||||
$.post(ext.contextPath + '/maintenance/doview_defect.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
//进入流程的不能删除
|
||||
/*if (item.status == null || item.status == '') {
|
||||
datas += item.id + ",";
|
||||
}*/
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/deleteDetails.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//刷新表格
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
//加载完厂区后,初始化工艺段和表格
|
||||
function initFun() {
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val("").trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getMaintenanceDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50, 100, 200, 500], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_code: companyId,
|
||||
processSectionId: $('#processSection').val(),
|
||||
type: '${MAINTENANCE_TYPE_DEFECT}',
|
||||
date: $('#reservationtimeD').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true,
|
||||
width: '40px',
|
||||
formatter: function (value, row, index) {
|
||||
/*if (row.status == null || row.status == '') {
|
||||
return {disabled: false}
|
||||
} else {
|
||||
return {disabled: true}
|
||||
}*/
|
||||
return {disabled: false}
|
||||
}
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%'
|
||||
}, {
|
||||
field: 'processSection.sname', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
}, {
|
||||
field: 'detailNumber', // 返回json数据中的name
|
||||
title: '工单编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
}, {
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '异常情况描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '26%'
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '发起时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: '_solverName', // 返回json数据中的name
|
||||
title: '处理人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return value;
|
||||
}
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%',
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '${Status_Start}' && row.type == '${TYPE_SUPPLEMENT}') {
|
||||
return '处理中';
|
||||
} else if (value == '${Status_Start}') {
|
||||
return '已下发';
|
||||
} else if (value == '${Status_Finish}') {
|
||||
return '已完成';
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')" data-toggle="tooltip" title="浏览"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>'
|
||||
// buts += '<button class="btn btn-default btn-sm" onclick="viewDetailFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
|
||||
buts += '<button type="button" class="btn btn-default btn-sm" title="处理" onclick="TaskListFun4Type(\'' + row.id + '\')"><i class="fa fa-play"></i><span class="hidden-md hidden-lg"> 处理</span></button>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function () {
|
||||
companyId = unitId;
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
initFun();
|
||||
initDate1();
|
||||
$('#reservationtimeD').val('');
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<%--<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>--%>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="handleDetailDiv"></div>
|
||||
<div id="maintainPlanDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div>
|
||||
<!-- <div class="form-group " style="margin-bottom:10px;">
|
||||
<label class="form-label" >公司:</label>
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
<span id="companyName" style="width:220px;border: none;background: transparent;" ></span>
|
||||
</div> -->
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/addDetail.do">
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
|
||||
<c:if test="${userId == 'emp01'}">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</c:if>
|
||||
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline hidden-xs">
|
||||
<div class="form-group">
|
||||
<label class="form-label ">工艺段:</label>
|
||||
<select id="processSection" class="form-control select2 " style="width: 160px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; border-radius: 5px;"
|
||||
id="reservationtimeD" placeholder="请选择日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" style="height: 34px;"
|
||||
class="form-control pull-right"
|
||||
placeholder="问题描述">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height: 34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
359
src/main/webapp/jsp/maintenance/defectRecordListApp.jsp
Normal file
359
src/main/webapp/jsp/maintenance/defectRecordListApp.jsp
Normal file
@ -0,0 +1,359 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@page import="com.sipai.entity.workorder.WorkorderDetail" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
|
||||
<%request.setAttribute("Status_Start", WorkorderDetail.Status_Start);%>
|
||||
<%request.setAttribute("Status_Cancel", WorkorderDetail.Status_Cancel);%>
|
||||
<%request.setAttribute("Status_Finish", WorkorderDetail.Status_Finish);%>
|
||||
<%request.setAttribute("Status_Compete", WorkorderDetail.Status_Compete);%>
|
||||
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_OVERHAUL", MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN);%>
|
||||
|
||||
<%request.setAttribute("REPAIR", WorkorderDetail.REPAIR);%>
|
||||
<%request.setAttribute("MAINTAIN", WorkorderDetail.MAINTAIN);%>
|
||||
<%request.setAttribute("ANTISEPTIC", WorkorderDetail.ANTISEPTIC);%>
|
||||
<%request.setAttribute("LUBRICATION", WorkorderDetail.LUBRICATION);%>
|
||||
<%request.setAttribute("INSTRUMENT", WorkorderDetail.INSTRUMENT);%>
|
||||
|
||||
<%request.setAttribute("planIn", WorkorderDetail.planIn);%>
|
||||
<%request.setAttribute("planOut", WorkorderDetail.planOut);%>
|
||||
|
||||
<%request.setAttribute("smallRepair", WorkorderDetail.smallRepair);%>
|
||||
<%request.setAttribute("middleRepair", WorkorderDetail.middleRepair);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<%--文件上传 minio--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.contentAPPTitle .col-xs-3, .contentAPPTitle .col-xs-4 {
|
||||
padding-right: 5px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.contentAPPTitle .select2-container .select2-selection--single {
|
||||
font-size: 12px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.contentAPPTitle .select2-selection__arrow {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.contentAPPTitle .select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
color: #444;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
#contentAPPBody .col-xs-3, #contentAPPBody .col-xs-6, #contentAPPBody .col-xs-12 {
|
||||
padding-right: 0px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#contentAPP .panel {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#contentAPP .row {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#contentAPP .panel-body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#contentAPP .app-fontSize-18 {
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#contentAPP .app-title, .app-datetime {
|
||||
color: #9f9f9f;
|
||||
}
|
||||
|
||||
#contentAPP .app-content {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.status {
|
||||
color: #ff9d2b;
|
||||
border: 2px solid #ff9d2b;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
//新增
|
||||
var addFun = function () {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/workorder/workorderDetail/doAddRepair.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//浏览
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/doview_defect.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//弹窗 异常单
|
||||
var viewFunAbnormity = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doview_new.do', {id: id, ycCount: 1}, function (data) {
|
||||
$("#subDivAbnormity").html(data);
|
||||
openModal('subAbnormalModal');
|
||||
});
|
||||
};
|
||||
|
||||
var companyId = unitId;
|
||||
$(function () {
|
||||
companyId = unitId;
|
||||
// refreshtypeForSelect();
|
||||
|
||||
initAPP();
|
||||
|
||||
/*var statusSelectAPP = $("#statusSelectAPP").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
placeholder: '状态',
|
||||
}).val('all').trigger("change");
|
||||
statusSelectAPP.on("change", function (e) {
|
||||
initAPP();
|
||||
});*/
|
||||
var statusSelectAPP = $("#statusSelectAPP").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
statusSelectAPP.on("change", function (e) {
|
||||
initAPP();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function initAPP() {
|
||||
var htmlStr = '<div class="panel panel-default">' +
|
||||
'<div class="panel-body text-center">正在努力加载的数据中,请稍后......</div>' +
|
||||
'</div>';
|
||||
$("#contentAPPBody").html(htmlStr);
|
||||
var list = {
|
||||
type: 'repair',
|
||||
unitId: '${unitId}',
|
||||
statusSelectAPP: $("#statusSelectAPP").val()
|
||||
};
|
||||
// 存在
|
||||
$.ajax({
|
||||
//请求方式
|
||||
type: "POST",
|
||||
//请求的媒体类型
|
||||
// contentType: "application/json;charset=UTF-8",
|
||||
//请求地址
|
||||
url: ext.contextPath + '/maintenance/getMaintenanceDetailList4APP.do',
|
||||
//数据,json字符串
|
||||
data: list,
|
||||
dataType: "json",
|
||||
//请求成功
|
||||
success: function (result) {
|
||||
// console.log(result);
|
||||
htmlStr = '';
|
||||
if (result.length > 0) {
|
||||
$.each(result, function (key, value) {
|
||||
var actualFinishDate = '-';
|
||||
var statusName = '-'
|
||||
if (value.actualFinishDate != null) {
|
||||
actualFinishDate = value.actualFinishDate.substring(0, 19);
|
||||
}
|
||||
var status = $("#statusSelectAPP").val();
|
||||
if (status == '0') {
|
||||
status = '处理中';
|
||||
} else {
|
||||
status = '已完成';
|
||||
}
|
||||
|
||||
var str = "";
|
||||
str += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + value.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">浏览</span></button>';
|
||||
htmlStr += '<div class="panel panel-default">' +
|
||||
'<div class="panel-body app-title">' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">缺陷编号:</div>' +
|
||||
'<div class="col-xs-6 app-datetime">' + value.detailNumber + '</div>' +
|
||||
'<div class="col-xs-3"><span class="status">' + status + '</span></div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">维修时间:</div>' +
|
||||
'<div class="col-xs-9 app-datetime">' + actualFinishDate + '</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">故障现象:</div>' +
|
||||
'<div class="col-xs-9 app-datetime">' + value.problemcontent + '</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-xs-3">操作:</div><div class="col-xs-9"><div class="btn-group app-content" >' + str + '</div></div>' +
|
||||
// '<div class="col-xs-3"><span class="status">' + '处理中' + '</span></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
})
|
||||
} else {
|
||||
htmlStr = '<div class="panel panel-default">' +
|
||||
'<div class="panel-body text-center">没有找到匹配的记录</div>' +
|
||||
'</div>';
|
||||
}
|
||||
$("#contentAPPBody").html(htmlStr);
|
||||
},
|
||||
//请求失败,包含具体的错误信息
|
||||
error: function (e) {
|
||||
console.log(e.status);
|
||||
console.log(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivAbnormity"></div>
|
||||
<div id="subDiv_achievement"></div>
|
||||
<div id="subDivDetail"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="handleDetailDiv"></div>
|
||||
<div id="maintainPlanDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
|
||||
<div id="library4SelectDiv"></div>
|
||||
|
||||
<%--<div>
|
||||
<div class="row contentAPPTitle">
|
||||
<div class="col-xs-12">
|
||||
<div class="col-xs-4">
|
||||
<select class="form-control select2 input-sm " id="statusSelectAPP"
|
||||
name="statusSelectAPP" style="width: 100%;float: left;">
|
||||
<option value="0">未完成</option>
|
||||
<option value="1">已完成</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contentAPP">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body text-center">正在努力加载的数据中,请稍后......</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>--%>
|
||||
|
||||
|
||||
<div id="contentAPP">
|
||||
<div class="row contentAPPTitle">
|
||||
<div class="col-xs-12">
|
||||
<%--<div class="col-xs-4">
|
||||
<select class="form-control select2 input-sm " name="statusSelectAPP">
|
||||
<option value="${Start}">待处理</option>
|
||||
<option value="${Processing}">处理中</option>
|
||||
<option value="${Clear}">已销单</option>
|
||||
<option value="${Finish}">已完成</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<select class="form-control select2 input-sm " name="statusSelectAPP">
|
||||
<option value="${Start}">待处理</option>
|
||||
<option value="${Processing}">处理中</option>
|
||||
<option value="${Clear}">已销单</option>
|
||||
<option value="${Finish}">已完成</option>
|
||||
</select>
|
||||
</div>--%>
|
||||
<div class="col-xs-3">
|
||||
<select class="form-control select2 input-sm " id="statusSelectAPP" name="statusSelectAPP">
|
||||
<option value="0">处理中</option>
|
||||
<%--<option value="${Status_Compete}">待抢单</option>
|
||||
<option value="${Status_Cancel}">已取消</option>--%>
|
||||
<option value="1">已完成</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-left" id="contentAPPBody">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body text-center">正在努力加载的数据中,请稍后......</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc" + "ript>")
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc" + "ript>")
|
||||
</script>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
180
src/main/webapp/jsp/maintenance/defectRecordView.jsp
Normal file
180
src/main/webapp/jsp/maintenance/defectRecordView.jsp
Normal file
@ -0,0 +1,180 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%request.setAttribute("Status_Launch", Maintenance.Status_Launch);%>
|
||||
<%request.setAttribute("Status_Edit", Maintenance.Status_Edit);%>
|
||||
|
||||
<% request.setAttribute("UNIT_AUDIT", BusinessUnit.UNIT_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_BASE_AUDIT", BusinessUnit.UNIT_BASE_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_PRODUCT_AUDIT", BusinessUnit.UNIT_PRODUCT_AUDIT);%>
|
||||
<% request.setAttribute("UNIT_CENTER_AUDIT", BusinessUnit.UNIT_CENTER_AUDIT);%>
|
||||
<% request.setAttribute("PASS", CommString.ACTI_Condition_PASS);%>
|
||||
<% request.setAttribute("FATL", CommString.ACTI_Condition_FAIL);%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<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 masterId = '${maintenanceDetail.id}';
|
||||
var tbName = 'tb_maintenance_file'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var status = 'view';//不可删除
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#targetusers").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
//加载文件
|
||||
getFileListMinioPic('maintenanceDetailFile_view', 'view', masterId, previews, previewConfigs);
|
||||
|
||||
$('#plannedenddt').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('plannedenddt', 'NOT_VALIDATED', null)
|
||||
.validateField('plannedenddt');
|
||||
});
|
||||
|
||||
//计划费用保留两位小数
|
||||
$("#planMoney").val(parseFloat('${maintenanceDetail.planMoney}').toFixed(2))
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '下一级人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//显示流程详情
|
||||
var id = '${maintenanceDetail.id}';
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {
|
||||
id: id,
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView_viewSS").html(data);
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<form class="form-horizontal" id="detailForm" enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" name="id" value="${maintenanceDetail.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">缺陷编号</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${maintenanceDetail.detailNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="companyid" id="companyid" type="hidden"
|
||||
value="${maintenanceDetail.company.id}"/>
|
||||
<p class="form-control-static">${maintenanceDetail.company.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${maintenanceDetail.processSection.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">${maintenanceDetail._solverName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">完成时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<p class="form-control-static">${maintenanceDetail.actualFinishDate.substring(0,19)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${maintenanceDetail.planMoney}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">实际费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${maintenanceDetail.actualMoney}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">缺陷详情</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${maintenanceDetail.problemcontent}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">完成图片</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="maintenanceDetailFile_view" id="maintenanceDetailFile_view"
|
||||
multiple
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView_viewSS"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
194
src/main/webapp/jsp/maintenance/defectRecordView_2021-10-14.jsp
Normal file
194
src/main/webapp/jsp/maintenance/defectRecordView_2021-10-14.jsp
Normal file
@ -0,0 +1,194 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.div-row{
|
||||
margin-left:3px;
|
||||
margin-right:3px;
|
||||
}
|
||||
.div-border{
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
text-align:center;
|
||||
}
|
||||
.right-border{
|
||||
border-right:none;
|
||||
}
|
||||
.top-right-border{
|
||||
border-top:none;
|
||||
border-right:none;
|
||||
}
|
||||
.top-border{
|
||||
border-top:none;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
})
|
||||
</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">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<h3 class="modal-title" style="text-align:center;padding-bottom :3%;">${mDetail.company.sname}缺陷处理单</h3>
|
||||
<table border="2" style="border: solid 1px" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:30px;line-height:30px;text-align:center" >填报日期</td>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;line-height:30px;text-align:center">${mDetail.insdt.substring(0,10)}</td>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:30px;line-height:30px;text-align:center">序号</td>
|
||||
<td style="border-bottom: solid 1px;height:30px;line-height:15px;text-align:center">${mDetail.detailNumber}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:40px;line-height:40px;text-align:center">填报部门</td>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:40px;line-height:40px;text-align:center">${mDetail.company.sname}</td>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:40px;line-height:40px;text-align:center">级别</td>
|
||||
<td style="border-bottom: solid 1px;height:40px;line-height:40px;text-align:center"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:60px;line-height:30px;text-align:center">工作任务<br></td>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:60px;line-height:30px;text-align:center">${mDetail.equipmentNames}</td>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:60px;line-height:60px;text-align:center">工作任务地点</td>
|
||||
<td style="border-bottom: solid 1px;height:60px;line-height:30px;text-align:center">${mDetail.processSection.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:60px;line-height:30px;text-align:center">任务内容(处理内容)</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;height:60px;line-height:30px;text-align:center">${mDetail.problemcontent}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:30px;line-height:30px;text-align:center">填报人</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;height:30px;line-height:30px;text-align:center">${mDetail.insertUser.caption}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:60px;line-height:60px;text-align:center">设备专责意见</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;height:60px;line-height:60px;text-align:center">${mDetail.equipmentOpinion}</td>
|
||||
</tr>
|
||||
<c:if test="${not empty equipmentTeam.id}">
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;text-align:center" >工作记录(维修班填写)</td>
|
||||
<td style="border-bottom: solid 1px;" colspan="3" border="0">
|
||||
<table cellspacing="0" width="100%" height="100%">
|
||||
<tr >
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;width:120px;line-height:30px;text-align:center">处理人</td>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;line-height:30px;text-align:center">${equipmentTeam.insuserName}</td>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;width:120px;line-height:30px;text-align:center">处理日期</td>
|
||||
<td style="border-bottom:solid 1px;height:30px;line-height:30px;text-align:center">${equipmentTeam.handledt.substring(0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:60px;width:120px;line-height:60px;text-align:center">处理情况</td>
|
||||
<td colspan="3" style="border-bottom:solid 1px;height:60px;line-height:30px;text-align:center">${equipmentTeam.handledetail}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="height:60px;line-height:60px;text-align:center;border-right:solid 1px;width:120px;">处理材料</td>
|
||||
<td colspan="3" style="height:60px;line-height:30px;text-align:center">${equipmentTeam.detailsupplement}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${not empty mDetail.baseOpinion}">
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:30px;line-height:30px;text-align:center;">基层领导意见</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;height:30px;line-height:30px;text-align:center;">${mDetail.baseOpinion}</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<c:if test="${not empty mDetail.productOpinion}">
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:30px;line-height:30px;text-align:center;">生产运营中心</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;height:30px;line-height:30px;text-align:center;">${mDetail.productOpinion}</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<c:if test="${not empty mDetail.middleOpinion}">
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;height:30px;line-height:30px;text-align:center;">中层领导意见</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;height:30px;line-height:30px;text-align:center;">${mDetail.middleOpinion}</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<c:if test="${not empty equipmentOffice.id}">
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;text-align:center;" >工作记录(设备办填写)</td>
|
||||
<td colspan="3" style="border-bottom: solid 1px;" border="0" >
|
||||
<table style="border: none;" cellspacing="0" width="100%" height="100%">
|
||||
<tr >
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;width:120px;line-height:30px;text-align:center;">处理人</td>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;line-height:30px;text-align:center;">${equipmentOffice.insuserName}</td>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;width:120px;line-height:30px;text-align:center;">处理日期</td>
|
||||
<td style="border-bottom:solid 1px;height:30px;line-height:30px;text-align:center;">${equipmentOffice.handledt.substring(0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:60px;width:120px;line-height:60px;text-align:center;">处理情况</div>
|
||||
<td colspan="3" style="border-bottom:solid 1px;height:60px;line-height:30px;text-align:center;">${equipmentOffice.handledetail}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="border-right:solid 1px;height:60px;line-height:60px;text-align:center;width:120px;">处理材料</td>
|
||||
<td colspan="3" style="height:60px;line-height:30px;text-align:center;">${equipmentOffice.detailsupplement}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<c:if test="${not empty outsource.id}">
|
||||
<tr >
|
||||
<td style="border-right: solid 1px;border-bottom: solid 1px;text-align:center;">工作记录(外包填写)</td>
|
||||
<td style="border-bottom: solid 1px;" colspan="3" border="0">
|
||||
<table style="border: none;" cellspacing="0" width="100%" height="100%">
|
||||
<tr>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;width:120px;line-height:30px;text-align:center;">处理人</td>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;line-height:30px;text-align:center;">${outsource.insuserName}</td>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:30px;width:120px;line-height:30px;text-align:center;">处理日期</td>
|
||||
<td style="border-bottom:solid 1px;height:30px;line-height:30px;text-align:center;">${outsource.handledt.substring(0,10)}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:60px;width:120px;line-height:60px;text-align:center;">处理情况</td>
|
||||
<td colspan="3" style="border-bottom:solid 1px;height:60px;line-height:30px;text-align:center;">${outsource.handledetail}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-right:solid 1px;height:60px;line-height:60px;width:120px;text-align:center;">处理材料</td>
|
||||
<td colspan="3" style="height:60px;line-height:30px;text-align:center;">${outsource.detailsupplement}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<tr >
|
||||
<td style="text-align:center;border-right: solid 1px;">验收意见</td>
|
||||
<td colspan="3">
|
||||
<table style="border: none;" cellspacing="0" width="100%" height="100%">
|
||||
<tr>
|
||||
<td style="border-bottom:solid 1px;border-right:solid 1px;height:45px;width:120px;line-height:45px;text-align:center;">处理质量验收</td>
|
||||
<td style="border-bottom:solid 1px;height:45px;text-align:center;">${mDetail.qualityOpinion}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="border-right:solid 1px;height:45px;line-height:45px;width:120px;text-align:center;">使用材料数量验收</td>
|
||||
<td style="height:45px;text-align:center;">${mDetail.materialOpinion}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
391
src/main/webapp/jsp/maintenance/equipmentPlanAdd.jsp
Normal file
391
src/main/webapp/jsp/maintenance/equipmentPlanAdd.jsp
Normal file
@ -0,0 +1,391 @@
|
||||
<%@ taglib prefix="c" uri="/jodd" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function dosave() {
|
||||
//保存前先赋值班组
|
||||
var val = $('#_groupDetailId').val();
|
||||
var rolestr = "";
|
||||
if (val != null && val != '') {
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#groupDetailId').val(rolestr);//赋值班组
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlan/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//保养计划提交审核
|
||||
function dosubmit() {
|
||||
$("#status").val('${SUBMIT}');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED', null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
//setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlan/startPlanAudit.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else if (data.res == 2) {
|
||||
showAlert('d', '未检测到保养计划审核流程,请先部署流程!');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
//}, 100);
|
||||
}
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun() {
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan', {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接收人员不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
planNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cycle: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '周期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planDate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planTypeName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择计划类型'
|
||||
}
|
||||
}
|
||||
},
|
||||
unitId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planContents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '保养内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//初始化班组
|
||||
refreshSelect('');
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
//下发日期选择
|
||||
$('#planDate').datepicker({
|
||||
format: 'yyyy-mm',
|
||||
language: "zh-CN",
|
||||
autoclose: true,
|
||||
startView: 1,
|
||||
minViewMode: 1,
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('planDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planDate');
|
||||
});
|
||||
|
||||
var selectType = $("#planTypeBigName").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
var selectType = $("#planTypeSmallName").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: 'by'}, function (data) {
|
||||
$("#planTypeSmallName").empty();
|
||||
var selelct_ = $("#planTypeSmallName").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(data[0].id).trigger("change");
|
||||
$('#planTypeSmall').val(data[0].id);
|
||||
|
||||
selelct_.on('change', function (e) {
|
||||
$('#planTypeSmall').val(e.target.value);
|
||||
})
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function () {
|
||||
var userIds = $("#auditId").val();
|
||||
// $.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "auditId",
|
||||
textId: "auditMan",
|
||||
userIds: userIds,
|
||||
jobIds: '${jobIds}'
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//初始化 任务班组
|
||||
function refreshSelect(groupTypeId) {
|
||||
$.post(ext.contextPath + "/work/groupDetail/getlistForSelect2.do", {
|
||||
unitId: unitId,
|
||||
grouptype: groupTypeId
|
||||
}, function (data) {
|
||||
//先清空下拉选项 避免数据叠加
|
||||
$("#_groupDetailId").empty();
|
||||
//加载下拉选项
|
||||
var selelct = $("#_groupDetailId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
/*var roleitems = new Array();
|
||||
var roles = JSON.parse(decodeURIComponent(''));
|
||||
for (var i = 0; i < roles.length; i++) {
|
||||
roleitems.push(roles[i].id);
|
||||
}
|
||||
selelct.val(roleitems).trigger("change");*/
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
//初始化 班组类型
|
||||
var selectType = $("#sheetName").select2({minimumResultsForSearch: 10});
|
||||
$.post(ext.contextPath + "/work/groupType/getGroupTypeTree.do", {unitId: unitId}, function (data) {
|
||||
$("#groupTypeName").empty();
|
||||
var selelct_ = $("#groupTypeName").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 5,//数据超过5个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${equipmentPlan.groupTypeId}').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#groupTypeId').val(e.target.value);
|
||||
|
||||
|
||||
$('#groupDetailId').val('');
|
||||
$('#_groupDetailId').val('');
|
||||
refreshSelect(e.target.value);
|
||||
})
|
||||
}, '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">新增计划</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" name="planTypeBig" id="planTypeBig" value="${param.type}"/>
|
||||
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="status" id="status" type="hidden" value="${Status_NoStart}"/>
|
||||
<input name="id" id="id" type="hidden" value="${id}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="unitId" id="unitId" type="hidden" value="${company.id}"/>
|
||||
<p class="form-control-static">${company.sname}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="planNumber" id="planNumber" type="hidden" value="${detailNumber}"/>
|
||||
<p class="form-control-static">${detailNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${param.type == Code_Type_By}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*类别</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="planTypeSmallName" name="planTypeSmallName"
|
||||
style="width: 100%;"></select>
|
||||
<input type="hidden" class="form-control" id="planTypeSmall" name="planTypeSmall"
|
||||
value=""/>
|
||||
</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="groupTypeName" name="groupTypeName"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
<input type="hidden" name="groupTypeId" id="groupTypeId">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">任务班组</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="_groupDetailId" name="_groupDetailId" style="width: 100%;">
|
||||
</select>
|
||||
<input type="hidden" name="groupDetailId" id="groupDetailId" value="">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预算 (元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="planMoney" name="planMoney" placeholder="计划费用"
|
||||
min="0" value=0.00 step="50.01" autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*计划日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="planDate" name="planDate"
|
||||
style="width: 230px;" placeholder="请选择" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="planContents" name="planContents" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">验收人员</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择"
|
||||
onclick="showUser4AuditSelectsFun();" value="" autocomplete="off">
|
||||
<input id="auditId" name="auditId" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<%--<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()"
|
||||
><i class="fa fa-paperclip"></i>上传文件
|
||||
</button>
|
||||
</div>
|
||||
<div id="fileArea"></div>--%>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
350
src/main/webapp/jsp/maintenance/equipmentPlanAudit.jsp
Normal file
350
src/main/webapp/jsp/maintenance/equipmentPlanAudit.jsp
Normal file
@ -0,0 +1,350 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr" %>
|
||||
<%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); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/*.file-border {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 1px;
|
||||
margin-left: 17%;
|
||||
padding-right: 0px;
|
||||
padding-left: 0px;
|
||||
border-color: #D2D6DE;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 1px 1px;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}*/
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${equipmentPlan.id}';//业务Id equipmentPlan
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function doSubmit() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED', null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlan/doAudit.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '操作执行失败,请重试');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#targetusers").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "targetusers",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var viewEquFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanEqu/doview.do', {id: id}, function (data) {
|
||||
$("#subDivEqu").html(data);
|
||||
openModal('subModalEqu');
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNode("${businessUnitAudit.taskid}");
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '提交人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
//加载维修流程
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/showProcessView.do', {
|
||||
id: '${equipmentPlan.id}',
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
|
||||
|
||||
$("#table_equipmentCard").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanEqu/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid: '${equipmentPlan.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '35%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '35%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentCard.equipmentname;
|
||||
}
|
||||
}, {
|
||||
field: 'ys', // 返回json数据中的name
|
||||
title: '预算(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.planMoney;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewEquFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentCard");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
|
||||
//计划保养费用保留两位小数
|
||||
$("#planMoney").html(parseFloat('${equipmentPlan.planMoney}').toFixed(2) + "元");
|
||||
|
||||
$("#cycle").select2({minimumResultsForSearch: 10}).val("${equipmentPlan.cycle}").trigger("change");
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">计划(${taskName})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒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 name="unitId" id="unitId" type="hidden" value="${equipmentPlan.unitId}"/> -->
|
||||
<p class="form-control-static">${companyName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentPlan.planNumber}</p>
|
||||
<!-- <input type="text" class="form-control" id="planNumber" name ="planNumber" placeholder="计划编号" value="${equipmentPlan.planNumber}" readonly> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${equipmentPlan.planTypeBig == Code_Type_By}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*类型</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${planTypeSmallName}</p>
|
||||
<input type="hidden" name="planTypeSmall"
|
||||
value="${equipmentPlan.planTypeSmall}">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预算 (元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" id="planMoney">${equipmentPlan.planMoney}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划日期</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentPlan.planDate.substring(0,7)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentPlan.planContents}</p>
|
||||
<!-- <textarea class="form-control " id="planContents" name="planContents" rows="2" >${equipmentPlan.planContents}</textarea> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核人</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="${userName}">
|
||||
<input id="auditId" name="auditId" type="hidden" value="${equipmentPlan.auditId}" />
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()"
|
||||
id="btn_save"><i class="fa fa-paperclip"></i>上传文件
|
||||
</button>
|
||||
</div>
|
||||
<div id="fileArea"></div>
|
||||
|
||||
|
||||
<input type="hidden" class="form-control" name="id" value="${businessUnitAudit.id}">
|
||||
<input type="hidden" class="form-control" name="processid"
|
||||
value="${businessUnitAudit.processid}">
|
||||
<input type="hidden" class="form-control" name="taskid" value="${businessUnitAudit.taskid}">
|
||||
<input type="hidden" class="form-control" name="businessid"
|
||||
value="${businessUnitAudit.businessid}">
|
||||
<input type="hidden" class="form-control" name=unitid value="${param.unitId}">
|
||||
<input type="hidden" class="form-control" name="taskdefinitionkey"
|
||||
value="${businessUnitAudit.taskdefinitionkey}">
|
||||
<!-- <input type="hidden" class="form-control" id ="passstatus" name ="passstatus" value=true>
|
||||
<input type="hidden" class="form-control" id ="auditopinion" name ="auditopinion" >
|
||||
<input type="hidden" class="form-control" id ="routeNum" name ="routeNum" > -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核结果</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="passstatus" name="passstatus"
|
||||
style="width: 270px;">
|
||||
<option value=true>通过</option>
|
||||
<option value=false>驳回</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name="routeNum"
|
||||
style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="reject" class="form-group">
|
||||
<label class="col-sm-2 control-label">*处理意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="auditopinion" name="auditopinion"
|
||||
placeholder="处理意见"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">提交至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName"
|
||||
placeholder="下一级人员" onclick="showUser4SelectsFun();">
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<!-- <div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||
</div>
|
||||
<div id="fileArea">
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联设备</h3>
|
||||
|
||||
<!-- <div class="box-tools pull-right">
|
||||
<a onclick="doEditEquipmentCard()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentCard"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<%-- <button type="button" class="btn btn-primary" onclick="processExecute(doPass,${businessUnitAudit.taskid},true)" id="btn_update">通过</button>
|
||||
<button type="button" class="btn btn-danger" onclick="processExecute(doBack,${businessUnitAudit.taskid},false)" id="btn_submit">驳回</button> --%>
|
||||
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
624
src/main/webapp/jsp/maintenance/equipmentPlanEdit.jsp
Normal file
624
src/main/webapp/jsp/maintenance/equipmentPlanEdit.jsp
Normal file
@ -0,0 +1,624 @@
|
||||
<%@ taglib prefix="c" uri="/jodd" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function dosave() {
|
||||
//保存前先赋值班组
|
||||
var val = $('#_groupDetailId').val();
|
||||
var rolestr = "";
|
||||
if (val != null && val != '') {
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#groupDetailId').val(rolestr);//赋值班组
|
||||
}
|
||||
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan', {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '验收人员不能为空'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlan/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//计划提交审核
|
||||
function dosubmit() {
|
||||
//保存前先赋值班组
|
||||
var val = $('#_groupDetailId').val();
|
||||
var rolestr = "";
|
||||
if (val != null && val != '') {
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#groupDetailId').val(rolestr);//赋值班组
|
||||
}
|
||||
|
||||
$("#status").val('${Status_NoStart}');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED', null)
|
||||
.validateField('auditMan');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlan/startPlanAudit.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else if (data.res == 2) {
|
||||
showAlert('d', '未检测到设备计划审核流程,请先部署流程!');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun() {
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan', {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '验收人员不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
planNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划编号不能为空'
|
||||
},
|
||||
/* remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/maintenance/equipmentPlan/checkExist.do',//验证地址
|
||||
message: '计划编号已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function(validator) {
|
||||
return {
|
||||
planNumber: $('#planNumber').val()
|
||||
};
|
||||
}
|
||||
}, */
|
||||
}
|
||||
},
|
||||
cycle: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '周期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planDate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// planMoney: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '预算不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
/*planTypeName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择计划类型'
|
||||
}
|
||||
}
|
||||
},*/
|
||||
unitId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planContents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '保养内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//厂区ID
|
||||
var companyId = "${company.id}";
|
||||
|
||||
$(function () {
|
||||
//初始化班组
|
||||
refreshSelect('${equipmentPlan.groupTypeId}');
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
//下发日期选择
|
||||
$('#planDate').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm',
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('planDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planDate');
|
||||
});
|
||||
|
||||
$("#table_equipmentCard").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanEqu/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [300, 5000], // 设置页面可以显示的数据条数
|
||||
pageSize: 300, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid: '${equipmentPlan.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px'
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '35%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
// return row.equipmentCard.equipmentcardid;
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentcardid + "'>" + row.equipmentCard.equipmentcardid + "</span>";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '35%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
// return row.equipmentCard.equipmentname;
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentname + "'>" + row.equipmentCard.equipmentname + "</span>";
|
||||
}
|
||||
}
|
||||
},
|
||||
/*{
|
||||
field: 'nr', // 返回json数据中的name
|
||||
title: '内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.contents + "'>" + row.contents + "</span>";
|
||||
}
|
||||
}, */
|
||||
{
|
||||
field: 'ys', // 返回json数据中的name
|
||||
title: '预算(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.planMoney;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
//if (row.status == '${Status_NoStart}') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editEquFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteEquFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
/*} else {
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="processDetailViewFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
}*/
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentCard");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
|
||||
var selectType = $("#planTypeBigName").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
var selectType = $("#planTypeSmallName").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
|
||||
$("#cycle").select2({minimumResultsForSearch: 10}).val("${equipmentPlan.cycle}").trigger("change");
|
||||
});
|
||||
|
||||
var editEquFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanEqu/doedit.do', {id: id}, function (data) {
|
||||
$("#subDivEqu").html(data);
|
||||
openModal('subModalEqu');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteEquFun = function (id) {
|
||||
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/equipmentPlanEqu/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesEquipment = function () {
|
||||
var checkedItems = $("#table_equipmentCard").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/equipmentPlanEqu/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function () {
|
||||
var userIds = $("#auditId").val();
|
||||
// $.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "auditId",
|
||||
textId: "auditMan",
|
||||
userIds: userIds,
|
||||
jobIds: '${jobIds}'
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var doEditEquipment = function () {
|
||||
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
|
||||
unitId: '${equipmentPlan.unitId}',
|
||||
equPlanId: '${equipmentPlan.id}',
|
||||
choiceType: 'main'//通过保养模块过来的,需要筛选近期需要保养的功能
|
||||
}, function (data) {
|
||||
$("#subDiv_Equipment").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
}
|
||||
|
||||
//保存选择设备 datas为id
|
||||
var doFinishSelectEquipment = function (datas_id, datas_name) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanEqu/updateEquipmentCards.do', {
|
||||
pid: '${equipmentPlan.id}',
|
||||
equipmentCardIds: datas_id
|
||||
}, function (data) {
|
||||
if (data.res) {
|
||||
closeModal("equipment4SelectModal");
|
||||
doRefreshEquipmentCards();
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var doRefreshEquipmentCards = function () {
|
||||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
//初始化 任务班组
|
||||
function refreshSelect(groupTypeId) {
|
||||
$.post(ext.contextPath + "/work/groupDetail/getlistForSelect2.do", {
|
||||
unitId: unitId,
|
||||
grouptype: groupTypeId
|
||||
}, function (data) {
|
||||
//先清空下拉选项 避免数据叠加
|
||||
$("#_groupDetailId").empty();
|
||||
//加载下拉选项
|
||||
var selelct = $("#_groupDetailId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
var roleitems = new Array();
|
||||
var roles = JSON.parse(decodeURIComponent('${dept}'));
|
||||
for (var i = 0; i < roles.length; i++) {
|
||||
roleitems.push(roles[i].id);
|
||||
}
|
||||
selelct.val(roleitems).trigger("change");
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
//初始化 班组类型
|
||||
var selectType = $("#sheetName").select2({minimumResultsForSearch: 10});
|
||||
$.post(ext.contextPath + "/work/groupType/getGroupTypeTree.do", {unitId: unitId}, function (data) {
|
||||
$("#groupTypeName").empty();
|
||||
var selelct_ = $("#groupTypeName").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 5,//数据超过5个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${equipmentPlan.groupTypeId}').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#groupTypeId').val(e.target.value);
|
||||
|
||||
|
||||
$('#groupDetailId').val('');
|
||||
$('#_groupDetailId').val('');
|
||||
refreshSelect(e.target.value);
|
||||
})
|
||||
}, '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">编辑计划</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="status" id="status" type="hidden" value="${Status_NoStart}"/>
|
||||
<input name="id" id="id" type="hidden" value="${equipmentPlan.id}"/>
|
||||
<input name="planTypeBig" id="planTypeBig" type="hidden" value="${equipmentPlan.planTypeBig}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<input name="unitId" id="unitId" type="hidden" value="${equipmentPlan.unitId}"/>
|
||||
<p class="form-control-static">${companyName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentPlan.planNumber}</p>
|
||||
<input type="hidden" class="form-control" id="planNumber" name="planNumber"
|
||||
placeholder="计划编号" value="${equipmentPlan.planNumber}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${param.type == Code_Type_By}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类别</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${planTypeSmallName}</p>
|
||||
<input type="hidden" name="planTypeSmall" value="${equipmentPlan.planTypeSmall}">
|
||||
</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="groupTypeName" name="groupTypeName"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
<input type="hidden" name="groupTypeId" id="groupTypeId" value="${equipmentPlan.groupTypeId}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">任务班组</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="_groupDetailId" name="_groupDetailId" style="width: 100%;">
|
||||
</select>
|
||||
<input type="hidden" name="groupDetailId" id="groupDetailId" value="">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预算 (元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="planMoney" name="planMoney" placeholder="计划费用"
|
||||
min="0" step="50.01" value="${equipmentPlan.planMoney}" autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*计划日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="planDate" name="planDate"
|
||||
style="width: 230px;" placeholder="请选择"
|
||||
value="${equipmentPlan.planDate.substring(0,7)}" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="planContents" name="planContents"
|
||||
rows="2">${equipmentPlan.planContents}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">验收人员</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择"
|
||||
onclick="showUser4AuditSelectsFun();" value="${userName}" autocomplete="off">
|
||||
<input id="auditId" name="auditId" type="hidden" value="${equipmentPlan.auditId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<%--<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()"
|
||||
><i class="fa fa-paperclip"></i>上传文件
|
||||
</button>
|
||||
</div>
|
||||
<div id="fileArea"></div>--%>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联设备</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doEditEquipment()" class="btn btn-box-tool" data-toggle="tooltip"
|
||||
title="新增"><i class="fa fa-plus"></i></a>
|
||||
<a onclick="deletesEquipment()" class="btn btn-box-tool" data-toggle="tooltip"
|
||||
title="删除"><i class="fa fa-minus"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentCard" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
287
src/main/webapp/jsp/maintenance/equipmentPlanEquEdit.jsp
Normal file
287
src/main/webapp/jsp/maintenance/equipmentPlanEquEdit.jsp
Normal file
@ -0,0 +1,287 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTAIN",MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("INTER_MAINTENANCE",MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE",MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE",MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<%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); %>
|
||||
<%request.setAttribute("START",MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT",MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function dosaveEqu() {
|
||||
$("#subFormEqu").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormEqu").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanEqu/doupdate.do", $("#subFormEqu").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||||
closeModal("subModalEqu");
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subFormEqu").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
planMoney: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '预算不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#table_Type_Wx").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanEqu/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid: '${equipmentPlan.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备部位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '32%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '项目名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentCard.equipmentname;
|
||||
}
|
||||
}, {
|
||||
field: 'ys', // 返回json数据中的name
|
||||
title: '维修内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.planMoney;
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '18%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts='';
|
||||
if(row.status == '${START}'){
|
||||
buts+= '<security:authorize buttonUrl="maintenance/equipmentPlan/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editEquFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
buts+= '<security:authorize buttonUrl="maintenance/equipmentPlan/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteEquFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
}else{
|
||||
buts+= '<button class="btn btn-default btn-sm" onclick="processDetailViewFun(\''+row.id+'\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
}
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_Type_Wx");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalEqu">
|
||||
<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强制为subFormEqu -->
|
||||
<form class="form-horizontal" id="subFormEqu">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="status" id="status" type="hidden" value="${START}"/>
|
||||
<input name="id" id="id" type="hidden" value="${equipmentPlanEqu.id}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentcardid}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*预算 (元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="planMoney" name ="planMoney" placeholder="计划费用" min="0" step="50.01" value="${equipmentPlanEqu.planMoney}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="contents" name="contents" rows="2" >${equipmentPlanEqu.contents}</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">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Wx"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联保养库</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Ty"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联润滑库</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Rh"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联防腐库</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Ff"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联仪表库</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Yb"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联大修库</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Dx"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联重置库</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addfun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="editfun()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Type_Xz"></table>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosaveEqu()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
577
src/main/webapp/jsp/maintenance/equipmentPlanEquListIssue.jsp
Normal file
577
src/main/webapp/jsp/maintenance/equipmentPlanEquListIssue.jsp
Normal file
@ -0,0 +1,577 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr" %>
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%request.setAttribute("MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
|
||||
<%request.setAttribute("START", MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT", MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
<%request.setAttribute("FINISH", MaintenanceCommString.PLAN_FINISH); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
<%request.setAttribute("Status_Issued", EquipmentPlan.Status_Issued); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
columns = [
|
||||
{
|
||||
checkbox: true,
|
||||
width: '40px',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.status == '${Status_Finish}') {
|
||||
return {disabled: false}
|
||||
} else {
|
||||
return {disabled: true}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentPlan.company.sname', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: '1', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '2', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
return row.equipmentCard.equipmentname;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '3', // 返回json数据中的name
|
||||
title: '计划月份', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentPlan.planDate.substring(0, 7);
|
||||
}
|
||||
}, {
|
||||
field: 'planMoney', // 返回json数据中的name
|
||||
title: '预算', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '计划内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
}
|
||||
/*,
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}*/
|
||||
]
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
alert('浏览页面开发中');
|
||||
}
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
$(function () {
|
||||
initDate1();
|
||||
$(".daterangepicker").css({'width': '680px'});
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
$('#reservationtimeD').val('');
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
$("#status_val").select2({minimumResultsForSearch: 10});
|
||||
|
||||
if ('${type}' == 'by') {
|
||||
$("#equipmentPlanType").show();
|
||||
$("#equipmentPlanTypelabel").show();
|
||||
initEquipmentPlanType();
|
||||
} else {
|
||||
$("#equipmentPlanType").hide();
|
||||
$("#equipmentPlanTypelabel").hide();
|
||||
}
|
||||
});
|
||||
var initEquipmentPlanType = function () {
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: 'by'}, function (data) {
|
||||
$("#equipmentPlanType").empty();
|
||||
var selelct_ = $("#equipmentPlanType").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId: unitId,
|
||||
planTypeId: $('#equipmentPlanType').val(),
|
||||
// planType: $('#searchType').val(),
|
||||
search_name: $('#search_name').val(),
|
||||
date: $('#reservationtimeD').val(),
|
||||
search_equ: $('#search_equ').val(),
|
||||
status_val: $('#status_val').val(), //状态筛选
|
||||
type: '${type}',
|
||||
}
|
||||
};
|
||||
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanEqu/getListIssue.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
// singleSelect: true, // 不显示全选
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: columns,
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发
|
||||
*/
|
||||
var issueFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/user/userForAllSelectWorkOrder.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "solver",
|
||||
textId: "solvername",
|
||||
userIds: '',
|
||||
ids: datas
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearchTab = function () {
|
||||
if ($('#status_val').val() == '${Status_Issued}') {
|
||||
columns = [
|
||||
{
|
||||
checkbox: true,
|
||||
width: '40px',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.status == '${Status_Finish}') {
|
||||
return {disabled: false}
|
||||
} else {
|
||||
return {disabled: true}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentPlan.company.sname', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: '1', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '2', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
return row.equipmentCard.equipmentname;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '3', // 返回json数据中的name
|
||||
title: '计划月份', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentPlan.planDate.substring(0, 7);
|
||||
}
|
||||
}, {
|
||||
field: 'planMoney', // 返回json数据中的name
|
||||
title: '预算', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '计划内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
}, {
|
||||
field: 'user.caption', // 返回json数据中的name
|
||||
title: '维保人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
}
|
||||
/*,
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}*/
|
||||
]
|
||||
} else {
|
||||
columns = [
|
||||
{
|
||||
checkbox: true,
|
||||
width: '40px',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.status == '${Status_Finish}') {
|
||||
return {disabled: false}
|
||||
} else {
|
||||
return {disabled: true}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentPlan.company.sname', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: '1', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '2', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
return row.equipmentCard.equipmentname;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '3', // 返回json数据中的name
|
||||
title: '计划月份', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentPlan.planDate.substring(0, 7);
|
||||
}
|
||||
}, {
|
||||
field: 'planMoney', // 返回json数据中的name
|
||||
title: '预算', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '计划内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
}
|
||||
/*,
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}*/
|
||||
]
|
||||
}
|
||||
$("#table").bootstrapTable('destroy');
|
||||
initFun();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<%-- <section class="content-header">--%>
|
||||
<%-- <h1 id="head_title"></h1>--%>
|
||||
<%-- <ol class="breadcrumb">--%>
|
||||
<%-- <li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivEqu"></div>
|
||||
<div id="roleUserDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="traceDiv"></div>
|
||||
<div id="subDiv_Equipment"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div id="companySelectTree" style="display: none;"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlan/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="issueFun();"><i
|
||||
class="fa fa-paper-plane"></i> 下发
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<label class="form-label" id="equipmentPlanTypelabel">维保类型</label>
|
||||
<select class="form-control select2" id="equipmentPlanType" name="equipmentPlanType"
|
||||
style="width: 160px;"></select>
|
||||
<label class="form-label">状态</label>
|
||||
<select class="form-control select2" id="status_val" name="status_val" style="width: 160px;"
|
||||
onchange="dosearchTab();">
|
||||
<%-- <option value="" selected="selected">全部</option>--%>
|
||||
<option value="${Status_Finish}" selected="selected">未下发</option>
|
||||
<option value="${Status_Issued}">已下发</option>
|
||||
</select>
|
||||
|
||||
<label class="form-label">日期</label>
|
||||
<%-- <div class="input-group input-group-sm pull-right">--%>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; width: 200px;" id="reservationtimeD" style="width:320px;"
|
||||
placeholder="请选择日期">
|
||||
</div>
|
||||
|
||||
<label class="form-label">计划内容</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" autocomplete="off" name="search_name"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
</div>
|
||||
|
||||
<label class="form-label">设备搜索</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_equ" autocomplete="off" name="search_equ"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入设备ID或设备名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <label class="form-label">计划内容</label>--%>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 250px;">--%>
|
||||
<%-- <input type="text" id="search_name" autocomplete="off" name="search_name"--%>
|
||||
<%-- class="form-control pull-right" style="height:34px" placeholder="请输入">--%>
|
||||
<%-- <div class="input-group-btn">--%>
|
||||
<%-- <button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i--%>
|
||||
<%-- class="fa fa-search"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ionicons/css/ionicons.min.css"/>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
74
src/main/webapp/jsp/maintenance/equipmentPlanEquView.jsp
Normal file
74
src/main/webapp/jsp/maintenance/equipmentPlanEquView.jsp
Normal file
@ -0,0 +1,74 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTAIN",MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("INTER_MAINTENANCE",MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE",MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE",MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<%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); %>
|
||||
<%request.setAttribute("START",MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT",MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalEqu">
|
||||
<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强制为subFormEqu -->
|
||||
<form class="form-horizontal" id="subFormEqu">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="status" id="status" type="hidden" value="${START}"/>
|
||||
<input name="id" id="id" type="hidden" value="${equipmentPlanEqu.id}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">设备编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentcardid}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${equipmentname}</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" >${equipmentPlanEqu.planMoney}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" >${equipmentPlanEqu.contents}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
195
src/main/webapp/jsp/maintenance/equipmentPlanExecuteView.jsp
Normal file
195
src/main/webapp/jsp/maintenance/equipmentPlanExecuteView.jsp
Normal file
@ -0,0 +1,195 @@
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%request.setAttribute("Status_Finish", Maintenance.Status_Finish);%>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var tbName_problem = 'tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance = 'tb_maintenance_file'; //数据表
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var bucketName = 'maintenance';
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
resizeImage: true,
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: '',
|
||||
actionDelete: ''
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
var viewHandleDetailFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailView.do', {id: id}, function (data) {
|
||||
$("#handleDetailDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${param.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
|
||||
$(function () {
|
||||
getFileList_process();
|
||||
$("#judgemaintainerstaff").rating('refresh', {showClear: false, showCaption: false, readonly: true});
|
||||
$("#judgeresult").rating('refresh', {showClear: false, showCaption: false, readonly: true});
|
||||
var result = '${businessUnitRecords}';
|
||||
result = result.replace(new RegExp("\r\n", "gm"), "");
|
||||
var json = JSON.parse(result);
|
||||
$.each(json, function (index, item) {
|
||||
if (item.id != null && item.id != "") {
|
||||
previews = new Array();
|
||||
$('#' + item.id).show();
|
||||
var data = item.files;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = 'data:image/png;base64,' + data[i].streamFile;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfig['showRemove'] = false;//不显示移除按钮
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput(item.id);
|
||||
}
|
||||
});
|
||||
})
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
var printpage = function (myDiv) {
|
||||
$('.printContent').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print();
|
||||
wind.close();
|
||||
$('.printContent').hide();
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<c:choose>
|
||||
<c:when test='${finishFlag && status.last}'>
|
||||
<i class="fa fa-check bg-blue"></i>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body" style="padding-left:5px;padding-right:5px;">
|
||||
<div>
|
||||
${item.record}
|
||||
</div>
|
||||
|
||||
<c:if test="${item.id!=''}">
|
||||
<div style="padding-top:5px;">
|
||||
<input type="file" id='${item.id}' multiple class="file-loading"/>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!--
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
|
||||
<!-- 流程打印布局 开始-->
|
||||
<div id="maintenanceDetail">
|
||||
<div class="printContent" style="display:none">
|
||||
<h4 style="text-align:center;">流程处理详情</h4>
|
||||
</div>
|
||||
<div class="printContent" style="display:none">
|
||||
<table style="border-collapse:collapse;margin:0 auto">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">时间</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">发起人</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">任务</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">流程内容详情</td>
|
||||
</tr>
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:150px;text-align: center;">${item.insdt.substring(0,16)}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.user.caption}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.taskName}</td>
|
||||
<td style="border:1px solid black;width:300px;">${item.record}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<!-- <label class="col-sm-2 control-label">文件附件:</label> -->
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 流程打印布局 结束-->
|
||||
@ -0,0 +1,270 @@
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT",Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE",Maintenance.TYPE_MAINTENANCE);%>
|
||||
<%request.setAttribute("UNIT_HANDLE",BusinessUnit.UNIT_HANDLE);%>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//var masterId=$('#maintenanceId').val();
|
||||
var tbName_problem='tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance='tb_maintenance_file'; //数据表
|
||||
var tb_nameSpace='MaintenanceProblem';//保存文件夹
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${param.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
resizeImage:true,
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDelete:''
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
var viewHandleDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailView.do', {id:id} , function(data) {
|
||||
$("#handleDetailDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
$("#judgemaintainerstaff").rating('refresh',{showClear:false,showCaption:false,readonly:true});
|
||||
$("#judgeresult").rating('refresh',{showClear:false,showCaption:false,readonly:true});
|
||||
var result='${businessUnitRecords}';
|
||||
result=result.replace(new RegExp("\r\n","gm"),"");
|
||||
var json =JSON.parse(result);
|
||||
$.each(json, function(index, item) {
|
||||
if(item.id!=null &&item.id!=""){
|
||||
previews=new Array();
|
||||
$('#'+item.id).show();
|
||||
var data =item.files;
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");
|
||||
previews.push(path);
|
||||
previewConfig['width']= '30px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
showFileInput(item.id);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
var printpage = function (myDiv){
|
||||
$('.printContent').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
/*
|
||||
var ss = ".coversheet-pageBoder{"
|
||||
+" padding: 10px;"
|
||||
+" margin-top: 10px;"
|
||||
+" border: 1px solid gray;"
|
||||
+" page-break-after: always;"
|
||||
+" border-radius: 5px;"
|
||||
+" box-shadow: 0 1px 2px 1px rgba(0,0,0,.08), 0 3px 6px rgba(0,0,0,.08);"
|
||||
+"}"
|
||||
+".noprint{display: none;}"
|
||||
+".select2-container .select2-selection--single{ "
|
||||
+" height:34px; "
|
||||
+" line-height: 34px; "
|
||||
+" }"
|
||||
+" .select2-selection__arrow{"
|
||||
+" margin-top:3px;"
|
||||
+" } "
|
||||
+" .div-row{"
|
||||
+" margin-left:3px;"
|
||||
+" margin-right:3px;"
|
||||
+" }"
|
||||
+" .div-border{"
|
||||
+" border-style:solid;"
|
||||
+" border-width:1px;"
|
||||
+" text-align:center;"
|
||||
+" }"
|
||||
+" .right-border{"
|
||||
+" border-right:none;"
|
||||
+" }"
|
||||
+" .top-right-border{"
|
||||
+" border-top:none;"
|
||||
+" border-right:none;"
|
||||
+" }"
|
||||
+" .top-border{"
|
||||
+" border-top:none;"
|
||||
+" }";
|
||||
*/
|
||||
//for Chrome Firefox Opera Safari
|
||||
//wind.document.body.innerHTML = printHtml;
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
/*
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.rel = 'stylesheet';
|
||||
style.appendChild(document.createTextNode(ss));
|
||||
wind.document.head.appendChild(style);
|
||||
*/
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
//console.log(wind.document);
|
||||
wind.print();
|
||||
wind.close();
|
||||
$('.printContent').hide();
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="modal fade" id="equipmentPlanExcuteModal">
|
||||
<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 " style="padding-left:0;padding-right:0;" >
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<c:choose>
|
||||
<c:when test='${finishFlag && status.last}'>
|
||||
<i class="fa fa-check bg-blue"></i>
|
||||
</c:when>
|
||||
<c:otherwise >
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body" style="padding-left:5px;padding-right:5px;">
|
||||
<div>
|
||||
${item.record}
|
||||
</div>
|
||||
<c:if test ="${item.id!=''}">
|
||||
<div style="padding-top:5px;">
|
||||
<input type="file" id='${item.id}' multiple class="file-loading" />
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<!-- 流程打印布局 开始 -->
|
||||
<div id="equipmentPlanExcuteDetail">
|
||||
<div class="printContent" style="display:none">
|
||||
<h4 style="text-align:center;">设备计划审核处理详情</h4>
|
||||
</div>
|
||||
<div class="printContent" style="display:none">
|
||||
<table style="border-collapse:collapse;margin:0 auto">
|
||||
<tr >
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">时间</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">发起人</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">任务</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">流程内容详情</td>
|
||||
</tr>
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:150px;text-align: center;">${item.insdt.substring(0,16)}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.user.caption}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.taskName}</td>
|
||||
<td style="border:1px solid black;width:300px;">${item.record}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文件附件:</label>
|
||||
</div>
|
||||
<!-- 文件上传,显示 -->
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 流程打印布局 结束-->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="printpage('equipmentPlanExcuteDetail');"><i class="fa fa-print"></i>打印</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
610
src/main/webapp/jsp/maintenance/equipmentPlanListBy.jsp
Normal file
610
src/main/webapp/jsp/maintenance/equipmentPlanListBy.jsp
Normal file
@ -0,0 +1,610 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr" %>
|
||||
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
<%request.setAttribute("Status_Issued", EquipmentPlan.Status_Issued); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<%@page import="com.sipai.entity.activiti.ProcessType" %>
|
||||
<%request.setAttribute("Maintain_Plan", ProcessType.Maintain_Plan.getId());%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
//跳转至待办
|
||||
function TaskListFun4Type() {
|
||||
window.parent.addTab('taskList', '待办事项', 'activiti/workflow/taskList.do?modelKey=${Maintain_Plan}-' + unitId);
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport(id) {
|
||||
window.open(ext.contextPath + "/maintenance/equipmentPlan/doExport.do?id=" + id);
|
||||
}
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doadd.do', {
|
||||
companyId: unitId,
|
||||
type: '${Code_Type_By}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doedit.do', {
|
||||
id: id,
|
||||
type: '${Code_Type_By}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doview.do', {
|
||||
id: id,
|
||||
type: '${Code_Type_By}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
//流程处理详情
|
||||
/*var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}*/
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/equipmentPlan/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
// datas += item.id + ",";
|
||||
//进入流程的不能删除
|
||||
if (item.status == null || item.status == '${Status_NoStart}' || item.status == '') {
|
||||
datas += item.id + ",";
|
||||
}
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/equipmentPlan/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
// initEquipmentPlanType();
|
||||
initFun();
|
||||
};
|
||||
|
||||
var dosearchTab = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
//选择保养类型
|
||||
var selectType = $("#searchType").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
})
|
||||
selectType.val('').trigger("change");
|
||||
selectType.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
|
||||
//$("#status_val").select2({minimumResultsForSearch: 10}).val("${Status_NoStart}").trigger("change");
|
||||
$("#status_val").select2({minimumResultsForSearch: 10}).val("").trigger("change");
|
||||
});
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId: unitId,
|
||||
planTypeId: $('#equipmentPlanType').val(),
|
||||
planType: $('#searchType').val(),
|
||||
date: $('#reservationtimeD').val(),
|
||||
search_name: $('#search_name').val(),
|
||||
status_val: $('#status_val').val(),
|
||||
type: '${Code_Type_By}'
|
||||
}
|
||||
};
|
||||
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
initEquipmentPlanType();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlan/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
// singleSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
columns: [
|
||||
{
|
||||
checkbox: true,
|
||||
width: '40px',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.status == null || row.status == '${Status_NoStart}' || row.status == '') {
|
||||
return {disabled: false,}
|
||||
} else {
|
||||
return {disabled: true,}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'company.sname', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'planNumber', // 返回json数据中的name
|
||||
title: '计划编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
},
|
||||
/*{
|
||||
field: 'cycle', // 返回json数据中的name
|
||||
title: '周期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '${Maintain_Month}':
|
||||
return "月度";
|
||||
case '${Maintain_Quarter}':
|
||||
return "季度";
|
||||
case '${Maintain_HalfYear}':
|
||||
return "半年";
|
||||
case '${Maintain_Year}':
|
||||
return "年度";
|
||||
default:
|
||||
return "--";
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
field: 'planDate',// 返回json数据中的name
|
||||
title: '计划日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.planDate.substring(0, 7);
|
||||
}
|
||||
},
|
||||
/*{
|
||||
field: 'planContents', // 返回json数据中的name
|
||||
title: '计划内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%',
|
||||
}, */
|
||||
{
|
||||
field: 'planTypeBig', // 返回json数据中的name
|
||||
title: '维保类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentPlanType != null && row.equipmentPlanType != '') {
|
||||
return row.equipmentPlanType.name;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '审核状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.status == '${Status_NoStart}') {
|
||||
return "未提交审核";
|
||||
} else if (row.status == '${Status_Start}') {
|
||||
return "已提交审核";
|
||||
} else if (row.status == '${Status_Finish}') {
|
||||
return "审核通过";
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '', // 返回json数据中的name
|
||||
title: '签收进度', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentNumSignfor+' / '+row.equipmentNum;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '', // 返回json数据中的name
|
||||
title: '完成进度', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.equipmentNumFinish+' / '+row.equipmentNum;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if (row.status == '${Status_NoStart}') {
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
buts += '<button class="btn btn-default btn-sm" title="导出" onclick="doExport(\'' + row.id + '\')"><i class="fa fa fa-cloud-download"></i><span class="hidden-md hidden-lg">导出</span></button>';
|
||||
|
||||
//跳转到对应的待办页面
|
||||
if (row.status != '${Status_Finish}') {
|
||||
buts += '<button type="button" class="btn btn-default btn-sm" title="处理" onclick="TaskListFun4Type(\'' + row.id + '\')"><i class="fa fa-play"></i><span class="hidden-md hidden-lg"> 处理</span></button>';
|
||||
}
|
||||
}
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var initEquipmentPlanType = function () {
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: 'by'}, function (data) {
|
||||
$("#equipmentPlanType").empty();
|
||||
var selelct_ = $("#equipmentPlanType").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
// "format": 'YYYY-MM-DD HH:mm',
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(0, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
$(function () {
|
||||
initDate1();
|
||||
$(".daterangepicker").css({'width': '680px'});
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
$('#reservationtimeD').val('');
|
||||
initFun();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<%-- <section class="content-header">--%>
|
||||
<%-- <h1 id="head_title"></h1>--%>
|
||||
<%-- <ol class="breadcrumb">--%>
|
||||
<%-- <li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||||
<%-- <!-- <li class="active">Here</li> -->--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<!-- <div id="subDiv" style="width: 220px;height:10px;"></div> -->
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivEqu"></div>
|
||||
<div id="roleUserDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="traceDiv"></div>
|
||||
<div id="subDiv_Equipment"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div id="companySelectTree" style="display: none;"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlan/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" onclick="issueFun();"><i class="fa fa-send-o"></i> 计划下发</button>--%>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<label class="form-label">维保类型</label>
|
||||
<select class="form-control select2" id="equipmentPlanType" name="equipmentPlanType"
|
||||
style="width: 160px;"></select>
|
||||
<label class="form-label">状态</label>
|
||||
<select class="form-control select2" id="status_val" name="status_val" style="width: 160px;"
|
||||
onchange="dosearchTab();">
|
||||
<option value="">全部</option>
|
||||
<option value="${Status_NoStart}">未提交审核</option>
|
||||
<option value="${Status_Start}">已提交审核</option>
|
||||
<option value="${Status_Finish}">已通过</option>
|
||||
</select>
|
||||
<label class="form-label">日期</label>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; width: 200px;" id="reservationtimeD" style="width:320px;"
|
||||
placeholder="请选择日期">
|
||||
</div>
|
||||
<label class="form-label">计划内容</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" autocomplete="off" name="search_name"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ionicons/css/ionicons.min.css"/>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</html>
|
||||
619
src/main/webapp/jsp/maintenance/equipmentPlanListWx.jsp
Normal file
619
src/main/webapp/jsp/maintenance/equipmentPlanListWx.jsp
Normal file
@ -0,0 +1,619 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr" %>
|
||||
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
|
||||
<%--<%request.setAttribute("MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("Response_StartProcess_NoProcessDef", MaintenanceCommString.Response_StartProcess_NoProcessDef); %>
|
||||
<%request.setAttribute("Response_StartProcess_NoUser", MaintenanceCommString.Response_StartProcess_NoUser); %>
|
||||
<%request.setAttribute("Response_StartProcess_PlanIssued", MaintenanceCommString.Response_StartProcess_PlanIssued); %>--%>
|
||||
|
||||
<%--<%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); %>--%>
|
||||
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
<%request.setAttribute("Status_Issued", EquipmentPlan.Status_Issued); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doadd.do', {
|
||||
companyId: unitId,
|
||||
type: '${Code_Type_Wx}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doedit.do', {
|
||||
id: id,
|
||||
type: '${Code_Type_Wx}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//导出
|
||||
function doExport(id) {
|
||||
window.open(ext.contextPath + "/maintenance/equipmentPlan/doExport.do?id=" + id);
|
||||
}
|
||||
|
||||
var viewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/doview.do', {
|
||||
id: id,
|
||||
type: '${Code_Type_Wx}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
//流程处理详情
|
||||
var processDetailViewFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/showProcessView.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('equipmentPlanExcuteModal');
|
||||
});
|
||||
}
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/equipmentPlan/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
// datas += item.id + ",";
|
||||
//进入流程的不能删除
|
||||
/*if (item.status == null || item.status == '
|
||||
${Status_NoStart}' || item.status == '') {
|
||||
datas += item.id + ",";
|
||||
}*/
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/equipmentPlan/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
// initEquipmentPlanType();
|
||||
initFun();
|
||||
};
|
||||
|
||||
var dosearchTab = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
//选择保养类型
|
||||
var selectType = $("#searchType").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
})
|
||||
selectType.val('').trigger("change");
|
||||
selectType.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
|
||||
//输入框验证
|
||||
/* $("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
cname_input: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请先选择厂区'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}); */
|
||||
$("#status_val").select2({minimumResultsForSearch: 10}).val("").trigger("change");
|
||||
});
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId: unitId,
|
||||
planTypeId: $('#equipmentPlanType').val(),
|
||||
planType: $('#searchType').val(),
|
||||
search_name: $('#search_name').val(),
|
||||
date: $('#reservationtimeD').val(),
|
||||
status_val: $('#status_val').val(),
|
||||
status_equ: $('#status_equ').val(),
|
||||
type: '${Code_Type_Wx}'
|
||||
}
|
||||
};
|
||||
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
initEquipmentPlanType();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlan/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
// singleSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true,
|
||||
width: '40px',
|
||||
formatter: function (value, row, index) {
|
||||
/*if (row.status == null || row.status == '
|
||||
${Status_NoStart}' || row.status == '') {
|
||||
return {disabled: false,}
|
||||
} else {
|
||||
return {disabled: true,}
|
||||
}*/
|
||||
return {disabled: false,}
|
||||
}
|
||||
}, {
|
||||
field: 'company.sname', // 返回json数据中的name
|
||||
title: '所属厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
}, {
|
||||
field: 'planNumber', // 返回json数据中的name
|
||||
title: '计划编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
},
|
||||
/*{
|
||||
field: 'cycle', // 返回json数据中的name
|
||||
title: '周期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '${Maintain_Month}':
|
||||
return "月度";
|
||||
case '${Maintain_Quarter}':
|
||||
return "季度";
|
||||
case '${Maintain_HalfYear}':
|
||||
return "半年";
|
||||
case '${Maintain_Year}':
|
||||
return "年度";
|
||||
default:
|
||||
return "--";
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
field: 'planDate',// 返回json数据中的name
|
||||
title: '计划日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.planDate.substring(0, 7);
|
||||
}
|
||||
}, {
|
||||
field: 'planContents', // 返回json数据中的name
|
||||
title: '计划内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '45%',
|
||||
},
|
||||
/*{
|
||||
field: 'planTypeBig', // 返回json数据中的name
|
||||
title: '维保类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentPlanType != null && row.equipmentPlanType != '') {
|
||||
return row.equipmentPlanType.name;
|
||||
}
|
||||
}
|
||||
}, */
|
||||
{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '审核状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.status == '${Status_NoStart}') {
|
||||
return "未提交审核";
|
||||
} else if (row.status == '${Status_Start}') {
|
||||
return "已提交审核";
|
||||
} else if (row.status == '${Status_Finish}') {
|
||||
return "审核通过";
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '5%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if (row.status == '${Status_NoStart}') {
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
buts += '<button class="btn btn-default btn-sm" title="导出" onclick="doExport(\'' + row.id + '\')"><i class="fa fa fa-cloud-download"></i><span class="hidden-md hidden-lg">导出</span></button>';
|
||||
}
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
<%--var buts = '';--%>
|
||||
<%--if (row.status == '${Status_NoStart}') {--%>
|
||||
<%-- buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/edit.do">';--%>
|
||||
<%-- buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';--%>
|
||||
<%-- buts += '</security:authorize>';--%>
|
||||
<%-- buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/delete.do">';--%>
|
||||
<%-- buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';--%>
|
||||
<%-- buts += '</security:authorize>';--%>
|
||||
<%--} else {--%>
|
||||
<%-- buts += '<button class="btn btn-default btn-sm" onclick="processDetailViewFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'--%>
|
||||
<%--}--%>
|
||||
<%--buts = '<div class="btn-group" >' + buts + '</div>';--%>
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
var initEquipmentPlanType = function () {
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: 'by'}, function (data) {
|
||||
$("#equipmentPlanType").empty();
|
||||
var selelct_ = $("#equipmentPlanType").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
$(function () {
|
||||
initDate1();
|
||||
$(".daterangepicker").css({'width': '680px'});
|
||||
var flag = IsApp();
|
||||
if (flag == true) {
|
||||
|
||||
} else {
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
$('#reservationtimeD').val('');
|
||||
initFun();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<%-- <section class="content-header">--%>
|
||||
<%-- <h1 id="head_title"></h1>--%>
|
||||
<%-- <ol class="breadcrumb">--%>
|
||||
<%-- <li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||||
<%-- <!-- <li class="active">Here</li> -->--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<!-- <div id="subDiv" style="width: 220px;height:10px;"></div> -->
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivEqu"></div>
|
||||
<div id="roleUserDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="traceDiv"></div>
|
||||
<div id="subDiv_Equipment"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div id="companySelectTree" style="display: none;"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlan/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" onclick="issueFun();"><i class="fa fa-send-o"></i> 计划下发</button>--%>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<%--<label class="form-label">维保类型</label>
|
||||
<select class="form-control select2" id="equipmentPlanType" name="equipmentPlanType"
|
||||
style="width: 160px;"></select>--%>
|
||||
<label class="form-label">状态</label>
|
||||
<select class="form-control select2" id="status_val" name="status_val" style="width: 160px;"
|
||||
onchange="dosearchTab();">
|
||||
<option value="" selected="selected">全部</option>
|
||||
<option value="${Status_NoStart}">未提交审核</option>
|
||||
<option value="${Status_Start}">已提交审核</option>
|
||||
<option value="${Status_Finish}">已通过</option>
|
||||
</select>
|
||||
<label class="form-label">日期</label>
|
||||
<%-- <div class="input-group input-group-sm pull-right">--%>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; width: 200px;" id="reservationtimeD" style="width:320px;"
|
||||
placeholder="请选择日期">
|
||||
</div>
|
||||
<label class="form-label">计划内容</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" autocomplete="off" name="search_name"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
</div>
|
||||
<label class="form-label">设备搜索</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="status_equ" autocomplete="off" name="status_equ"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入设备ID或名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ionicons/css/ionicons.min.css"/>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</html>
|
||||
@ -0,0 +1,88 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Cycle_Month", EquipmentPlanType.Code_Cycle_Month); %>
|
||||
<%request.setAttribute("Code_Cycle_Quarter", EquipmentPlanType.Code_Cycle_Quarter); %>
|
||||
<%request.setAttribute("Code_Cycle_HalfYear", EquipmentPlanType.Code_Cycle_HalfYear); %>
|
||||
<%request.setAttribute("Code_Cycle_Year", EquipmentPlanType.Code_Cycle_Year); %>
|
||||
|
||||
<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() {
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/dodetailsave.do", $("#subForm1").serialize(), function (data) {
|
||||
if (data.res > 0) {
|
||||
closeModal('subModal3');
|
||||
$("#table1").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function closeModel() {
|
||||
closeModal('subModal3');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal3">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm1">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" id="pid" name="pid" value="${planid}"></input>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*周期</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control select2 " id="mainType" name="mainType" readonly
|
||||
style="width: 220px;">
|
||||
<option value="月">月</option>
|
||||
<option value="季">季</option>
|
||||
<option value="半年">半年</option>
|
||||
<option value="年">年</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*起始月份</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control " id="month" name="month" style="width: 270px;"
|
||||
placeholder="起始月份" min="1" max="12" step="1"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="closeModel()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
347
src/main/webapp/jsp/maintenance/equipmentPlanMainYearAdd.jsp
Normal file
347
src/main/webapp/jsp/maintenance/equipmentPlanMainYearAdd.jsp
Normal file
@ -0,0 +1,347 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("INTER_MAINTENANCE", MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE", MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE", MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<%request.setAttribute("MAINTAIN_YEAR", MaintenanceCommString.MAINTAIN_YEAR); %>
|
||||
<%request.setAttribute("MAINTAIN_MONTH", MaintenanceCommString.MAINTAIN_MONTH); %>
|
||||
<%request.setAttribute("MAINTAIN_HALFYEAR", MaintenanceCommString.MAINTAIN_HALFYEAR); %>
|
||||
<%request.setAttribute("START", MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT", MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<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 masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipmentNumber', 'NOT_VALIDATED', null)
|
||||
.validateField('equipmentNumber');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipname', 'NOT_VALIDATED', null)
|
||||
.validateField('equipname');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('particularYear', 'NOT_VALIDATED', null)
|
||||
.validateField('particularYear');
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
//}, 100);
|
||||
}
|
||||
|
||||
//保养计划提交审核
|
||||
/*function dosubmit() {
|
||||
$("#active").val('${SUBMIT}');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED', null)
|
||||
.validateField('auditMan');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipname', 'NOT_VALIDATED', null)
|
||||
.validateField('equipname');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
//setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/startPlanAudit.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else if (data.res == 2) {
|
||||
showAlert('d', '未检测到维修计划审核流程,请先部署流程!');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
//}, 100);
|
||||
}*/
|
||||
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipmentNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
particularYear: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//厂区ID
|
||||
var companyId = unitId;
|
||||
|
||||
$(function () {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
//下发日期选择
|
||||
$('#particularYear').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy',
|
||||
minViewMode: 2,
|
||||
maxViewMode: 2
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('initialDate', 'NOT_VALIDATED', null)
|
||||
.validateField('initialDate');
|
||||
});
|
||||
|
||||
//$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change");
|
||||
|
||||
//保养方式
|
||||
$("#maintenanceWay").select2({
|
||||
minimumResultsForSearch: 10
|
||||
}).val('${INTER_MAINTENANCE}').trigger("change");
|
||||
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: '${param.planType}'}, function (data) {
|
||||
$("#type").empty();
|
||||
var selelct_ = $("#type").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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(data[0].id).trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
// dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
|
||||
//选择保养的设备,根据厂区id选择厂内设备
|
||||
var selectEquipmentCard = function () {
|
||||
/*$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect2.do', {
|
||||
companyId: unitId,
|
||||
equipmentId: $("#equipid").val()
|
||||
},
|
||||
function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});*/
|
||||
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
|
||||
unitId: unitId,
|
||||
equPlanId: '${id}',
|
||||
choiceType: 'main'//通过保养模块过来的,需要筛选近期需要保养的功能
|
||||
}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//保存选择设备 datas为id
|
||||
var doFinishSelectEquipment = function (datas_id, datas_name, datas_cardId) {
|
||||
var array = datas_id.split(',');
|
||||
if(array.length>1){
|
||||
alert('只能选择一台设备');
|
||||
}else{
|
||||
$('#equipmentId').val(datas_id);
|
||||
$('#equipname').val(datas_name);
|
||||
$('#equipmentNumber').val(datas_cardId);
|
||||
closeModal("equipment4SelectModal");
|
||||
}
|
||||
}
|
||||
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function () {
|
||||
var userIds = $("#auditId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "auditId",
|
||||
textId: "auditMan",
|
||||
userIds: userIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//弹出人员列表
|
||||
var showUser4Handle = function () {
|
||||
var userIds = $("#receiveUserId").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "receiveUserId",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="active" id="active" type="hidden" value="${START}"/>
|
||||
<input name="id" id="id" type="hidden" value="${id}"/>
|
||||
<input name="unitId" id="unitId" type="hidden" value="${unitId}"/>
|
||||
<input name="planType" id="planType" type="hidden" value="${param.planType}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipmentId" name="equipmentId" type="hidden" value=""/>
|
||||
<input class="form-control" id="equipname" name="equipname" autocomplete="off"
|
||||
onclick="selectEquipmentCard()" placeholder="请点击选择" cursor="pointer" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*设备编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentNumber" name="equipmentNumber"
|
||||
cursor="pointer" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="planMoney" name="planMoney" placeholder="计划费用"
|
||||
min="0" value=0.00 step="50.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*计划日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="particularYear" name="particularYear"
|
||||
style="width: 132px;" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%-- <c:if test="${param.planType == Code_Type_By}">--%>
|
||||
<label class="col-sm-2 control-label">*类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="type" name="type" style="width: 170px;">
|
||||
</select>
|
||||
</div>
|
||||
<%-- </c:if>--%>
|
||||
|
||||
<label class="col-sm-2 control-label">实施人员</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName"
|
||||
placeholder="请选择实施人员" onclick="showUser4Handle();" autocomplete="off">
|
||||
<input id="receiveUserId" name="receiveUserId" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="contents" name="contents" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="remark" name="remark" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
533
src/main/webapp/jsp/maintenance/equipmentPlanMainYearEdit.jsp
Normal file
533
src/main/webapp/jsp/maintenance/equipmentPlanMainYearEdit.jsp
Normal file
@ -0,0 +1,533 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("INTER_MAINTENANCE", MaintenanceCommString.INTER_MAINTENANCE); %>
|
||||
<%request.setAttribute("EXTERANL_MAINTENANCE", MaintenanceCommString.EXTERANL_MAINTENANCE); %>
|
||||
<%request.setAttribute("COMMON_MAINTENANCE", MaintenanceCommString.COMMON_MAINTENANCE); %>
|
||||
<%request.setAttribute("MAINTAIN_YEAR", MaintenanceCommString.MAINTAIN_YEAR); %>
|
||||
<%request.setAttribute("MAINTAIN_MONTH", MaintenanceCommString.MAINTAIN_MONTH); %>
|
||||
<%request.setAttribute("MAINTAIN_HALFYEAR", MaintenanceCommString.MAINTAIN_HALFYEAR); %>
|
||||
<%request.setAttribute("START", MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT", MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* .file-border{
|
||||
padding-top :10px;
|
||||
padding-bottom :1px;
|
||||
margin-left :17%;
|
||||
padding-right :0px;
|
||||
padding-left :0px;
|
||||
border-color :#D2D6DE;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 1px 1px;
|
||||
border-top-left-radius:10px;
|
||||
border-top-right-radius:10px;
|
||||
border-bottom-left-radius:10px;
|
||||
border-bottom-right-radius:10px;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${equipmentPlanMainYear.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
var deleteFun1 = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/detaildelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table1").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function deleteSubscribeDetailFun() {
|
||||
var checkedItems = $("#table1").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertDetaildiv');
|
||||
} else {
|
||||
if (confirm("信息删除后不能恢复,请问要执行删除操作吗?")) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/detaildeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table1").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function doupdate() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipmentNumber', 'NOT_VALIDATED', null)
|
||||
.validateField('equipmentNumber');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipname', 'NOT_VALIDATED', null)
|
||||
.validateField('equipname');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('particularYear', 'NOT_VALIDATED', null)
|
||||
.validateField('particularYear');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
//setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
//}, 100);
|
||||
}
|
||||
|
||||
//保养计划提交审核
|
||||
function dosubmit() {
|
||||
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('auditMan', 'NOT_VALIDATED', null)
|
||||
.validateField('auditMan');
|
||||
/* $('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('equipname', 'NOT_VALIDATED',null)
|
||||
.validateField('equipname'); */
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
//setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/startPlanAudit.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else if (data.res == 2) {
|
||||
showAlert('d', '未检测到保养计划审核流程,请先部署流程!');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
//}, 100);
|
||||
}
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun() {
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan', {
|
||||
equipmentId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
var initTable = function (id) {
|
||||
$("#table1").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanMainYear/getDetailList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
search_name: $('#search_name').val(),
|
||||
planid: id
|
||||
}
|
||||
|
||||
},
|
||||
sortName: 'month', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'month', // 返回json数据中的name
|
||||
title: '月份', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value;
|
||||
}
|
||||
}, {
|
||||
field: 'mainType', // 返回json数据中的name
|
||||
title: '周期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
field: 'resourceId',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="sparepart/supplierQualification/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun1(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table1");
|
||||
$("#table1").bootstrapTable("hideRow", 1)
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
equipmentNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
equipname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '设备名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
particularYear: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var companyId = unitId;
|
||||
|
||||
var planid = $("#id").val();
|
||||
var addSubscribeDetailFun = function () {
|
||||
|
||||
var usid1 = $("#id").val();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/detailadd.do', {planid: planid},
|
||||
function (data) {
|
||||
$("#detailFunadd").html(data);
|
||||
openModal('subModal3');
|
||||
});
|
||||
}
|
||||
|
||||
initTable(planid);
|
||||
|
||||
$(function () {
|
||||
|
||||
initTable(planid);
|
||||
//初始化文件显示
|
||||
//getFileList_process();
|
||||
//计划保养费用保留两位小数
|
||||
// //选择时间
|
||||
$('#particularYear').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy',
|
||||
minViewMode: 2,
|
||||
maxViewMode: 2
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('particularYear', 'NOT_VALIDATED', null)
|
||||
.validateField('particularYear');
|
||||
});
|
||||
//选择保养类型
|
||||
var selectType = $("#type").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
selectType.val('${equipmentPlanMainYear.type}').trigger("change");
|
||||
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: '${param.planType}'}, function (data) {
|
||||
$("#type").empty();
|
||||
var selelct_ = $("#type").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('${equipmentPlanMainYear.type}').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
// dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
//选择设备,根据厂区id选择厂内设备
|
||||
var selectEquipmentCard = function () {
|
||||
/*$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect2.do', {
|
||||
companyId: companyId,
|
||||
equipmentId: $("#equipmentId").val()
|
||||
}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});*/
|
||||
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
|
||||
unitId: unitId,
|
||||
equPlanId: '${id}',
|
||||
choiceType: 'main'//通过保养模块过来的,需要筛选近期需要保养的功能
|
||||
}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal("equipment4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//保存选择设备 datas为id
|
||||
var doFinishSelectEquipment = function (datas_id, datas_name, datas_cardId) {
|
||||
var array = datas_id.split(',');
|
||||
if(array.length>1){
|
||||
alert('只能选择一台设备');
|
||||
}else{
|
||||
$('#equipmentId').val(datas_id);
|
||||
$('#equipname').val(datas_name);
|
||||
$('#equipmentNumber').val(datas_cardId);
|
||||
closeModal("equipment4SelectModal");
|
||||
}
|
||||
}
|
||||
|
||||
//选择审核人
|
||||
var showUser4AuditSelectsFun = function () {
|
||||
var userIds = $("#auditId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "auditId",
|
||||
textId: "auditMan",
|
||||
userIds: userIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//弹出人员列表
|
||||
var showUser4Handle = function () {
|
||||
var userIds = $("#receiveUserId").val();
|
||||
var jobIds = $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "receiveUserId",
|
||||
textId: "targetUsersName",
|
||||
userIds: userIds,
|
||||
jobIds: jobIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="id" name="id" value="${equipmentPlanMainYear.id}">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*设备名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="equipmentId" name="equipmentId" type="hidden"
|
||||
value="${equipmentPlanMainYear.equipmentId}"/>
|
||||
<input class="form-control" id="equipname" autocomplete="off"
|
||||
value="${equipmentPlanMainYear.equipmentCard.equipmentname}"
|
||||
onclick="selectEquipmentCard()" onclick="selectEquipmentCard()" placeholder="设备编号" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*设备编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="equipmentNumber" name="equipmentNumber"
|
||||
value="${equipmentPlanMainYear.equipmentCard.equipmentcardid}"
|
||||
readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">费用/元</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="planMoney" name="planMoney"
|
||||
value="${equipmentPlanMainYear.planMoney}" step="50.01" placeholder="计划费用">
|
||||
</div>
|
||||
<!-- <div id="issueDate"> -->
|
||||
<label class="col-sm-2 control-label">*计划日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="particularYear" name="particularYear"
|
||||
style="width: 132px;" placeholder="请选择"
|
||||
value="${equipmentPlanMainYear.particularYear}"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </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="type" name="type" style="width: 170px;">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">实施人员</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName"
|
||||
placeholder="请选择实施人员" onclick="showUser4Handle();" autocomplete="off"
|
||||
value="${equipmentPlanMainYear.receiveUser.caption}">
|
||||
<input id="receiveUserId" name="receiveUserId" type="hidden"
|
||||
value="${equipmentPlanMainYear.receiveUserId}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="contents" name="contents"
|
||||
rows="2">${equipmentPlanMainYear.contents}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="remark" name="remark"
|
||||
rows="2">${equipmentPlanMainYear.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">计划详情</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addSubscribeDetailFun()" class="btn btn-box-tool" data-toggle="tooltip"
|
||||
title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deleteSubscribeDetailFun()" class="btn btn-box-tool" data-toggle="tooltip"
|
||||
title="删除"><i class="glyphicon glyphicon-minus"></i></a></div>
|
||||
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table1"></table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
100
src/main/webapp/jsp/maintenance/equipmentPlanMainYearImport.jsp
Normal file
100
src/main/webapp/jsp/maintenance/equipmentPlanMainYearImport.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.tools.CommUtil" %>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", "")); %>
|
||||
<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 control;
|
||||
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '${param.companyId}',//此处自定义传参
|
||||
"plan_type": '${param.plan_type}'
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.status == true) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s', data.response.msg, 'mainAlertdiv');
|
||||
} else {
|
||||
showAlert('d', data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initUpload("filelist", ext.contextPath + "/maintenance/equipmentPlanMainYear/saveExcelData.do");
|
||||
})
|
||||
|
||||
//导入上传文件的数据
|
||||
function importExcelFun() {
|
||||
if ($("#filelist").val() == null || $("#filelist").val() == "") {
|
||||
showAlert('d', '上传的文件不能为空!');
|
||||
} else {
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple
|
||||
accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
553
src/main/webapp/jsp/maintenance/equipmentPlanMainYearListBy.jsp
Normal file
553
src/main/webapp/jsp/maintenance/equipmentPlanMainYearListBy.jsp
Normal file
@ -0,0 +1,553 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/gettype.do", {}, function (data) {
|
||||
var selelct = $("#type_name1").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
}, 'json');
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/add.do', {
|
||||
unitId: unitId,
|
||||
planType: '${planType}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//导出设备列表
|
||||
function downloadFun() {
|
||||
var search_name = $('#search_name').val();
|
||||
var search_name_equipment = $('#search_name_equipment').val();
|
||||
var type_name1 = $('#type_name1').val();
|
||||
var supplierClass = $('#supplierClass').val();
|
||||
var equipmentPlanType = $('#equipmentPlanType').val();
|
||||
var search_year = $('#search_year').val();
|
||||
var plan_type = '${Code_Type_By}';
|
||||
window.open(ext.contextPath + "/maintenance/equipmentPlanMainYear/exportExcel.do?type_name=" + type_name1
|
||||
+ "&search_name=" + search_name
|
||||
+ "&search_name_equipment=" + search_name_equipment
|
||||
+ "&supplierClass=" + supplierClass
|
||||
+ "&equipmentPlanType=" + equipmentPlanType
|
||||
+ "&search_year=" + search_year
|
||||
+ "&unitId=" + unitId
|
||||
+ "&plan_type=" + plan_type
|
||||
);
|
||||
}
|
||||
|
||||
//导入设备列表
|
||||
function importFun() {
|
||||
var companyId = unitId;
|
||||
var plan_type = '${Code_Type_By}';
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/importEquipmentCard.do', {
|
||||
companyId: companyId,
|
||||
plan_type: plan_type
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/edit.do', {
|
||||
id: id,
|
||||
planType: '${planType}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/delete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/equipmentPlanMainYear/deletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYearQualification/deletebySupplierId.do', {id: datas}, function (data) {
|
||||
});
|
||||
$.post(ext.contextPath + '/sparepart/Score/deletebySupplierId.do', {id: datas}, function (data) {
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function initDate2() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||||
"九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker(
|
||||
{
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'),
|
||||
moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'),
|
||||
moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [
|
||||
moment().subtract(1, 'month').startOf('month'),
|
||||
moment().subtract(1, 'month').endOf('month')
|
||||
.subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore2,
|
||||
endDate: endTimeStore2
|
||||
},
|
||||
function (start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
|
||||
} else {
|
||||
this.element.val(this.startDate
|
||||
.format(this.locale.format)
|
||||
+ this.locale.separator
|
||||
+ this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(
|
||||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||||
};
|
||||
|
||||
var initEquipmentPlanType = function () {
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: 'by'}, function (data) {
|
||||
$("#equipmentPlanType").empty();
|
||||
var selelct_ = $("#equipmentPlanType").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var dosearchTab = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initEquipmentPlanType();
|
||||
|
||||
$('#search_year').datepicker({
|
||||
format: 'yyyy',
|
||||
weekStart: 1,
|
||||
autoclose: true,
|
||||
startView: 2,
|
||||
minViewMode: 2,
|
||||
maxViewMode: 2,
|
||||
forceParse: false,
|
||||
language: 'zh-CN'
|
||||
}).on('changeDate', dosearchTab);
|
||||
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanMainYear/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
// showColumns: true,
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_equ: $('#search_equ').val(),
|
||||
type_name: $('#type_name1').val(),
|
||||
supplierClass: $('#supplierClass').val(),
|
||||
equipmentPlanType: $('#equipmentPlanType').val(),
|
||||
search_year: $('#search_year').val(),
|
||||
unitId: unitId,
|
||||
planType: '${planType}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px'
|
||||
},
|
||||
{
|
||||
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '18%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentcardid + "'>" + row.equipmentCard.equipmentcardid + "</span>";
|
||||
} else {
|
||||
return "暂无关联设备";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '18%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentname + "'>" + row.equipmentCard.equipmentname + "</span>";
|
||||
} else {
|
||||
return "暂无关联设备";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'equipmentPlanType.name', // 返回json数据中的name
|
||||
title: '维保类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'planMoney', // 返回json数据中的name
|
||||
title: '计划费用', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%'
|
||||
},
|
||||
{
|
||||
field: 'particularYear', // 返回json数据中的name
|
||||
title: '计划年份', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%'
|
||||
},
|
||||
{
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '维保内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '28%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.contents + "'>" + row.contents + "</span>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'receiveUser.caption', // 返回json数据中的name
|
||||
title: '保养人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
// {
|
||||
// field: 'remark', // 返回json数据中的name
|
||||
// title: '备注', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// width: '10%'
|
||||
// },
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
// $("#status_val").select2({minimumResultsForSearch: 10}).val("").trigger("change");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<%-- <section class="content-header">--%>
|
||||
<%-- <h1 id="head_title"></h1>--%>
|
||||
<%-- <ol class="breadcrumb">--%>
|
||||
<%-- <li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div id="detailFunadd"></div>
|
||||
<div id="qualificationedit"></div>
|
||||
<div id="qualificationadd"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 320px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<label class="form-label">维保类型</label>
|
||||
<select class="form-control select2" id="equipmentPlanType" name="equipmentPlanType"
|
||||
style="width: 160px;"></select>
|
||||
<%-- <label class="form-label">状态</label>--%>
|
||||
<%-- <select class="form-control select2" id="status_val" name="status_val" style="width: 160px;"--%>
|
||||
<%-- onchange="dosearchTab();">--%>
|
||||
<%-- <option value="" selected="selected">全部</option>--%>
|
||||
<%-- <option value="${Status_NoStart}">未提交审核</option>--%>
|
||||
<%-- <option value="${Status_Start}">已提交审核</option>--%>
|
||||
<%-- <option value="${Status_Finish}">已通过</option>--%>
|
||||
<%-- </select>--%>
|
||||
<label class="form-label">年份</label>
|
||||
<div class="input-group" style="width: 60px;">
|
||||
<input class="form-control date-picker" id="search_year" name="search_year" autocomplete="off" type="text"
|
||||
placeholder="点击选择" style="background-color:#FFFFFF;height:100%;" value="${nowyear}"/>
|
||||
</div>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 60px;">--%>
|
||||
<%-- <input type="text" id="search_year" autocomplete="off" name="search_year"--%>
|
||||
<%-- class="form-control pull-right" style="height:34px" placeholder="请输入"--%>
|
||||
<%-- value="${nowyear}">--%>
|
||||
|
||||
<%-- </div>--%>
|
||||
<label class="form-label">设备搜索</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_equ" autocomplete="off"
|
||||
name="search_equ"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入设备ID或设备名称">
|
||||
</div>
|
||||
<label class="form-label">计划内容</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" autocomplete="off" name="search_name"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</html>
|
||||
532
src/main/webapp/jsp/maintenance/equipmentPlanMainYearListWx.jsp
Normal file
532
src/main/webapp/jsp/maintenance/equipmentPlanMainYearListWx.jsp
Normal file
@ -0,0 +1,532 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanMainYear/gettype.do", {}, function (data) {
|
||||
var selelct = $("#type_name1").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
}, 'json');
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/add.do', {
|
||||
unitId: unitId,
|
||||
planType: '${planType}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//导出设备列表
|
||||
function downloadFun() {
|
||||
var search_name = $('#search_name').val();
|
||||
var search_name_equipment = $('#search_name_equipment').val();
|
||||
var type_name1 = $('#type_name1').val();
|
||||
var supplierClass = $('#supplierClass').val();
|
||||
var equipmentPlanType = $('#equipmentPlanType').val();
|
||||
var search_year = $('#search_year').val();
|
||||
var plan_type = '${Code_Type_Wx}';
|
||||
window.open(ext.contextPath + "/maintenance/equipmentPlanMainYear/exportExcel.do?type_name=" + type_name1
|
||||
+ "&search_name=" + search_name
|
||||
+ "&search_name_equipment=" + search_name_equipment
|
||||
+ "&supplierClass=" + supplierClass
|
||||
+ "&equipmentPlanType=" + equipmentPlanType
|
||||
+ "&search_year=" + search_year
|
||||
+ "&unitId=" + unitId
|
||||
+ "&plan_type=" + plan_type
|
||||
);
|
||||
}
|
||||
|
||||
//导入设备列表
|
||||
function importFun() {
|
||||
var companyId = unitId;
|
||||
var plan_type = '${Code_Type_Wx}';
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/importEquipmentCard.do', {
|
||||
companyId: companyId,
|
||||
plan_type: plan_type
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/edit.do', {
|
||||
id: id,
|
||||
planType: '${planType}'
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/view.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYear/delete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/equipmentPlanMainYear/deletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanMainYearQualification/deletebySupplierId.do', {id: datas}, function (data) {
|
||||
});
|
||||
$.post(ext.contextPath + '/sparepart/Score/deletebySupplierId.do', {id: datas}, function (data) {
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function initDate2() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||||
"九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker(
|
||||
{
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'),
|
||||
moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'),
|
||||
moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [
|
||||
moment().subtract(1, 'month').startOf('month'),
|
||||
moment().subtract(1, 'month').endOf('month')
|
||||
.subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore2,
|
||||
endDate: endTimeStore2
|
||||
},
|
||||
function (start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
|
||||
} else {
|
||||
this.element.val(this.startDate
|
||||
.format(this.locale.format)
|
||||
+ this.locale.separator
|
||||
+ this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(
|
||||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||||
};
|
||||
|
||||
var initEquipmentPlanType = function () {
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList4Code.do", {code: 'wx'}, function (data) {
|
||||
$("#equipmentPlanType").empty();
|
||||
var selelct_ = $("#equipmentPlanType").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var dosearchTab = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initEquipmentPlanType();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanMainYear/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50, 200], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
// showColumns: true,
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_name_equipment: $('#search_name_equipment').val(),
|
||||
type_name: $('#type_name1').val(),
|
||||
supplierClass: $('#supplierClass').val(),
|
||||
equipmentPlanType: $('#equipmentPlanType').val(),
|
||||
search_year: $('#search_year').val(),
|
||||
unitId: unitId,
|
||||
planType: '${planType}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px'
|
||||
},
|
||||
{
|
||||
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '19%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentname + "'>" + row.equipmentCard.equipmentname + "</span>";
|
||||
} else {
|
||||
return "暂无关联设备";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'equipmentPlanType.name', // 返回json数据中的name
|
||||
title: '维修类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'planMoney', // 返回json数据中的name
|
||||
title: '计划费用', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '6%'
|
||||
},
|
||||
{
|
||||
field: 'particularYear', // 返回json数据中的name
|
||||
title: '计划年份', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '6%'
|
||||
},
|
||||
{
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '维保内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '33%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.contents + "'>" + row.contents + "</span>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'receiveUser.caption', // 返回json数据中的name
|
||||
title: '保养人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '6%'
|
||||
},
|
||||
{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
$("#status_val").select2({minimumResultsForSearch: 10}).val("").trigger("change");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div id="detailFunadd"></div>
|
||||
<div id="qualificationedit"></div>
|
||||
<div id="qualificationadd"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 320px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlanMainYear/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<label class="form-label">维修类型</label>
|
||||
<select class="form-control select2" id="equipmentPlanType" name="equipmentPlanType"
|
||||
style="width: 160px;"></select>
|
||||
<label class="form-label">状态</label>
|
||||
<select class="form-control select2" id="status_val" name="status_val" style="width: 160px;"
|
||||
onchange="dosearchTab();">
|
||||
<option value="" selected="selected">全部</option>
|
||||
<option value="${Status_NoStart}">未提交审核</option>
|
||||
<option value="${Status_Start}">已提交审核</option>
|
||||
<option value="${Status_Finish}">已通过</option>
|
||||
</select>
|
||||
<label class="form-label">年份</label>
|
||||
<div class="input-group input-group-sm" style="width: 60px;">
|
||||
<input type="text" id="search_year" autocomplete="off" name="search_year"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
|
||||
</div>
|
||||
<label class="form-label">设备名称</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name_equipment" autocomplete="off"
|
||||
name="search_name_equipment"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<label class="form-label">计划内容</label>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" autocomplete="off" name="search_name"
|
||||
class="form-control pull-right" style="height:34px" placeholder="请输入">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</html>
|
||||
107
src/main/webapp/jsp/maintenance/equipmentPlanTypeAdd.jsp
Normal file
107
src/main/webapp/jsp/maintenance/equipmentPlanTypeAdd.jsp
Normal file
@ -0,0 +1,107 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '代号不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#isCompete").select2({minimumResultsForSearch: 10});
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="id" id="id" type="hidden" value="${id}"/>
|
||||
<input name="pid" id="pid" type="hidden" value="-1"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${equipmentPlanType.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*代号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="代号"
|
||||
value="${equipmentPlanType.code}">
|
||||
</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="morder" name="morder" placeholder="顺序"
|
||||
value="${equipmentPlanType.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*是否启用抢单</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="isCompete" name="isCompete"
|
||||
style="width: 170px;">
|
||||
<option value="${Active_True}">启用</option>
|
||||
<option value="${Active_False}" selected="selected">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
125
src/main/webapp/jsp/maintenance/equipmentPlanTypeAddDetail.jsp
Normal file
125
src/main/webapp/jsp/maintenance/equipmentPlanTypeAddDetail.jsp
Normal file
@ -0,0 +1,125 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType"%>
|
||||
<%request.setAttribute("Type_Wx",EquipmentPlanType.Type_Wx); %>
|
||||
<%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); %>
|
||||
<%request.setAttribute("Type_Dx",EquipmentPlanType.Type_Dx); %>
|
||||
<%request.setAttribute("Type_Xz",EquipmentPlanType.Type_Xz); %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosaveDetail() {
|
||||
$("#subFormDetail").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormDetail").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/dosave.do", $("#subFormDetail").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_detail").bootstrapTable('refresh');
|
||||
closeModal("subModalDetail");
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subFormDetail").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择类型'
|
||||
}
|
||||
}
|
||||
},
|
||||
libraryActive: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择是否启用库'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalDetail">
|
||||
<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强制为subFormDetail -->
|
||||
<form class="form-horizontal" id="subFormDetail">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="id" id="id" type="hidden" value="${id}"/>
|
||||
<input name="pid" id="pid" type="hidden" value="${param.pid}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="" >
|
||||
</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="type" name ="type" style="width: 170px;">
|
||||
<option value="" selected="selected">请选择</option>
|
||||
<option value="${Type_Wx}">维修</option>
|
||||
<option value="${Type_Ty}">通用</option>
|
||||
<option value="${Type_Rh}">润滑</option>
|
||||
<option value="${Type_Ff}">防腐</option>
|
||||
<option value="${Type_Yb}">仪表</option>
|
||||
<option value="${Type_Dx}">大修</option>
|
||||
<option value="${Type_Xz}">重置</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*是否启用库</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="libraryActive" name ="libraryActive" style="width: 170px;">
|
||||
<option value="" selected="selected">请选择</option>
|
||||
<option value="${Active_True}">启用</option>
|
||||
<option value="${Active_False}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosaveDetail()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
276
src/main/webapp/jsp/maintenance/equipmentPlanTypeEdit.jsp
Normal file
276
src/main/webapp/jsp/maintenance/equipmentPlanTypeEdit.jsp
Normal file
@ -0,0 +1,276 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Type_Wx", EquipmentPlanType.Type_Wx); %>
|
||||
<%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); %>
|
||||
<%request.setAttribute("Type_Dx", EquipmentPlanType.Type_Dx); %>
|
||||
<%request.setAttribute("Type_Xz", EquipmentPlanType.Type_Xz); %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '代号不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//初始化抢单下拉框
|
||||
$("#isCompete").select2({minimumResultsForSearch: 10}).val("${equipmentPlanType.isCompete}").trigger("change");
|
||||
|
||||
$("#table_detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanType/getListDetail.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid: '${equipmentPlanType.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
}, {
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.type == '${Type_Wx}') {
|
||||
return "维修";
|
||||
}
|
||||
if (row.type == '${Type_Ty}') {
|
||||
return "通用";
|
||||
}
|
||||
if (row.type == '${Type_Rh}') {
|
||||
return "润滑";
|
||||
}
|
||||
if (row.type == '${Type_Ff}') {
|
||||
return "防腐";
|
||||
}
|
||||
if (row.type == '${Type_Yb}') {
|
||||
return "仪表";
|
||||
}
|
||||
if (row.type == '${Type_Dx}') {
|
||||
return "大修";
|
||||
}
|
||||
if (row.type == '${Type_Xz}') {
|
||||
return "重置";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'libraryActive', // 返回json数据中的name
|
||||
title: '是否启动库', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.libraryActive == '${Active_True}') {
|
||||
return "启用";
|
||||
}
|
||||
if (row.libraryActive == '${Active_False}') {
|
||||
return "禁用";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '20%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="doEditDetail(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="doDeleteDetail(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_detail");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var doAddDetail = function () {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanType/doaddDetail.do', {pid: '${equipmentPlanType.id}'}, function (data) {
|
||||
$("#subDivDetail").html(data);
|
||||
openModal('subModalDetail');
|
||||
});
|
||||
};
|
||||
var doEditDetail = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanType/doeditDetail.do', {id: id}, function (data) {
|
||||
$("#subDivDetail").html(data);
|
||||
openModal('subModalDetail');
|
||||
});
|
||||
};
|
||||
var doDeleteDetail = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/equipmentPlanType/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table_detail").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="id" id="id" type="hidden" value="${equipmentPlanType.id}"/>
|
||||
<input name="pid" id="pid" type="hidden" value="${equipmentPlanType.pid}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${equipmentPlanType.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*代号(请勿修改)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="代号"
|
||||
value="${equipmentPlanType.code}">
|
||||
</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="morder" name="morder" placeholder="顺序"
|
||||
value="${equipmentPlanType.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*是否启用抢单</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="isCompete" name="isCompete"
|
||||
style="width: 170px;">
|
||||
<option value="${Active_True}">启用</option>
|
||||
<option value="${Active_False}" selected="selected">禁用</option>
|
||||
</select>
|
||||
</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">
|
||||
<a onclick="doAddDetail()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i
|
||||
class="glyphicon glyphicon-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" 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>
|
||||
126
src/main/webapp/jsp/maintenance/equipmentPlanTypeEditDetail.jsp
Normal file
126
src/main/webapp/jsp/maintenance/equipmentPlanTypeEditDetail.jsp
Normal file
@ -0,0 +1,126 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType"%>
|
||||
<%request.setAttribute("Type_Wx",EquipmentPlanType.Type_Wx); %>
|
||||
<%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); %>
|
||||
<%request.setAttribute("Type_Dx",EquipmentPlanType.Type_Dx); %>
|
||||
<%request.setAttribute("Type_Xz",EquipmentPlanType.Type_Xz); %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosaveDetail() {
|
||||
$("#subFormDetail").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormDetail").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/doupdate.do", $("#subFormDetail").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_detail").bootstrapTable('refresh');
|
||||
closeModal("subModalDetail");
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subFormDetail").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
type: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择类型'
|
||||
}
|
||||
}
|
||||
},
|
||||
libraryActive: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择是否启用库'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$("#type").select2({minimumResultsForSearch: 10}).val("${equipmentPlanType.type}").trigger("change");
|
||||
$("#libraryActive").select2({minimumResultsForSearch: 10}).val("${equipmentPlanType.libraryActive}").trigger("change");
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModalDetail">
|
||||
<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强制为subFormDetail -->
|
||||
<form class="form-horizontal" id="subFormDetail">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="id" id="id" type="hidden" value="${equipmentPlanType.id}"/>
|
||||
<input name="pid" id="pid" type="hidden" value="${equipmentPlanType.pid}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${equipmentPlanType.name}" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${equipmentPlanType.morder}" >
|
||||
</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="type" name ="type" style="width: 170px;">
|
||||
<option value="" selected="selected">请选择</option>
|
||||
<option value="${Type_Wx}">维修</option>
|
||||
<option value="${Type_Ty}">通用</option>
|
||||
<option value="${Type_Rh}">润滑</option>
|
||||
<option value="${Type_Ff}">防腐</option>
|
||||
<option value="${Type_Yb}">仪表</option>
|
||||
<option value="${Type_Dx}">大修</option>
|
||||
<option value="${Type_Xz}">重置</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*是否启用库</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="libraryActive" name ="libraryActive" style="width: 170px;">
|
||||
<option value="" selected="selected">请选择</option>
|
||||
<option value="${Active_True}">启用</option>
|
||||
<option value="${Active_False}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosaveDetail()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
386
src/main/webapp/jsp/maintenance/equipmentPlanTypeList.jsp
Normal file
386
src/main/webapp/jsp/maintenance/equipmentPlanTypeList.jsp
Normal file
@ -0,0 +1,386 @@
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString" %>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr" %>
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%request.setAttribute("MAINTAIN", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); %>
|
||||
<%request.setAttribute("Response_StartProcess_NoProcessDef", MaintenanceCommString.Response_StartProcess_NoProcessDef); %>
|
||||
<%request.setAttribute("Response_StartProcess_NoUser", MaintenanceCommString.Response_StartProcess_NoUser); %>
|
||||
<%request.setAttribute("Response_StartProcess_PlanIssued", MaintenanceCommString.Response_StartProcess_PlanIssued); %>
|
||||
|
||||
<%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); %>
|
||||
|
||||
<%request.setAttribute("START", MaintenanceCommString.PLAN_START); %>
|
||||
<%request.setAttribute("SUBMIT", MaintenanceCommString.PLAN_SUBMIT); %>
|
||||
<%request.setAttribute("FINISH", MaintenanceCommString.PLAN_FINISH); %>
|
||||
|
||||
<%request.setAttribute("Type_Wx", EquipmentPlanType.Type_Wx); %>
|
||||
<%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); %>
|
||||
<%request.setAttribute("Type_Dx", EquipmentPlanType.Type_Dx); %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var companyId = "";
|
||||
|
||||
var addFun = function () {
|
||||
if (companyId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanType/doadd.do', {companyId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
var editFun = function (id) {
|
||||
//stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanType/doedit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanType/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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/equipmentPlanType/dodelete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/equipmentPlanType/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
// initEquipmentPlanType();
|
||||
initFun();
|
||||
};
|
||||
var dosearchTab = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
//选择保养类型
|
||||
var selectType = $("#searchType").select2({
|
||||
minimumResultsForSearch: 10,
|
||||
})
|
||||
selectType.val('').trigger("change");
|
||||
selectType.on("change", function (e) {
|
||||
dosearchTab();
|
||||
});
|
||||
|
||||
//输入框验证
|
||||
/* $("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
cname_input: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请先选择厂区'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}); */
|
||||
$("#status_val").select2({minimumResultsForSearch: 10}).val("").trigger("change");
|
||||
});
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order
|
||||
}
|
||||
};
|
||||
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
// initEquipmentPlanType();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanType/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
singleSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '代号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}, {
|
||||
field: 'libraryActive', // 返回json数据中的name
|
||||
title: '是否启动抢单', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.isCompete == '${Active_True}') {
|
||||
return "启用";
|
||||
}
|
||||
if (row.isCompete == '${Active_False}') {
|
||||
return "禁用";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '100px',
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<security:authorize buttonUrl="maintenance/equipmentPlan/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*var initEquipmentPlanType = function(){
|
||||
$.post(ext.contextPath + "/maintenance/equipmentPlanType/getSelectList.do", {}, function(data) {
|
||||
$("#equipmentPlanType").empty();
|
||||
var selelct_ =$("#equipmentPlanType").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
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('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearchTab();
|
||||
});
|
||||
},'json');
|
||||
}*/
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<!-- <div id="subDiv" style="width: 220px;height:10px;"></div> -->
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivDetail"></div>
|
||||
<div id="roleUserDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="traceDiv"></div>
|
||||
<div id="subDiv_Equipment"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div id="companySelectTree" style="display:none;"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="maintenance/equipmentPlan/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</form>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ionicons/css/ionicons.min.css"/>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
</html>
|
||||
237
src/main/webapp/jsp/maintenance/equipmentPlanView.jsp
Normal file
237
src/main/webapp/jsp/maintenance/equipmentPlanView.jsp
Normal file
@ -0,0 +1,237 @@
|
||||
<%@ taglib prefix="c" uri="/jodd" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
|
||||
<%@ page import="com.sipai.entity.maintenance.EquipmentPlan" %>
|
||||
<%request.setAttribute("Status_NoStart", EquipmentPlan.Status_NoStart); %>
|
||||
<%request.setAttribute("Status_Start", EquipmentPlan.Status_Start); %>
|
||||
<%request.setAttribute("Status_Finish", EquipmentPlan.Status_Finish); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.EquipmentPlanType" %>
|
||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||
<%request.setAttribute("Code_Type_By", EquipmentPlanType.Code_Type_By); %>
|
||||
<%request.setAttribute("Code_Type_Dx", EquipmentPlanType.Code_Type_Dx); %>
|
||||
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
//厂区ID
|
||||
var companyId = "${company.id}";
|
||||
|
||||
$(function () {
|
||||
//初始化文件显示
|
||||
getFileList_process();
|
||||
//下发日期选择
|
||||
$('#planDate').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm',
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('planDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planDate');
|
||||
});
|
||||
|
||||
//加载维修流程
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlan/showProcessView.do', {
|
||||
id: '${equipmentPlan.id}',
|
||||
inModal: 'inModal'
|
||||
}, function (data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
|
||||
|
||||
$("#table_equipmentCard").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/equipmentPlanEqu/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 100, 500], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid: '${equipmentPlan.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '35%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
// return row.equipmentCard.equipmentcardid;
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentcardid + "'>" + row.equipmentCard.equipmentcardid + "</span>";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '35%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||||
// return row.equipmentCard.equipmentname;
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentCard.equipmentname + "'>" + row.equipmentCard.equipmentname + "</span>";
|
||||
}
|
||||
}
|
||||
},
|
||||
/*{
|
||||
field: 'nr', // 返回json数据中的name
|
||||
title: '内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '25%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.contents + "'>" + row.contents + "</span>";
|
||||
}
|
||||
}, */
|
||||
{
|
||||
field: 'ys', // 返回json数据中的name
|
||||
title: '预算(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.planMoney;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewEquFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentCard");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
|
||||
var selectType = $("#planTypeBigName").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
var selectType = $("#planTypeSmallName").select2({
|
||||
minimumResultsForSearch: 10
|
||||
})
|
||||
|
||||
$("#cycle").select2({minimumResultsForSearch: 10}).val("${equipmentPlan.cycle}").trigger("change");
|
||||
});
|
||||
|
||||
var viewEquFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/equipmentPlanEqu/doview.do', {id: id}, function (data) {
|
||||
$("#subDivEqu").html(data);
|
||||
openModal('subModalEqu');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input name="status" id="status" type="hidden" value="${Status_NoStart}"/>
|
||||
<input name="id" id="id" type="hidden" value="${equipmentPlan.id}"/>
|
||||
<input name="planTypeBig" id="planTypeBig" type="hidden"
|
||||
value="${equipmentPlan.planTypeBig}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${companyName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentPlan.planNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${param.type == Code_Type_By}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类别</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${planTypeSmallName}</p>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预算 (元)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${equipmentPlan.planMoney}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<p class="form-control-static">${equipmentPlan.planDate.substring(0,7)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划内容</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${equipmentPlan.planContents}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联设备</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentCard" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-xs-12" id="showView"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,162 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
|
||||
<% request.setAttribute("Maintain_IN", com.sipai.entity.maintenance.MaintainCommStr.Maintain_IN); %>
|
||||
<% request.setAttribute("Maintain_OUT", com.sipai.entity.maintenance.MaintainCommStr.Maintain_OUT); %>
|
||||
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#table_content_branch").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/repairLibraryBranch/getList4Trunk.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
id: '${param.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
// responseHandler: function(res){
|
||||
// return res.result
|
||||
// },
|
||||
columns: [
|
||||
{
|
||||
field: 'companyName', // 返回json数据中的name
|
||||
title: '厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.company!=null && row.company!=''){
|
||||
return row.company.sname;
|
||||
}else{
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'equipmentModel', // 返回json数据中的name
|
||||
title: '型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.equipmentCard!=null && row.equipmentCard!=''){
|
||||
return row.equipmentCard.equipmentTypeNumber.name;
|
||||
}else{
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'insideRepairTime', // 返回json数据中的name
|
||||
title: '自修工时(小时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.insideRepairTime!=null && row.insideRepairTime!=''){
|
||||
return row.insideRepairTime;
|
||||
}else{
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'outsideRepairCost', // 返回json数据中的name
|
||||
title: '委外费用(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.outsideRepairCost!=null && row.outsideRepairCost!=''){
|
||||
return row.outsideRepairCost;
|
||||
}else{
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'materialCost', // 返回json数据中的name
|
||||
title: '物资费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.materialCost;
|
||||
}
|
||||
}, {
|
||||
field: 'adjustmentReason', // 返回json数据中的name
|
||||
title: '调整原因', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '30%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.adjustmentReason;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_content_branch");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
});
|
||||
</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">
|
||||
|
||||
<!-- 分厂调整列表 -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<!-- <h3 class="box-title">分厂定额</h3> -->
|
||||
<div class="box-tools pull-right">
|
||||
<!-- <a onclick="getMaterials()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i
|
||||
class="glyphicon glyphicon-edit"></i></a> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_content_branch"></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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
76
src/main/webapp/jsp/maintenance/faultTypeForSelects.jsp
Normal file
76
src/main/webapp/jsp/maintenance/faultTypeForSelects.jsp
Normal file
@ -0,0 +1,76 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
function doSelectFaultType() {
|
||||
var checkedtree = $('#faultType_tree').treeview('getChecked');
|
||||
var datas="";
|
||||
var datas_name="";
|
||||
$.each(checkedtree,function(index,item){
|
||||
if(item.pid != '-1'){
|
||||
if(datas != ""){
|
||||
datas+= ",";
|
||||
}
|
||||
datas+=item.id;
|
||||
if(datas_name != ""){
|
||||
datas_name+= ",";
|
||||
}
|
||||
datas_name+=item.text;
|
||||
}
|
||||
});
|
||||
if(datas!=""){
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("problemTyp4SelectModal")
|
||||
}else{
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
closeModal("problemTyp4SelectModal")
|
||||
}
|
||||
}
|
||||
function selectNode(){
|
||||
$.each(eval('${json}'),function(index,item){
|
||||
var node =$('#faultType_tree').treeview('findNodes', [item.id, 'id']);
|
||||
$('#faultType_tree').treeview('toggleNodeChecked', [ node, { silent: true } ]);
|
||||
});
|
||||
}
|
||||
function initialTree(){
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/getFaultTypeTree.do', {} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length > 0){
|
||||
$('#faultType_tree').treeview({
|
||||
data: data,
|
||||
showCheckbox: true,
|
||||
//showTags:true,
|
||||
showBorder:false,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
onRendered: function() {
|
||||
setTimeout("selectNode();","10");
|
||||
}
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
$(function() {
|
||||
initialTree();
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="problemTyp4SelectModal" >
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" data-target="#menuFuncModal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择故障类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="alertDiv"></div>
|
||||
<div id="faultType_tree" style="height:400px;overflow:auto; "></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" data-target="#menuFuncModal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelectFaultType()">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,39 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/getFaultLibrariesJsonActive.do', function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#fault_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#fault_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("fault4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="fault4SelectModal">
|
||||
<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">
|
||||
<div id="fault_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
135
src/main/webapp/jsp/maintenance/faultlibraryManage.jsp
Normal file
135
src/main/webapp/jsp/maintenance/faultlibraryManage.jsp
Normal file
@ -0,0 +1,135 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="-1";
|
||||
console.info(node)
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/doadd.do', {pid:pid} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/doedit.do', {id:id} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
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 + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/getFaultLibrariesJson.do', function(data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({data: data
|
||||
});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
editFun(data.id);
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
},'json');
|
||||
$("#faultBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
initTreeView();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">故障列表</h3>
|
||||
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8" id="faultBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
87
src/main/webapp/jsp/maintenance/judgeMaintainDetail.jsp
Normal file
87
src/main/webapp/jsp/maintenance/judgeMaintainDetail.jsp
Normal file
@ -0,0 +1,87 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<%request.setAttribute("Status_CancelTOMaintainer",Maintenance.Status_CancelTOMaintainer);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
var judgemaintainerstaff = $('#judgemaintainerstaff').val();
|
||||
var judgeresult = $('#judgeresult').val();
|
||||
if (judgemaintainerstaff == 0 && judgeresult == 0) {
|
||||
showAlert('d', '尚未评价!')
|
||||
} else {
|
||||
$.post(ext.contextPath + "/maintenance/updateDetail.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$(".modal").modal("hide");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '评价失败,请重试!');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
$(function () {
|
||||
|
||||
|
||||
$("#judgemaintainer").rating('refresh', { showClear: false, showCaption: false });
|
||||
$("#judgemaintainerstaff").rating('refresh', { showClear: false, showCaption: false });
|
||||
$("#judgeresult").rating('refresh', { showClear: false, showCaption: false });
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name="id" value="${maintenanceDetail.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">您对保养人员服务评价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="judgemaintainerstaff" name="judgemaintainerstaff" type="number" class="rating" min=0 max=5
|
||||
step=1 data-size="xs">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">您对保养结果评价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="judgeresult" name="judgeresult" type="number" class="rating" min=0 max=5 step=1 data-size="xs">
|
||||
</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="doupdate()">完成评价</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,91 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<%request.setAttribute("Status_CancelTOMaintainer",Maintenance.Status_CancelTOMaintainer);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
var judgemaintainer =$('#judgemaintainer').val();
|
||||
var judgemaintainerstaff =$('#judgemaintainerstaff').val();
|
||||
var judgeresult =$('#judgeresult').val();
|
||||
if(judgemaintainer==0 && judgemaintainerstaff==0 &&judgeresult==0){
|
||||
showAlert('d','尚未评价!')
|
||||
}else{
|
||||
$.post(ext.contextPath + "/maintenance/updateData.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$(".modal").modal("hide");
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','评价失败,请重试!');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
$(function() {
|
||||
|
||||
|
||||
$("#judgemaintainer").rating('refresh',{showClear:false,showCaption:false});
|
||||
$("#judgemaintainerstaff").rating('refresh',{showClear:false,showCaption:false});
|
||||
$("#judgeresult").rating('refresh',{showClear:false,showCaption:false});
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id ="maintenanceId" name ="id" value="${maintenance.id}">
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-4 control-label">您对运维商服务评价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="judgemaintainer" name='judgemaintainer' type="number" class="rating" min=0 max=5 step=1 data-size="xs" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-4 control-label">您对运维人员服务评价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="judgemaintainerstaff" name="judgemaintainerstaff" type="number" class="rating" min=0 max=5 step=1 data-size="xs" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-4 control-label">您对运维结果评价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="judgeresult" name="judgeresult" type="number" class="rating" min=0 max=5 step=1 data-size="xs" >
|
||||
</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="doupdate()" >完成评价</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
95
src/main/webapp/jsp/maintenance/libraryAddResetImport.jsp
Normal file
95
src/main/webapp/jsp/maintenance/libraryAddResetImport.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<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 control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '-1', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/maintenance/libraryAddResetProject/saveExcelData.do?unitId="+unitId);
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,95 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<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 control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '-1', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/maintenance/libraryAddResetProject/saveExcelData4Biz.do?unitId="+unitId);
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
221
src/main/webapp/jsp/maintenance/libraryAddResetProjectAdd.jsp
Normal file
221
src/main/webapp/jsp/maintenance/libraryAddResetProjectAdd.jsp
Normal file
@ -0,0 +1,221 @@
|
||||
<%@ 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);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_add", MaintainCommStr.Maintain_OverhaulType_add);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_reset", MaintainCommStr.Maintain_OverhaulType_reset);%>
|
||||
<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/libraryAddResetProject/dosave4Bloc.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#projectTable").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: {
|
||||
code:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目名称不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
$("#div_in").show();
|
||||
$("#div_out").hide();
|
||||
$("#div_in").find(":input").attr("disabled", false);
|
||||
$("#div_out").find(":input").attr("disabled", true);
|
||||
|
||||
//委外显示运输费 自修隐藏
|
||||
$('input[type=radio][name=repairPartyType]').change(function () {
|
||||
if (this.value == '${Maintain_IN}') {//自修
|
||||
$("#div_in").show();
|
||||
$("#div_out").hide();
|
||||
$("#div_in").find(":input").attr("disabled", false);
|
||||
$("#div_out").find(":input").attr("disabled", true);
|
||||
} else {//委外
|
||||
$("#div_in").hide();
|
||||
$("#div_out").show();
|
||||
$("#div_in").find(":input").attr("disabled", true);
|
||||
$("#div_out").find(":input").attr("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</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="${libraryAddResetProject.id}">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}" readonly="true">
|
||||
<input type="hidden" id="unitId" name="unitId" value="${param.unitId}" readonly="true">
|
||||
|
||||
<!-- 界面提醒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="code" name="code" placeholder="项目编号" autocomplete="off" >
|
||||
</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" >
|
||||
</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="${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="type" id="type1" value="${Maintain_OverhaulType_add}" checked> 新增
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="type" id="type2" value="${Maintain_OverhaulType_reset}"> 重置
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_in">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"><span style="color:red;">自修定额:</span></label>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原设备拆除(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="dismantle" name="dismantle" placeholder="原设备拆除" autocomplete="off" value="0" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">新设备安装(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="install" name="install" placeholder="新设备本体安装" value="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新设备调试(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="debugging" name="debugging" placeholder="新设备调试" value="0" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">附属及土建(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="accessory" name="accessory" placeholder="附属物及土建" value="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费" value="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_out">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"><span style="color:red;">委外定额:</span></label>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原设备拆除(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="dismantle" name="dismantle" placeholder="原设备拆除" autocomplete="off" value="0" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">新设备安装(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="install" name="install" placeholder="新设备本体安装" value="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新设备调试(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="debugging" name="debugging" placeholder="新设备调试" value="0" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">附属物及土建(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="accessory" name="accessory" placeholder="附属物及土建" value="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">运输费等(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="transport" name="transport" placeholder="运输费等" value="0}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费" value="0" step="0.01">
|
||||
</div>
|
||||
</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>
|
||||
@ -0,0 +1,164 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//var unitId="";
|
||||
|
||||
var updateFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/libraryOverhaulProjectBiz/update4UintId.do', {unitId: unitId}, function (data) {
|
||||
if (data.code == 1) {
|
||||
alert('同步成功');
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
alert('同步失败');
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
var editFun = function (id, pid, type) {
|
||||
|
||||
//获取对应的设备型号
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ext.contextPath + '/equipment/getdata4Equ.do',
|
||||
data: {id: id, pid: pid, type: type, unitId: unitId},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
$('#modelButton').empty(); //清空resText里面的所有内容
|
||||
var html = '';
|
||||
modelId = '-1';
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\''+-1+'\');">通用</button>';
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
// if (i == 0) {
|
||||
// modelId = data[i].id;
|
||||
// }
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + data[i].id + '\');">' + data[i].text + '</button>';
|
||||
}
|
||||
$('#modelButton').html(html);
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/showListBiz.do', {
|
||||
classId: id,
|
||||
type: type,
|
||||
modelId: modelId,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#overhaulTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
function choiceModel(id) {
|
||||
$('#modelId').val(id);//给型号id赋值
|
||||
$('#projectId').val('');//清除用于大修内容的id
|
||||
|
||||
projectFun();
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTree4EquipmentCardWithoutParts.do', {unitId: unitId}, function (data) {
|
||||
var treeData = data.result;
|
||||
console.log(treeData);
|
||||
$('#tree').treeview({data: treeData, levels: 2});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
});
|
||||
}, 'json');
|
||||
$("#overhaulTable").html("");
|
||||
};
|
||||
|
||||
//导入
|
||||
function doImport() {
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/doImport4Biz.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport() {
|
||||
window.open(ext.contextPath + "/maintenance/libraryAddResetProject/doExport4Biz.do?unitId=" + unitId);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//alert(unitId);
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<div class="box-tools">
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExport();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 设备型号按钮 -->
|
||||
<div class="col-md-9" id="modelButton"></div>
|
||||
<!-- 大修项目及内容 -->
|
||||
<div class="col-md-9" id="overhaulTable"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,155 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var unitId = "";
|
||||
|
||||
var editFun = function (id, pid, type) {
|
||||
var modelId = '';
|
||||
|
||||
//获取对应的设备型号
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ext.contextPath + '/equipment/equipmentTypeNumber/getdata4EquClass.do',
|
||||
data: {id: id, pid: pid, type: type},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
$('#modelButton').empty(); //清空resText里面的所有内容
|
||||
var html = '';
|
||||
modelId = '-1';
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + -1 + '\',\'(' + '通用' + ')\');">通用</button>';
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + data[i].id + '\',\'(' + data[i].text + ')\');">' + data[i].text + '</button>';
|
||||
}
|
||||
$('#modelButton').html(html);
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/showListBloc.do', {
|
||||
classId: id,
|
||||
type: type,
|
||||
modelId: modelId
|
||||
}, function (data) {
|
||||
$("#newAndResetTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
function choiceModel(id, text) {
|
||||
$('#modelId').val(id);//给型号id赋值
|
||||
$('#modelNameId').html(text);
|
||||
|
||||
if ($('#modelId').val() != '-1') {
|
||||
$("#projectadd").hide();
|
||||
// $("#contentadd").hide();
|
||||
} else {
|
||||
$("#projectadd").show();
|
||||
// $("#contentadd").show();
|
||||
}
|
||||
|
||||
projectFun();
|
||||
// contentFun();
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson4Equ.do', {unitId: unitId}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 2});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
// if(treeData.type == 3){
|
||||
// $("#addDiv").css("display","block");//显示div
|
||||
// }else{
|
||||
// $("#addDiv").css("display","none");//隐藏div
|
||||
// }
|
||||
|
||||
});
|
||||
}, 'json');
|
||||
$("#newAndResetTable").html("");
|
||||
};
|
||||
|
||||
//导入
|
||||
function doImport() {
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/doImport.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport() {
|
||||
window.open(ext.contextPath + "/maintenance/libraryAddResetProject/doExport.do?unitId=" + unitId);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
unitId = unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<div class="box-tools" id="addDiv">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExport();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:1000px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 设备型号按钮 -->
|
||||
<div class="col-md-9" id="modelButton"></div>
|
||||
<!-- 大修项目及内容 -->
|
||||
<div class="col-md-9" id="newAndResetTable"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
235
src/main/webapp/jsp/maintenance/libraryAddResetProjectEdit.jsp
Normal file
235
src/main/webapp/jsp/maintenance/libraryAddResetProjectEdit.jsp
Normal file
@ -0,0 +1,235 @@
|
||||
<%@ 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);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_add", MaintainCommStr.Maintain_OverhaulType_add);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_reset", MaintainCommStr.Maintain_OverhaulType_reset);%>
|
||||
<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');//提交验证
|
||||
$.post(ext.contextPath + "/maintenance/libraryAddResetProject/doupdate4Bloc.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#projectTable").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: {
|
||||
code:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目名称不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
//委外显示运输费 自修隐藏
|
||||
$('input[type=radio][name=repairPartyType]').change(function () {
|
||||
if (this.value == '${Maintain_IN}') {//自修
|
||||
$("#div_in").show();
|
||||
$("#div_out").hide();
|
||||
$("#div_in").find(":input").attr("disabled", false);
|
||||
$("#div_out").find(":input").attr("disabled", true);
|
||||
}else {//委外
|
||||
$("#div_in").hide();
|
||||
$("#div_out").show();
|
||||
$("#div_in").find(":input").attr("disabled", true);
|
||||
$("#div_out").find(":input").attr("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
if ("${libraryAddResetProject.repairPartyType }" == "${Maintain_IN}") {//自修
|
||||
$("#repairPartyType1").attr("checked","checked");
|
||||
$("#repairPartyType2").removeAttr("checked");
|
||||
$("#div_in").show();
|
||||
$("#div_out").hide();
|
||||
$("#div_in").find(":input").attr("disabled", false);
|
||||
$("#div_out").find(":input").attr("disabled", true);
|
||||
}else{//委外
|
||||
$("#repairPartyType2").attr("checked","checked");
|
||||
$("#repairPartyType1").removeAttr("checked");
|
||||
$("#div_in").hide();
|
||||
$("#div_out").show();
|
||||
$("#div_in").find(":input").attr("disabled", true);
|
||||
$("#div_out").find(":input").attr("disabled", false);
|
||||
}
|
||||
|
||||
if ("${libraryAddResetProject.type }" == "${Maintain_OverhaulType_add}") {
|
||||
$("#type1").attr("checked","checked");
|
||||
$("#type2").removeAttr("checked");
|
||||
}else{
|
||||
$("#type2").attr("checked","checked");
|
||||
$("#type1").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="${libraryAddResetProject.id}">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}" readonly="true">
|
||||
<input type="hidden" id="unitId" name="unitId" value="${param.unitId}" readonly="true">
|
||||
<!-- 界面提醒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="code" name="code" placeholder="项目编号" autocomplete="off" value="${libraryAddResetProject.code}">
|
||||
</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="${libraryAddResetProject.name}">
|
||||
</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="type" id="type1" value="${Maintain_OverhaulType_add}" checked> 新增
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="type" id="type2" value="${Maintain_OverhaulType_reset}"> 重置
|
||||
</label>
|
||||
</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="${libraryAddResetProject.pid}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="div_in">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"><span style="color:red;">自修定额:</span></label>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原设备拆除(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="dismantle" name="dismantle" placeholder="原设备拆除" autocomplete="off" value="${libraryAddResetProject.libraryAddResetProjectBloc.dismantle}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">新设备安装(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="install" name="install" placeholder="新设备本体安装" value="${libraryAddResetProject.libraryAddResetProjectBloc.install}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新设备调试(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="debugging" name="debugging" placeholder="新设备调试" value="${libraryAddResetProject.libraryAddResetProjectBloc.debugging}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">附属及土建(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="accessory" name="accessory" placeholder="附属物及土建" value="${libraryAddResetProject.libraryAddResetProjectBloc.accessory}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费" value="${libraryAddResetProject.libraryAddResetProjectBloc.materialCost}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_out">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"><span style="color:red;">委外定额:</span></label>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原设备拆除(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="dismantle" name="dismantle" placeholder="原设备拆除" autocomplete="off" value="${libraryAddResetProject.libraryAddResetProjectBloc.dismantle}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">新设备安装(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="install" name="install" placeholder="新设备本体安装" value="${libraryAddResetProject.libraryAddResetProjectBloc.install}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新设备调试(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="debugging" name="debugging" placeholder="新设备调试" value="${libraryAddResetProject.libraryAddResetProjectBloc.debugging}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">附属物及土建(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="accessory" name="accessory" placeholder="附属物及土建" value="${libraryAddResetProject.libraryAddResetProjectBloc.accessory}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">运输费等(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="transport" name="transport" placeholder="运输费等" value="${libraryAddResetProject.libraryAddResetProjectBloc.transport}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费" value="${libraryAddResetProject.libraryAddResetProjectBloc.materialCost}" step="0.01">
|
||||
</div>
|
||||
</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>
|
||||
@ -0,0 +1,220 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%request.setAttribute("Maintain_IN", MaintainCommStr.Maintain_IN);%>
|
||||
<%request.setAttribute("Maintain_OUT", MaintainCommStr.Maintain_OUT);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_add", MaintainCommStr.Maintain_OverhaulType_add);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_reset", MaintainCommStr.Maintain_OverhaulType_reset);%>
|
||||
<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');//提交验证
|
||||
$.post(ext.contextPath + "/maintenance/libraryAddResetProject/doupdate4Biz.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#projectTable").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: {
|
||||
code:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目名称不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
if ("${libraryAddResetProject.repairPartyType }" == "${Maintain_IN}") {//自修
|
||||
$("#repairPartyType1").attr("checked","checked");
|
||||
$("#repairPartyType2").removeAttr("checked");
|
||||
$("#div_in").show();
|
||||
$("#div_out").hide();
|
||||
$("#div_in").find(":input").attr("disabled", false);
|
||||
$("#div_out").find(":input").attr("disabled", true);
|
||||
}else{//委外
|
||||
$("#repairPartyType2").attr("checked","checked");
|
||||
$("#repairPartyType1").removeAttr("checked");
|
||||
$("#div_in").hide();
|
||||
$("#div_out").show();
|
||||
$("#div_in").find(":input").attr("disabled", true);
|
||||
$("#div_out").find(":input").attr("disabled", false);
|
||||
}
|
||||
|
||||
if ("${libraryAddResetProject.type }" == "${Maintain_OverhaulType_add}") {
|
||||
$("#type1").attr("checked","checked");
|
||||
$("#type2").removeAttr("checked");
|
||||
}else{
|
||||
$("#type2").attr("checked","checked");
|
||||
$("#type1").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="${libraryAddResetProject.id}">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}" readonly="true">
|
||||
<input type="hidden" id="unitId" name="unitId" value="${param.unitId}" readonly="true">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">项目编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${libraryAddResetProject.code}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">项目名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${libraryAddResetProject.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">大修方式</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="hidden" name="repairPartyType" value="${libraryAddResetProject.repairPartyType}" readonly="true">
|
||||
<c:if test="${libraryAddResetProject.repairPartyType == Maintain_IN}">
|
||||
<p class="form-control-static">自修</p>
|
||||
</c:if>
|
||||
<c:if test="${libraryAddResetProject.repairPartyType == Maintain_OUT}">
|
||||
<p class="form-control-static">委外</p>
|
||||
</c:if>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">大修类型</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${libraryAddResetProject.type == Maintain_OverhaulType_add}">
|
||||
<p class="form-control-static">新增</p>
|
||||
</c:if>
|
||||
<c:if test="${libraryAddResetProject.type == Maintain_OverhaulType_reset}">
|
||||
<p class="form-control-static">重置</p>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">上级层级</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${pname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_in">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"><span style="color:red;">自修定额:</span></label>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原设备拆除(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="dismantle" name="dismantle" placeholder="原设备拆除" autocomplete="off" value="${libraryAddResetProject.libraryAddResetProjectBiz.dismantle}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">新设备安装(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="install" name="install" placeholder="新设备本体安装" value="${libraryAddResetProject.libraryAddResetProjectBiz.install}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新设备调试(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="debugging" name="debugging" placeholder="新设备调试" value="${libraryAddResetProject.libraryAddResetProjectBiz.debugging}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">附属及土建(小时)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="accessory" name="accessory" placeholder="附属物及土建" value="${libraryAddResetProject.libraryAddResetProjectBiz.accessory}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费" value="${libraryAddResetProject.libraryAddResetProjectBiz.materialCost}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_out">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"><span style="color:red;">委外定额:</span></label>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原设备拆除(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="dismantle" name="dismantle" placeholder="原设备拆除" autocomplete="off" value="${libraryAddResetProject.libraryAddResetProjectBiz.dismantle}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">新设备安装(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="install" name="install" placeholder="新设备本体安装" value="${libraryAddResetProject.libraryAddResetProjectBiz.install}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新设备调试(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="debugging" name="debugging" placeholder="新设备调试" value="${libraryAddResetProject.libraryAddResetProjectBiz.debugging}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">附属物及土建(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="accessory" name="accessory" placeholder="附属物及土建" value="${libraryAddResetProject.libraryAddResetProjectBiz.accessory}" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">运输费等(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="transport" name="transport" placeholder="运输费等" value="${libraryAddResetProject.libraryAddResetProjectBiz.transport}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">物资费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="materialCost" name="materialCost" placeholder="物资费" value="${libraryAddResetProject.libraryAddResetProjectBiz.materialCost}" step="0.01">
|
||||
</div>
|
||||
</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>
|
||||
@ -0,0 +1,219 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%request.setAttribute("Maintain_IN", MaintainCommStr.Maintain_IN);%>
|
||||
<%request.setAttribute("Maintain_OUT", MaintainCommStr.Maintain_OUT);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_add", MaintainCommStr.Maintain_OverhaulType_add);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_reset", MaintainCommStr.Maintain_OverhaulType_reset);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var companyId;
|
||||
|
||||
var dosearch = function () {
|
||||
$("#projectTable").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var projectFun = function () {
|
||||
var modelId = $('#modelId').val();
|
||||
|
||||
$("#projectTable").bootstrapTable('destroy');
|
||||
$("#projectTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryAddResetProject/getListJsonBiz.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [12,24], // 设置页面可以显示的数据条数
|
||||
pageSize: 12, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
classId: '${param.classId}',
|
||||
modelId: modelId,
|
||||
unitId: unitId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//赋值一个故障库id 用于维修库新增使用
|
||||
$('#projectId').val(row.id);
|
||||
},
|
||||
//rowStyle:rowStyleFault,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
field: 'cs',
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '项目编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.code;
|
||||
}
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '项目名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.name;
|
||||
}
|
||||
}, {
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '新增/重置', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.type=='${Maintain_OverhaulType_add}'){
|
||||
return '新增';
|
||||
}
|
||||
if(row.type=='${Maintain_OverhaulType_reset}'){
|
||||
return '重置';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'repairPartyType', // 返回json数据中的name
|
||||
title: '维修方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.repairPartyType=='${Maintain_IN}'){
|
||||
return '自修';
|
||||
}
|
||||
if(row.repairPartyType=='${Maintain_OUT}'){
|
||||
return '委外';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '', // 返回json数据中的name
|
||||
title: '自主实施工时(时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.libraryAddResetProjectBiz!=null){
|
||||
return row.libraryAddResetProjectBiz.insideRepairTime;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: '', // 返回json数据中的name
|
||||
title: '委外工时费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.libraryAddResetProjectBiz!=null){
|
||||
return row.libraryAddResetProjectBiz.outsideRepairCost;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: '', // 返回json数据中的name
|
||||
title: '物资费定额(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.libraryAddResetProjectBiz!=null){
|
||||
return row.libraryAddResetProjectBiz.materialCost;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'button',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editProjectFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("projectTable");
|
||||
//合并单元格
|
||||
var data = $('#projectTable').bootstrapTable('getData', true);
|
||||
//mergeCells(data, "code", 1, $('#projectTable'));
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//修改
|
||||
var editProjectFun = function (id) {
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/doeditBiz.do', { id: id, modelId: modelId, unitId: unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
projectFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<input type="hidden" id="classId" name="classId" value="${param.classId}">
|
||||
<input type="hidden" id="projectId" name="projectId" value="">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}">
|
||||
|
||||
<!-- <input type="text" id="search_name" name="search_name" value="${param.search_name}"> -->
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增重置项目</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;" id="modelNameId">(通用)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<!-- <button id="projectadd" type="button" class="btn btn-default" onclick="addProjectFun();"><i class="fa fa-plus"></i> 新增</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>
|
||||
|
||||
<table id="projectTable" ></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@ -0,0 +1,357 @@
|
||||
<%@page import="com.sipai.entity.maintenance.MaintainCommStr"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%request.setAttribute("Maintain_IN", MaintainCommStr.Maintain_IN);%>
|
||||
<%request.setAttribute("Maintain_OUT", MaintainCommStr.Maintain_OUT);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_add", MaintainCommStr.Maintain_OverhaulType_add);%>
|
||||
<%request.setAttribute("Maintain_OverhaulType_reset", MaintainCommStr.Maintain_OverhaulType_reset);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var companyId;
|
||||
|
||||
|
||||
// var viewFun = function (id) {
|
||||
// $.post(ext.contextPath + '/timeEfficiency/patrolModel/doview.do', { id: id }, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// }
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/timeEfficiency/patrolContents/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function () {
|
||||
$("#projectTable").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var projectFun = function () {
|
||||
var modelId = $('#modelId').val();
|
||||
|
||||
$("#projectTable").bootstrapTable('destroy');
|
||||
$("#projectTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryAddResetProject/getListJsonBloc.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [12,24], // 设置页面可以显示的数据条数
|
||||
pageSize: 12, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
classId: '${param.classId}',
|
||||
modelId: modelId,
|
||||
unitId: unitId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//赋值一个故障库id 用于维修库新增使用
|
||||
$('#projectId').val(row.id);
|
||||
},
|
||||
//rowStyle:rowStyleFault,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
field: 'cs',
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '项目编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.code;
|
||||
}
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '项目名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.name;
|
||||
}
|
||||
}, {
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '新增/重置', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.type=='${Maintain_OverhaulType_add}'){
|
||||
return '新增';
|
||||
}
|
||||
if(row.type=='${Maintain_OverhaulType_reset}'){
|
||||
return '重置';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'repairPartyType', // 返回json数据中的name
|
||||
title: '维修方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.repairPartyType=='${Maintain_IN}'){
|
||||
return '自修';
|
||||
}
|
||||
if(row.repairPartyType=='${Maintain_OUT}'){
|
||||
return '委外';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: '', // 返回json数据中的name
|
||||
title: '自主实施工时(时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.libraryAddResetProjectBloc!=null){
|
||||
return row.libraryAddResetProjectBloc.insideRepairTime;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: '', // 返回json数据中的name
|
||||
title: '委外工时费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.libraryAddResetProjectBloc!=null){
|
||||
return row.libraryAddResetProjectBloc.outsideRepairCost;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: '', // 返回json数据中的name
|
||||
title: '物资费定额(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.libraryAddResetProjectBloc!=null){
|
||||
return row.libraryAddResetProjectBloc.materialCost;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'button',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editProjectFun(\'' + 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="deleteProjectFun(\'' + 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("projectTable");
|
||||
//合并单元格
|
||||
var data = $('#projectTable').bootstrapTable('getData', true);
|
||||
//mergeCells(data, "code", 1, $('#projectTable'));
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 合并单元格
|
||||
* @param data 原始数据(在服务端完成排序)
|
||||
* @param fieldName 合并属性名称
|
||||
* @param colspan 合并列
|
||||
* @param target 目标表格对象
|
||||
*/
|
||||
// function mergeCells(data,fieldName,colspan,target){
|
||||
// //声明一个map计算相同属性值在data对象出现的次数和
|
||||
// var sortMap = {};
|
||||
// for(var i = 0 ; i < data.length ; i++){
|
||||
// for(var prop in data[i]){
|
||||
// if(prop == fieldName){
|
||||
// var key = data[i][prop]
|
||||
// if(sortMap.hasOwnProperty(key)){
|
||||
// sortMap[key] = sortMap[key] * 1 + 1;
|
||||
// } else {
|
||||
// sortMap[key] = 1;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// for(var prop in sortMap){
|
||||
// console.log(prop,sortMap[prop])
|
||||
// }
|
||||
// var index = 0;
|
||||
// for(var prop in sortMap){
|
||||
// var count = sortMap[prop] * 1;
|
||||
// $(target).bootstrapTable('mergeCells',{index:index, field:fieldName, colspan: colspan, rowspan: count});
|
||||
// $(target).bootstrapTable('mergeCells',{index:index, field:'name', colspan: colspan, rowspan: count});
|
||||
// $(target).bootstrapTable('mergeCells',{index:index, field:'cs', colspan: colspan, rowspan: count});
|
||||
// $(target).bootstrapTable('mergeCells',{index:index, field:'button', colspan: colspan, rowspan: count});
|
||||
// $(target).bootstrapTable('mergeCells',{index:index, field:'repairPartyType', colspan: colspan, rowspan: count});
|
||||
// $(target).bootstrapTable('mergeCells',{index:index, field:'type', colspan: colspan, rowspan: count});
|
||||
// index += count;
|
||||
// }
|
||||
// }
|
||||
|
||||
//新增
|
||||
var addProjectFun = function () {
|
||||
var pid = '${param.classId}';
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/doadd.do', { pid: pid, modelId: modelId, unitId: unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//修改
|
||||
var editProjectFun = function (id) {
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryAddResetProject/doedit.do', { id: id, modelId: modelId, unitId: unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//删除故障库
|
||||
var deleteProjectFun = function (id) {
|
||||
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/libraryAddResetProject/dodelete.do', { id: id }, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#projectTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
$(function () {
|
||||
projectFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<input type="hidden" id="classId" name="classId" value="${param.classId}">
|
||||
<input type="hidden" id="projectId" name="projectId" value="">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}">
|
||||
|
||||
<!-- <input type="text" id="search_name" name="search_name" value="${param.search_name}"> -->
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增重置项目</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;" id="modelNameId">(通用)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button id="projectadd" type="button" class="btn btn-default" onclick="addProjectFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>
|
||||
|
||||
<table id="projectTable" ></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
175
src/main/webapp/jsp/maintenance/libraryFaultBiz4Tree.jsp
Normal file
175
src/main/webapp/jsp/maintenance/libraryFaultBiz4Tree.jsp
Normal file
@ -0,0 +1,175 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//var unitId="";
|
||||
|
||||
var updateFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBiz/update4UintId.do', {unitId: unitId}, function (data) {
|
||||
if (data.code == 1) {
|
||||
alert('同步成功');
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
alert('同步失败');
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
var editFun = function (id, pid, type) {
|
||||
var modelId = '';
|
||||
var modelNameId = '';
|
||||
//获取对应的设备型号
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ext.contextPath + '/equipment/getdata4Equ.do',
|
||||
data: {id: id, pid: pid, type: type, unitId: unitId},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
$('#modelButton').empty(); //清空resText里面的所有内容
|
||||
var html = '';
|
||||
modelId = '-1';
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + -1 + '\',\'(' + '通用' + ')\');">通用</button>';
|
||||
|
||||
//暂时注释 -- sj 2021-08-23
|
||||
// for (var i = 0; i < data.length; i++) {
|
||||
// html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + data[i].id + '\',\'(' + data[i].text + ')\');">' + data[i].text + '</button>';
|
||||
// }
|
||||
$('#modelButton').html(html);
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/showListBiz.do', {
|
||||
classId: id,
|
||||
type: type,
|
||||
modelId: modelId
|
||||
}, function (data) {
|
||||
$("#faultListTable").html(data);
|
||||
//$('#modelNameId').html(modelNameId);
|
||||
});
|
||||
};
|
||||
|
||||
function choiceModel(id, text) {
|
||||
$('#modelId').val(id);//给型号id赋值
|
||||
//$('#faultId').val('');//清除用于大修内容的id
|
||||
$('#modelNameId').html(text);
|
||||
|
||||
repairFun();
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTree4EquipmentCard.do', {unitId: unitId}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
if (treeData != undefined && treeData.length > 0) {
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
});
|
||||
var node = $('#tree').treeview('findNodes', [treeData[0].nodes[0].id, 'id']);
|
||||
$('#tree').treeview('selectNode', [node[0], { silent: true }]);
|
||||
editFun(treeData[0].nodes[0].id, treeData[0].nodes[0].pid, treeData[0].nodes[0].type);
|
||||
}
|
||||
}, 'json');
|
||||
$("#faultListTable").html("");
|
||||
};
|
||||
$(function () {
|
||||
//alert(unitId);
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
var doInit = function () {
|
||||
let sure = confirm("此操作将重置当前配置还原为公司级标准!是否继续?");
|
||||
if (sure) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doInit.do', {unitId: unitId}, function (data) {
|
||||
if (data.code == '1') {
|
||||
showAlert('s', data.msg, 'mainAlertdiv');
|
||||
// refreshPage('/SIPAIIS_WMS/maintenance/libraryFaultBloc/showList4TreeBiz.do')
|
||||
location.reload();
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
};
|
||||
|
||||
//导入
|
||||
function doImport() {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/importLibraryFaultBiz.do', {unitId: unitId}, function (data) {
|
||||
// $.post(ext.contextPath + '/maintenance/libraryFaultBloc/importLibraryFaultBloc.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport() {
|
||||
window.open(ext.contextPath + "/maintenance/libraryFaultBloc/doExport4Biz.do?unitId=" + unitId);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<div class="box-tools" id="addDiv">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doInit();"><i
|
||||
class="fa fa-retweet"></i>
|
||||
初始化
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExport();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 设备型号按钮 -->
|
||||
<div class="col-md-9" id="modelButton"></div>
|
||||
|
||||
<div class="col-md-9" id="faultListTable"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
39
src/main/webapp/jsp/maintenance/libraryFaultBiz4Tree3.jsp
Normal file
39
src/main/webapp/jsp/maintenance/libraryFaultBiz4Tree3.jsp
Normal file
@ -0,0 +1,39 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/getFaultLibrariesJson.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#fault_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#fault_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("fault4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="fault4SelectModal">
|
||||
<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">
|
||||
<div id="fault_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
99
src/main/webapp/jsp/maintenance/libraryFaultBizImport.jsp
Normal file
99
src/main/webapp/jsp/maintenance/libraryFaultBizImport.jsp
Normal file
@ -0,0 +1,99 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.tools.CommUtil" %>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", "")); %>
|
||||
<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 control;
|
||||
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '-1', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.status == true) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s', data.response.msg, 'mainAlertdiv');
|
||||
} else {
|
||||
showAlert('d', data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initUpload("filelist", ext.contextPath + "/maintenance/libraryFaultBloc/saveExcelData4Biz.do?unitId=" + unitId);
|
||||
})
|
||||
|
||||
//导入上传文件的数据
|
||||
function importExcelFun() {
|
||||
if ($("#filelist").val() == null || $("#filelist").val() == "") {
|
||||
showAlert('d', '上传的文件不能为空!');
|
||||
} else {
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple
|
||||
accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
695
src/main/webapp/jsp/maintenance/libraryFaultBizList.jsp
Normal file
695
src/main/webapp/jsp/maintenance/libraryFaultBizList.jsp
Normal file
@ -0,0 +1,695 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%@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);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
/*.colStyle {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: '13%';
|
||||
}*/
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var viewFaultFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
var dosearch = function () {
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var faultFun = function () {
|
||||
$("#faultTable").bootstrapTable('destroy');
|
||||
$("#faultTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryFaultBloc/getListJsonBiz.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,
|
||||
classId: '${param.classId}',
|
||||
unitId: unitId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//赋值一个故障库id 用于维修库新增使用
|
||||
$('#faultId').val(row.id);
|
||||
// $('#contentNameId').html('('+row.faultName+')');
|
||||
$('#contentNameId').html(row.faultName);
|
||||
repairFun();
|
||||
},
|
||||
//rowStyle:rowStyleFault,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px'
|
||||
}, {
|
||||
field: 'faultNumber', // 返回json数据中的name
|
||||
title: '故障编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.faultNumber + "'>" + row.faultNumber + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'faultName', // 返回json数据中的name
|
||||
title: '故障名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '45%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.faultName + "'>" + row.faultName + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'faultDescribe', // 返回json数据中的name
|
||||
title: '故障描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '45%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.faultDescribe + "'>" + row.faultDescribe + "</span>";
|
||||
}
|
||||
}
|
||||
, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editFaultFun(\'' + 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="deleteFaultFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
// buts += '<button class="btn btn-default btn-sm" onclick="viewFaultFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">查看</span></button>';
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("faultTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var repairFun = function () {
|
||||
var classId = '${param.classId}';
|
||||
var modelId = $('#modelId').val();
|
||||
var faultId = $('#faultId').val();
|
||||
|
||||
$("#repairTable").bootstrapTable('destroy');
|
||||
$("#repairTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryRepairBloc/getListJsonBiz.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,
|
||||
faultId: faultId,
|
||||
classId: classId,
|
||||
modelId: modelId,
|
||||
unitId: unitId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//rowStyle:rowStyleRepair,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
field: 'cs',
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px'
|
||||
}, {
|
||||
field: 'repairNumber', // 返回json数据中的name
|
||||
title: '维修编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.repairNumber;
|
||||
}
|
||||
}, {
|
||||
field: 'repairName', // 返回json数据中的name
|
||||
title: '维修名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.repairName + "'>" + row.repairName + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'repairPartyType', // 返回json数据中的name
|
||||
title: '委外/自修', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.repairPartyType == '${Maintain_IN}') {
|
||||
return '自修';
|
||||
}
|
||||
if (row.repairPartyType == '${Maintain_OUT}') {
|
||||
return '委外';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'repairType', // 返回json数据中的name
|
||||
title: '小修/中修', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.repairType == '${Maintain_RepairType_Small}') {
|
||||
return '小修';
|
||||
}
|
||||
if (row.repairType == '${Maintain_RepairType_Medium}') {
|
||||
return '中修';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'insideRepairTime', // 返回json数据中的name
|
||||
title: '自修工时(时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.repairPartyType == '${Maintain_IN}') {
|
||||
if (row.libraryRepairEquBiz != null) {
|
||||
return row.libraryRepairEquBiz.insideRepairTime;//分厂自己的工时
|
||||
} else {
|
||||
return row.insideRepairTime;//标准的工时
|
||||
}
|
||||
}
|
||||
if (row.repairPartyType == '${Maintain_OUT}') {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'outsideRepairCost', // 返回json数据中的name
|
||||
title: '委外费用(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.repairPartyType == '${Maintain_IN}') {
|
||||
return '-';
|
||||
}
|
||||
if (row.repairPartyType == '${Maintain_OUT}') {
|
||||
if (row.libraryRepairEquBiz != null) {
|
||||
return row.libraryRepairEquBiz.outsideRepairCost;//分厂自己的费用
|
||||
} else {
|
||||
return row.outsideRepairCost;//标准费用
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'materialCost', // 返回json数据中的name
|
||||
title: '物资费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.libraryRepairEquBiz != null) {
|
||||
return row.libraryRepairEquBiz.materialCost;
|
||||
} else {
|
||||
return row.materialCost;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'totalCost', // 返回json数据中的name
|
||||
title: '总费用(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.libraryRepairEquBiz != null) {
|
||||
return row.libraryRepairEquBiz.totalCost;
|
||||
} else {
|
||||
return row.totalCost;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editRepairFun(\'' + 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="deleteRepairFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
// buts += '<button class="btn btn-default btn-sm" onclick="sysnRepairFun(\'' + row.id + '\')" data-toggle="tooltip" title="同步"><i class="glyphicon glyphicon-refresh"></i><span class="hidden-md hidden-lg"> 同步</span></button>';
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("repairTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//修改维修库
|
||||
var editRepairFun = function (id) {
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryRepairBloc/doedit4Biz.do', {
|
||||
id: id,
|
||||
modelId: modelId,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function sysnRepairFun(id) {
|
||||
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/syn.do', {id: id}, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '同步失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function docopy4Equ() {
|
||||
var modelId = $('#modelId').val();
|
||||
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/libraryRepairEquBiz/docopy4Equ.do', {
|
||||
id: id,
|
||||
modelId: modelId,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
faultFun();
|
||||
} else {
|
||||
showAlert('d', '同步失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//新增故障库
|
||||
var addFaultFun = function () {
|
||||
var pid = '${param.classId}';
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doadd.do', {
|
||||
pid: pid,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//修改故障库
|
||||
var editFaultFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doedit.do', {
|
||||
id: id,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//新增维修库
|
||||
var addRepairFun = function () {
|
||||
var faultId = $('#faultId').val();
|
||||
if (faultId != null && faultId != '') {
|
||||
$.post(ext.contextPath + '/maintenance/libraryRepairBloc/doadd.do', {faultId: faultId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '请先点击故障内容', 'mainAlertdiv');
|
||||
}
|
||||
};
|
||||
|
||||
//修改维修库
|
||||
var editRepairFun = function (id) {
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryRepairBloc/doedit4Bloc.do', {
|
||||
id: id,
|
||||
modelId: modelId,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//删除故障库
|
||||
var deleteFaultFun = function (id) {
|
||||
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/libraryFaultBloc/dodelete.do', {id: id}, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//删除故障库--多删
|
||||
var deleteFaultsFun = function () {
|
||||
var checkedItems = $("#faultTable").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/libraryFaultBloc/dodeletes.do', {ids: datas}, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
console.log(11111)
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//删除维修库--单条
|
||||
var deleteRepairFun = function (id) {
|
||||
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/libraryRepairBloc/dodelete.do', {id: id}, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
console.log(11111111111)
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//删除维修库--多删
|
||||
var deleteRepairsFun = function () {
|
||||
var checkedItems = $("#repairTable").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/libraryRepairBloc/dodeletes.do', {ids: datas}, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function () {
|
||||
faultFun();
|
||||
repairFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<input type="hidden" id="classId" name="classId" value="${param.classId}">
|
||||
<input type="hidden" id="faultId" name="faultId" value="">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}">
|
||||
|
||||
<!-- <input type="text" id="search_name" name="search_name" value="${param.search_name}"> -->
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">故障内容</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;"
|
||||
id="modelNameId">(通用)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-default" onclick="addFaultFun();"><i class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" onclick="deleteFaultsFun();"><i class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<%-- <div class="box-tools pull-right">--%>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="docopy4Equ();"><i class="fa fa-copy"></i> 复制</button> -->
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<%-- <div id="alertDiv_power"></div>--%>
|
||||
<%-- <div id="powerDiv"></div>--%>
|
||||
<%-- <div id="menu4SelectDiv_func"></div>--%>
|
||||
|
||||
<table id="faultTable" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">维修内容</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;"
|
||||
id="contentNameId">(全部)</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-default" onclick="addRepairFun();"><i class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" onclick="deleteRepairsFun();"><i class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<%-- <div class="box-tools pull-right">--%>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="addRepairFun();"><i class="fa fa-plus"></i> 新增</button> -->
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>
|
||||
|
||||
<table id="repairTable" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</html>
|
||||
270
src/main/webapp/jsp/maintenance/libraryFaultBloc4Tree.jsp
Normal file
270
src/main/webapp/jsp/maintenance/libraryFaultBloc4Tree.jsp
Normal file
@ -0,0 +1,270 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
|
||||
.buttonDiv {
|
||||
float: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var companyId = "-1";
|
||||
|
||||
var addFun = function () {
|
||||
var node = $('#tree').treeview('getSelected');
|
||||
var pid = "";
|
||||
if (node != null && node.length > 0) {
|
||||
pid = node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/add.do', {pid: pid}, function (data) {
|
||||
//console.log(data);
|
||||
$("#faultListTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id, pid, type) {
|
||||
var modelId = '';
|
||||
|
||||
//获取对应的设备型号
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ext.contextPath + '/equipment/equipmentTypeNumber/getdata4EquClass.do',
|
||||
data: {id: id, pid: pid, type: type},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
$('#modelButton').empty(); //清空resText里面的所有内容
|
||||
var html = '';
|
||||
modelId = '-1';
|
||||
html += '<button type="button" class="btn btn-default" onclick="choiceModel(\'' + -1 + '\',\'(' + '通用' + ')\');">通用</button>';
|
||||
|
||||
//暂时注释 -- sj 2021-08-23
|
||||
// for (var i = 0; i < data.length; i++) {
|
||||
// html += '<button type="button" class="btn btn-default" onclick="choiceModel(\''+data[i].id+'\',\'('+data[i].text+')\');">'+data[i].text+'</button>';
|
||||
// }
|
||||
$('#modelButton').html(html);
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/showListBloc.do', {
|
||||
classId: id,
|
||||
type: type,
|
||||
modelId: modelId
|
||||
}, function (data) {
|
||||
$("#faultListTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
function choiceModel(id, text) {
|
||||
$('#modelId').val(id);//给型号id赋值
|
||||
$('#modelNameId').html(text);
|
||||
//$('#faultId').val('');
|
||||
|
||||
if ($('#modelId').val() != '-1') {
|
||||
$("#faultadd").hide();
|
||||
$("#repairadd").hide();
|
||||
} else {
|
||||
$("#faultadd").show();
|
||||
$("#repairadd").show();
|
||||
}
|
||||
|
||||
//projectFun();
|
||||
repairFun();
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {unitId: companyId}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
if (treeData.type == 3) {
|
||||
//$("#addDiv").css("display","block");//显示div
|
||||
} else {
|
||||
//$("#addDiv").css("display","none");//隐藏div
|
||||
}
|
||||
|
||||
});
|
||||
}, 'json');
|
||||
$("#faultListTable").html("");
|
||||
};
|
||||
|
||||
//高级搜索
|
||||
function searchDivFun() {
|
||||
var searchStatus = $('#searchStatus').val();
|
||||
if (searchStatus == '0') {
|
||||
$('#searchDiv').css('display', 'block');//显示div
|
||||
$('#searchStatus').val('1');
|
||||
|
||||
$('#searchButton2').css('display', 'block');
|
||||
$("#searchButton1").css("display", "none");
|
||||
}
|
||||
if (searchStatus == '1') {
|
||||
$('#searchDiv').css('display', 'none');//隐藏div
|
||||
$('#searchStatus').val('0');
|
||||
|
||||
$('#searchButton1').css('display', 'block');
|
||||
$("#searchButton2").css("display", "none");
|
||||
}
|
||||
}
|
||||
|
||||
//执行搜索
|
||||
function searchFun() {
|
||||
var quotaTypes = document.getElementsByName("quotaType");//定额类型 低中高
|
||||
var repairPartyTypes = document.getElementsByName("repairPartyType");//维修方式 自修或委外
|
||||
var repairTypes = document.getElementsByName("repairType");//维修类型 小修、中修等
|
||||
var search_name = $('#search_name').val();//搜索内容
|
||||
|
||||
//定额类型
|
||||
var check_val = [];
|
||||
for (k in quotaTypes) {
|
||||
if (quotaTypes[k].checked) {
|
||||
check_val.push(quotaTypes[k].value);
|
||||
}
|
||||
}
|
||||
//维修方式
|
||||
var check_val2 = [];
|
||||
for (k in repairPartyTypes) {
|
||||
if (repairPartyTypes[k].checked) {
|
||||
check_val2.push(repairPartyTypes[k].value);
|
||||
}
|
||||
}
|
||||
//维修类型
|
||||
var check_val3 = [];
|
||||
for (k in repairTypes) {
|
||||
if (repairTypes[k].checked) {
|
||||
check_val3.push(repairTypes[k].value);
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ext.contextPath + '/maintenance/libraryFaultBloc/getClassIds4Search.do',
|
||||
data: {
|
||||
quotaTypes: check_val,
|
||||
repairPartyTypes: check_val2,
|
||||
repairTypes: check_val3,
|
||||
search_name: search_name
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
var id = data.result;
|
||||
var ids = '';
|
||||
for (var i = 0; i < id.length; i++) {
|
||||
ids += id[i] + ',';
|
||||
}
|
||||
//alert(ids);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson4Where.do', {
|
||||
unitId: companyId,
|
||||
ids: ids
|
||||
}, function (data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData, levels: 3});
|
||||
$('#tree').on('nodeSelected', function (event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
if (treeData.type == 3) {
|
||||
//$("#addDiv").css("display","block");//显示div
|
||||
} else {
|
||||
//$("#addDiv").css("display","none");//隐藏div
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//导入
|
||||
function doImport() {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/importLibraryFaultBloc.do', {unitId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport() {
|
||||
window.open(ext.contextPath + "/maintenance/libraryFaultBloc/doExport.do?unitId=" + companyId);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<!-- 搜索状态 0为隐藏 1为显示 -->
|
||||
<input type="hidden" id="searchStatus" name="searchStatus" value="0">
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<div class="box-tools" id="addDiv">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExport();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 设备型号按钮 -->
|
||||
<div class="col-md-9" id="modelButton"></div>
|
||||
<!-- 故障库列表 -->
|
||||
<div class="col-md-9" id="faultListTable"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
305
src/main/webapp/jsp/maintenance/libraryFaultBloc4TreeView.jsp
Normal file
305
src/main/webapp/jsp/maintenance/libraryFaultBloc4TreeView.jsp
Normal file
@ -0,0 +1,305 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.buttonDiv{
|
||||
float: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var unitId="";
|
||||
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/add.do', {pid:pid} , function(data) {
|
||||
//console.log(data);
|
||||
$("#faultListTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id, type) {
|
||||
$.post(ext.contextPath + '/maintenance/faultLibrary/showFaultList.do', {classId: id,type: type} , function(data) {
|
||||
$("#faultListTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {unitId:unitId} , function(data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData,levels: 3});
|
||||
$('#tree').on('nodeSelected', function(event, treeData) {
|
||||
editFun(treeData.id, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
if(treeData.type == 3){
|
||||
$("#addDiv").css("display","block");//显示div
|
||||
}else{
|
||||
$("#addDiv").css("display","none");//隐藏div
|
||||
}
|
||||
|
||||
});
|
||||
},'json');
|
||||
$("#faultListTable").html("");
|
||||
};
|
||||
|
||||
//高级搜索
|
||||
function searchDivFun(){
|
||||
var searchStatus = $('#searchStatus').val();
|
||||
if(searchStatus == '0'){
|
||||
$('#searchDiv').css('display','block');//显示div
|
||||
$('#searchStatus').val('1');
|
||||
|
||||
$('#searchButton2').css('display','block');
|
||||
$("#searchButton1").css("display","none");
|
||||
}
|
||||
if(searchStatus == '1'){
|
||||
$('#searchDiv').css('display','none');//隐藏div
|
||||
$('#searchStatus').val('0');
|
||||
|
||||
$('#searchButton1').css('display','block');
|
||||
$("#searchButton2").css("display","none");
|
||||
}
|
||||
}
|
||||
|
||||
//执行搜索
|
||||
function searchFun(){
|
||||
var quotaTypes = document.getElementsByName("quotaType");//定额类型 低中高
|
||||
var repairPartyTypes = document.getElementsByName("repairPartyType");//维修方式 自修或委外
|
||||
var repairTypes = document.getElementsByName("repairType");//维修类型 小修、中修等
|
||||
var search_name = $('#search_name').val();//搜索内容
|
||||
|
||||
//定额类型
|
||||
var check_val = [];
|
||||
for (k in quotaTypes){
|
||||
if(quotaTypes[k].checked){
|
||||
check_val.push(quotaTypes[k].value);
|
||||
}
|
||||
}
|
||||
//维修方式
|
||||
var check_val2 = [];
|
||||
for (k in repairPartyTypes){
|
||||
if(repairPartyTypes[k].checked){
|
||||
check_val2.push(repairPartyTypes[k].value);
|
||||
}
|
||||
}
|
||||
//维修类型
|
||||
var check_val3 = [];
|
||||
for (k in repairTypes){
|
||||
if(repairTypes[k].checked){
|
||||
check_val3.push(repairTypes[k].value);
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ext.contextPath + '/maintenance/faultLibrary/getClassIds4Search.do',
|
||||
data: {quotaTypes:check_val,repairPartyTypes:check_val2,repairTypes:check_val3,search_name:search_name},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
var id = data.result;
|
||||
var ids = '';
|
||||
for (var i = 0; i < id.length; i++) {
|
||||
ids += id[i]+',';
|
||||
}
|
||||
//alert(ids);
|
||||
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson4Where.do', {unitId:unitId,ids:ids} , function(data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData,levels: 3});
|
||||
$('#tree').on('nodeSelected', function(event, treeData) {
|
||||
editFun(treeData.id, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
if(treeData.type == 3){
|
||||
$("#addDiv").css("display","block");//显示div
|
||||
}else{
|
||||
$("#addDiv").css("display","none");//隐藏div
|
||||
}
|
||||
});
|
||||
},'json');
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
unitId=unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<!-- 搜索状态 0为隐藏 1为显示 -->
|
||||
<input type="hidden" id="searchStatus" name="searchStatus" value="0">
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"> </h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
|
||||
<div style="background-color:#FFFFFF;">
|
||||
<div style="height:8px;"></div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:8px;">
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;padding-left:15px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" autocomplete="off" placeholder="请输入搜索内容">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="searchFun();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
|
||||
<div id="searchButton1" class="buttonDiv" style="display: block;"><!-- 下箭头 -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="searchDivFun();" ><i class="glyphicon glyphicon-chevron-down"></i> 高级搜索</button>
|
||||
</div>
|
||||
|
||||
<div id="searchButton2" class="buttonDiv" style="display: none;"><!-- 上箭头 -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="searchDivFun();" ><i class="glyphicon glyphicon-chevron-up" id="searchButton" ></i> 高级搜索</button>
|
||||
</div>
|
||||
|
||||
<div id="searchButton3" class="buttonDiv">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="searchFun();"><i class="glyphicon glyphicon-search"></i> 搜索</button>
|
||||
</div>
|
||||
|
||||
<div id="searchButton4" class="buttonDiv">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="resetFun();"><i class="glyphicon glyphicon-repeat"></i> 重置</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="searchDiv" style="display:none;">
|
||||
<div style="height:30px;padding-left:15px;float:left;">
|
||||
定额等级:
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="quotaType" value="低">低
|
||||
</label>
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="quotaType" value="中">中
|
||||
</label>
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="quotaType" value="高">高
|
||||
</label>
|
||||
</div>
|
||||
<div style="float:left;">
|
||||
<div style="float:left;padding-left:30px;">工时:</div>
|
||||
<div style="width:70px;height:30px;float:left;" >
|
||||
<div class="input-group mb-3 input-group-sm" >
|
||||
<input class="form-control date-picker"
|
||||
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:20px;height:30px;float:left;margin-left:6px;">
|
||||
至
|
||||
</div>
|
||||
<div style="width:70px;height:30px;float:left;" >
|
||||
<div class="input-group mb-3 input-group-sm" >
|
||||
<input class="form-control date-picker"
|
||||
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="float:left;">
|
||||
|
||||
<div style="float:left;padding-left:30px;">费用:</div>
|
||||
<div style="width:70px;height:30px;float:left;" >
|
||||
<div class="input-group mb-3 input-group-sm" >
|
||||
<input class="form-control date-picker"
|
||||
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:20px;height:30px;float:left;margin-left:6px;">
|
||||
至
|
||||
</div>
|
||||
<div style="width:70px;height:30px;float:left;" >
|
||||
<div class="input-group mb-3 input-group-sm" >
|
||||
<input class="form-control date-picker"
|
||||
type="text" placeholder="" style="background-color:#FFFFFF;height:20px;" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="clear:both;height:30px;padding-left:15px;">
|
||||
维修方式:
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="repairPartyType" value="自修">自修
|
||||
</label>
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="repairPartyType" value="委外">委外
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div style="clear:both;height:30px;padding-left:15px;">
|
||||
维修类型:
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="repairType" value="小修">小修
|
||||
</label>
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="repairType" value="中修">中修
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="width:100%;height:10px;background-color:#ECF0F5;">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<div class="box-tools" id="addDiv" style="display:none">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9" id="faultListTable" ></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
127
src/main/webapp/jsp/maintenance/libraryFaultBlocAdd.jsp
Normal file
127
src/main/webapp/jsp/maintenance/libraryFaultBlocAdd.jsp
Normal file
@ -0,0 +1,127 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr"%>
|
||||
<%request.setAttribute("PatrolType_Product", TimeEfficiencyCommStr.PatrolType_Product);%>
|
||||
<%request.setAttribute("PatrolType_Equipment", TimeEfficiencyCommStr.PatrolType_Equipment);%>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryFaultBloc/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#faultTable").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: {
|
||||
faultNumber:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
faultDescribe:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障现象描述不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</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" 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">
|
||||
<input type="text" class="form-control" id="faultNumber" name="faultNumber" placeholder="故障编号" autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*故障名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="faultName" name="faultName" placeholder="故障名称" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name="morder" 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-10">
|
||||
<textarea class="form-control" rows="2" id ="faultDescribe" name ="faultDescribe" placeholder="请输入" autocomplete="off" value="${libraryFaultBloc.faultDescribe}"></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>
|
||||
128
src/main/webapp/jsp/maintenance/libraryFaultBlocEdit.jsp
Normal file
128
src/main/webapp/jsp/maintenance/libraryFaultBlocEdit.jsp
Normal file
@ -0,0 +1,128 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr"%>
|
||||
<%request.setAttribute("PatrolType_Product", TimeEfficiencyCommStr.PatrolType_Product);%>
|
||||
<%request.setAttribute("PatrolType_Equipment", TimeEfficiencyCommStr.PatrolType_Equipment);%>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryFaultBloc/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#faultTable").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: {
|
||||
faultNumber:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
faultDescribe:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障现象描述不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</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="${libraryFaultBloc.id}">
|
||||
<!-- 界面提醒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="faultNumber" name="faultNumber" placeholder="故障编号" autocomplete="off"
|
||||
value="${libraryFaultBloc.faultNumber}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*故障名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="faultName" name="faultName" placeholder="故障名称" autocomplete="off" value="${libraryFaultBloc.faultName}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序" autocomplete="off" value="${libraryFaultBloc.morder}">
|
||||
</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" value="${pname}">
|
||||
<input type="hidden" id="pid" name="pid" value="${libraryFaultBloc.pid}">
|
||||
</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 ="faultDescribe" name ="faultDescribe" placeholder="请输入" autocomplete="off" >${libraryFaultBloc.faultDescribe}</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>
|
||||
101
src/main/webapp/jsp/maintenance/libraryFaultBlocImport.jsp
Normal file
101
src/main/webapp/jsp/maintenance/libraryFaultBlocImport.jsp
Normal file
@ -0,0 +1,101 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.tools.CommUtil" %>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", "")); %>
|
||||
<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 companyId = '-1';
|
||||
|
||||
var control;
|
||||
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": '-1', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.status == true) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s', data.response.msg, 'mainAlertdiv');
|
||||
} else {
|
||||
showAlert('d', data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initUpload("filelist", ext.contextPath + "/maintenance/libraryFaultBloc/saveExcelData.do?unitId=" + companyId);
|
||||
})
|
||||
|
||||
//导入上传文件的数据
|
||||
function importExcelFun() {
|
||||
if ($("#filelist").val() == null || $("#filelist").val() == "") {
|
||||
showAlert('d', '上传的文件不能为空!');
|
||||
} else {
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple
|
||||
accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
762
src/main/webapp/jsp/maintenance/libraryFaultBlocList.jsp
Normal file
762
src/main/webapp/jsp/maintenance/libraryFaultBlocList.jsp
Normal file
@ -0,0 +1,762 @@
|
||||
<%@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);%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var companyId = '-1';
|
||||
|
||||
|
||||
// var viewFun = function (id) {
|
||||
// $.post(ext.contextPath + '/timeEfficiency/patrolModel/doview.do', { id: id }, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// }
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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 + '/timeEfficiency/patrolContents/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function () {
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var faultFun = function () {
|
||||
var modelId = $('#modelId').val();
|
||||
|
||||
$("#faultTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryFaultBloc/getListJsonBloc.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,
|
||||
classId: '${param.classId}',
|
||||
modelId: modelId,
|
||||
unitId: companyId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//赋值一个故障库id 用于维修库新增使用
|
||||
$('#faultId').val(row.id);
|
||||
$('#projectNameId').html('('+row.faultName+')');
|
||||
repairFun(row.id);
|
||||
},
|
||||
//rowStyle:rowStyleFault,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px',
|
||||
}, {
|
||||
field: 'faultNumber', // 返回json数据中的name
|
||||
title: '故障编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.faultNumber + "'>" + row.faultNumber + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'faultName', // 返回json数据中的name
|
||||
title: '故障名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.faultName + "'>" + row.faultName + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'faultDescribe', // 返回json数据中的name
|
||||
title: '故障描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '50%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.faultDescribe + "'>" + row.faultDescribe + "</span>";
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editFaultFun(\'' + 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="deleteFaultFun(\'' + 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("faultTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var repairFun = function () {
|
||||
var classId = '${param.classId}';
|
||||
var modelId = $('#modelId').val();
|
||||
var faultId = $('#faultId').val();
|
||||
|
||||
$("#repairTable").bootstrapTable('destroy');
|
||||
$("#repairTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryRepairBloc/getListJsonBloc.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [12,24], // 设置页面可以显示的数据条数
|
||||
pageSize: 12, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
faultId: faultId,
|
||||
classId: classId,
|
||||
modelId: modelId,
|
||||
unitId:companyId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//rowStyle:rowStyleRepair,//通过自定义函数设置行样式
|
||||
|
||||
columns: [
|
||||
{
|
||||
field: 'cs',
|
||||
checkbox: true, // 显示一个勾选框
|
||||
width: '40px',
|
||||
}, {
|
||||
field: 'repairNumber', // 返回json数据中的name
|
||||
title: '维修编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.repairNumber;
|
||||
}
|
||||
}, {
|
||||
field: 'repairName', // 返回json数据中的name
|
||||
title: '维修名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.repairName + "'>" + row.repairName + "</span>";
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'repairContent', // 返回json数据中的name
|
||||
// title: '维修内容', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle', // 上下居中
|
||||
// width: '15%',
|
||||
// formatter: function (value, row, index) {
|
||||
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.repairContent + "'>" + row.repairContent + "</span>";
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'repairPartyType', // 返回json数据中的name
|
||||
title: '委外/自修', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '9%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.repairPartyType=='${Maintain_IN}'){
|
||||
return '自修';
|
||||
}
|
||||
if(row.repairPartyType=='${Maintain_OUT}'){
|
||||
return '委外';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'repairType', // 返回json数据中的name
|
||||
title: '小修/中修', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '9%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.repairType=='${Maintain_RepairType_Small}'){
|
||||
return '小修';
|
||||
}
|
||||
if(row.repairType=='${Maintain_RepairType_Medium}'){
|
||||
return '中修';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'insideRepairTime', // 返回json数据中的name
|
||||
title: '自修工时(时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.repairPartyType=='${Maintain_IN}'){
|
||||
/*if(row.libraryRepairModelBloc!=null){
|
||||
return row.libraryRepairModelBloc.insideRepairTime;
|
||||
}else{
|
||||
return '-';
|
||||
}*/
|
||||
return row.insideRepairTime;
|
||||
}
|
||||
if(row.repairPartyType=='${Maintain_OUT}'){
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'outsideRepairCost', // 返回json数据中的name
|
||||
title: '委外费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '9%',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.repairPartyType=='${Maintain_IN}'){
|
||||
return '-';
|
||||
}
|
||||
if(row.repairPartyType=='${Maintain_OUT}'){
|
||||
/*if(row.libraryRepairModelBloc!=null){
|
||||
return row.libraryRepairModelBloc.outsideRepairCost;
|
||||
}else{
|
||||
return '-';
|
||||
}*/
|
||||
return row.outsideRepairCost;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'materialCost', // 返回json数据中的name
|
||||
title: '物资费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '9%',
|
||||
formatter: function (value, row, index) {
|
||||
/*if(row.libraryRepairModelBloc!=null){
|
||||
return row.libraryRepairModelBloc.materialCost;
|
||||
}else{
|
||||
return '-';
|
||||
}*/
|
||||
return row.materialCost;
|
||||
}
|
||||
}, {
|
||||
field: 'totalCost', // 返回json数据中的name
|
||||
title: '总费用(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '9%',
|
||||
formatter: function (value, row, index) {
|
||||
/*if(row.libraryRepairModelBloc!=null){
|
||||
return row.libraryRepairModelBloc.totalCost;
|
||||
}else{
|
||||
return '-';
|
||||
}*/
|
||||
return row.totalCost;
|
||||
}
|
||||
}, {
|
||||
field: 'button',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editRepairFun(\'' + 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="showBizList(\'' + row.id + '\')" data-toggle="tooltip" title="查看"><i class="glyphicon glyphicon-th-list"></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="deleteRepairFun(\'' + 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("repairTable");
|
||||
var data = $('#repairTable').bootstrapTable('getData', true);
|
||||
//合并单元格
|
||||
//mergeCells(data, "repairNumber", 1, $('#repairTable'));
|
||||
//mergeCells(data, "name", 1, $('#repairTable'));
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 合并单元格
|
||||
* @param data 原始数据(在服务端完成排序)
|
||||
* @param fieldName 合并属性名称
|
||||
* @param colspan 合并列
|
||||
* @param target 目标表格对象
|
||||
*/
|
||||
function mergeCells(data,fieldName,colspan,target){
|
||||
//声明一个map计算相同属性值在data对象出现的次数和
|
||||
var sortMap = {};
|
||||
for(var i = 0 ; i < data.length ; i++){
|
||||
for(var prop in data[i]){
|
||||
if(prop == fieldName){
|
||||
var key = data[i][prop]
|
||||
if(sortMap.hasOwnProperty(key)){
|
||||
sortMap[key] = sortMap[key] * 1 + 1;
|
||||
} else {
|
||||
sortMap[key] = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(var prop in sortMap){
|
||||
console.log(prop,sortMap[prop])
|
||||
}
|
||||
var index = 0;
|
||||
for(var prop in sortMap){
|
||||
var count = sortMap[prop] * 1;
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:fieldName, colspan: colspan, rowspan: count});
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:'cs', colspan: colspan, rowspan: count});
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:'button', colspan: colspan, rowspan: count});
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:'name', colspan: colspan, rowspan: count});
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:'repairPartyType', colspan: colspan, rowspan: count});
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:'repairType', colspan: colspan, rowspan: count});
|
||||
$(target).bootstrapTable('mergeCells',{index:index, field:'repairContent', colspan: colspan, rowspan: count});
|
||||
index += count;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
维修库table高亮显示
|
||||
*/
|
||||
// function rowStyleFault(row, index) {
|
||||
// var search_name = $('#search_name').val();//维修库浏览界面的搜索内容
|
||||
// var style = {};
|
||||
// if(search_name!=null && search_name!=''){
|
||||
// if((row.name).indexOf(search_name)!=-1 || (row.faultNumber).indexOf(search_name)!=-1){
|
||||
// style={css:{'color':'#ed5565'}};
|
||||
// }
|
||||
// }
|
||||
// return style;
|
||||
// }
|
||||
|
||||
/*
|
||||
故障库table单元格符合条件高亮显示
|
||||
*/
|
||||
function cellStyleFault(value, row, index){
|
||||
var search_name = $('#search_name').val();//维修库浏览界面的搜索内容
|
||||
var style = {};
|
||||
if(search_name!=null && search_name!=''){
|
||||
if((value).indexOf(search_name)!=-1){
|
||||
style={css:{'color':'#ed5565'}};
|
||||
}
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
/*
|
||||
维修库table高亮显示
|
||||
*/
|
||||
// function rowStyleRepair(row, index) {
|
||||
// var search_name = $('#search_name').val();//维修库浏览界面的搜索内容
|
||||
// var style = {};
|
||||
// if(search_name!=null && search_name!=''){
|
||||
// if((row.name).indexOf(search_name)!=-1 || (row.repairNumber).indexOf(search_name)!=-1){
|
||||
// style={css:{'color':'#ed5565'}};
|
||||
// }
|
||||
// }
|
||||
// return style;
|
||||
// }
|
||||
|
||||
/*
|
||||
维修库table单元格符合条件高亮显示
|
||||
*/
|
||||
/*function cellStyleRepair(value, row, index){
|
||||
var search_name = $('#search_name').val();//维修库浏览界面的搜索内容
|
||||
var style = {};
|
||||
if(search_name!=null && search_name!=''){
|
||||
if(value!=null && value!=''){
|
||||
if((value).indexOf(search_name)!=-1){
|
||||
style={css:{
|
||||
'color':'#ed5565',
|
||||
'white-space': 'nowrap',
|
||||
'text-overflow': 'ellipsis',
|
||||
'overflow': 'hidden'
|
||||
}};
|
||||
}
|
||||
}
|
||||
}
|
||||
return style;
|
||||
}*/
|
||||
|
||||
/*function cellStyleQuotaType(value, row, index){
|
||||
var quotaTypes = document.getElementsByName("quotaType");//定额类型 低中高
|
||||
//定额类型
|
||||
var check_val = [];
|
||||
for (k in quotaTypes){
|
||||
if(quotaTypes[k].checked){
|
||||
check_val.push(quotaTypes[k].value);
|
||||
}
|
||||
}
|
||||
var style = {};
|
||||
if(check_val!=null && check_val!=''){
|
||||
if((value).indexOf(check_val)!=-1){
|
||||
style={css:{'color':'#ed5565'}};
|
||||
}
|
||||
}
|
||||
return style;
|
||||
}*/
|
||||
|
||||
//新增故障库
|
||||
var addFaultFun = function () {
|
||||
var pid = '${param.classId}';
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doadd.do', { pid: pid, unitId: companyId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//修改故障库
|
||||
var editFaultFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryFaultBloc/doedit.do', { id: id, unitId: companyId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//新增维修库
|
||||
var addRepairFun = function () {
|
||||
var faultId = $('#faultId').val();
|
||||
if(faultId!=null && faultId!=''){
|
||||
$.post(ext.contextPath + '/maintenance/libraryRepairBloc/doadd.do', { faultId: faultId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}else{
|
||||
showAlert('d', '请先点击故障内容', 'mainAlertdiv');
|
||||
}
|
||||
};
|
||||
|
||||
//修改维修库
|
||||
var editRepairFun = function (id) {
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryRepairBloc/doedit4Bloc.do', { id: id, modelId: modelId, unitId:companyId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//删除故障库
|
||||
var deleteFaultFun = function (id) {
|
||||
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/libraryFaultBloc/dodelete.do', { id: id }, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//删除故障库--多删
|
||||
var deleteFaultsFun = function() {
|
||||
var checkedItems = $("#faultTable").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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/libraryFaultBloc/dodeletes.do', {ids:datas} , function(data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#faultTable").bootstrapTable('refresh');
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//删除维修库--单条
|
||||
var deleteRepairFun = function (id) {
|
||||
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/libraryRepairBloc/dodelete.do', { id: id }, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//删除维修库--多删
|
||||
var deleteRepairsFun = function() {
|
||||
var checkedItems = $("#repairTable").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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/libraryRepairBloc/dodeletes.do', {ids:datas} , function(data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#repairTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function showBizList(id){
|
||||
var modelId = $('#modelId').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryRepairEquBiz/showList.do', {contentId: id,modelId: modelId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
faultFun();
|
||||
repairFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<input type="hidden" id="classId" name="classId" value="${param.classId}">
|
||||
<input type="hidden" id="faultId" name="faultId" value="">
|
||||
<input type="hidden" id="modelId" name="modelId" value="${param.modelId}">
|
||||
|
||||
<!-- <input type="text" id="search_name" name="search_name" value="${param.search_name}"> -->
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">故障内容</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;" id="modelNameId">(通用)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-default" onclick="addFaultFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="deleteFaultsFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<%--<div id="alertDiv_power"></div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>--%>
|
||||
|
||||
<table id="faultTable" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">维修内容</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;" id="projectNameId">(所有)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-default" onclick="addRepairFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="deleteRepairsFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>
|
||||
|
||||
<table id="repairTable" style="table-layout:fixed;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</html>
|
||||
127
src/main/webapp/jsp/maintenance/libraryFaultBlocView.jsp
Normal file
127
src/main/webapp/jsp/maintenance/libraryFaultBlocView.jsp
Normal file
@ -0,0 +1,127 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr"%>
|
||||
<%request.setAttribute("PatrolType_Product", TimeEfficiencyCommStr.PatrolType_Product);%>
|
||||
<%request.setAttribute("PatrolType_Equipment", TimeEfficiencyCommStr.PatrolType_Equipment);%>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryFaultBloc/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#faultTable").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: {
|
||||
faultNumber:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
faultDescribe:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '故障现象描述不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" id="id" name="id" value="${libraryFaultBloc.id}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">故障编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${libraryFaultBloc.faultNumber}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">故障名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${libraryFaultBloc.faultName}</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">${libraryFaultBloc.morder}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级部位</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${pname}</p>
|
||||
<input type="hidden" id="pid" name="pid" value="${libraryFaultBloc.pid}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">故障描述</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${libraryFaultBloc.faultDescribe}</p>
|
||||
</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>
|
||||
334
src/main/webapp/jsp/maintenance/libraryMaintainCar4Select.jsp
Normal file
334
src/main/webapp/jsp/maintenance/libraryMaintainCar4Select.jsp
Normal file
@ -0,0 +1,334 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_equ").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
|
||||
var checkedItems = $("#table_equ").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id;
|
||||
});
|
||||
|
||||
datas_name="";
|
||||
datas_model="";
|
||||
|
||||
console.info(datas)
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintainCar/getlist.do', {unitId:unitId,checkedIds : datas,page:1,rows:50}, function(resp) {
|
||||
$.each(resp.rows, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
datas_model+=",";
|
||||
}
|
||||
datas_name+=item.name;
|
||||
datas_model+=item.model;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$('#${param.formId} #${param.modelId}').val(datas_model);
|
||||
closeModal("equipment4SelectModal")
|
||||
},'json');
|
||||
}else{
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$('#${param.formId} #${param.modelId}').val(datas_model);
|
||||
closeModal("equipment4SelectModal")
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${maintainCars}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${maintainCars}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${maintainCars}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_equName').val(),
|
||||
unitId: unitId,
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
// var companyId= '${param.companyId}';
|
||||
$(function() {
|
||||
$("#searchEquForm").attr("onsubmit","return false;");
|
||||
$("#searchEquForm").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEqu();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
|
||||
// $.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
// var selelct_ =$("#processSection").select2({
|
||||
// data: data,
|
||||
// cache : false,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
// $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
// selelct_.val("").trigger("change");
|
||||
// /* selelct_.on("change",function(e){
|
||||
// dosearch();
|
||||
// }); */
|
||||
// },'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_equ").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryMaintainCar/getlist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
radio:true,
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '车辆名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%'
|
||||
}, {
|
||||
field: 'model', // 返回json数据中的name
|
||||
title: '车辆型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '40%'
|
||||
}, {
|
||||
field: 'fuelConsumptionPer100km', // 返回json数据中的name
|
||||
title: '百公里油耗定额(L/100Km)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%'
|
||||
}
|
||||
/*{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
},*/
|
||||
/*{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
},*/
|
||||
/*{
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipment4SelectModal">
|
||||
<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 " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse" >
|
||||
<form class="form-horizontal " style="padding:0;" id="searchEquForm">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="control-label col-sm-2">工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 170px;"></select>
|
||||
</div> -->
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_equName" name="search_equName" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id ="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-sm-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
133
src/main/webapp/jsp/maintenance/libraryMaintainCarAdd.jsp
Normal file
133
src/main/webapp/jsp/maintenance/libraryMaintainCarAdd.jsp
Normal file
@ -0,0 +1,133 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintainCar/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
// //选择设备,可多选
|
||||
// var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
// var equipmentIds = $('#equipmentIds').val();
|
||||
// $.post(ext.contextPath + '/sparepart/goods/showEquipmentCardForGoodsSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,equipmentIds:equipmentIds} , function(data) {
|
||||
// $("#equ4SelectDiv").html(data);
|
||||
// openModal("equipment4SelectModal");
|
||||
// });
|
||||
// };
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '车辆名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
model: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '车辆型号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
fuelConsumptionPer100km: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '百公里油耗定额不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
//选择物品类别
|
||||
// var showGoodsClass4SelectFun = function() {
|
||||
// $.post(ext.contextPath + '/sparepart/goodsClass/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
|
||||
// $("#fault4SelectDiv").html(data);
|
||||
// openModal('fault4SelectModal');
|
||||
// });
|
||||
// };
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${libraryMaintainCar.id}"/>
|
||||
<input id="unitId" name="unitId" type="hidden" value="${param.unitId}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*车辆名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="车辆名称" autocomplete="off" value="${libraryMaintainCar.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*车辆型号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="model" name ="model" placeholder="车辆型号" autocomplete="off" value="${libraryMaintainCar.model}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*百公里油耗定额(L/100Km)</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" id="fuelConsumptionPer100km" name ="fuelConsumptionPer100km" placeholder="百公里油耗定额(L/100Km)" value="${libraryMaintainCar.fuelConsumptionPer100km}" step="0.1">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*物品类别</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="pname" placeholder="请选择" autocomplete="off" onclick="showGoodsClass4SelectFun();" value="" readonly>
|
||||
<input id="pid" name="classId" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden" value="" />
|
||||
<input class="form-control" id="equipname" name ="equipname" onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipname');" placeholder="请点击选择" readonly>
|
||||
</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 ="memo" name ="memo" placeholder="备注...">${libraryMaintainCar.memo}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" 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>
|
||||
@ -0,0 +1,332 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchEqu = function() {
|
||||
$("#table_equ1").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelectEqu(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
|
||||
var checkedItems = $("#table_equ1").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id;
|
||||
});
|
||||
|
||||
datas_name="";
|
||||
datas_money="";
|
||||
datas_workingHours="";
|
||||
|
||||
console.info(datas)
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintainCar/getDetaillist.do', {id:'${param.maintainCarId}',checkedIds : datas,page:1,rows:50}, function(resp) {
|
||||
$.each(resp.rows, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
datas_money+=",";
|
||||
datas_workingHours+=",";
|
||||
}
|
||||
datas_name+=item.num10thousandKm;
|
||||
datas_money+=item.money;
|
||||
datas_workingHours+=item.workingHours;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$('#${param.formId} #${param.moneyId}').val(datas_money);
|
||||
$('#${param.formId} #${param.workingHoursId}').val(datas_workingHours);
|
||||
closeModal("equipmentDetail4SelectModal")
|
||||
},'json');
|
||||
}else{
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$('#${param.formId} #${param.moneyId}').val(datas_money);
|
||||
$('#${param.formId} #${param.workingHoursId}').val(datas_workingHours);
|
||||
closeModal("equipmentDetail4SelectModal")
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${maintainCarDetails}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
var $table1;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${maintainCarDetails}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${maintainCarDetails}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
// search_name : $('#search_equName').val(),
|
||||
id: '${param.maintainCarId}',
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
// var companyId= '${param.companyId}';
|
||||
$(function() {
|
||||
$("#searchEquForm").attr("onsubmit","return false;");
|
||||
$("#searchEquForm").keyup(function(){
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车查询
|
||||
doSearchEqu();
|
||||
event.stopPropagation();
|
||||
}
|
||||
})
|
||||
|
||||
// $.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
// var selelct_ =$("#processSection").select2({
|
||||
// data: data,
|
||||
// cache : false,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
// $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
// selelct_.val("").trigger("change");
|
||||
// /* selelct_.on("change",function(e){
|
||||
// dosearch();
|
||||
// }); */
|
||||
// },'json');
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
$table1=$("#table_equ1").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryMaintainCar/getDetaillist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
singleSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'num_10thousand_km', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
radio:true,
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'num10thousandKm', // 返回json数据中的name
|
||||
title: '里程(万公里)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%'
|
||||
}, {
|
||||
field: 'money', // 返回json数据中的name
|
||||
title: '维保费用(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '40%'
|
||||
}, {
|
||||
field: 'workingHours', // 返回json数据中的name
|
||||
title: '维保工时(小时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%'
|
||||
}
|
||||
/*{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
},*/
|
||||
/*{
|
||||
field: 'equipmentClass.name', // 返回json数据中的name
|
||||
title: '设备类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
},*/
|
||||
/*{
|
||||
field: 'equipmentstatus', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '0' :
|
||||
return "禁用";
|
||||
case '1' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_equ1");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table1.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="equipmentDetail4SelectModal">
|
||||
<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 " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse" >
|
||||
<form class="form-horizontal " style="padding:0;" id="searchEquForm">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2 ">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_equName" name="search_equName" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id ="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-sm-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchEqu();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_equ1" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelectEqu()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
111
src/main/webapp/jsp/maintenance/libraryMaintainCarDetailEdit.jsp
Normal file
111
src/main/webapp/jsp/maintenance/libraryMaintainCarDetailEdit.jsp
Normal file
@ -0,0 +1,111 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosavedetail(num) {
|
||||
var id= $("#id"+num).val();
|
||||
var money= $("#money"+num).val();
|
||||
var workingHours= $("#workingHours"+num).val();
|
||||
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintainCar/dosavedetail.do", {id:id, money:money, workingHours:workingHours}, function(data) {
|
||||
if (data.code == 1) {
|
||||
// showAlert('s','保存成功','mainAlertdiv');
|
||||
viewFun('${libraryMaintainCar.id}');
|
||||
}else{
|
||||
showAlert('d',data.result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function dosaveall() {
|
||||
var ids="";
|
||||
var moneys="";
|
||||
var workingHourss="";
|
||||
for (i = 1; i <= 20; i++) {
|
||||
ids += $("#id"+i).val();
|
||||
moneys += ($("#money"+i).val()==null||$("#money"+i).val()=="")?"null":$("#money"+i).val();
|
||||
workingHourss += ($("#workingHours"+i).val()==null||$("#workingHours"+i).val()=="")?"null":$("#workingHours"+i).val();
|
||||
if (i<=19) {
|
||||
ids+=",";
|
||||
moneys+=",";
|
||||
workingHourss+=",";
|
||||
}
|
||||
}
|
||||
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintainCar/dosaveall.do", {ids:ids, moneys:moneys, workingHourss:workingHourss}, function(data) {
|
||||
if (data.code == 1) {
|
||||
// showAlert('s','保存成功','mainAlertdiv');
|
||||
viewFun('${libraryMaintainCar.id}');
|
||||
}else{
|
||||
showAlert('d',data.result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function dorefreshdetail(num) {
|
||||
var id= $("#id"+num).val();
|
||||
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintainCar/dorefreshdetail.do", {id:id}, function(data) {
|
||||
if (data.code == 1) {
|
||||
// showAlert('s','删除成功','mainAlertdiv');
|
||||
viewFun('${libraryMaintainCar.id}');
|
||||
}else{
|
||||
showAlert('d',data.result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
</script>
|
||||
<div class="box box-primary" style="margin-bottom:0px;">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">${libraryMaintainCar.name}</h3>
|
||||
<button type="button" class="btn btn-primary" style="float: right;" onclick="dosaveall()" id="btn_save">保存</button>
|
||||
|
||||
<!-- <div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">里程(万公里)</label>
|
||||
<label class="col-sm-3 control-label">维保费用(元)</label>
|
||||
<label class="col-sm-3 control-label">维保工时(小时)</label>
|
||||
<label class="col-sm-3 control-label">操作</label>
|
||||
</div>
|
||||
<c:forEach var="detail" items="${list}" varStatus="s">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${detail.num10thousandKm}</label>
|
||||
<div class="col-sm-3">
|
||||
|
||||
<input type="hidden" id="id${s.count}" name ="id${s.count}" value="${detail.id}">
|
||||
|
||||
<c:if test="${(detail.money < 0) or (detail.money > 0)}" var="flag1">
|
||||
<input type="number" class="form-control" id="money${s.count}" name ="money${s.count}" value="<fmt:formatNumber value="${detail.money}" type="number" pattern="0.00" maxFractionDigits="2"/>" step="0.1">
|
||||
</c:if>
|
||||
<c:if test="${not flag1}">
|
||||
<input type="number" class="form-control" id="money${s.count}" name ="money${s.count}" step="0.1">
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
|
||||
<c:if test="${(detail.workingHours < 0) or (detail.workingHours > 0)}" var="flag2">
|
||||
<input type="number" class="form-control" id="workingHours${s.count}" name ="workingHours${s.count}" value="${detail.workingHours}" step="0.1">
|
||||
</c:if>
|
||||
<c:if test="${not flag2}">
|
||||
<input type="number" class="form-control" id="workingHours${s.count}" name ="workingHours${s.count}" step="0.1">
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<button type="button" class="btn btn-default" onclick="dorefreshdetail('${s.count}')" data-dismiss="modal">清空</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="dosavedetail('${s.count}')" id="btn_save">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
133
src/main/webapp/jsp/maintenance/libraryMaintainCarEdit.jsp
Normal file
133
src/main/webapp/jsp/maintenance/libraryMaintainCarEdit.jsp
Normal file
@ -0,0 +1,133 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<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 doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintainCar/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
// //选择设备,可多选
|
||||
// var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
// var equipmentIds = $('#equipmentIds').val();
|
||||
// $.post(ext.contextPath + '/sparepart/goods/showEquipmentCardForGoodsSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,equipmentIds:equipmentIds} , function(data) {
|
||||
// $("#equ4SelectDiv").html(data);
|
||||
// openModal("equipment4SelectModal");
|
||||
// });
|
||||
// };
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '车辆名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
model: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '车辆型号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
fuelConsumptionPer100km: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '百公里油耗定额不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
//选择物品类别
|
||||
// var showGoodsClass4SelectFun = function() {
|
||||
// $.post(ext.contextPath + '/sparepart/goodsClass/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
|
||||
// $("#fault4SelectDiv").html(data);
|
||||
// openModal('fault4SelectModal');
|
||||
// });
|
||||
// };
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${libraryMaintainCar.id}"/>
|
||||
<input id="unitId" name="unitId" type="hidden" value="${libraryMaintainCar.unitId}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*车辆名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="车辆名称" autocomplete="off" value="${libraryMaintainCar.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*车辆型号</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="model" name ="model" placeholder="车辆型号" autocomplete="off" value="${libraryMaintainCar.model}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*百公里油耗定额(L/100Km)</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" id="fuelConsumptionPer100km" name ="fuelConsumptionPer100km" placeholder="百公里油耗定额(L/100Km)" value="${libraryMaintainCar.fuelConsumptionPer100km}" step="0.1">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*物品类别</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="pname" placeholder="请选择" autocomplete="off" onclick="showGoodsClass4SelectFun();" value="" readonly>
|
||||
<input id="pid" name="classId" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属设备</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="equipmentIds" name="equipmentIds" type="hidden" value="" />
|
||||
<input class="form-control" id="equipname" name ="equipname" onclick="showEquipment4SelectsFun('subForm','equipmentIds','equipname');" placeholder="请点击选择" readonly>
|
||||
</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 ="memo" name ="memo" placeholder="备注...">${libraryMaintainCar.memo}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
263
src/main/webapp/jsp/maintenance/libraryMaintainCarList.jsp
Normal file
263
src/main/webapp/jsp/maintenance/libraryMaintainCarList.jsp
Normal file
@ -0,0 +1,263 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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 addFun = function () {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintainCar/doadd.do', {unitId:unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintainCar/doedit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintainCar/doview.do', {id: id}, function (data) {
|
||||
$("#detail").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintainCar/dodelete.do', {id: id}, function (data) {
|
||||
console.log(data.code);
|
||||
if (data.code == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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/libraryMaintainCar/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data.code==1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryMaintainCar/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: unitId,
|
||||
// search_name: $('#search_name').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '车辆名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'model', // 返回json数据中的name
|
||||
title: '车辆型号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'fuelConsumptionPer100km', // 返回json数据中的name
|
||||
title: '百公里油耗定额(L/100Km)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'memo', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa 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");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div id="mainAlertdiv"></div>
|
||||
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<%--<div class="form-group pull-right form-inline">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="物品名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" id="detail"></div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,160 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.LibraryMaintenanceCommon"%>
|
||||
<%request.setAttribute("type_Common", LibraryMaintenanceCommon.type_Common);%>
|
||||
<%request.setAttribute("type_Meter", LibraryMaintenanceCommon.type_Meter);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
|
||||
.buttonDiv{
|
||||
float: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var unitId="";
|
||||
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/add.do', {pid:pid} , function(data) {
|
||||
$("#lubricationTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id, pid,type) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceCommon/showList.do', {classId: id,type: type} , function(data) {
|
||||
$("#lubricationTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTree4EquipmentCard.do', {unitId:unitId} , function(data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData,levels: 3});
|
||||
$('#tree').on('nodeSelected', function(event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
// if(treeData.type == 3){
|
||||
// $("#addDiv").css("display","block");//显示div
|
||||
// }else{
|
||||
// $("#addDiv").css("display","none");//隐藏div
|
||||
// }
|
||||
|
||||
});
|
||||
},'json');
|
||||
$("#lubricationTable").html("");
|
||||
};
|
||||
|
||||
|
||||
//导入
|
||||
function doImport(){
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceCommon/doImport.do', {unitId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExportTy(){
|
||||
window.open(ext.contextPath + "/maintenance/libraryMaintenanceCommon/doExport.do?unitId="+unitId+'&type=${type_Common}');
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExportYb(){
|
||||
window.open(ext.contextPath + "/maintenance/libraryMaintenanceCommon/doExport.do?unitId="+unitId+'&type=${type_Meter}');
|
||||
}
|
||||
|
||||
function choiceType(type,name){
|
||||
$('#type').val(type);//给型号id赋值
|
||||
$('#headId1').html('('+name+')');
|
||||
$('#headId2').html('(所有)');
|
||||
$('#projectId').val('');
|
||||
projectFun();
|
||||
contentFun();
|
||||
}
|
||||
|
||||
$(function() {
|
||||
unitId=unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<!-- 搜索状态 0为隐藏 1为显示 -->
|
||||
<input type="hidden" id="searchStatus" name="searchStatus" value="0">
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"> </h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<%--<div class="box-tools" id="addDiv" style="display:none">
|
||||
</div>--%>
|
||||
|
||||
<div class="box-tools" id="addDiv">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExportTy();"><i class="fa fa-cloud-download"></i>
|
||||
导出通用
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExportYb();"><i class="fa fa-cloud-download"></i>
|
||||
导出仪表
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9" id="modelButton" >
|
||||
<button type="button" class="btn btn-default" onclick="choiceType('${type_Common}','通用');">通用</button>
|
||||
<button type="button" class="btn btn-default" onclick="choiceType('${type_Meter}','仪表');">仪表</button>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<div class="col-md-9" id="lubricationTable" ></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
157
src/main/webapp/jsp/maintenance/libraryMaintenanceCommonAdd.jsp
Normal file
157
src/main/webapp/jsp/maintenance/libraryMaintenanceCommonAdd.jsp
Normal file
@ -0,0 +1,157 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintenanceCommon/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#projectTable").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: {
|
||||
cycle:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择周期'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保代码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
insideRepairTime:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '定额工时不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cost:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保费不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= '';
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"lubricationuid",textId:"_lubricationuid",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" name="unitId" value="${param.unitId}">
|
||||
<input type="hidden" name="type" value="${param.type}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*周期</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="cycle" name="cycle">
|
||||
<option value="">请选择</option>
|
||||
<!-- <option value="${Maintain_Week}">一周</option>
|
||||
<option value="${Maintain_TenDays}">旬</option> -->
|
||||
<option value="${Maintain_Month}">月度</option>
|
||||
<option value="${Maintain_Quarter}">季度</option>
|
||||
<option value="${Maintain_HalfYear}">半年度</option>
|
||||
<option value="${Maintain_Year}">年度</option>
|
||||
</select>
|
||||
</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">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="维保代码" autocomplete="off">
|
||||
</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">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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="${libraryMaintenanceCommon.insideRepairTime}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*维保费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="cost" name="cost" placeholder="维保费" autocomplete="off" value="${libraryMaintenanceCommon.cost}" 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>
|
||||
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintenanceCommonContent/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: {
|
||||
code:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '内容代号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
unit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
tools:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '方法及工具不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
security:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全措施不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= '';
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"lubricationuid",textId:"_lubricationuid",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- <input type="hidden" 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">
|
||||
<input type="text" class="form-control" id="code" name="code" 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="commonId" name="commonId" value="${pid}">
|
||||
</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 ="contents" name ="contents" placeholder="请输入" autocomplete="off" >${libraryMaintenanceCommonContent.contents}</textarea>
|
||||
</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 ="tools" name ="tools" placeholder="请输入" autocomplete="off" >${libraryMaintenanceCommonContent.tools}</textarea>
|
||||
</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 ="security" name ="security" placeholder="请输入" autocomplete="off" >${libraryMaintenanceCommonContent.security}</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>
|
||||
@ -0,0 +1,139 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintenanceCommonContent/doupdate.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: {
|
||||
code:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '内容代号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保内容不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
unit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
tools:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '方法及工具不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
security:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全措施不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" name="id" value="${libraryMaintenanceCommonContent.id}">
|
||||
<!-- 界面提醒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="code" name="code" placeholder="内容代码" autocomplete="off" value="${libraryMaintenanceCommonContent.code}">
|
||||
</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="commonId" name="commonId" value="${libraryMaintenanceCommonContent.commonId}">
|
||||
</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 ="contents" name ="contents" placeholder="请输入" autocomplete="off" >${libraryMaintenanceCommonContent.contents}</textarea>
|
||||
</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 ="tools" name ="tools" placeholder="请输入" autocomplete="off" >${libraryMaintenanceCommonContent.tools}</textarea>
|
||||
</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 ="security" name ="security" placeholder="请输入" autocomplete="off" >${libraryMaintenanceCommonContent.security}</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>
|
||||
158
src/main/webapp/jsp/maintenance/libraryMaintenanceCommonEdit.jsp
Normal file
158
src/main/webapp/jsp/maintenance/libraryMaintenanceCommonEdit.jsp
Normal file
@ -0,0 +1,158 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintenanceCommon/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#projectTable").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: {
|
||||
cycle:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择周期'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保代码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
insideRepairTime:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '定额工时不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cost:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '维保费不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= '';
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"lubricationuid",textId:"_lubricationuid",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#cycle").val("${libraryMaintenanceCommon.cycle}");
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" name="id" value="${libraryMaintenanceCommon.id}">
|
||||
<input type="hidden" name="unitId" value="${libraryMaintenanceCommon.unitId}">
|
||||
<input type="hidden" name="type" value="${libraryMaintenanceCommon.type}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*周期</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="cycle" name="cycle">
|
||||
<option value="">请选择</option>
|
||||
<!-- <option value="${Maintain_Week}">一周</option>
|
||||
<option value="${Maintain_TenDays}">旬</option> -->
|
||||
<option value="${Maintain_Month}">月度</option>
|
||||
<option value="${Maintain_Quarter}">季度</option>
|
||||
<option value="${Maintain_HalfYear}">半年度</option>
|
||||
<option value="${Maintain_Year}">年度</option>
|
||||
</select>
|
||||
</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="${libraryMaintenanceCommon.pid}">
|
||||
</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="code" name="code" placeholder="维保代码" autocomplete="off" value="${libraryMaintenanceCommon.code}">
|
||||
</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="${libraryMaintenanceCommon.name}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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="${libraryMaintenanceCommon.insideRepairTime}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*维保费(元)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="cost" name="cost" placeholder="维保费" autocomplete="off" value="${libraryMaintenanceCommon.cost}" 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>
|
||||
@ -0,0 +1,318 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
|
||||
<%@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);%>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.LibraryMaintenanceCommon"%>
|
||||
<%request.setAttribute("type_Common", LibraryMaintenanceCommon.type_Common);%>
|
||||
<%request.setAttribute("type_Meter", LibraryMaintenanceCommon.type_Meter);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchPatrolPoint = function () {
|
||||
$("#table_libraryMain4Select").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect() {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
datas_name = "";
|
||||
$.each(selectionIds, function (index, item) {
|
||||
if (datas != "") {
|
||||
datas += ",";
|
||||
}
|
||||
datas += item;
|
||||
});
|
||||
//调用上一界面方法完成选择
|
||||
var type = '${param.equipmentType}';
|
||||
doFinishSelectLibraryMain(datas,type);
|
||||
closeModal("libraryModal");
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
$.each(eval('${librarys}'), function (index, item) {
|
||||
if (row.id == item.id) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds() {
|
||||
var check_array = eval('${librarys}');
|
||||
if (check_array != null && check_array.length > 0) {
|
||||
selectionIds = new Array(check_array.length);
|
||||
for (var i = 0; i < check_array.length; i++) {
|
||||
selectionIds[i] = check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds() {
|
||||
var ids = "";
|
||||
var check_array = eval('${librarys}');
|
||||
$.each(check_array, function (index, item) {
|
||||
if (ids != "") {
|
||||
ids += ",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
equipmentId: '${param.equipmentId}',
|
||||
unitId: '${param.unitId}',
|
||||
type: '${param.equipmentType}'
|
||||
};
|
||||
var status = $('#switchBtn').bootstrapSwitch('state');
|
||||
if (status) {
|
||||
temp.checkedIds = getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function () {
|
||||
$("#searchForm_Equ").attr("onsubmit", "return false;");
|
||||
$("#search_name_equ").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchPatrolPoint();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
})
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
|
||||
initialSelectionIds();
|
||||
$table = $("#table_libraryMain4Select").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryMaintenanceCommon/getList4Select.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
clickToSelect: true,
|
||||
responseHandler: responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked: true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'code',
|
||||
title: "部位",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function(value, row, index){
|
||||
if(row.equipmentClass!=null && row.equipmentClass!=''){
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.equipmentClass.name + "'>" + row.equipmentClass.name + "</span>";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'code',
|
||||
title: "编号",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%'
|
||||
}, {
|
||||
field: 'name',
|
||||
title: "名称",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function(value, row, index){
|
||||
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + row.name + "'>" + row.name + "</span>";
|
||||
}
|
||||
}, {
|
||||
field: 'cycle',
|
||||
title: "周期",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(value=='${Maintain_Week}'){
|
||||
return '周';
|
||||
}else if(value=='${Maintain_TenDays}'){
|
||||
return '旬';
|
||||
}else if(value=='${Maintain_Month}'){
|
||||
return '月度';
|
||||
}else if(value=='${Maintain_Quarter}'){
|
||||
return '季度';
|
||||
}else if(value=='${Maintain_HalfYear}'){
|
||||
return '半年度';
|
||||
}else if(value=='${Maintain_Year}'){
|
||||
return '年度';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'insideRepairTime',
|
||||
title: "工时定额(小时)",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
}, {
|
||||
field: 'cost',
|
||||
title: "维保费(元)",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '20%'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_libraryMain4Select");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if ('check' == e.type) {
|
||||
obj.parent().addClass("checked");
|
||||
} else {
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = { "union": union, "difference": difference };
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="libraryModal">
|
||||
<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 " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse">
|
||||
<form class="form-horizontal " id="searchForm_Equ">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="col-sm-2 control-label">部门</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name_equ" name="search_name_equ"
|
||||
class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
|
||||
<button type="button" class="btn btn-default btn-sm pull-right"
|
||||
onclick="doSearchPatrolPoint();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_libraryMain4Select" style="height:230px;overflow:auto;width:100%"></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="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,120 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.tools.CommUtil" %>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", "")); %>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.LibraryMaintenanceCommon" %>
|
||||
<%request.setAttribute("type_Common", LibraryMaintenanceCommon.type_Common); %>
|
||||
<%request.setAttribute("type_Meter", LibraryMaintenanceCommon.type_Meter); %>
|
||||
|
||||
<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 control;
|
||||
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var mainType = $('#mainType').val();
|
||||
var data = {
|
||||
"companyId": '-1',
|
||||
"mainType": mainType, //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.status == true) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s', data.response.msg, 'mainAlertdiv');
|
||||
} else {
|
||||
showAlert('d', data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initUpload("filelist", ext.contextPath + "/maintenance/libraryMaintenanceCommon/saveExcelData.do?unitId=" + unitId);
|
||||
})
|
||||
|
||||
//导入上传文件的数据
|
||||
function importExcelFun() {
|
||||
var mainType = $('#mainType').val();
|
||||
if ($("#filelist").val() == null || $("#filelist").val() == "") {
|
||||
showAlert('d', '上传的文件不能为空!');
|
||||
} else {
|
||||
if (mainType != null && mainType != '') {
|
||||
control.fileinput("upload");
|
||||
} else {
|
||||
showAlert('d', '请选择保养类型!');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<select class="form-control select2" id="mainType" name="mainType">
|
||||
<option value="">请选择</option>
|
||||
<option value="${type_Common}">通用维保</option>
|
||||
<option value="${type_Meter}">仪表维保</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple
|
||||
accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
523
src/main/webapp/jsp/maintenance/libraryMaintenanceCommonList.jsp
Normal file
523
src/main/webapp/jsp/maintenance/libraryMaintenanceCommonList.jsp
Normal file
@ -0,0 +1,523 @@
|
||||
<%@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);%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
|
||||
<%@page import="com.sipai.entity.maintenance.LibraryMaintenanceCommon"%>
|
||||
<%request.setAttribute("type_Common", LibraryMaintenanceCommon.type_Common);%>
|
||||
<%request.setAttribute("type_Meter", LibraryMaintenanceCommon.type_Meter);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var companyId;
|
||||
|
||||
var dosearch = function () {
|
||||
$("#projectTable").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var projectFun = function () {
|
||||
var type = $('#type').val();
|
||||
|
||||
$("#projectTable").bootstrapTable('destroy');
|
||||
$("#projectTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/libraryMaintenanceCommon/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,
|
||||
classId: '${param.classId}',
|
||||
unitId: unitId,
|
||||
type: type
|
||||
}
|
||||
},
|
||||
/*responseHandler: function(res){
|
||||
return res.result
|
||||
},*/
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//赋值一个故障库id 用于维修库新增使用
|
||||
$('#projectId').val(row.id);
|
||||
$('#headId2').html('('+row.name+')');
|
||||
contentFun();
|
||||
},
|
||||
//rowStyle:rowStyleFault,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '维保代码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.code;
|
||||
}
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '26%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.name;
|
||||
}
|
||||
}, {
|
||||
field: 'cycle', // 返回json数据中的name
|
||||
title: '周期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '18%',
|
||||
formatter: function (value, row, index) {
|
||||
if(value=='${Maintain_Week}'){
|
||||
return '周';
|
||||
}else if(value=='${Maintain_TenDays}'){
|
||||
return '旬';
|
||||
}else if(value=='${Maintain_Month}'){
|
||||
return '月度';
|
||||
}else if(value=='${Maintain_Quarter}'){
|
||||
return '季度';
|
||||
}else if(value=='${Maintain_HalfYear}'){
|
||||
return '半年度';
|
||||
}else if(value=='${Maintain_Year}'){
|
||||
return '年度';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'insideRepairTime', // 返回json数据中的name
|
||||
title: '工时定额(小时)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '18%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.insideRepairTime;
|
||||
}
|
||||
}, {
|
||||
field: 'cost', // 返回json数据中的name
|
||||
title: '维保费(元)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '18%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.cost;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editFaultFun(\'' + 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="deleteFaultFun(\'' + 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("projectTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var contentFun = function () {
|
||||
var classId = '${param.classId}';
|
||||
var projectId = $('#projectId').val();
|
||||
var type = $('#type').val();
|
||||
|
||||
$("#contentTable").bootstrapTable('destroy');
|
||||
$("#contentTable").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,
|
||||
classId: '${param.classId}',
|
||||
unitId: unitId,
|
||||
projectId: projectId,
|
||||
type: type
|
||||
}
|
||||
},
|
||||
/* 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: '10%',
|
||||
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("contentTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//新增
|
||||
var addProjectFun = function () {
|
||||
var pid = '${param.classId}';
|
||||
var type = $('#type').val();
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceCommon/doadd.do', { pid: pid, unitId: unitId,type: type}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//修改
|
||||
var editFaultFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceCommon/doedit.do', { id: id, unitId: unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//删除
|
||||
var deleteFaultFun = function (id) {
|
||||
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/libraryMaintenanceCommon/dodelete.do', { id: id }, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#projectTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//多删
|
||||
var deletesProjectFun = function() {
|
||||
var checkedItems = $("#projectTable").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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/libraryMaintenanceCommon/dodeletes.do', {ids:datas} , function(data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#projectTable").bootstrapTable('refresh');
|
||||
$("#contentTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//新增
|
||||
var addContentFun = function () {
|
||||
var projectId = $('#projectId').val();
|
||||
if(projectId!=null && projectId!=''){
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceCommonContent/doadd.do', { projectId: projectId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}else{
|
||||
showAlert('d', '请先点击维保项目', 'mainAlertdiv');
|
||||
}
|
||||
};
|
||||
|
||||
//修改
|
||||
var editContentFun = function (id) {
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceCommonContent/doedit.do', { id: id, unitId: unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//删除
|
||||
var deleteContentFun = function (id) {
|
||||
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/libraryMaintenanceCommonContent/dodelete.do', { id: id }, function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#contentTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//多删
|
||||
var deletesContentFun = function() {
|
||||
var checkedItems = $("#contentTable").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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/libraryMaintenanceCommonContent/dodeletes.do', {ids:datas} , function(data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
if (datastr.code == 1) {
|
||||
$("#contentTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function () {
|
||||
projectFun();
|
||||
contentFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<input type="hidden" id="classId" name="classId" value="${param.classId}">
|
||||
<input type="hidden" id="projectId" name="projectId" value="">
|
||||
<input type="hidden" id="type" name="type" value="${type_Common}">
|
||||
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<h3 class="box-title">维保项目</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;" id="headId1">(通用)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-default" onclick="addProjectFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="deletesProjectFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>
|
||||
|
||||
<table id="projectTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">维保内容</h3> <h3 class="box-title" style="color:#3C8DBC;font-size:14px;" id="headId2">(所有)</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-default" onclick="addContentFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="deletesContentFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<%-- <div id="alertDiv_power"></div>--%>
|
||||
<%-- <div id="powerDiv"></div>--%>
|
||||
<%-- <div id="menu4SelectDiv_func"></div>--%>
|
||||
|
||||
<table id="contentTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@ -0,0 +1,136 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
|
||||
.buttonDiv{
|
||||
float: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var unitId="";
|
||||
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/add.do', {pid:pid} , function(data) {
|
||||
$("#lubricationTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id, pid,type) {
|
||||
var modelId = '';
|
||||
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceLubrication/showList.do', {classId: id,type: type,modelId:modelId} , function(data) {
|
||||
$("#lubricationTable").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/getTree4EquipmentCard.do', {unitId:unitId} , function(data) {
|
||||
var treeData = data.result;
|
||||
$('#tree').treeview({data: treeData,levels: 3});
|
||||
$('#tree').on('nodeSelected', function(event, treeData) {
|
||||
editFun(treeData.id, treeData.pid, treeData.type);
|
||||
//level为树形层级 1为设备大类 2为设备小类 3为部位
|
||||
// if(treeData.type == 3){
|
||||
// $("#addDiv").css("display","block");//显示div
|
||||
// }else{
|
||||
// $("#addDiv").css("display","none");//隐藏div
|
||||
// }
|
||||
|
||||
});
|
||||
},'json');
|
||||
$("#lubricationTable").html("");
|
||||
};
|
||||
|
||||
|
||||
//导入
|
||||
function doImport(){
|
||||
$.post(ext.contextPath + '/maintenance/libraryMaintenanceLubrication/doImport.do', {unitId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
function doExport(){
|
||||
window.open(ext.contextPath + "/maintenance/libraryMaintenanceLubrication/doExport.do?unitId="+unitId);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
unitId=unitId;
|
||||
initTreeView();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<!-- 搜索状态 0为隐藏 1为显示 -->
|
||||
<input type="hidden" id="searchStatus" name="searchStatus" value="0">
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"> </h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设备分类</h3>
|
||||
<div class="box-tools" id="addDiv" style="display:none">
|
||||
</div>
|
||||
|
||||
<div class="box-tools" id="addDiv">
|
||||
<button type="button" class="btn btn-box-tool" onclick="doImport();"><i class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="doExport();"><i class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:700px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 故障库列表 -->
|
||||
<div class="col-md-9" id="lubricationTable" ></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,192 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||||
<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()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/maintenance/libraryMaintenanceLubrication/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#faultTable").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: {
|
||||
code:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '代号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
cycle:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择周期'
|
||||
}
|
||||
}
|
||||
},
|
||||
standard: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '油量标准不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
unit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
model:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '型号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
insideRepairTime:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '定额工时不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contents:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '润滑内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= '';
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"lubricationuid",textId:"_lubricationuid",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" 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">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="内容代码" autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*周期</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="cycle" name="cycle">
|
||||
<option value="">请选择</option>
|
||||
<!-- <option value="${Maintain_Week}">一周</option>
|
||||
<option value="${Maintain_TenDays}">旬</option> -->
|
||||
<option value="${Maintain_Month}">月度</option>
|
||||
<option value="${Maintain_Quarter}">季度</option>
|
||||
<option value="${Maintain_HalfYear}">半年度</option>
|
||||
<option value="${Maintain_Year}">年度</option>
|
||||
</select>
|
||||
</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="${pid}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*油量标准</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="standard" name="standard" placeholder="油量标准,填写数值" autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*单位</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="unit" name="unit" placeholder="单位" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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="${libraryMaintenanceLubrication.insideRepairTime}" step="0.01">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">油品型号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="model" name="model" placeholder="油品型号" autocomplete="off" value="${libraryMaintenanceLubrication.model}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">润滑人员</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="_lubricationuid" name ="_lubricationuid" placeholder="润滑人员" onclick="showUser4SelectsFun();" value="${_lubricationuid}">
|
||||
<input id="lubricationuid" name="lubricationuid" type="hidden" value="${libraryMaintenanceLubrication.lubricationuid}"/>
|
||||
</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 ="contents" name ="contents" placeholder="请输入" autocomplete="off" >${libraryMaintenanceLubrication.contents}</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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user