32af38a9df4a5f59ac583a30a3c5472cd0a40ba9.svn-base 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  1. /**
  2. * 按钮
  3. * @author 郭恩乐
  4. * 2016-11-03
  5. */
  6. var user_ID = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();//用户ID
  7. var role_ID = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();//用户多角色时,用逗号隔开
  8. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  9. var personId = "";//处理人ID
  10. function buttonFun(){//按钮的显示情况
  11. getPersonMsg();
  12. //personId = isSeenBut.split(",")[0];//如果这样代码可以用,那么getPersonMsg()就可以不用
  13. //isSend : 1-待审核;3-待签发;4-待分发
  14. //根据状态判断该显示那些按钮
  15. //再根据登录人id是不是等于处理人id判断【根据状态判断该显示那些按钮】是否隐藏
  16. if(isSend == 0 && user_ID == writerIdBut){
  17. $("#sendBut").show();//【发送】
  18. $("#sendBut").after("  ");
  19. }
  20. if(isSeenBut.split(",")[1] == 0 && isSeenBut.split(",")[2] == user_ID && isSend != 0){
  21. $("#rollBackBut").show();//【撤回】
  22. $("#rollBackBut").after("  ");
  23. }
  24. if(personId == user_ID){
  25. if(isSend == 1){
  26. if(currentLevel == 29 || currentLevel == 30){//红橙色、一二级
  27. $("#checkBut").show();//【审核】
  28. $("#checkBut").after("  ");
  29. }else if(currentLevel == 31 || currentLevel == 32){//黄蓝色、三四级
  30. $("#checkSignBut").show();//【审核并签发】
  31. $("#checkSignBut").after("  ");
  32. }
  33. }else if(isSend == 3){
  34. $("#signBut").show();//【签发】
  35. $("#signBut").after("  ");
  36. }else if(isSend == 4){
  37. $("#issueBut").show();//【发布】
  38. $("#issueBut").after("  ");
  39. }
  40. }
  41. }
  42. function rollBackButFun(){//撤回
  43. var isSeenMsg = isSeenBut;
  44. var isSeen_0 = isSeenMsg.split(",")[0];//下一节点处理人ID
  45. var isSeen_1 = isSeenMsg.split(",")[1];//下一节点处理人是(1)否(0)查看
  46. var isSeen_2 = isSeenMsg.split(",")[2];//处理人ID
  47. var stateNow = isSend;//通知单当前状态
  48. var stateNext = 0;//通知单撤回后的状态(0-待发送 1-待审核 2-撤回 3-待签发 4-待分发 5-已发布 6-结束)
  49. if(isSeen_1 == 1){
  50. top.Dialog.alert("下一节点处理人已经查看,不能撤回了!");
  51. return;
  52. }else if(isSeen_1 == 0){
  53. if(user_ID !=isSeen_2){
  54. top.Dialog.alert("下一流程已走完,不能撤回了!");
  55. return;
  56. } else if(user_ID == isSeen_2){
  57. if(stateNow == 1){//待审核
  58. stateNext = stateNow-1;//撤回到待发送
  59. }else if(stateNow == 3){//待签发
  60. stateNext = stateNow-2;//撤回到待审核
  61. }else if(stateNow == 4){//待分发
  62. if(noticeLevel == 31 || noticeLevel == 32){//III级,IV级
  63. stateNext = stateNow-3;//撤回到待审核
  64. }else if(noticeLevel == 29 || noticeLevel == 30){//I级,II级
  65. stateNext = stateNow-1;//撤回到待签发
  66. }
  67. }
  68. }
  69. var params = {
  70. classid : "365",
  71. FD_OBJECTID365 : fd_id,
  72. //IS_SEND_365 : "0"
  73. IS_SEND_365 : stateNext,
  74. IS_SEEN_365 : "a,b,c"
  75. };
  76. top.Dialog.confirm("确定要撤回吗?|撤回", function() {
  77. $.ajax({
  78. url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
  79. type : 'post',
  80. timeout : 15000,
  81. data : params,
  82. dataType : 'json',
  83. success : function(data) {
  84. top.Dialog.alert('撤回成功!', null, null, null, -1);
  85. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/Warning.jsp");
  86. //_this.listGrid.rend();
  87. },
  88. error : function(e) {
  89. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  90. }
  91. });
  92. });
  93. }
  94. }
  95. function sendButFun(){//发送
  96. if(ewpBut == 51){
  97. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningRelieve.jsp?fd_id="+ fd_id+"&is_edit=0");
  98. }else{
  99. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAddEdit.jsp?fd_id="+ fd_id+"&is_adjst=5");
  100. }
  101. }
  102. function checkButFun(){//审核
  103. if(ewpBut == 51){
  104. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
  105. }else{
  106. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
  107. }
  108. }
  109. function checkSignButFun(){//审核并签发
  110. if(ewpBut == 51){
  111. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
  112. }else{
  113. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
  114. }
  115. }
  116. function signButFun(){//签发
  117. if(ewpBut == 51){
  118. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+1);
  119. }else{
  120. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+1);
  121. }
  122. }
  123. function issueButFun(){
  124. $("#PLAN_TYPE_ID_368").val(planType);
  125. if(writerIdBut != user_ID){
  126. top.Dialog.alert("只有填报人才有发布权限!");
  127. return;
  128. }
  129. var flag = -1;//是-0否-1走发布
  130. /** ***********************************start************************************** **/
  131. if(ewpBut == 49){
  132. //1.判断是否有同单位同类型预案的预警通知单(如果有跳转到预警列表页面,没有,就继续)之前“发布通知单时,把本单位相同预案的其它通知单状态改为结束”去掉--updadeWarningStateTo6
  133. //2.判断是否有同单位同类型预案的响应通知单(如果有跳转到响应列表页面,没有,就继续)
  134. $.ajax({//查询本单位是否有相同预案的通知单
  135. url : $.pathname() + '/ws/alertToImpl/AlertToImplService/getTZDNum/',//获取通知单记录条数
  136. data : {planTypeId : planType,//预案类型
  137. isAlert : "1" ,//预警or响应
  138. corpId : CorpArea,//单位ID
  139. fd_id : fd_id,
  140. lastId : isLastId
  141. },
  142. type : 'post',
  143. timeout : 15000,
  144. dataType : 'text',
  145. async : false,
  146. success : function(data) {
  147. debugger;
  148. var aOrP = data.split(",")[0];//预警-0或响应-1
  149. var aOrPNum = data.split(",")[1];//通知单数量
  150. if(aOrP == "0"){
  151. if(aOrPNum > 0){
  152. flag = 1;
  153. top.Dialog.confirm("本单位有相同预案已发布的预警通知单,无法继续当前操作!是否处理已发布的预警通知单?|响应",
  154. function(){//确定
  155. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
  156. return;
  157. },
  158. function(){//取消
  159. //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/WarningAddEdit.jsp");
  160. top.Dialog.close();
  161. return;
  162. }
  163. );
  164. }else{
  165. flag = 0;
  166. }
  167. }else if(aOrP == "1"){
  168. if(aOrPNum > 0){
  169. flag = 1;
  170. top.Dialog.confirm("本单位有相同预案已发布的响应通知单,无法继续当前操作!是否处理已发布的响应通知单?|响应",
  171. function(){//确定
  172. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  173. return;
  174. },
  175. function(){//取消
  176. //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/WarningAddEdit.jsp");
  177. top.Dialog.close();
  178. return;
  179. }
  180. );
  181. }else{
  182. flag = 0;
  183. }
  184. }
  185. },error : function(e) {
  186. top.Dialog.alert("系统提示信息!");
  187. }
  188. });
  189. }
  190. /** *******************************end****************************************** **/
  191. if(flag == 0 || flag == -1){
  192. var is_send = '5';
  193. if(ewpBut == "51"){
  194. is_send = '6';
  195. }
  196. //====================================================================================================================
  197. var url0 = $.pathname() + '/ws/human/TreateHumanService/updateTreateHumanDispose';
  198. var params0 = {
  199. personId_378 : user_ID,
  200. businessId_378 : fd_id,
  201. statues_378 : '4'
  202. };
  203. $.request.query(url0,params0,function(data){
  204. //alert(data);
  205. });
  206. //=====================================================================================================================
  207. var EARLY_WARNING_ID_365=getAlertNum($("#EARLY_WARNING_ID_365").html().split('-')[0],ewpBut);
  208. if("51"==ewpBut){//如果是解除
  209. EARLY_WARNING_ID_365=$("#EARLY_WARNING_ID_365").html();
  210. }
  211. var params = {
  212. classid : "365",
  213. FD_OBJECTID365 : fd_id,
  214. EARLY_WARNING_ID_365:EARLY_WARNING_ID_365,//通知单编号
  215. IS_SEND_365 : is_send,//通知单状态
  216. RELEASE_UNIT_365:CorpArea//,//发布单位
  217. };
  218. var planId = meetEmergencyPlan;//$("#MEET_EMERGENCIES_PLAN_365")
  219. var planName = "";
  220. $.ajax({//查询预案名称select PLAN_NAME from ECM_AM_YJYASERVER where FD_OBJECTID = planId
  221. url : $.pathname() + '/ws/response/responseService/getPlanName/',
  222. data : { planId214 : planId },
  223. type:'post',
  224. dataType : 'text',
  225. timeout : 666666,
  226. async : false,
  227. success : function(result){
  228. planName = result;
  229. },error : function(e){
  230. top.Dialog.alert("系统错误!");
  231. }
  232. });
  233. var earlyWarningAreaId = earlyWarningAreaIds;//$("#EARLY_WARNING_AREA_ID_365").val();
  234. var paramsJK = {
  235. classid : "365",
  236. FD_OBJECTID365 :fd_id,
  237. RELIEVE_DATE_365:getDateTime(),/////////////////////////////////////////////////////////
  238. IS_SEND_365 : "6",
  239. IS_RELIEVE_365:"2",
  240. PLAN_NAME : planName,
  241. EARLY_WARNING_AREA_ID : earlyWarningAreaId,
  242. LAST_LEVEL : lastLevel,
  243. CURRENT_LEVEL : currentLevel
  244. };
  245. var num = getAlertNum($("#EARLY_WARNING_ID_365").html().split('-')[0],ewpBut);
  246. top.Dialog.confirm("确定要发布吗?|发布", function() {
  247. //通过fd_id获取IS_LAST_ID
  248. $.ajax({
  249. url : $.pathname() + '/ws/response/responseService/getIsLastIdByFdid/',
  250. data : { FD_OBJECTID : fd_id },
  251. type : 'post',
  252. dataType : 'text',
  253. timeout : 15000,
  254. //async : false,
  255. success : function (lastId){
  256. //把fd_objectId为lastId的状态改为6(即结束该通知单),没有返回值
  257. $.ajax({
  258. url : $.pathname() + '/ws/response/responseService/updateIsSend/',
  259. data : { FD_OBJECTID : lastId },
  260. type : 'post',
  261. dataType : 'text',
  262. timeout : 15000,
  263. //async : false,
  264. success : function (nothing){
  265. },error : function(e){
  266. top.Dialog.alert('系统提示信息');
  267. }
  268. });
  269. },error : function(e){
  270. top.Dialog.alert('访问服务失败!');
  271. }
  272. });
  273. var men_url = $.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id;
  274. $.ajax({
  275. url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
  276. type : 'post',
  277. timeout : 15000,
  278. data : params,
  279. dataType : 'json',
  280. //async : false,
  281. success : function(data) {
  282. $.ajax({//发布通知单时,右下角弹框提示发布单位的下级和本级的应急办成员
  283. url : $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/tzdIssueDwr/',
  284. data : { fd_id : data.Msg.objectID },//参数为发布的通知单的ID
  285. type : 'post',
  286. timeout : 15000,
  287. dataType : 'text',
  288. async : false,
  289. success : function(data) {
  290. },error : function(e) {
  291. top.Dialog.alert("系统错误!");
  292. }
  293. });
  294. saveAddNum();
  295. if(isLastId != null && isLastId != ""){
  296. var params = {
  297. classid : "365",
  298. FD_OBJECTID365 : isLastId,
  299. RELIEVE_DATE_365:getDateTime(),////////////////////////////////////////////
  300. IS_SEND_365 : "6"
  301. };
  302. $.ajax({
  303. url : $.pathname() + '/ws/crud/CRUDService/update/',
  304. type : 'post',
  305. timeout : 15000,
  306. data : params,
  307. dataType : 'json',
  308. //async:false,
  309. success : function(data) {
  310. top.Dialog.alert('发布通过!', null, null, null, -1);
  311. if(ewpBut != "51"){//非解除
  312. if(ewpBut == "49"){//初次发布,说明是预警转响应的一条记录
  313. updatePlan(prevEWId,num,releaseUnitId,meetEmergencyPlan,typhoonDate,currentLevel,"2",$("#RELEASE_RELIEVE_DATE_365").html(),fd_id,dataMsg,men_url);
  314. }else{//调整
  315. // updatePlan(prevEWId,num,releaseUnitId,meetEmergencyPlan,typhoonDate,currentLevel,"1",$("#RELEASE_RELIEVE_DATE_365").html(),fd_id,dataMsg,men_url);
  316. updatePlan(prevEWId,num,releaseUnitId,meetEmergencyPlan,typhoonDate,currentLevel,"2",$("#RELEASE_RELIEVE_DATE_365").html(),fd_id,dataMsg,men_url);
  317. }
  318. }else{//解除
  319. finishPlan($("#EARLY_WARNING_ID_365").html(),releaseUnitId,eventId,$("#EVENT_ID_365_SHOW").html());//20160830
  320. }
  321. },error : function(e) {
  322. top.Dialog.alert('系统提示信息!');
  323. }});
  324. }else{
  325. createPlan2(dataMsg,men_url);
  326. top.Dialog.alert('发布通过!', null, null, null, -1);
  327. }
  328. },error : function(e) {
  329. top.Dialog.alert('系统提示信息!');
  330. }
  331. });
  332. $.ajax({//发布以后,用推送的方式,调用首页的方法,更新首页导航下方滚动的预警通知单信息(不需要传参数)
  333. url : $.pathname() + '/ws/alertToImpl/AlertToImplService/updadeWarningMsgOfMainPage/',
  334. type : 'post',
  335. timeout : 15000,
  336. //data : params,
  337. dataType : 'text',
  338. success : function(data) {
  339. },error : function(e) {
  340. //top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  341. }
  342. });
  343. var jkUrl = "";//发布通知单时,调用接口的url
  344. var tzdProperty = ewpBut;//通知单预警性质
  345. if(tzdProperty == "51"){//解除
  346. jkUrl = $.pathname() + '/ws/alertToImpl/AlertToImplService/responseRelieveIssue/';
  347. }else if(tzdProperty == "49" || tzdProperty == "50"){//初次或调整
  348. jkUrl = $.pathname() + '/ws/alertToImpl/AlertToImplService/responseSend/';
  349. }
  350. $.ajax({
  351. url : jkUrl,
  352. type : 'post',
  353. timeout : 15000,
  354. //data : params,
  355. data : paramsJK,
  356. dataType : 'json',
  357. success : function(data) {
  358. },error : function(e) {
  359. //top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  360. }
  361. });
  362. });
  363. }
  364. }
  365. function saveAddNum(){
  366. var $form1 = $('#alertResponseNumForm');
  367. var formValue = $form1.serialize();
  368. var url = $.pathname() + '/ws/crud/CRUDService/create/';
  369. $.request.add(url,formValue,function(data){
  370. //$('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/alert/warning/WarningReleaseMatter.jsp?fd_id="+ fd_id);
  371. });
  372. };
  373. /**
  374. * 替换计划
  375. */
  376. function updatePlan(oldAlert,newAlert,companyId,meet_plan_id,typhoon,alertLevel,isAlert,relieveDate,fd_id,row,men_url){
  377. var planTime = getPlanTime(meet_plan_id,typhoon,alertLevel);
  378. var circleTime = planTime.split("_______")[0];
  379. var temporaryTime = planTime.split("_______")[0];
  380. var params = {
  381. OLD_WARN : oldAlert,
  382. NEW_WARN : newAlert,
  383. COMP_ID : companyId,
  384. 'isAlert' : isAlert,
  385. "temporaryTime" : temporaryTime,
  386. "circleTime" : circleTime,
  387. areaName : row.EARLY_WARNING_AREA_NAME_365,
  388. areaId : row.EARLY_WARNING_AREA_ID_365
  389. };
  390. $.ajax({
  391. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/updatePlan',
  392. type : 'post',
  393. timeout : 15000,
  394. data : params,
  395. dataType : 'text',
  396. success : function(data) {
  397. if(data){
  398. createPlan(meet_plan_id,newAlert,relieveDate,alertLevel,fd_id,row,men_url);
  399. }else{
  400. $('#frmright', window.parent.document).attr('src',men_url);
  401. }
  402. },error:function(e){
  403. alert("updateplan出错");
  404. }
  405. });
  406. }
  407. /**
  408. * 通过预案数据获取周期性和临时性时间
  409. * @param meet_plan_id
  410. * @param typhoon
  411. * @returns {String}
  412. */
  413. function getPlanTime(meet_plan_id,typhoon,alertLevel){
  414. var alertDate = ""; //周期时间
  415. var temporaryTime = ""; //临时时间
  416. $.ajax({
  417. url : $.pathname() + '/ws/sendmenu/SendMsgService/PlanInfoEM',
  418. type : 'post',
  419. timeout : 15000,
  420. data : {file_id:meet_plan_id,grade_type:'%6_2'},
  421. dataType : 'json',
  422. async: false,
  423. success : function(data) {
  424. if(data != null && data != ""){
  425. var tempRow = data;
  426. if(alertLevel == 29){
  427. alertDate = tempRow[0].FRIST_GRADE;
  428. }else if(alertLevel == 30){
  429. alertDate = tempRow[0].SECOND_GRADE;
  430. }else if(alertLevel == 31){
  431. alertDate = tempRow[0].THRID_GRADE;
  432. }else if(alertLevel == 32){
  433. alertDate = tempRow[0].FOURTH_GRADE;
  434. }
  435. alertDate = alertDate.split('||');
  436. temporary = alertDate[0];
  437. alertDate = alertDate[1];
  438. if(typhoon != null && typhoon != ''){
  439. temporaryTime = getFormatString(typhoon,temporary);
  440. }
  441. }
  442. }
  443. });
  444. return alertDate+"_______"+temporaryTime;
  445. }
  446. /**
  447. * 结束报表填报计划
  448. */
  449. function finishPlan(alertNum,companyId,event_id,event_name){
  450. var params = {WARNING_NUMBER:alertNum,COMP_ID:companyId,IS_ALERT:"1"};
  451. $.ajax({
  452. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/releasePlan',
  453. type : 'post',
  454. timeout : 15000,
  455. data : params,
  456. dataType : 'text',
  457. success : function(data) {
  458. var event_unit_id = queryEventInfo(event_id);
  459. if(event_unit_id==CorpArea){
  460. top.Dialog.confirm("发布通过,是否结束"+event_name+"事件?",function(){
  461. finishedEvent(event_id,event_name);
  462. },function(){
  463. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  464. });
  465. }else{
  466. top.Dialog.alert('发布通过!', null, null, null, -1);
  467. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  468. }
  469. }
  470. });
  471. }
  472. /**
  473. * 创建报表填报计划
  474. */
  475. function createPlan2(row,men_url){
  476. var status = row.PLAN_TYPE_ID_365;
  477. var grade_type = "%6_2";
  478. if(status=="5"){//大面积停电
  479. grade_type = "%6_1";
  480. }
  481. $.ajax({
  482. url : $.pathname() + '/ws/sendmenu/SendMsgService/PlanInfoEM',
  483. type : 'post',
  484. timeout : 15000,
  485. data : {file_id:row.MEET_EMERGENCIES_PLAN_365,grade_type:grade_type},
  486. dataType : 'json',
  487. async: false,
  488. success : function(data) {
  489. if(data != null && data != ""){
  490. //如果状态等于14代表突发性群体事件 ,16涉外突发事件,17网络与信息安全无报表填报要求
  491. if(status == 14 || status == 16 || status == 17){
  492. return;
  493. }
  494. var istemporary = "周期性";
  495. var tempRow = data;
  496. var alertLevel = row.CURRENT_ER_LEVEL_365;
  497. var alertDate = ""; //周期时间
  498. var temporaryTime = ""; //临时时间
  499. if(alertLevel == 29){
  500. alertDate = tempRow[0].FRIST_GRADE;
  501. }else if(alertLevel == 30){
  502. alertDate = tempRow[0].SECOND_GRADE;
  503. }else if(alertLevel == 31){
  504. alertDate = tempRow[0].THRID_GRADE;
  505. }else if(alertLevel == 32){
  506. alertDate = tempRow[0].FOURTH_GRADE;
  507. }
  508. //5为大面积停电事件每隔1、2、3小时填写一次
  509. if(status ==5){
  510. var mTime = getSysTimeM();
  511. var num = parseInt(alertDate);
  512. alertDate = "";
  513. for (var i = 0; i < 24;) {
  514. var nu = (i<10 ? "0"+ i : i);
  515. alertDate += "#"+nu+":"+mTime;
  516. i += num;
  517. }
  518. if(alertDate.indexOf("#")==0){
  519. alertDate = alertDate.substring(1, alertDate.length);
  520. }
  521. }
  522. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  523. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  524. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();//部门名称
  525. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  526. var Corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  527. var role_ids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();//角色id
  528. var real_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name;//用户名?还是角色名?这里需要用户名
  529. var alertName =row.EARLY_WARNING_NAME_365;//预警名称
  530. var areaId = row.EARLY_WARNING_AREA_ID_365;//预警范围部门id
  531. var areaName = row.EARLY_WARNING_AREA_NAME_365;//预警范围部门名称
  532. var isAlert = "1";//预警还是响应
  533. if(status == 9 || status == 10){
  534. alertDate = alertDate.split('||');
  535. temporary = alertDate[0];
  536. var typhoon = row.TYPHOON_DATE_365;
  537. //alert(tempRow[0].TABLE_NAME.split("***")[1]);
  538. parmas = {
  539. WARNING_NUMBER : row.EARLY_WARNING_ID_365,
  540. START_TIME : row.RELEASE_RELIEVE_DATE_365,
  541. FILL_IN_SCHEDULE : "周期性",
  542. REPORT_DEPT : tempRow[0].TABLE_NAME.split("***")[1],
  543. DEPT_ID : CorpArea,
  544. ROUND_TIME : alertDate[1],
  545. TEMPORARY_TIME : temporaryTime,
  546. USER_ID : userId,
  547. ROLE_ID : role_ids,
  548. deptName : Corp_names,
  549. real_name : real_name,
  550. alertName : alertName,
  551. areaId : areaId,
  552. areaName : areaName,
  553. isAlert : isAlert,
  554. alertLevel : alertLevel
  555. };
  556. $.ajax({
  557. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
  558. type : 'post',
  559. timeout : 15000,
  560. data : parmas,
  561. dataType : 'text',
  562. async: false,
  563. success : function(data) {
  564. }
  565. });
  566. if(typhoon != null && typhoon != ''){
  567. alertDate = "";
  568. temporaryTime = getFormatString(typhoon,temporary);
  569. parmas = {WARNING_NUMBER:alertNum,START_TIME:row.RELEASE_RELIEVE_DATE_365,
  570. FILL_IN_SCHEDULE:"临时性",REPORT_DEPT:tempRow[0].TABLE_NAME,DEPT_ID:CorpArea,ROUND_TIME:alertDate,
  571. TEMPORARY_TIME:temporaryTime,USER_ID:userId,ROLE_ID:role_ids,
  572. deptName:Corp_names,real_name:real_name,alertName:alertName,areaId:areaId,areaName:areaName,isAlert:isAlert,alertLevel:alertLevel};
  573. $.ajax({
  574. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
  575. type : 'post',
  576. timeout : 15000,
  577. data : parmas,
  578. dataType : 'json',
  579. async: false,
  580. success : function(data) {
  581. $('#frmright', window.parent.document).attr('src',men_url);
  582. }
  583. });
  584. }else{
  585. $('#frmright', window.parent.document).attr('src',men_url);
  586. }
  587. }else{
  588. parmas = {WARNING_NUMBER:row.EARLY_WARNING_ID_365,START_TIME:row.RELEASE_RELIEVE_DATE_365,
  589. FILL_IN_SCHEDULE:"周期性",REPORT_DEPT:tempRow[0].TABLE_NAME,DEPT_ID:CorpArea,ROUND_TIME:alertDate,
  590. TEMPORARY_TIME:temporaryTime,USER_ID:userId,ROLE_ID:role_ids,
  591. deptName:Corp_names,real_name:real_name,alertName:alertName,areaId:areaId,areaName:areaName,isAlert:isAlert,alertLevel:alertLevel};
  592. $.ajax({
  593. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
  594. type : 'post',
  595. timeout : 15000,
  596. data : parmas,
  597. dataType : 'text',
  598. async: false,
  599. success : function(data) {
  600. $('#frmright', window.parent.document).attr('src',men_url);
  601. }
  602. });
  603. }
  604. }else{
  605. top.Dialog.alert('预案中没有配置报表报告计划!');
  606. _this.listGrid.loadData();
  607. };
  608. },
  609. error : function(e) {
  610. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  611. }
  612. });
  613. }
  614. /**
  615. * 创建报表填报计划
  616. */
  617. function createPlan(meet_plan_id,newAlert,relieveDate,alertLevel,fd_id,row,men_url){
  618. var status = row.PLAN_TYPE_ID_365;
  619. var grade_type = "%6_2";
  620. if(status=="5"){//大面积停电
  621. grade_type = "%6_1";
  622. }
  623. $.ajax({
  624. url : $.pathname() + '/ws/sendmenu/SendMsgService/PlanInfoEM',
  625. type : 'post',
  626. timeout : 15000,
  627. data : {file_id:row.MEET_EMERGENCIES_PLAN_365,grade_type:grade_type},
  628. dataType : 'json',
  629. async: false,
  630. success : function(data) {
  631. if(data != null && data != ""){
  632. //如果状态等于14代表突发性群体事件 ,16涉外突发事件,17网络与信息安全无报表填报要求
  633. if(status == 14 || status == 16 || status == 17){
  634. return;
  635. }
  636. var istemporary = "周期性";
  637. var tempRow = data;
  638. var alertLevel = row.CURRENT_ER_LEVEL_365;
  639. var alertDate = ""; //周期时间
  640. var temporaryTime = ""; //临时时间
  641. if(alertLevel == 29){
  642. alertDate = tempRow[0].FRIST_GRADE;
  643. }else if(alertLevel == 30){
  644. alertDate = tempRow[0].SECOND_GRADE;
  645. }else if(alertLevel == 31){
  646. alertDate = tempRow[0].THRID_GRADE;
  647. }else if(alertLevel == 32){
  648. alertDate = tempRow[0].FOURTH_GRADE;
  649. }
  650. //5为大面积停电事件每隔1、2、3小时填写一次
  651. if(status ==5){
  652. var mTime = getSysTimeM();
  653. var num = parseInt(alertDate);
  654. alertDate = "";
  655. for (var i = 0; i < 24;) {
  656. var nu = (i<10 ? "0"+ i : i);
  657. alertDate += "#"+nu+":"+mTime;
  658. i += num;
  659. }
  660. if(alertDate.indexOf("#")==0){
  661. alertDate = alertDate.substring(1, alertDate.length);
  662. }
  663. }
  664. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  665. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  666. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();//部门名称
  667. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  668. var Corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  669. var role_ids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();//角色id
  670. var real_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name;//用户名?还是角色名?这里需要用户名
  671. var alertName =row.EARLY_WARNING_NAME_365;//预警名称
  672. var areaId = row.EARLY_WARNING_AREA_ID_365;//预警范围部门id
  673. var areaName = row.EARLY_WARNING_AREA_NAME_365;//预警范围部门名称
  674. var isAlert = "1";//预警还是响应
  675. if(status == 9 || status == 10){
  676. alertDate = alertDate.split('||');
  677. temporary = alertDate[0];
  678. var typhoon = row.TYPHOON_DATE_365;
  679. //alert(tempRow[0].TABLE_NAME.split("***")[1]);
  680. parmas = {
  681. WARNING_NUMBER : row.EARLY_WARNING_ID_365,
  682. START_TIME : row.RELEASE_RELIEVE_DATE_365,
  683. FILL_IN_SCHEDULE : "周期性",
  684. REPORT_DEPT : tempRow[0].TABLE_NAME.split("***")[1],
  685. DEPT_ID : CorpArea,
  686. ROUND_TIME : alertDate[1],
  687. TEMPORARY_TIME : temporaryTime,
  688. USER_ID : userId,
  689. ROLE_ID : role_ids,
  690. deptName : Corp_names,
  691. real_name : real_name,
  692. alertName : alertName,
  693. areaId : areaId,
  694. areaName : areaName,
  695. isAlert : isAlert,
  696. alertLevel : alertLevel
  697. };
  698. $.ajax({
  699. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
  700. type : 'post',
  701. timeout : 15000,
  702. data : parmas,
  703. dataType : 'text',
  704. async: false,
  705. success : function(data) {
  706. }
  707. });
  708. if(typhoon != null && typhoon != ''){
  709. alertDate = "";
  710. temporaryTime = getFormatString(typhoon,temporary);
  711. parmas = {WARNING_NUMBER:alertNum,START_TIME:row.RELEASE_RELIEVE_DATE_365,
  712. FILL_IN_SCHEDULE:"临时性",REPORT_DEPT:tempRow[0].TABLE_NAME,DEPT_ID:CorpArea,ROUND_TIME:alertDate,
  713. TEMPORARY_TIME:temporaryTime,USER_ID:userId,ROLE_ID:role_ids,
  714. deptName:Corp_names,real_name:real_name,alertName:alertName,areaId:areaId,areaName:areaName,isAlert:isAlert,alertLevel:alertLevel};
  715. $.ajax({
  716. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
  717. type : 'post',
  718. timeout : 15000,
  719. data : parmas,
  720. dataType : 'json',
  721. async: false,
  722. success : function(data) {
  723. $('#frmright', window.parent.document).attr('src',men_url);
  724. }
  725. });
  726. }else{
  727. $('#frmright', window.parent.document).attr('src',men_url);
  728. }
  729. }else{
  730. parmas = {WARNING_NUMBER:row.EARLY_WARNING_ID_365,START_TIME:row.RELEASE_RELIEVE_DATE_365,
  731. FILL_IN_SCHEDULE:"周期性",REPORT_DEPT:tempRow[0].TABLE_NAME,DEPT_ID:CorpArea,ROUND_TIME:alertDate,
  732. TEMPORARY_TIME:temporaryTime,USER_ID:userId,ROLE_ID:role_ids,
  733. deptName:Corp_names,real_name:real_name,alertName:alertName,areaId:areaId,areaName:areaName,isAlert:isAlert,alertLevel:alertLevel};
  734. $.ajax({
  735. url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
  736. type : 'post',
  737. timeout : 15000,
  738. data : parmas,
  739. dataType : 'text',
  740. async: false,
  741. success : function(data) {
  742. $('#frmright', window.parent.document).attr('src',men_url);
  743. }
  744. });
  745. }
  746. }else{
  747. top.Dialog.alert('预案中没有配置报表报告计划!');
  748. _this.listGrid.loadData();
  749. };
  750. },
  751. error : function(e) {
  752. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  753. }
  754. });
  755. }
  756. //获取通知单编号
  757. function getAlertNum(thing,alertQuality){
  758. //获取系统年份
  759. var year = allGetServerTime().getFullYear();
  760. var quality = "F";
  761. if(alertQuality == '49'){
  762. quality = "F";
  763. }else{
  764. quality = "T";
  765. }
  766. var params = {
  767. companyId : CorpArea,
  768. year : year,
  769. isAdjust : quality,
  770. isAlert:'1',
  771. plan_type_id : $("#PLAN_TYPE_ID_368").val()
  772. };
  773. var url = $.pathname()+ '/ws/response/responseService/getAlertresponse';
  774. $.ajax({
  775. url : url,
  776. type : 'post',
  777. timeout : 60000,
  778. dataType : 'json',
  779. data : params,
  780. async : false,
  781. success : function(data) {
  782. $("#IS_ADJUST_368").val(quality);
  783. $("#COMPANY_ID_368").val(CorpArea);
  784. $("#YEAR_368").val(year);
  785. $("#NUM_368").val(data);
  786. alertNum = thing + "-" + ""+quality+"" + "-" + year + "-" + data;//防风防汛-F-2016-83
  787. }
  788. });
  789. return alertNum;
  790. };
  791. function getPersonMsg(){
  792. //alert("fd_id="+fd_id+"\n isSend="+isSend);
  793. if(isSend != 0){
  794. $.ajax({//查询表【ECM_EM_TREATED_HUMAN】中的处理人ID
  795. url : $.pathname() + '/ws/sendsms/SendSmsService/getHumanMsg',
  796. data : { fd_id : fd_id , isSend : isSend},
  797. type : 'post',
  798. dataType : 'json',
  799. timeout : 666666,
  800. async : false,
  801. success : function (resultData){
  802. personId = resultData.personId;//处理人ID
  803. },error : function (e){
  804. top.Dialog.alert("系统错误!");
  805. }
  806. });
  807. }
  808. }
  809. /****
  810. * 根据id查询事件信息
  811. */
  812. function queryEventInfo(event_id){
  813. var unit_id = "";
  814. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  815. var params = {
  816. classid : '363',
  817. objectID : event_id
  818. };
  819. $.ajax({
  820. url : url,
  821. type : 'post',
  822. data : params,
  823. dataType : 'json',
  824. async:false,
  825. success : function(data) {
  826. unit_id = data.ISSUE_UNITE_ID_363;
  827. },
  828. error : function(e) {
  829. // $.messager.alert('访问服务失败!55', 'error');
  830. }
  831. });
  832. return unit_id;
  833. }
  834. /****
  835. * 根据id结束事件
  836. */
  837. function finishedEvent(event_id,event_name){
  838. var params = {
  839. classid : "363",
  840. FD_OBJECTID363 : event_id,
  841. EVENT_STATE_363 : "1"
  842. };
  843. $.ajax({
  844. url : $.pathname() + '/ws/crud/CRUDService/update/',
  845. type : 'post',
  846. data : params,
  847. dataType : 'json',
  848. success : function(data) {
  849. top.Dialog.alert(event_name+'事件已经结束!', null, null, null, -1);
  850. //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  851. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
  852. },
  853. error : function(e) {
  854. $.messager.alert('结束事件失败!');
  855. }
  856. });
  857. }
  858. //获得当前系统时间:年月日时分秒
  859. function getSysTime(){
  860. var s="";
  861. var d = allGetServerTime();
  862. var vYear = d.getFullYear();
  863. var vMon = d.getMonth() + 1;
  864. var vDay = d.getDate();
  865. var h = d.getHours();
  866. var m = d.getMinutes();
  867. var se = d.getSeconds();
  868. s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se);
  869. return s;
  870. }
  871. //获得当前系统时间:分
  872. function getSysTimeM(){
  873. var s="";
  874. var d = allGetServerTime();
  875. var vYear = d.getFullYear();
  876. var vMon = d.getMonth() + 1;
  877. var vDay = d.getDate();
  878. var h = d.getHours();
  879. var m = d.getMinutes();
  880. var se = d.getSeconds();
  881. //s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se);
  882. s= (m<10 ? "0" + m : m);
  883. return s;
  884. }