628 lines
29 KiB
Plaintext
628 lines
29 KiB
Plaintext
|
|
<%@ 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>
|