167 lines
7.1 KiB
Plaintext
167 lines
7.1 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
var showUser4SelectsFun = function () {
|
|||
|
|
var userIds = $("#solver").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect.do', {
|
|||
|
|
formId: "subFormItemContent",
|
|||
|
|
hiddenId: "userId",
|
|||
|
|
textId: "userName",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
$("#subFormItemContent").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
contents: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '分项内容不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
startDate: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '开始时间不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
baseHours: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '定额工时不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//初始化计划开始时间
|
|||
|
|
$('#startDate').datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format: 'yyyy-mm-dd',
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('startDate', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('startDate');
|
|||
|
|
});
|
|||
|
|
//初始化计划结束时间
|
|||
|
|
$('#finishDate').datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format: 'yyyy-mm-dd',
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('finishDate', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('finishDate');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function doItemSaveContent(id) {
|
|||
|
|
$("#subFormItemContent").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subFormItemContent").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/workorder/overhaulItemContent/dosave.do", $("#subFormItemContent").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
// showAlert('s','保存成功');
|
|||
|
|
closeModal('subModaloverhaulItemContent')
|
|||
|
|
$("#table_overhaul_item_content").bootstrapTable('refresh');
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModaloverhaulItemContent">
|
|||
|
|
<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">新增工单内容</h4>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subFormItemContent -->
|
|||
|
|
<form class="form-horizontal" id="subFormItemContent">
|
|||
|
|
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" class="form-control" name="id" value="${uuId}">
|
|||
|
|
<input type="hidden" class="form-control" name="itemId" 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="contents" name="contents" placeholder="请填写分项内容" autocomplete="off">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">分项进度(%)</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="progress" name="progress"
|
|||
|
|
placeholder="请填写分项进度" value="0" autocomplete="off">
|
|||
|
|
</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="startDate" name="startDate"
|
|||
|
|
style="width: 132px;" autocomplete="off" placeholder="请选择开始时间" 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="finishDate" name="finishDate"
|
|||
|
|
style="width: 132px;" autocomplete="off" placeholder="请选择结束时间" autocomplete="off">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*额定工时(小时)</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="baseHours" name="baseHours" value="0"
|
|||
|
|
placeholder="请填写额定工时" autocomplete="off">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">实际工时(小时)</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="workingHours" name="workingHours" value="0"
|
|||
|
|
placeholder="请填写实际工时" autocomplete="off">
|
|||
|
|
</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="doItemSaveContent('${uuId}')">保存</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|