344 lines
15 KiB
Plaintext
344 lines
15 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@page import="com.sipai.entity.process.ProcessAdjustment" %>
|
|||
|
|
<% request.setAttribute("Status_Start", ProcessAdjustment.Status_Start); %>
|
|||
|
|
<% request.setAttribute("Status_Finish", ProcessAdjustment.Status_Finish); %>
|
|||
|
|
|
|||
|
|
<!-- processAdjustmentContentList.jsp -->
|
|||
|
|
<jsp:include page="/jsp/process/processAdjustmentContentList.jsp"></jsp:include>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('targetUserName', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('targetUserName');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/process/processAdjustment/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 submitFun() {
|
|||
|
|
//没有入库明细不能发起审核
|
|||
|
|
var contentTableData = $("#table_content").bootstrapTable('getData');
|
|||
|
|
if (contentTableData.length == 0) {
|
|||
|
|
showAlert('d', '请先添加调整内容!', 'mainAlertdiv2');
|
|||
|
|
} else {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('targetUserName', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('targetUserName');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
dosubmit();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function dosubmit() {
|
|||
|
|
$("#status").val('${Status_Start}');
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('targetUserName', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('targetUserName');
|
|||
|
|
$.post(ext.contextPath + "/process/processAdjustment/startProcess.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');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
typeName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '工艺调整类型不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
abnormalCode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '异常编号不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
abnormalName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '异常名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
targetUserName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '审核人不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//加载调整内容
|
|||
|
|
getContent('${processAdjustment.id}', '${processAdjustment.status}');
|
|||
|
|
getContentForFile('${processAdjustment.id}', '${processAdjustment.status}');
|
|||
|
|
|
|||
|
|
//项目类型下拉数据
|
|||
|
|
var selectType = $("#typeName").select2({minimumResultsForSearch: 10});
|
|||
|
|
$.post(ext.contextPath + "/process/processAdjustmentType/getSelectList.do", {}, function (data) {
|
|||
|
|
$("#typeName").empty();
|
|||
|
|
var selelct_ = $("#typeName").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('${processAdjustment.typeId}').trigger("change");
|
|||
|
|
selelct_.on('change', function (e) {
|
|||
|
|
$('#typeId').val(e.target.value);
|
|||
|
|
//getAbnormalSelect(e.target.value);
|
|||
|
|
})
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
// $('#typeName').select2({ minimumResultsForSearch: 10 }).val('${processAdjustment.typeId}').trigger('change');
|
|||
|
|
// $('#typeName').val($('${processAdjustment.typeId}').val());
|
|||
|
|
// $('#typeName').trigger('chosen:updated');
|
|||
|
|
|
|||
|
|
//选择入库审核人
|
|||
|
|
// var showUser4AuditSelectsFun = function () {
|
|||
|
|
// var userIds = $("#targetUserIds").val();
|
|||
|
|
// $.post(ext.contextPath + '/user/userForSelect.do', {
|
|||
|
|
// formId: "subForm",
|
|||
|
|
// hiddenId: "targetUserIds",
|
|||
|
|
// textId: "targetUserName",
|
|||
|
|
// userIds: userIds
|
|||
|
|
// }, function (data) {
|
|||
|
|
// $("#user4SelectDiv").html(data);
|
|||
|
|
// openModal("user4SelectModal");
|
|||
|
|
// });
|
|||
|
|
// };
|
|||
|
|
|
|||
|
|
//选人
|
|||
|
|
var showUser4AuditSelectsFun = function () {
|
|||
|
|
var userIds = $("#receiveUserId").val();
|
|||
|
|
var type = $("#type").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect4FirstActiviti.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "targetUserIds",
|
|||
|
|
textId: "targetUserName",
|
|||
|
|
userIds: userIds,
|
|||
|
|
type: type
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//异常下拉数据
|
|||
|
|
//$('#abnormalSelect').select2({minimumResultsForSearch: 10}).val('${processAdjustment.typeId}').trigger('change');
|
|||
|
|
|
|||
|
|
/*function getAbnormalSelect(typeId) {
|
|||
|
|
$.post(ext.contextPath + "/process/libraryProcessAbnormal/getSelectList4Abnormal.do", {
|
|||
|
|
typeId: typeId,
|
|||
|
|
unitId: unitId
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#abnormalSelect").empty();
|
|||
|
|
var selelct_ = $("#abnormalSelect").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")
|
|||
|
|
}, 'json');
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
/*$("#abnormalSelect").change(function () {
|
|||
|
|
var id = $('#abnormalSelect').children('option:selected').val();
|
|||
|
|
$.ajax({
|
|||
|
|
type: "GET",
|
|||
|
|
url: ext.contextPath + "/process/libraryProcessAbnormal/getSelectList4Id.do",
|
|||
|
|
data: {id: id},
|
|||
|
|
dataType: "json",
|
|||
|
|
success: function (data) {
|
|||
|
|
$('#abnormalCode').val(data[0].abnormalCode);
|
|||
|
|
$('#abnormalName').val(data[0].abnormalName);
|
|||
|
|
$('#abnormalAnalysis').val(data[0].abnormalAnalysis);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
})*/
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<div class="modal-dialog modal-lg">
|
|||
|
|
<div class="modal-content">
|
|||
|
|
|
|||
|
|
<div id="mainAlertdiv2"></div>
|
|||
|
|
|
|||
|
|
<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" autocomplete="off">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" name="id" id="id" value="${processAdjustment.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="jobNumber" name="jobNumber" placeholder="工单号"
|
|||
|
|
value="${processAdjustment.jobNumber}" readonly>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*申请人</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="hidden" class="form-control" id="insuser" name="insuser"
|
|||
|
|
value="${processAdjustment.insuser}"/>
|
|||
|
|
<input type="text" class="form-control" id="insuserName" name="insuserName"
|
|||
|
|
value="${processAdjustment.user.caption}" readonly>
|
|||
|
|
</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="typeName" name="typeName"
|
|||
|
|
style="width: 170px;"></select>
|
|||
|
|
<input type="hidden" class="form-control" id="typeId" name="typeId"
|
|||
|
|
value="${processAdjustment.typeId}"/>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*厂区</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="hidden" class="form-control" id="unitId" name="unitId"
|
|||
|
|
value="${processAdjustment.unitId}"/>
|
|||
|
|
<input type="text" class="form-control" id="unitName" name="unitName"
|
|||
|
|
value="${processAdjustment.company.sname}" readonly>
|
|||
|
|
</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="abnormalSelect" name="abnormalSelect"
|
|||
|
|
style="width: 170px;"></select>
|
|||
|
|
<input type="hidden" name="abnormalName" id="abnormalName"
|
|||
|
|
value="${processAdjustment.abnormalName}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*异常编号</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="abnormalCode" name="abnormalCode"
|
|||
|
|
placeholder="异常编号"
|
|||
|
|
value="${processAdjustment.abnormalCode}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">异常现象分析</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" id="abnormalAnalysis" name="abnormalAnalysis"
|
|||
|
|
placeholder="异常现象分析">${processAdjustment.abnormalAnalysis}</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="remarks" name="remarks"
|
|||
|
|
placeholder="备注">${processAdjustment.remarks}</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="targetUserName" name="targetUserName"
|
|||
|
|
placeholder="点击选择"
|
|||
|
|
value="${processAdjustment.targetUser}" onclick="showUser4AuditSelectsFun();">
|
|||
|
|
<input id="targetUserIds" name="targetUserIds" type="hidden"
|
|||
|
|
value="${processAdjustment.targetUserIds}"/>
|
|||
|
|
</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="doImport('${processAdjustment.typeId}')" class="btn btn-box-tool"
|
|||
|
|
data-toggle="tooltip" title="导入"><i class="glyphicon glyphicon-th-list"></i></a>
|
|||
|
|
<a onclick="doaddContent('${processAdjustment.id}')" class="btn btn-box-tool"
|
|||
|
|
data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
|||
|
|
<a onclick="deleteContentFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
|||
|
|
class="glyphicon glyphicon-minus"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<table id="table_content" style="table-layout:fixed;"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="box box-primary">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">相关资料</h3>
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<table id="table_contentFile" 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()" >保存</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="submitFun()" >提交</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|