Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/hqconfig/riskLevelEdit.jsp
2026-01-16 14:13:44 +08:00

215 lines
9.6 KiB
Plaintext

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<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() {//获取验证结果,如果成功,执行下面代码
//保存前先赋值班组
var val = $('#_place').val();
var rolestr = "";
if (val != null && val != '') {
$.each(val, function (index, value, array) {
if (rolestr != "") {
rolestr += ","
}
rolestr += value;
})
$('#place').val(rolestr);//赋值班组
}
var param = $("#subForm").serialize();
$.post(ext.contextPath + "/hqconfig/riskGrade/doUpdate.do", param, function (data) {
if (data.code == 1) {
$(".modal").modal("hide");
$("#table").bootstrapTable('refresh');
} else if (data.code == 0) {
showAlert('d', '保存失败');
} else {
showAlert('d', data.res);
}
}, 'json');
}
//获取巡检区域
var selectAreaFun = function () {
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
}, function (data) {
$("#areaSubDiv").html(data);
openModal('areaSubModal');
});
};
<%--$.post(ext.contextPath + "/hqconfig/riskGrade/getAreaManage.do", {}, function(data) {--%>
<%-- var selelct = $("#_place").select2({--%>
<%-- data: data,--%>
<%-- placeholder: '请选择',//默认文字提示--%>
<%-- allowClear: false,//允许清空--%>
<%-- escapeMarkup: function (markup) {--%>
<%-- return markup;--%>
<%-- }, // 自定义格式化防止xss注入--%>
<%-- language: "zh-CN",--%>
<%-- minimumInputLength: 0,--%>
<%-- minimumResultsForSearch: 10,//数据超过十个启用搜索框--%>
<%-- multiple: true,--%>
<%-- formatResult: function formatRepo(repo) {--%>
<%-- return repo.text;--%>
<%-- }, // 函数用来渲染结果--%>
<%-- formatSelection: function formatRepoSelection(repo) {--%>
<%-- return repo.text;--%>
<%-- } // 函数用于呈现当前的选择--%>
<%-- });--%>
<%-- var roleitems = new Array();--%>
<%-- var roles = JSON.parse('${place}');--%>
<%-- for (var i = 0; i < roles.length; i++) {--%>
<%-- roleitems.push(roles[i].id);--%>
<%-- }--%>
<%-- selelct.val(roleitems).trigger("change");--%>
<%-- },'json');--%>
$(function(){
$('#lvalue, #svalue').bind('input propertychange',function () {
var lvalue = $('#lvalue').val();
var svalue = $('#svalue').val();
var rvalue = lvalue * svalue;
$('#rvalue').val(rvalue);
$.post(ext.contextPath + "/alarm/config/getConfigList.do", {rvalue: rvalue}, function(data) {
if (data.rows.length == 0) {
$('#risklevels').val("-");
$('#risklevel').val("-");
} else {
$('#risklevel').val(data.rows[0].id);
$('#risklevels').val(data.rows[0].level);
}
},'json');
// if(rvalue >= 20 && rvalue <= 25){
// $('#risklevel').val("A");
// }else if(rvalue >= 13 && rvalue <= 19){
// $('#risklevel').val("B");
// }else if(rvalue >= 8 && rvalue <= 12){
// $('#risklevel').val("C");
// }else if(rvalue >= 4 && rvalue <= 7){
// $('#risklevel').val("D");
// }else{
// $('#risklevel').val("-");
// }
});
});
var showAlarmTyps4SelectFun = function() {
$.post(ext.contextPath + '/work/alarmTypes/showList4Select.do', {formId:"subForm",hiddenId:"safetyinspection",textId:"safetyinspectionname", type:"s"} , function(data) {
$("#fault4SelectDiv").html(data);
openModal('fault4SelectModal');
});
};
</script>
<div class="modal fade" id="subModal">
<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">&times;</span></button>
<h4 class="modal-title">编辑风险等级</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<input type="hidden" id="risklevel" name="risklevel" class="form-control pull-right" value="${riskLevel.risklevel}">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" class="form-control" id="id" name ="id" value ="${riskLevel.id}">
<div class="form-group">
<label class="col-sm-2 control-label">安全项内容</label>
<div class="col-sm-4">
<input type="text" id="securitycontent" name="securitycontent" class="form-control pull-right" value="${riskLevel.securitycontent}">
</div>
<label class="col-sm-2 control-label">报警类型</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="safetyinspectionname" name ="safetyinspectionname" placeholder="请点击选择风险类型"
onclick="showAlarmTyps4SelectFun();" readonly="readonly" value="${riskLevel.safetyinspectionname}"></input>
<input id="safetyinspection" name="safetyinspection" type="hidden" value="${riskLevel.safetyinspection}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">地点</label>
<%-- <div class="col-sm-10">--%>
<%-- <select class="form-control select2" id="_place" name ="_place" style="width: 100%">--%>
<%-- </select>--%>
<%-- <input type="hidden" name="place" id="place" value="">--%>
<%-- </div>--%>
<div class="col-sm-10">
<%-- <input type="text" class="form-control" id="place" name="place"--%>
<%-- onclick="selectAreaFun()" placeholder="点击选择" value="${riskLevel.place}">--%>
<%-- <input type="hidden" class="form-control" id="areaid" name="areaid" value="${riskLevel.areaid}">--%>
<input type="text" id="place" name="place" class="form-control pull-right" value="${riskLevel.place}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">潜在的事故类别</label>
<div class="col-sm-4">
<select type="text" id="accidentcategory" class="form-control pull-right" name="accidentcategory">
<option value="1" <c:if test="${riskLevel.accidentcategory=='1'}"> selected</c:if>>中毒和窒息</option>
<option value="2" <c:if test="${riskLevel.accidentcategory=='2'}"> selected</c:if>>触电</option>
<option value="3" <c:if test="${riskLevel.accidentcategory=='3'}"> selected</c:if>>火灾</option>
<option value="4" <c:if test="${riskLevel.accidentcategory=='4'}"> selected</c:if>>淹溺</option>
<option value="7" <c:if test="${riskLevel.accidentcategory=='7'}"> selected</c:if>>坠落</option>
<option value="8" <c:if test="${riskLevel.accidentcategory=='8'}"> selected</c:if>>爆炸</option>
<option value="5" <c:if test="${riskLevel.accidentcategory=='5'}"> selected</c:if>>起重伤害</option>
<option value="6" <c:if test="${riskLevel.accidentcategory=='6'}"> selected</c:if>>其它伤害</option>
</select>
</div>
<label class="col-sm-2 control-label">主要后果</label>
<div class="col-sm-4">
<select type="text" id="consequences" class="form-control pull-right" name="consequences">
<option value="1" <c:if test="${riskLevel.consequences=='1'}"> selected</c:if>>轻伤</option>
<option value="2" <c:if test="${riskLevel.consequences=='2'}"> selected</c:if>>重伤</option>
<option value="3" <c:if test="${riskLevel.consequences=='3'}"> selected</c:if>>死亡</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">L</label>
<div class="col-sm-4">
<input type="text" id="lvalue" name="lvalue" class="form-control pull-right" value="${riskLevel.lvalue}">
</div>
<label class="col-sm-2 control-label">S</label>
<div class="col-sm-4">
<input type="text" id="svalue" name="svalue" class="form-control pull-right" value="${riskLevel.svalue}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">R(L*S)</label>
<div class="col-sm-4">
<input type="text" id="rvalue" name="rvalue" class="form-control pull-right" value="${riskLevel.rvalue}" readonly="readonly">
</div>
<label class="col-sm-2 control-label">风险等级</label>
<div class="col-sm-4">
<input type="text" id="risklevels" name="risklevels" class="form-control pull-right" value="${riskLevel.alarmLevelsConfig.level}" readonly="readonly">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">应采取的行动</label>
<div class="col-sm-10">
<textarea class="form-control " id="actionstaken" name="actionstaken" rows="6">${riskLevel.actionstaken}</textarea>
</div>
</div>
</form>
</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>