ContingercyPlanXiubian.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  2. var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  3. var parent_ids = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  4. //登陆用户的单位名称
  5. var corp_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  6. $(function(){
  7. getChildInfo();
  8. /** 绑定更多的按钮点击事件 */
  9. $more = $("#more"); // 更多按钮
  10. $more.bind('click', function() {
  11. more();
  12. });
  13. $searchButt = $("#searchButt");// 更多查询按钮
  14. $searchButt.live('click', function() {
  15. searchHandler();
  16. });
  17. //清空条件
  18. $("#emptyCondition").bind("click",function(){
  19. $("#PLAN_NAME_214").val("");
  20. var $selConditions = $("#selectConditions");
  21. var $selCon = $selConditions.find(".selectCondi");
  22. for(var i=0;i<$selCon.length;i++){
  23. $selCon[i].click();
  24. }
  25. });
  26. $searchOne = $("#searchOne");//查询图标绑定查询事件
  27. $searchOne.bind('click', function() {
  28. searchHandler();
  29. });
  30. });
  31. var conditionData2="";
  32. function getChildInfo(){
  33. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getChidInfo/';
  34. var params = {
  35. id : parent_id,
  36. };
  37. $.ajax({
  38. url : url,
  39. type : 'post',
  40. timeout : 60000,
  41. data : params,
  42. dataType : 'json',
  43. success : function(data){
  44. conditionData2 = JSON.stringify(data);
  45. var test = eval("("+conditionData2+")");
  46. if(conditionData2!='{"list":[{"name":"查询单位","className":"UNITS","list":[]}]}'){
  47. conditionData.list.push(test.list[0]);
  48. }
  49. createConditionsDom(conditionData);
  50. $(".item").unbind("click").bind("click",bindSelectOne);
  51. },
  52. error : function(e){
  53. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  54. }
  55. });
  56. }
  57. //当前系统时间
  58. //var time = TAKE_DATE
  59. var date = allGetServerTime();
  60. var seperator1 = "";
  61. var seperator2 = "";
  62. var month = date.getMonth() + 1;
  63. var strDate = date.getDate();
  64. if (month >= 1 && month <= 9) {
  65. month = "0" + month;
  66. }
  67. if (strDate >= 0 && strDate <= 9) {
  68. strDate = "0" + strDate;
  69. }
  70. time = date.getFullYear() + seperator1 +"-"+ month + seperator1 + "-"+strDate;
  71. var g;
  72. /**定义变量**/
  73. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
  74. var condition = "DATEDIFF(MONTH,take_date , DATE '"+time+"') >35 and IS_DEL='0' and UNITS='"+deptId+"'";
  75. //列表加载参数
  76. var loadParams = {
  77. "listId" : '214',
  78. "condition" : condition,
  79. direction:'DESC',
  80. sort: 'UPDATEDATE'
  81. };
  82. function initComplete(){
  83. /**
  84. * 工具条
  85. */
  86. var roleCons = roleButtonArr();
  87. var toolBarOpt1 = {
  88. items:[
  89. { text : '短信',click : 'sendMessage',iconClass : 'sendmsg_tem',id:"10005",disabled : false }
  90. ],
  91. roleCons:roleCons
  92. };
  93. /**
  94. * 树形列
  95. */
  96. var grid_option1 = {
  97. columns: [
  98. { display: '预案名称', name: 'PLAN_NAME_214', align: 'center', width: "10%",isPrimaryKey:true,
  99. render : function(rowdata, value) {
  100. return '<a href="javascript:void(0)" '
  101. + 'onclick=jumpPage("'
  102. + rowdata.FD_OBJECTID214+'","'+rowdata.PLAN_BIAOZHI_214+'","'+ rowdata.PLAN_REFINE_CATEGORY_214+'","'+ rowdata.PLAN_REFINE_CATEGORY_214 +'","'+ rowdata.PLAN_TYPE_214
  103. +'")>'+ rowdata.PLAN_NAME_214 +'</a>';
  104. }
  105. },
  106. { display: '预案编码', name: 'PLAN_NO_214', align: 'center', width: '10%'},
  107. { display: '预案类型', name: 'PLAN_TYPE_214_SHOW', align: 'center', width: '10%'},
  108. { display: '突发事件类型', name: 'BYSUNESS_TYPE_214_SHOW', align: 'center', width: '10%'},
  109. { display: '责任部门', name: 'INS_UNITS_214_SHOW', align: 'center', width: '8%'},
  110. { display: '颁布日期', name: 'ISSUE_DATE_214', align: 'center' , width: '8%' },
  111. { display: '实施日期', name: 'TAKE_DATE_214', align: 'center' , width: '8%' },
  112. { display: '所属单位', name: 'UNITS_214_SHOW', align: 'center', width: '15%' },
  113. { display: '简要说明', name: 'SYFW_214', align: 'center', width: '20%'}
  114. /* { display: '操作', isAllowHide: false, align: 'center', width:'8%',
  115. render: function (rowdata, rowindex, value, column){
  116. //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
  117. var fabu='';//fabu
  118. if(rowdata.PLAN_STAT_214=="1"){
  119. fabu = '<span class="fashang_07 hand" title="发布" onclick="fabu1()"></span>';
  120. }else{
  121. fabu = '<span class="fashang_06 hand" title="发布" onclick="fabu(' + rowindex + ')"></span>';
  122. }
  123. //判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09fashang_plan
  124. var shangbao='';
  125. if(rowdata.PLAN_STAT1_214=="1"){
  126. shangbao = '<span class="sendup_templan hand" title="上报" onclick="shangbao1()"></span>';
  127. }else{
  128. shangbao = '<span class="fashang_plan hand" title="上报" onclick="shangbao(' + rowindex + ')"></span>';
  129. //shangbao = '<span class="fashang_plan hand" title="上报" onclick="fillShangbao(' + rowindex + ')"></span>';
  130. }
  131. return fabu
  132. + shangbao;
  133. }
  134. }*/
  135. ],
  136. rownumbers : true,
  137. checkbox : true,
  138. pageSize : 10,
  139. percentWidthMode : true
  140. };
  141. var options1={
  142. url :'/nwyj/ws/crud/CRUDService/queryQui',
  143. params:loadParams,
  144. height: '100%',
  145. width:"100%",
  146. gridOptions:grid_option1,
  147. singleRecodeOptions:{a:"aa"},
  148. paperOpration:{showInput:"true"},
  149. toolBarOptions:toolBarOpt1
  150. };
  151. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  152. }
  153. //下载
  154. function onDownload(){
  155. var FD_OBJECTID = "";
  156. var rows = g.getSelectedRows();
  157. for (var i = 0; i < rows.length; i++) {
  158. var FD_OBJECTID1= rows[i].FD_OBJECTID214;//预案的主键
  159. var PLAN_BIAOZHI1 =rows[i].PLAN_BIAOZHI_214;//预案的标识位(新的预案还是旧的预案)
  160. var UPLOAND_FLAG1 =rows[i].UPLOAND_FLAG_214;//上传标识
  161. var PLAN_VERSION_REMAR1 =rows[i].PLAN_VERSION_REMARK_214;//修改预案后新增预案的情况,也必有附件
  162. //新增预案,控制必传附件 纯新增
  163. if(PLAN_BIAOZHI1=="0"&&PLAN_VERSION_REMAR1=="0"&&UPLOAND_FLAG1=="1"){
  164. //getFileList(fd_id,1);
  165. FD_OBJECTID += "'"+FD_OBJECTID1 +"'"+ ",";//预案的主键
  166. }
  167. //修改预案后新增预案的情况,也必有附件 纯修编
  168. if(PLAN_BIAOZHI1!="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="1"){
  169. //getFileList(fd_bojectid,1);
  170. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键
  171. }
  172. //纯修改
  173. if(PLAN_BIAOZHI1=="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="0"){
  174. //getFileList(PLAN_VERSION_REMARK,1);
  175. FD_OBJECTID += "'"+PLAN_VERSION_REMAR1+"'" + ",";//预案的主键
  176. }
  177. //修编修改
  178. if(PLAN_BIAOZHI1!="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="0"){
  179. //getFileList(PLAN_VERSION_REMARK,1);
  180. FD_OBJECTID += "'"+PLAN_VERSION_REMAR1+"'" + ",";//预案的主键
  181. }
  182. }
  183. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  184. //alert("temp****"+temp + "****99999****");
  185. //发送请求,获取文件名的集合。
  186. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  187. var params = {
  188. fileId : temp
  189. };
  190. var SAVENAME1="";
  191. var NAME1 = "";
  192. var FILEEXT1="";
  193. $.ajax({
  194. url : url,
  195. type : 'post',
  196. timeout : 60000,
  197. data : params,
  198. dataType : 'json',
  199. success : function(data){
  200. var dataLenth = data.rows.length;
  201. var filenames="";
  202. var downfilename = "";
  203. for (var i = 0; i < dataLenth; i++) {
  204. SAVENAME1= data.rows[i].SAVENAME;
  205. NAME1= data.rows[i].NAME;
  206. FILEEXT1= data.rows[i].FILEEXT;
  207. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  208. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  209. }
  210. var filenames1 = filenames.substring(0,filenames.length-1);
  211. filenames = decodeURI(filenames1);
  212. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  213. downfilename = decodeURI(downfilename1);
  214. showFile(filenames1,downfilename1);
  215. //alert(downfilename1+"============"+filenames1);
  216. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  217. },
  218. error : function(e){
  219. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  220. }
  221. });
  222. }
  223. function showFile(downfilename,filenames){
  224. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  225. window.open(url);
  226. }
  227. //高级查询
  228. function searchHandler(){
  229. $queryForm = $("#queryForm");
  230. if($("#PLAN_NAME_214").val()=="预案名称"){
  231. $("#PLAN_NAME_214").val("");
  232. }
  233. $queryForm.serialize();
  234. //获取选中的值
  235. var searchCondition = getSelectCon(conditionData);
  236. var queryParams = getQueryFormParams($queryForm);
  237. var params=$.extend({},loadParams,queryParams);
  238. //与之前参数条件拼接
  239. params.condition = searchCondition.condition + params.condition;
  240. g.setOptions({"params":params});
  241. //加载数据
  242. g.rend();
  243. }
  244. //点击查看
  245. function jumpPage(fd_id,PLAN_BIAOZHI,BM_YAXHLB,PLAN_REFINE_CATEGORY,PLAN_TYPE){
  246. if(PLAN_TYPE!="103"){
  247. window.location.href="Planinfo.jsp?"+fd_id;
  248. }else{
  249. if(PLAN_REFINE_CATEGORY=="17"){//网络与信息安全
  250. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  251. }else if(PLAN_REFINE_CATEGORY=="4"){//人身事故
  252. window.location.href="PlanOnViewNexus/PlanNexusRSSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  253. }else if(PLAN_REFINE_CATEGORY=="5"){//大面积停电事件
  254. window.location.href="PlanOnViewNexus/PlanNexusDMJTD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  255. }else if(PLAN_REFINE_CATEGORY=="6"){//设备事故
  256. window.location.href="PlanOnViewNexus/PlanNexusSBSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  257. }else if(PLAN_REFINE_CATEGORY=="7"){//电厂大坝厂房事故
  258. window.location.href="PlanOnViewNexus/PlanNexusDCDB.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  259. }else if(PLAN_REFINE_CATEGORY=="8"){//环境污染
  260. window.location.href="PlanOnViewNexus/PlanNexusHJWR.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  261. }else if(PLAN_REFINE_CATEGORY=="9"){//防风防汛PlanOnViewList\NewMsgNotice
  262. window.location.href="PlanOnViewNexus/PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  263. }else if(PLAN_REFINE_CATEGORY=="10"){//地震灾害
  264. window.location.href="PlanOnViewNexus/PlanNexusDZZH.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  265. }else if(PLAN_REFINE_CATEGORY=="11"){//低温雨雪冰冻灾害
  266. window.location.href="PlanOnViewNexus/PlanNexusDWBD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  267. }else if(PLAN_REFINE_CATEGORY=="12"){//电力供应及客户服务PlanNexusDLGY.jsp
  268. window.location.href="PlanOnViewNexus/PlanNexusDLGY.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  269. }else if(PLAN_REFINE_CATEGORY=="13"){//生产场所防恐怖袭击
  270. window.location.href="PlanOnViewNexus/PlanNexusKBXJ.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  271. }else if(PLAN_REFINE_CATEGORY=="14"){//突发性群体事件
  272. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  273. }else if(PLAN_REFINE_CATEGORY=="15"){//突发新闻事件
  274. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  275. }else if(PLAN_REFINE_CATEGORY=="16"){//涉外突发事件
  276. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  277. }else if(PLAN_REFINE_CATEGORY=="18"){//突发公共卫生
  278. window.location.href="PlanOnViewNexus/PlanNexusGGWS.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  279. }else{
  280. window.location.href="PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  281. }
  282. }
  283. }
  284. function onView(){
  285. //根据预案类型分别跳转不同的预案绑定的页面
  286. var rows = g.getSelectedRows();
  287. if(rows.length==0){
  288. top.Dialog.alert("请选择一条记录");
  289. return;
  290. }
  291. if(rows.length>1){
  292. top.Dialog.alert("只能选择一条记录");
  293. return;
  294. }
  295. /**
  296. * 如果是地震预案,跳转到地震对应的预案.
  297. * 传给子页面的值:
  298. * 1、主键
  299. * 2、 版本(初次版本为0;方便日后修订预案后将原有预案的绑定条件带出来。避免用户再次录入绑定条件)
  300. * 3、预案具体业务分类,方便分别找到对应的报表填报计划页面
  301. *
  302. * **/
  303. var fd_id = rows[0].FD_OBJECTID214;
  304. var PLAN_BIAOZHI = rows[0].PLAN_BIAOZHI_214;
  305. var PLAN_REFINE_CATEGORY = rows[0].PLAN_REFINE_CATEGORY_214;
  306. var BM_YAXHLB = rows[0].PLAN_REFINE_CATEGORY_214;
  307. var PLAN_TYPE = rows[0].PLAN_TYPE_214;
  308. if(PLAN_TYPE!="103"){
  309. window.location.href="Planinfo.jsp?"+fd_id;
  310. }else{
  311. if(PLAN_REFINE_CATEGORY=="17"){//网络与信息安全
  312. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  313. }else if(PLAN_REFINE_CATEGORY=="4"){//人身事故
  314. window.location.href="PlanOnViewNexus/PlanNexusRSSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  315. }else if(PLAN_REFINE_CATEGORY=="5"){//大面积停电事件
  316. window.location.href="PlanOnViewNexus/PlanNexusDMJTD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  317. }else if(PLAN_REFINE_CATEGORY=="6"){//设备事故
  318. window.location.href="PlanOnViewNexus/PlanNexusSBSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  319. }else if(PLAN_REFINE_CATEGORY=="7"){//电厂大坝厂房事故
  320. window.location.href="PlanOnViewNexus/PlanNexusDCDB.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  321. }else if(PLAN_REFINE_CATEGORY=="8"){//环境污染
  322. window.location.href="PlanOnViewNexus/PlanNexusHJWR.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  323. }else if(PLAN_REFINE_CATEGORY=="9"){//防风防汛
  324. window.location.href="PlanOnViewNexus/PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  325. }else if(PLAN_REFINE_CATEGORY=="10"){//地震灾害
  326. window.location.href="PlanOnViewNexus/PlanNexusDZZH.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  327. }else if(PLAN_REFINE_CATEGORY=="11"){//低温雨雪冰冻灾害
  328. window.location.href="PlanOnViewNexus/PlanNexusDWBD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  329. }else if(PLAN_REFINE_CATEGORY=="12"){//电力供应及客户服务PlanNexusDLGY.jsp
  330. window.location.href="PlanOnViewNexus/PlanNexusDLGY.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  331. }else if(PLAN_REFINE_CATEGORY=="13"){//生产场所防恐怖袭击
  332. window.location.href="PlanOnViewNexus/PlanNexusKBXJ.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  333. }else if(PLAN_REFINE_CATEGORY=="14"){//突发性群体事件
  334. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  335. }else if(PLAN_REFINE_CATEGORY=="15"){//突发新闻事件
  336. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  337. }else if(PLAN_REFINE_CATEGORY=="16"){//涉外突发事件
  338. window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  339. }else if(PLAN_REFINE_CATEGORY=="18"){//突发公共卫生
  340. window.location.href="PlanOnViewNexus/PlanNexusGGWS.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  341. }else{
  342. window.location.href="PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
  343. }
  344. }
  345. }
  346. $.messager=top.Dialog;
  347. // 更多
  348. function more() {
  349. $('#moreDiv').toggle();
  350. $(parent.document.body).find("#frmright").height($(window.document.body).height());
  351. }
  352. //短信
  353. function sendMessage(){
  354. addMsg();
  355. }
  356. $.messager=top.Dialog;