2555c0002d0d0768919b15ae9b0ed174166aab99.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. /**
  2. * 功能:
  3. *
  4. *
  5. * @author
  6. * @date 2015/09/19
  7. */
  8. AnticipationManager = function() {
  9. /** 定义变量* */
  10. var _this = this;
  11. _this.listGrid = null;// 预警数据列表
  12. _this.loadParams = null;// 预警列表加载参数
  13. _this.exportParams = null;// 导出EXCEL参数
  14. _this.classid=null;
  15. //查看详细
  16. _this.showInfo = function() {
  17. var rows = _this.listGrid.getSelectedRows();
  18. var rowsLength = rows.length;
  19. if (rowsLength == 0) {
  20. top.Dialog.alert("请选中要查看的记录!");
  21. return;
  22. } else if (rowsLength > 1) {
  23. top.Dialog.alert("请选中一条要查看的记录!");
  24. return;
  25. } else {
  26. var fd_id = rows[0].FD_OBJECTID365;
  27. var url = $.pathname()+'/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id='+ fd_id+"&weatherAlert=true";
  28. $('#frmright',window.parent.document).attr('src',url);
  29. }
  30. };
  31. //导出excel
  32. _this.exportData = function(){
  33. var rows = _this.listGrid.getSelectedRows();
  34. var rowsLength = rows.length;
  35. //查询条件的对象
  36. var con = {};
  37. //将查询条件赋值给con
  38. con.condition = _this.exportParams.condition;
  39. if(rowsLength != 0){
  40. var ids = "";
  41. for ( var i = 0; i < rowsLength; i++) {
  42. if(i == (rowsLength-1)){
  43. ids += "'"+rows[i].FD_OBJECTID365+"'";
  44. }else{
  45. ids += "'"+rows[i].FD_OBJECTID365+"'"+ ",";
  46. }
  47. }
  48. if(con.condition.indexOf("and FD_OBJECTID in")!=-1){
  49. con.condition = con.condition.substring(0,con.condition.indexOf("and FD_OBJECTID in"));
  50. }
  51. con.condition += " and FD_OBJECTID in("+ids+")";
  52. }else{
  53. if(con.condition.indexOf("and FD_OBJECTID in")!=-1){
  54. con.condition = con.condition.substring(0,con.condition.indexOf("and FD_OBJECTID in"));
  55. }
  56. }
  57. var expparams = "";
  58. var title ="";
  59. //取得第一行的数据,判断是预警还是响应
  60. if(_this.listGrid.getRow(0).IS_ALERT_365=="0"){//预警
  61. expparams = "IS_DEL,EARLY_WARNING_AREA_ID,WETHER_EW_ADJUST,PREV_EW_ID,CURRENT_ER_LEVEL," +
  62. "PREV_EW_LEVEL,PREV_ER_LEVEL,MEET_EMERGENCIES_PLAN,REMARK," +
  63. "RELIEVE_DATE,WRITE_DEPT,WRITER_ID,WRITE_TIME,UPDATEDATE,TYPHOON_DATE,CHECK_STATUS,WARNING_RESPONSE_STATUS," +
  64. "IS_SEND,IS_LAST_ID,IS_ALERT,FD_OBJECTID,IS_RELIEVE";
  65. title = "发布状态的预警清单";
  66. }else{//响应
  67. expparams = "IS_DEL,EARLY_WARNING_AREA_ID,WETHER_EW_ADJUST,PREV_EW_ID," +
  68. "PREV_EW_LEVEL,CURRENT_EW_LEVEL,PREV_ER_LEVEL,MEET_EMERGENCIES_PLAN,REMARK," +
  69. "RELIEVE_DATE,WRITE_DEPT,WRITER_ID,WRITE_TIME,UPDATEDATE,TYPHOON_DATE,CHECK_STATUS,WARNING_RESPONSE_STATUS," +
  70. "IS_SEND,IS_LAST_ID,IS_ALERT,FD_OBJECTID,IS_RELIEVE";
  71. title = "发布状态的响应清单";
  72. }
  73. excelExport(_this.classid,con,"应急响应预判",expparams,title);
  74. };
  75. //监测预判
  76. _this.anticipation = function(){
  77. var rows = _this.listGrid.getSelectedRows();
  78. var rowsLength = rows.length;
  79. if (rowsLength == 0) {
  80. top.Dialog.alert("请选中一条记录!");
  81. return;
  82. } else if (rowsLength > 1) {
  83. top.Dialog.alert("只能选择一条记录!");
  84. return;
  85. } else {
  86. var fd_id = rows[0].FD_OBJECTID365;
  87. url = $.pathname()+'/page/business/em/monitor/anticipation/ResponseViewYupan.jsp?fd_id='+ fd_id;
  88. $('#frmright',window.parent.document).attr('src',url);
  89. }
  90. }
  91. //短信
  92. _this.message = function(){
  93. /*top.Dialog.alert("发送短信!");*/
  94. /*addMsg("张东;李强","1389999345;137890002332");*/
  95. addMsg("","");
  96. };
  97. //点击主键跳转详细信息页面
  98. _this.openDetail = function(rowindex) {
  99. var row = _this.listGrid.getRow(rowindex);
  100. var fd_id = row.FD_OBJECTID365;
  101. $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id='+fd_id+"&weatherAlert=true");
  102. };
  103. return {
  104. responseInit : function() {
  105. _this.classid=365;
  106. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  107. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  108. //列表加载参数
  109. _this.loadParams = {
  110. listId : _this.classid,
  111. direction:'DESC',
  112. sort: 'UPDATEDATE',
  113. //condition : 'is_del=0 and is_alert=1'
  114. condition : "is_del=0 and IS_SEND =5 and IS_ALERT=1 and (EARLY_WARNING_AREA_ID like '%"+CorpArea+"%' or WRITE_DEPT ='"+CorpArea+"' ) "
  115. };
  116. _this.exportParams = _this.loadParams;
  117. var grid_option={
  118. //title : "预警接收管理数据列表",
  119. columns : [
  120. // {name : 'FD_OBJECTID365',display : '主键',align : 'center',hide : true},
  121. // {name : 'EARLY_WARNING_NAME_365',display : '响应名称',align : 'center', width: "18%"},
  122. // {name : 'EARLY_WARNING_ID_365',display : '响应编号',align : 'center', width: "18%"},
  123. // {name : 'CURRENT_EW_LEVEL_365_SHOW',display : '本次响应级别',align : 'center', width: "10%"},
  124. // {name : 'EARLY_WARNING_PROPERTY_365',display : '响应性质',align : 'center', width: "8%"},
  125. // {name : 'EARLY_WARNING_AREA_NAME_365_SHOW',display : '响应范围',align : 'center', width: "24%"},
  126. // {name : 'RELEASE_UNIT_365_SHOW',display : '发布单位',align : 'center', width: "10%"},
  127. // {name : 'RELEASE_RELIEVE_DATE_365',display : '发布时间',align : 'center', width: "12%"}
  128. {name : 'FD_OBJECTID365',hide : true},
  129. {name : 'IS_ALERT_365',hide : true},
  130. {display : '响应名称',name : 'EARLY_WARNING_NAME_365',align : 'center',width : "12%",
  131. isPrimaryKey:true,
  132. render : function(rowdata, rowindex, value, column) {
  133. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  134. }
  135. },
  136. {display : '响应编号',name : 'EARLY_WARNING_ID_365',align : 'center',width : "12%",showTitle:true},
  137. {display : '发布单位',name : 'RELEASE_UNIT_365_SHOW',align : 'center',width : "10%",showTitle:true},
  138. {display : '本次响应级别',name : 'CURRENT_ER_LEVEL_365_SHOW',align : 'center',width : "10%",showTitle:true},
  139. {display : '响应性质',name : 'EARLY_WARNING_PROPERTY_365_SHOW',align : 'center',width : "8%",showTitle:true},
  140. {display : '响应范围',name : 'EARLY_WARNING_AREA_NAME_365',align : 'center',width : "28%",showTitle:true},
  141. {display : '发布时间',name : 'RELEASE_RELIEVE_DATE_365', align : 'center',width : "10%",showTitle:true} ,
  142. //{display : '解除时间',name : 'RELIEVE_DATE_365',align : 'center',width : "10%"} ,
  143. {display : '状态',name : 'IS_SEND_365_SHOW',align : 'center',width : "6%",showTitle:true}
  144. ],
  145. usePager:true,
  146. checkbox : true,
  147. pageSize : 10,
  148. percentWidthMode : true,
  149. rownumbers:true
  150. };
  151. //查询出该角色权限下的所有按钮ID roleButtonArr()方法需引入/nwyj/scripts/freamwork/com/sinosoft/common/common.js
  152. var roleCons = roleButtonArr();
  153. var toolBarOpt={
  154. items: [//{text : '查看',click :'showInfo',iconClass : 'view_tem',id:"10000"},
  155. {text : '导出',click : 'exportData',iconClass : 'export_tem',id:"03dc"},
  156. {text : '监测预判',click : 'anticipation',iconClass : 'export_tem',id:"03jcyp"},
  157. {text : '短信',click : 'message',iconClass : 'sendmsg_tem',id:"03dx"}],
  158. roleCons:roleCons};//将角色id传参到grid
  159. var options={
  160. url :'/nwyj/ws/crud/CRUDService/queryQui',
  161. params: _this.loadParams,
  162. width:960,
  163. gridOptions:grid_option,
  164. singleRecodeOptions:{a:"aa"},
  165. paperOpration:{showInput:"true"},
  166. toolBarOptions:toolBarOpt
  167. };
  168. /**grid载入数据(定义数据列表)**/
  169. _this.listGrid = gridAndSingleRecode=$("#reponseDataGrid").quickgridAndSingleRecode(options);
  170. }//,
  171. // alertInit : function() {
  172. // _this.classid=365;
  173. // var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  174. // //列表加载参数
  175. // _this.loadParams = {
  176. // listId : _this.classid,
  177. // direction:'DESC',
  178. // sort: 'UPDATEDATE',
  179. // //condition : 'is_del=0 and is_alert=0'
  180. // condition : "is_del=0 and IS_SEND =5 and IS_ALERT=0 and (EARLY_WARNING_AREA_ID like '%"+deptId+"%' or WRITE_DEPT ='"+deptId+"' ) "
  181. // };
  182. // _this.exportParams = _this.loadParams;
  183. //
  184. // var grid_option={
  185. // //title : "响应信息接收管理数据列表",
  186. // columns : [
  187. //// {name : 'FD_OBJECTID365',display : '主键',align : 'center',hide : true},
  188. //// {name : 'EARLY_WARNING_NAME_365',display : '预警名称++',align : 'center', width: "18%"},
  189. //// {name : 'EARLY_WARNING_ID_365',display : '预警编号',align : 'center', width: "18%"},
  190. //// {name : 'CURRENT_EW_LEVEL_365_SHOW',display : '本次预警级别',align : 'center', width: "10%"},
  191. //// {name : 'EARLY_WARNING_PROPERTY_365_SHOW',display : '预警性质',align : 'center', width: "8%"},
  192. //// {name : 'EARLY_WARNING_AREA_NAME_365',display : '预警范围',align : 'center', width: "24%"},
  193. //// {name : 'RELEASE_UNIT_365_SHOW',display : '发布单位',align : 'center', width: "10%"},
  194. //// {name : 'RELEASE_RELIEVE_DATE_365',display : '发布时间',align : 'center', width: "12%"}
  195. //
  196. // {name : 'FD_OBJECTID365',hide : true},
  197. // {name : 'IS_ALERT_365',hide : true},
  198. // {display : '预警名称--',name : 'EARLY_WARNING_NAME_365',align : 'center',width : "12%"},
  199. // {display : '预警编号',name : 'EARLY_WARNING_ID_365',align : 'center',width : "12%"},
  200. // {display : '发布单位',name : 'RELEASE_UNIT_365_SHOW',align : 'center',width : "10%"},
  201. // {display : '本次预警级别',name : 'CURRENT_EW_LEVEL_365_SHOW',align : 'center',width : "10%"},
  202. // {display : '预警性质',name : 'EARLY_WARNING_PROPERTY_365_SHOW',align : 'center',width : "8%"},
  203. // {display : '预警范围',name : 'EARLY_WARNING_AREA_NAME_365',align : 'center',width : "28%"},
  204. // {display : '发布时间',name : 'RELEASE_RELIEVE_DATE_365',align : 'center',width : "10%"} ,
  205. // //{display : '解除时间',name : 'RELIEVE_DATE_365',align : 'center',width : "10%"} ,
  206. // {display : '状态',name : 'IS_SEND_365_SHOW',align : 'center',width : "6%"}
  207. //
  208. // ],
  209. // usePager:true,
  210. // checkbox : true,
  211. // pageSize : 10,
  212. // percentWidthMode : true,
  213. // rownumbers:true
  214. // };
  215. // //查询出该角色权限下的所有按钮ID roleButtonArr()方法需引入/nwyj/scripts/freamwork/com/sinosoft/common/common.js
  216. // var roleCons = roleButtonArr();
  217. // var toolBarOpt={
  218. // items: [{text : '查看',click :'showInfo',iconClass : 'view_tem',id:"10003"},
  219. // {text : '导出',click : 'exportData',iconClass : 'export_tem',id:"10004"},
  220. // {text : '短信',click : 'message',iconClass : 'sendmsg_tem',id:"10105"}],
  221. // roleCons:""};//将角色id传参到grid
  222. // var options={
  223. // url :'/nwyj/ws/crud/CRUDService/queryQui',
  224. // params: _this.loadParams,
  225. // width:960,
  226. // gridOptions:grid_option,
  227. // singleRecodeOptions:{a:"aa"},
  228. // paperOpration:{showInput:"true"},
  229. // toolBarOptions:toolBarOpt
  230. // };
  231. //
  232. // //grid载入数据(定义数据列表)
  233. // //_this.listGrid =gridAndSingleRecode=$("#alertDataGrid").quickgridAndSingleRecode(options);
  234. // }
  235. };
  236. }();
  237. $(function() {
  238. AnticipationManager.responseInit();
  239. // $("#tab").bind("actived", function(e, i) {
  240. // if (i == 0) {
  241. // AnticipationManager.alertInit();
  242. // }
  243. // if (i == 1) {
  244. // AnticipationManager.responseInit();
  245. // }
  246. // });
  247. });
  248. function showPrimaryKey(obj,index){
  249. var fd_id = obj.FD_OBJECTID365;
  250. var url = "";
  251. url = $.pathname()+'/page/business/em/response/emergencyResponse/WarningView.jsp?fd_id='+ fd_id+"&weatherAlert=true";
  252. }