123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- /**
- * 功能:
- *
- *
- * @author
- * @date 2015/09/19
- */
- AnticipationManager = function() {
- /** 定义变量* */
- var _this = this;
- _this.listGrid = null;// 预警数据列表
- _this.loadParams = null;// 预警列表加载参数
- _this.exportParams = null;// 导出EXCEL参数
- _this.classid=null;
- //查看详细
- _this.showInfo = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要查看的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要查看的记录!");
- return;
- } else {
- var fd_id = rows[0].FD_OBJECTID365;
- var url = $.pathname()+'/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id='+ fd_id+"&weatherAlert=true";
- $('#frmright',window.parent.document).attr('src',url);
-
- }
- };
- //导出excel
- _this.exportData = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- //查询条件的对象
- var con = {};
- //将查询条件赋值给con
- con.condition = _this.exportParams.condition;
- if(rowsLength != 0){
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- if(i == (rowsLength-1)){
- ids += "'"+rows[i].FD_OBJECTID365+"'";
- }else{
- ids += "'"+rows[i].FD_OBJECTID365+"'"+ ",";
- }
-
- }
- if(con.condition.indexOf("and FD_OBJECTID in")!=-1){
- con.condition = con.condition.substring(0,con.condition.indexOf("and FD_OBJECTID in"));
- }
- con.condition += " and FD_OBJECTID in("+ids+")";
- }else{
- if(con.condition.indexOf("and FD_OBJECTID in")!=-1){
- con.condition = con.condition.substring(0,con.condition.indexOf("and FD_OBJECTID in"));
- }
- }
- var expparams = "";
- var title ="";
- //取得第一行的数据,判断是预警还是响应
- if(_this.listGrid.getRow(0).IS_ALERT_365=="0"){//预警
- expparams = "IS_DEL,EARLY_WARNING_AREA_ID,WETHER_EW_ADJUST,PREV_EW_ID,CURRENT_ER_LEVEL," +
- "PREV_EW_LEVEL,PREV_ER_LEVEL,MEET_EMERGENCIES_PLAN,REMARK," +
- "RELIEVE_DATE,WRITE_DEPT,WRITER_ID,WRITE_TIME,UPDATEDATE,TYPHOON_DATE,CHECK_STATUS,WARNING_RESPONSE_STATUS," +
- "IS_SEND,IS_LAST_ID,IS_ALERT,FD_OBJECTID,IS_RELIEVE";
- title = "发布状态的预警清单";
- }else{//响应
- expparams = "IS_DEL,EARLY_WARNING_AREA_ID,WETHER_EW_ADJUST,PREV_EW_ID," +
- "PREV_EW_LEVEL,CURRENT_EW_LEVEL,PREV_ER_LEVEL,MEET_EMERGENCIES_PLAN,REMARK," +
- "RELIEVE_DATE,WRITE_DEPT,WRITER_ID,WRITE_TIME,UPDATEDATE,TYPHOON_DATE,CHECK_STATUS,WARNING_RESPONSE_STATUS," +
- "IS_SEND,IS_LAST_ID,IS_ALERT,FD_OBJECTID,IS_RELIEVE";
- title = "发布状态的响应清单";
- }
- excelExport(_this.classid,con,"应急响应预判",expparams,title);
- };
- //监测预判
- _this.anticipation = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中一条记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("只能选择一条记录!");
- return;
- } else {
- var fd_id = rows[0].FD_OBJECTID365;
- url = $.pathname()+'/page/business/em/monitor/anticipation/ResponseViewYupan.jsp?fd_id='+ fd_id;
- $('#frmright',window.parent.document).attr('src',url);
- }
- }
- //短信
- _this.message = function(){
- /*top.Dialog.alert("发送短信!");*/
- /*addMsg("张东;李强","1389999345;137890002332");*/
- addMsg("","");
- };
- //点击主键跳转详细信息页面
- _this.openDetail = function(rowindex) {
- var row = _this.listGrid.getRow(rowindex);
- var fd_id = row.FD_OBJECTID365;
- $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id='+fd_id+"&weatherAlert=true");
- };
- return {
- responseInit : function() {
- _this.classid=365;
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //列表加载参数
- _this.loadParams = {
- listId : _this.classid,
- direction:'DESC',
- sort: 'UPDATEDATE',
- //condition : 'is_del=0 and is_alert=1'
- condition : "is_del=0 and IS_SEND =5 and IS_ALERT=1 and (EARLY_WARNING_AREA_ID like '%"+CorpArea+"%' or WRITE_DEPT ='"+CorpArea+"' ) "
- };
- _this.exportParams = _this.loadParams;
-
- var grid_option={
- //title : "预警接收管理数据列表",
- columns : [
- // {name : 'FD_OBJECTID365',display : '主键',align : 'center',hide : true},
- // {name : 'EARLY_WARNING_NAME_365',display : '响应名称',align : 'center', width: "18%"},
- // {name : 'EARLY_WARNING_ID_365',display : '响应编号',align : 'center', width: "18%"},
- // {name : 'CURRENT_EW_LEVEL_365_SHOW',display : '本次响应级别',align : 'center', width: "10%"},
- // {name : 'EARLY_WARNING_PROPERTY_365',display : '响应性质',align : 'center', width: "8%"},
- // {name : 'EARLY_WARNING_AREA_NAME_365_SHOW',display : '响应范围',align : 'center', width: "24%"},
- // {name : 'RELEASE_UNIT_365_SHOW',display : '发布单位',align : 'center', width: "10%"},
- // {name : 'RELEASE_RELIEVE_DATE_365',display : '发布时间',align : 'center', width: "12%"}
-
- {name : 'FD_OBJECTID365',hide : true},
- {name : 'IS_ALERT_365',hide : true},
- {display : '响应名称',name : 'EARLY_WARNING_NAME_365',align : 'center',width : "12%",
- isPrimaryKey:true,
- render : function(rowdata, rowindex, value, column) {
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
- },
- {display : '响应编号',name : 'EARLY_WARNING_ID_365',align : 'center',width : "12%",showTitle:true},
- {display : '发布单位',name : 'RELEASE_UNIT_365_SHOW',align : 'center',width : "10%",showTitle:true},
- {display : '本次响应级别',name : 'CURRENT_ER_LEVEL_365_SHOW',align : 'center',width : "10%",showTitle:true},
- {display : '响应性质',name : 'EARLY_WARNING_PROPERTY_365_SHOW',align : 'center',width : "8%",showTitle:true},
- {display : '响应范围',name : 'EARLY_WARNING_AREA_NAME_365',align : 'center',width : "28%",showTitle:true},
- {display : '发布时间',name : 'RELEASE_RELIEVE_DATE_365', align : 'center',width : "10%",showTitle:true} ,
- //{display : '解除时间',name : 'RELIEVE_DATE_365',align : 'center',width : "10%"} ,
- {display : '状态',name : 'IS_SEND_365_SHOW',align : 'center',width : "6%",showTitle:true}
-
- ],
- usePager:true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true,
- rownumbers:true
-
- };
- //查询出该角色权限下的所有按钮ID roleButtonArr()方法需引入/nwyj/scripts/freamwork/com/sinosoft/common/common.js
- var roleCons = roleButtonArr();
- var toolBarOpt={
- items: [//{text : '查看',click :'showInfo',iconClass : 'view_tem',id:"10000"},
- {text : '导出',click : 'exportData',iconClass : 'export_tem',id:"03dc"},
- {text : '监测预判',click : 'anticipation',iconClass : 'export_tem',id:"03jcyp"},
- {text : '短信',click : 'message',iconClass : 'sendmsg_tem',id:"03dx"}],
- roleCons:roleCons};//将角色id传参到grid
- var options={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params: _this.loadParams,
- width:960,
- gridOptions:grid_option,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt
- };
- /**grid载入数据(定义数据列表)**/
- _this.listGrid = gridAndSingleRecode=$("#reponseDataGrid").quickgridAndSingleRecode(options);
- }//,
- // alertInit : function() {
- // _this.classid=365;
- // var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- // //列表加载参数
- // _this.loadParams = {
- // listId : _this.classid,
- // direction:'DESC',
- // sort: 'UPDATEDATE',
- // //condition : 'is_del=0 and is_alert=0'
- // condition : "is_del=0 and IS_SEND =5 and IS_ALERT=0 and (EARLY_WARNING_AREA_ID like '%"+deptId+"%' or WRITE_DEPT ='"+deptId+"' ) "
- // };
- // _this.exportParams = _this.loadParams;
- //
- // var grid_option={
- // //title : "响应信息接收管理数据列表",
- // columns : [
- //// {name : 'FD_OBJECTID365',display : '主键',align : 'center',hide : true},
- //// {name : 'EARLY_WARNING_NAME_365',display : '预警名称++',align : 'center', width: "18%"},
- //// {name : 'EARLY_WARNING_ID_365',display : '预警编号',align : 'center', width: "18%"},
- //// {name : 'CURRENT_EW_LEVEL_365_SHOW',display : '本次预警级别',align : 'center', width: "10%"},
- //// {name : 'EARLY_WARNING_PROPERTY_365_SHOW',display : '预警性质',align : 'center', width: "8%"},
- //// {name : 'EARLY_WARNING_AREA_NAME_365',display : '预警范围',align : 'center', width: "24%"},
- //// {name : 'RELEASE_UNIT_365_SHOW',display : '发布单位',align : 'center', width: "10%"},
- //// {name : 'RELEASE_RELIEVE_DATE_365',display : '发布时间',align : 'center', width: "12%"}
- //
- // {name : 'FD_OBJECTID365',hide : true},
- // {name : 'IS_ALERT_365',hide : true},
- // {display : '预警名称--',name : 'EARLY_WARNING_NAME_365',align : 'center',width : "12%"},
- // {display : '预警编号',name : 'EARLY_WARNING_ID_365',align : 'center',width : "12%"},
- // {display : '发布单位',name : 'RELEASE_UNIT_365_SHOW',align : 'center',width : "10%"},
- // {display : '本次预警级别',name : 'CURRENT_EW_LEVEL_365_SHOW',align : 'center',width : "10%"},
- // {display : '预警性质',name : 'EARLY_WARNING_PROPERTY_365_SHOW',align : 'center',width : "8%"},
- // {display : '预警范围',name : 'EARLY_WARNING_AREA_NAME_365',align : 'center',width : "28%"},
- // {display : '发布时间',name : 'RELEASE_RELIEVE_DATE_365',align : 'center',width : "10%"} ,
- // //{display : '解除时间',name : 'RELIEVE_DATE_365',align : 'center',width : "10%"} ,
- // {display : '状态',name : 'IS_SEND_365_SHOW',align : 'center',width : "6%"}
- //
- // ],
- // usePager:true,
- // checkbox : true,
- // pageSize : 10,
- // percentWidthMode : true,
- // rownumbers:true
- // };
- // //查询出该角色权限下的所有按钮ID roleButtonArr()方法需引入/nwyj/scripts/freamwork/com/sinosoft/common/common.js
- // var roleCons = roleButtonArr();
- // var toolBarOpt={
- // items: [{text : '查看',click :'showInfo',iconClass : 'view_tem',id:"10003"},
- // {text : '导出',click : 'exportData',iconClass : 'export_tem',id:"10004"},
- // {text : '短信',click : 'message',iconClass : 'sendmsg_tem',id:"10105"}],
- // roleCons:""};//将角色id传参到grid
- // var options={
- // url :'/nwyj/ws/crud/CRUDService/queryQui',
- // params: _this.loadParams,
- // width:960,
- // gridOptions:grid_option,
- // singleRecodeOptions:{a:"aa"},
- // paperOpration:{showInput:"true"},
- // toolBarOptions:toolBarOpt
- // };
- //
- // //grid载入数据(定义数据列表)
- // //_this.listGrid =gridAndSingleRecode=$("#alertDataGrid").quickgridAndSingleRecode(options);
- // }
-
-
- };
- }();
- $(function() {
- AnticipationManager.responseInit();
- // $("#tab").bind("actived", function(e, i) {
- // if (i == 0) {
- // AnticipationManager.alertInit();
- // }
- // if (i == 1) {
- // AnticipationManager.responseInit();
- // }
- // });
- });
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID365;
- var url = "";
- url = $.pathname()+'/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id='+ fd_id+"&weatherAlert=true";
- }
|