226 lines
9.3 KiB
Plaintext
226 lines
9.3 KiB
Plaintext
|
|
<%@ taglib prefix="c" uri="/jodd" %>
|
|||
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var masterId = '${jobNumber}';
|
|||
|
|
var masterId_process = masterId;
|
|||
|
|
var tbName = 'tb_maintenance_problem_fille'; //数据表
|
|||
|
|
var nameSpace = 'maintenance';//保存文件夹
|
|||
|
|
var bucketName = 'maintenance';//保存文件夹
|
|||
|
|
var previews = new Array();
|
|||
|
|
var previewConfigs = new Array();
|
|||
|
|
|
|||
|
|
function doItemSaveProject(id) {
|
|||
|
|
getFileList(()=>{
|
|||
|
|
$("#subFormItemProject").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subFormItemProject").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/workorder/overhaulItemProject/dosave.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,'alertDiv2');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var showUser4SelectsFun = function () {
|
|||
|
|
var userIds = $("#solver").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect.do', {
|
|||
|
|
formId: "subFormItemProject",
|
|||
|
|
hiddenId: "userId",
|
|||
|
|
textId: "userName",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
$("#subFormItemProject").bootstrapValidator({
|
|||
|
|
live: 'enabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
projectTypeName: {
|
|||
|
|
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) {
|
|||
|
|
$('#subFormItemProject').data('bootstrapValidator')
|
|||
|
|
.updateStatus('planStartDate', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('planStartDate');
|
|||
|
|
});
|
|||
|
|
//初始化计划结束时间
|
|||
|
|
$('#planFinishDate').datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format: 'yyyy-mm-dd',
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
$('#subFormItemProject').data('bootstrapValidator')
|
|||
|
|
.updateStatus('planFinishDate', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('planFinishDate');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//项目类型下拉数据
|
|||
|
|
var selectType = $("#projectTypeName").select2({minimumResultsForSearch: 10});
|
|||
|
|
$.post(ext.contextPath + "/workorder/overhaulType/getSelectList.do", {}, function (data) {
|
|||
|
|
$("#projectTypeName").empty();
|
|||
|
|
var selelct_ = $("#projectTypeName").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");
|
|||
|
|
selelct_.on('change', function (e) {
|
|||
|
|
$('#projectTypeId').val(e.target.value);
|
|||
|
|
})
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
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 () {
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
</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="alertDiv2"></div>
|
|||
|
|
<input type="hidden" class="form-control" name="id" value="${uuId}">
|
|||
|
|
<input type="hidden" class="form-control" name="unitId" value="${param.unitId}">
|
|||
|
|
<input type="hidden" class="form-control" name="projectId" value="${param.projectId}">
|
|||
|
|
|
|||
|
|
<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" autocomplete="off"
|
|||
|
|
placeholder="请填写工单号" value="${jobNumber}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*项目名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="projectTypeName" name="projectTypeName"
|
|||
|
|
style="width: 170px;"></select>
|
|||
|
|
<input type="hidden" class="form-control" id="projectTypeId" name="projectTypeId" value=""/>
|
|||
|
|
</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" placeholder="请选择计划开始时间" value="${nowDate}">
|
|||
|
|
</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" placeholder="请选择计划完成时间">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<div class="form-group" style="margin:8px">
|
|||
|
|
<label class="col-sm-2 control-label"></label>
|
|||
|
|
<button type="button" class="btn btn-default btn-file" onclick="fileinput('maintenancefile')"
|
|||
|
|
><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>
|
|||
|
|
<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="doItemSaveProject('${uuId}')">保存</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|