Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/cqbytSampleValue/cqbytVISITOUTINDATAEdit.jsp

113 lines
3.9 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
function doupdate() {
$('#subForm').data('bootstrapValidator')
.updateStatus('happenDate', 'NOT_VALIDATED',null)
.validateField('happenDate');
$('#subForm').data('bootstrapValidator')
.updateStatus('accidentTypeName', 'NOT_VALIDATED',null)
.validateField('accidentTypeName');
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/accident/accident/doupdate.do", $("#subForm").serialize(), function(data) {
if (data.code == 1){
showAlert('s','保存成功');
closeModal('subModal')
$("#table").bootstrapTable('refresh');
}else if(data.code == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.msg);
}
},'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
happenDate: {
validators: {
notEmpty: {
message: '日期不能为空'
}
}
},
happenPlace: {
validators: {
notEmpty: {
message: '地点不能为空'
}
}
},
accidentTypeName: {
validators: {
notEmpty: {
message: '事故分类不能为空'
}
}
},
emergencyPlanTrue: {
validators: {
notEmpty: {
message: '是否响应应急预案不能为空'
}
}
},
}
});
$(function(){
$("#emergencyPlanTrue").select2({ minimumResultsForSearch: 10 }).val("${accident.emergencyPlanTrue}").trigger("change");
$("#happenDate").datetimepicker({
// startDate: date,
language:'zh-CN',
format: 'yyyy-mm-dd',
startView: "month", //初始化视图是‘年’
minView: 2,
maxView: "year",
autoclose: true
// todayBtn: "linked"
});
})
//选择设备根据厂区id和工艺段id选择厂内设备可多选
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
$.post(ext.contextPath + '/accident/accidentType/showAccidentType4Select4Use.do', { formId: formId, hiddenId: hiddenId, textId: textId }, function (data) {
$("#equ4SelectDiv").html(data);
openModal("equipment4SelectModal");
});
};
</script>
<div class="modal fade" id="subModal">
<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">&times;</span></button>
<h4 class="modal-title">出入照片</h4>
</div>
<div class="modal-body">
<img src="${jpg}" width="870"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<!-- <button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button> -->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>