448 lines
18 KiB
Plaintext
448 lines
18 KiB
Plaintext
<%@ 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>
|