f3f66240805b766891ad60b98149d2a6f0ba295c.svn-base 27 KB

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