/*****************************************************有预警的应急预案预警时短息通知的JS***********************************************************/
$(function(){
$("#titlename").html(parent.parent.titlename);
getIniValue();
//getRelevancyInfo(sub_fd_id,SUB_BM_YAXHLB);//初始化存入库表的值
getOrgInfo2();//初始化应急组织列表
setHeightThis();
//window.setTimeout("setHeightThis()", 200);
});
function setHeightThis(){
$(parent.parent.document.body).find("iframe").height($(window.document.body).height()+700);
$(parent.parent.parent.document.body).find("iframe").height($(parent.parent.document.body).height()+700);
}
function resetSearch(){
document.location.reload();
}
function goBack(){
var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
}
//取预案的主键
var sub_fd_id ="";
//取页面传过来的预案主键ID : 传过来的预案ID
sub_fd_id = parent.parent.fd_id;
//预案的类型
var SUB_BM_YAXHLB= "";
SUB_BM_YAXHLB = parent.parent.BM_YAXHLB;
var tempValue="";
/**************************拼接类型*************************************************/
//判断细化类型
/**
* 细化类型
* 4、人身事故
* 5、大面积停电事件
* 6、设备事故
* 7、电厂大坝厂房事故
* 8、环境污染
* 9、防风防汛
* 10、地震灾害
* 11、低温雨雪冰冻灾害
* 12、电力供应及客户服务
* 13、生产场所防恐怖袭击
* 14、突发性群体事件
* 15、突发新闻事件
* 16、涉外突发事件
* 17、网络与信息安全
* 18、突发公共卫生
* **/
if(SUB_BM_YAXHLB=="4"){
tempValue="4_5_1";
}else if(SUB_BM_YAXHLB=="5"){
tempValue="5_5_1";
}else if(SUB_BM_YAXHLB=="6"){
tempValue="6_5_1";
}else if(SUB_BM_YAXHLB=="7"){
tempValue="7_5_1";
}else if(SUB_BM_YAXHLB=="8"){
tempValue="8_5_1";
}else if(SUB_BM_YAXHLB=="9"){
tempValue="9_5_1";
}else if(SUB_BM_YAXHLB=="10"){
tempValue="10_5_1";
}else if(SUB_BM_YAXHLB=="11"){
tempValue="11_5_1";
}else if(SUB_BM_YAXHLB=="12"){
tempValue="12_5_1";
}else if(SUB_BM_YAXHLB=="13"){
tempValue="13_5_1";
}else if(SUB_BM_YAXHLB=="14"){
tempValue="14_5_1";
}else if(SUB_BM_YAXHLB=="15"){
tempValue="15_5_1";
}else if(SUB_BM_YAXHLB=="16"){
tempValue="16_5_1";
}else if(SUB_BM_YAXHLB=="17"){
tempValue="17_5_1";
}else if(SUB_BM_YAXHLB=="18"){
tempValue="18_5_1";
}else if(SUB_BM_YAXHLB=="21"){
tempValue="21_5_1";
}else if(SUB_BM_YAXHLB=="22"){
tempValue="22_5_1";
}else if(SUB_BM_YAXHLB=="23"){
tempValue="23_5_1";
}else if(SUB_BM_YAXHLB=="24"){
tempValue="24_5_1";
}
/*//重设高度
function reSetHight(){
$(parent.parent.document.body).find("iframe").height(1300);
$(top.parent.document.body).find("#frmright").height(1000);
}*/
var orgName1 = "";
var orgName2 = "";
var orgName3 = "";
var orgName4 = "";
function getIniValue(){
var url = $.pathname()
+ "/ws/sendmenu/SendMsgService/PlanInfo";
var params = {
file_id : sub_fd_id,
grade_type:tempValue,
};
$.ajax({
url : url,
type : 'post',
timeout : 12000,
data : params,
dataType : 'json',
success : function(data) {
var orgVlue = data.rows[0].MSG_OPTER;
$("#show_SPONSOR_COMP_299").val(orgVlue);
orgName1 = data.rows[0].FRIST_GRADE;
orgName2 = data.rows[0].SECOND_GRADE;
orgName3 = data.rows[0].THRID_GRADE;
orgName4 = data.rows[0].FOURTH_GRADE;
$('#show_SPONSOR_COMP_2991').val(orgName1);
$('#show_SPONSOR_COMP_2992').val(orgName2);
$('#show_SPONSOR_COMP_2993').val(orgName3);
$('#show_SPONSOR_COMP_2994').val(orgName4);
fd_id215 = data.rows[0].FD_OBJECTID;
FILLER1_215 = data.rows[0].FILLER1;
$("#fd_id215").val(fd_id215);
$("#FILLER1_215").val(FILLER1_215);
},
error : function(e) {
$.messager.alert('系统提示信息', '访问服务失败!', 'error');
}
});
}
var type = SUB_BM_YAXHLB + "5_2";//拼短信通知的类型
var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
/*****************************************测试返回数据*************************************************/
//单位ID
var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
var loadData;
var org;
/****************************************************单表**********************************************************/
function getOrgInfo2() {
org = $("#maingridorg1").quiGrid({
columns: [
{display : '姓名',name : 'name',align : 'center',width : '20%'},
/*{display : '所属单位',name : 'org',align : 'center',width : '14%'},
{display : '所属部门',name : 'dept',align : 'center',width : '14%'}, */
{ display: '红色预警',level1 : 'level1', isAllowHide: false, align: 'center', width:'20%',
render: function (rowdata, rowindex, value, column){
var fabu='';
if(rowdata.level1=="1"){//"1"代表被选中的
fabu = '';
}else{
fabu = '';
}
return fabu;
},
},
{ display: '橙色预警',level2 : 'level2', isAllowHide: false, align: 'center', width:'20%',
render: function (rowdata, rowindex, value, column){
var fabu='';
if(rowdata.level2=="1"){
fabu = '';
}else{
fabu = '';
}
return fabu;
},
},
{ display: '黄色预警',level3 : 'level3', isAllowHide: false, align: 'center', width:'20%',
render: function (rowdata, rowindex, value, column){
var fabu='';
if(rowdata.level3=="1"){
fabu = '';
}else{
fabu = '';
}
return fabu;
},
},
{ display: '蓝色预警',level4 : 'level4', isAllowHide: false, align: 'center', width:'20%',
render: function (rowdata, rowindex, value, column){
var fabu='';
if(rowdata.level4=="1"){
fabu = '';
}else{
fabu = '';
}
return fabu;
},
}
],
url :$.pathname()+ "/ws/planService/PlanService/queryDxtzyjzz",
params :{
fdId : sub_fd_id,
gtype:"1",
deptId:deptId
},
sortName : '',
sortOrder : '',
rownumbers : true,
checkbox : false,
/* height: '99%',
width:"100%",*/
pageSize : 10,
percentWidthMode : true,
isChecked:checkedHandler,
onCheckRow: checkRowHandler,
onCheckAllRow: checkAllRowHandler,
//顶部图标按钮栏
toolbar:{
items:[
//{text: '查看', click: "onView", iconClass: 'view_tem',id:"10003"}
//{text: '查看', click: onView, iconClass: 'view_tem'},
{ line : true }
]
}
});
}
//预案ID.
//人ID.
//预警还是响应.
//1234.
//0 1
//123组织、队伍、专家
//地址changeDxtzyjzz
function fabu(rowindex,event,userid,is_del){
var id = $(event).attr("id");//取1234个等级
var url = $.pathname() + '/ws/planService/PlanService/changeDxtzyjzz/';
if(is_del=="1"){
is_del="0";
}else{
is_del="1";
}
var params = {
gtype : "1", //预警或响应
//gtype:tempValue,
fdId:sub_fd_id,//预案主键
msgType:"1", //组织1、队伍2、专家3
msgOpter:userid,//人员ID
clum:id,//
clv:is_del//删除还是创建标志
};
$.ajax({
url : url,
type : 'post',
timeout : 60000,
data : params,
dataType : 'json',
success : function(data){
if(data=="1"){
var classValue = $(event).attr("class");
if(classValue=="getUserInfo2 hand"){
$(event).removeClass("getUserInfo2 hand");
$(event).addClass("getUserInfo1 hand");
}else{
$(event).removeClass("getUserInfo1 hand");
$(event).addClass("getUserInfo2 hand");
}
}
},
error : function(e){
$.messager.alert('系统提示信息', '访问服务失败!', 'error');
}
});
};
var fd_id215 = "";
//判断是走新增还是走修改的方法
function isAdd1(){
if(fd_id215!=""){
//修改方法
edit();
}else{
//新增绑定条件
addTransferDaily();
}
}
//修改
function edit(){
//常用组织的名称
var orgValueName1 = $('#show_SPONSOR_COMP_2991').val();
var orgValueName2 = $('#show_SPONSOR_COMP_2992').val();
var orgValueName3 = $('#show_SPONSOR_COMP_2993').val();
var orgValueName4 = $('#show_SPONSOR_COMP_2994').val();
var orgValue1 = $('#SPONSOR_COMP_2991').val();
var orgValue2 = $('#SPONSOR_COMP_2992').val();
var orgValue3 = $('#SPONSOR_COMP_2993').val();
var orgValue4 = $('#SPONSOR_COMP_2994').val();
var orgValue1Temp1 = "";
var orgValue1Temp2 = "";
var orgValue1Temp3 = "";
var orgValue1Temp4 = "";
if(orgName1!=orgValueName1){
orgValue1Temp1 = orgValueName1;
}else{
orgValue1Temp1 = orgName1;
}
if(orgName2!=orgValueName2){
orgValue1Temp2 = orgValueName2;
}else{
orgValue1Temp2 = orgName2;
}
if(orgName3!=orgValueName3){
orgValue1Temp3 = orgValueName3;
}else{
orgValue1Temp3 = orgName3;
}
if(orgName4!=orgValueName4){
orgValue1Temp4 = orgValueName4;
}else{
orgValue1Temp4 = orgName4;
}
$("#FRIST_GRADE_215").val(orgValue1Temp1);
$("#SECOND_GRADE_215").val(orgValue1Temp2);
$("#THRID_GRADE_215").val(orgValue1Temp3);
$("#FOURTH_GRADE_215").val(orgValue1Temp4);
var orgValue = orgValue1 + "|" + orgValue2 + "|" + orgValue3 + "|" + orgValue4;
//写入预案分级的等级
$("#GRADE_TYPE_215").val(tempValue);
$("#FILLER1_215").val(sub_fd_id);
$("#MSG_OPTER_215").val(orgValue);
var formValue = $('#fillForm').serialize();
var url = $.pathname() + '/ws/crud/CRUDService/update';
$.ajax({
url : url,
type : 'post',
data : formValue,
dataType : 'text',
timeout : 60000,
success : function(data){
$.messager.alert('修改成功');
location.reload();//防风防汛短信通知刷新当前页面。
//parent.location.reload();
},
error : function(){
$.messager.alert('操作失败');
}
});
}
//增加
function addTransferDaily(){
//红橙黄蓝四个级别预警的常用组织ID
var orgValue1 = $('#SPONSOR_COMP_2991').val();
var orgValue2 = $('#SPONSOR_COMP_2992').val();
var orgValue3 = $('#SPONSOR_COMP_2993').val();
var orgValue4 = $('#SPONSOR_COMP_2994').val();
var orgValue = orgValue1 + "|" + orgValue2 + "|" + orgValue3 + "|" + orgValue4;
$("#MSG_OPTER_215").val(orgValue);
//常用组织的名称
var orgValueName1 = $('#show_SPONSOR_COMP_2991').val();
var orgValueName2 = $('#show_SPONSOR_COMP_2992').val();
var orgValueName3 = $('#show_SPONSOR_COMP_2993').val();
var orgValueName4 = $('#show_SPONSOR_COMP_2994').val();
//alert("orgValueName1:" + orgValueName1 + "orgValueName2:" + orgValueName2 + "orgValueName3" + orgValueName3 + "orgValueName4" + orgValueName4);
$("#FRIST_GRADE_215").val(orgValueName1);
$("#SECOND_GRADE_215").val(orgValueName2);
$("#THRID_GRADE_215").val(orgValueName3);
$("#FOURTH_GRADE_215").val(orgValueName4);
//写入预案分级的等级
$("#GRADE_TYPE_215").val(tempValue);
//预案的ID
$("#FILLER1_215").val(sub_fd_id);
$form = $('#fillForm');
var url = $.pathname() + '/ws/crud/CRUDService/create';
$.ajax({
url : url,
type : 'post',
data : $form.serialize(),
dataType : 'text',
timeout : 60000,
success : function(data){
$.messager.alert("保存成功",null,null,null,-1);
location.reload();
//parent.location.reload();
},
error : function(){
$.messager.alert('操作失败');
}
});
}
/*****************************************短信通知人员列表*********************************************/
$.messager=top.Dialog;
/*$(window).resize(function(){
$(parent.document.body).find("#frmright").css("height","1000px");
});*/