first commit
This commit is contained in:
278
WebRoot/jsp/workorder/overhaulItemProjectEdit.jsp
Normal file
278
WebRoot/jsp/workorder/overhaulItemProjectEdit.jsp
Normal file
@ -0,0 +1,278 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<jsp:include page="/jsp/workorder/workorderOverhaulItemContent.jsp"></jsp:include>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var masterId = '${overhaulItemProject.jobNumber}';
|
||||
var masterId_process = masterId;
|
||||
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_process = 'tb_maintenance_problem_fille'; //数据表
|
||||
var nameSpace_process = 'MaintenanceProblem';//保存文件夹
|
||||
var nameSpace = 'maintenance';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var status = 'delete'
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var oid = '${overhaulItemProject.id}';
|
||||
|
||||
function doItemUpdateProject() {
|
||||
|
||||
|
||||
getFileList(() => {
|
||||
$('#subFormItemProject').data('bootstrapValidator')
|
||||
.updateStatus('planStartDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planStartDate');
|
||||
$('#subFormItemProject').data('bootstrapValidator')
|
||||
.updateStatus('planFinishDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planFinishDate');
|
||||
$("#subFormItemProject").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormItemProject").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/workorder/overhaulItemProject/doupdate.do", $("#subFormItemProject").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
// showAlert('s', '保存成功');
|
||||
closeModal('subModaloverhaulItemProject')
|
||||
$("#table_overhaul_item_project").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#receiveUserIds").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {
|
||||
formId: "subFormItemProject",
|
||||
hiddenId: "receiveUserIds",
|
||||
textId: "receiveUserIdsName",
|
||||
userIds: userIds
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$("#subFormItemProject").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
projectName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '项目名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planStartDate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划开始时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
planFinishDate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '计划完成时间不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//初始化计划开始时间
|
||||
$('#planStartDate').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('planStartDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planStartDate');
|
||||
});
|
||||
$('#planStartDate').datepicker('setDate', '${overhaulItemProject.planStartDate.substring(0, 10)}');
|
||||
|
||||
//初始化计划结束时间
|
||||
$('#planFinishDate').datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
}).on('hide', function (e) {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('planFinishDate', 'NOT_VALIDATED', null)
|
||||
.validateField('planFinishDate');
|
||||
});
|
||||
$('#planFinishDate').datepicker('setDate', '${overhaulItemProject.planFinishDate.substring(0, 10)}');
|
||||
|
||||
//加载大修分项-关联的内容
|
||||
getOverhaulItemContent('${overhaulItemProject.id}');
|
||||
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function (back) {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId: masterId, tbName: tbName}, function (data) {
|
||||
//console.info(data)
|
||||
// if (data.length > 0) {
|
||||
$('#annex').val(data.length)
|
||||
back()
|
||||
}, 'json');
|
||||
};
|
||||
$(function () {
|
||||
|
||||
status = '${edit}' == '1' ? 'delete' : 'view'
|
||||
// getFileList_process_minio(masterId_process, tbName_process, nameSpace, status)
|
||||
if ('${edit}' == '0' || '${edit}' == 0) {
|
||||
getFileListMinio('maintenancefile','${overhaulItemProject.jobNumber}',true);
|
||||
$('#overhaulJobNumberEdit').hide();
|
||||
$('#projectTypeId').attr('readonly', 'readonly');
|
||||
$('#planStartDate').attr('readonly', 'readonly');
|
||||
$('#planStartDate').css('pointer-events', 'none');
|
||||
|
||||
$('#planFinishDate').attr('readonly', 'readonly');
|
||||
$('#planFinishDate').css('pointer-events', 'none');
|
||||
|
||||
$('#fileupbt').css('display', 'none');
|
||||
} else {
|
||||
getFileListMinio('maintenancefile','${overhaulItemProject.jobNumber}',false);
|
||||
$('#overhaulJobNumberShow').hide();
|
||||
}
|
||||
|
||||
|
||||
// showFileInput("maintenanceDetailFile")
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModaloverhaulItemProject">
|
||||
<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强制为subFormItemProject -->
|
||||
<form class="form-horizontal" id="subFormItemProject">
|
||||
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" name="id" value="${overhaulItemProject.id}">
|
||||
<input type="hidden" class="form-control" name="unitId" value="${overhaulItemProject.unitId}">
|
||||
<input type="hidden" class="form-control" name="projectId" value="${overhaulItemProject.projectId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">分项工单号</label>
|
||||
<div class="col-sm-4">
|
||||
<!-- <p class="form-control-static">${jobNumber}</p> -->
|
||||
<div id="overhaulJobNumberEdit">
|
||||
<input type="text" class="form-control" id="jobNumber" name="jobNumber"
|
||||
value="${overhaulItemProject.jobNumber}">
|
||||
</div>
|
||||
<div id="overhaulJobNumberShow">
|
||||
<p class="form-control-static">${overhaulItemProject.jobNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*项目名称</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-4">
|
||||
<input type="hidden" class="form-control" id="projectTypeId" name="projectTypeId"
|
||||
value="${overhaulItemProject.projectTypeId}"/>
|
||||
<p class="form-control-static">${overhaulItemProject.overhaulType.name}</p>
|
||||
</div>
|
||||
</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="planStartDate" name="planStartDate"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
</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="planFinishDate" name="planFinishDate"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
</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="receiveUserIdsName" name="receiveUserIdsName"
|
||||
placeholder="请选择接收人员" onclick="showUser4SelectsFun();"
|
||||
value="${overhaulItemProject.receiveUsersName}" readonly>
|
||||
<input id="receiveUserIds" name="receiveUserIds" type="hidden"
|
||||
value="${overhaulItemProject.receiveUserIds}"/>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group" style="margin:8px">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<button type="button" id="fileupbt" class="btn btn-default btn-file"
|
||||
onclick="fileinput('maintenancefile','${overhaulItemProject.id}')"
|
||||
><i class="fa fa-paperclip"></i>附件上传
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" id="annex" name="annex">
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenancefile" id="maintenancefile" multiple
|
||||
class="file-loading"/>
|
||||
</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="doItemAddContent('${overhaulItemProject.id}')" class="btn btn-box-tool"--%>
|
||||
<%-- data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>--%>
|
||||
<%-- <a onclick="deleteItemContentsFun()" 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_overhaul_item_content" style="table-layout:fixed;"></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="doItemUpdateProject()">保存</button>
|
||||
<%--<button type="button" class="btn btn-primary" onclick="doItemSubmit('${overhaulItemProject.id}')">下发
|
||||
</button>--%>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user