first commit
This commit is contained in:
170
WebRoot/jsp/workorder/overhaulItemContentEdit.jsp
Normal file
170
WebRoot/jsp/workorder/overhaulItemContentEdit.jsp
Normal file
@ -0,0 +1,170 @@
|
||||
<%@ 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');
|
||||
});
|
||||
$('#startDate').datepicker('setDate', '${overhaulItemContent.startDate.substring(0, 10)}');
|
||||
|
||||
//初始化计划结束时间
|
||||
$('#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');
|
||||
});
|
||||
$('#finishDate').datepicker('setDate', '${overhaulItemContent.finishDate.substring(0, 10)}');
|
||||
|
||||
function doItemUpdateContent() {
|
||||
$("#subFormItemContent").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormItemContent").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/workorder/overhaulItemContent/doupdate.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="${overhaulItemContent.id}">
|
||||
<input type="hidden" class="form-control" name="itemId" value="${overhaulItemContent.itemId}">
|
||||
|
||||
<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="请填写分项内容"
|
||||
value="${overhaulItemContent.contents}" 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="${overhaulItemContent.progress}" step="0.01"
|
||||
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="请选择开始时间">
|
||||
</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="请选择结束时间">
|
||||
</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"
|
||||
placeholder="请填写额定工时" value="${overhaulItemContent.baseHours}" step="0.01"
|
||||
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"
|
||||
placeholder="请填写实际工时" value="${overhaulItemContent.workingHours}" step="0.01"
|
||||
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="doItemUpdateContent()">保存</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user