6649661facaecf4ccca9e839a626459f5ca60c94.svn-base 22 KB

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