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