72e5657232f32eb5fa8812c736363615c4e60672.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. /**
  2. * 功能:应急预警报告添加及修改
  3. *
  4. *
  5. * @author HXB
  6. * @date 2015/09/25
  7. */
  8. WarningAddEditAdjust = function() {
  9. /**定义变量**/
  10. var _this = this;
  11. var nowTime ="";
  12. /**私有方法**/
  13. _this.DateTime = function(){
  14. $.ajax({//后台获取系统当前时间
  15. url:$.pathname()+ '/ws/response/responseService/getNowTime',
  16. // data : {},
  17. type : 'post',
  18. dataType : 'text',
  19. async : false,
  20. timeout : 6000,
  21. success : function(result){
  22. nowTime=result;
  23. },error : function(e){
  24. top.Dialog.alert("获取后台时间失败!");
  25. return;
  26. }
  27. });
  28. };
  29. var isCheckAndIssue = 0;//判断是否是点击审核并签发按钮 0》》不是 1》》是
  30. var isPass = "";
  31. /***新增信息***/
  32. _this.save = function(diag,fd_id,isCheckAndIssue){
  33. _this.DateTime();
  34. var is_audit = $("#is_audit").val();
  35. var nextManId = "";//代办处理会用到这个变量,主要用于保存下一节点处理人ID
  36. if(diag){
  37. isPass = diag.innerFrame.contentWindow.$("input:radio[name='aa']:checked").val();//判断是否同意
  38. }
  39. if(isCheckAndIssue == 0){//不是“审核并签发”
  40. if(is_audit==0){
  41. /********** 弹框start **********/
  42. var valid = diag.innerFrame.contentWindow.$("#ideaForm").validationEngine({returnIsValid: true});//弹框页面的非空验证
  43. if(!valid){
  44. top.Dialog.alert("请检查红色输入框!");
  45. return;
  46. };
  47. var a = diag.innerFrame.contentWindow.$("#EXPLAIN_37800").val();//弹框页面的回退说明的值
  48. $("#EXPLAIN_378").val(a);//给主页面的回退说明标签赋值
  49. var b = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").val();//弹框页面的下一节点人的id
  50. nextManId = b;
  51. $("#PERSON_ID_378").val(b);//给主页面的下一节点人id赋值
  52. var isChecked1 = diag.innerFrame.contentWindow.$("#yAgree").attr("checked");
  53. var isChecked2 = diag.innerFrame.contentWindow.$("#nAgree").attr("checked");
  54. if(isChecked1 == 'checked' && b == undefined){
  55. top.Dialog.alert("请选择下一处理人!");
  56. return;
  57. }
  58. if(isChecked2 == 'checked' && a == ""){
  59. top.Dialog.alert("请填写回退说明!");
  60. return;
  61. }
  62. // if(a=='' && b == undefined){
  63. // top.Dialog.alert("请选择下一处理人!!");
  64. // return;
  65. // }
  66. var c = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").next().html();//弹框页面的下一节点人的NAME
  67. $("#PERSON_NAME_378").val(c);
  68. var d = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").next().next().val();//弹框页面的下一节点人的电话
  69. var e = diag.innerFrame.contentWindow.$("#msgRemind").attr("checked");//短信是否被勾选
  70. var f = diag.innerFrame.contentWindow.$("#appRemind").attr("checked");//app是否被勾选
  71. isPass = diag.innerFrame.contentWindow.$(".aa[checked='checked']").val();//判断是否同意
  72. if(isChecked1 == 'checked'){
  73. isPass = "同意";
  74. }else{
  75. isPass = "回退";
  76. }
  77. var g = '您有新的通知单任务,请及时处理!';//短信内容
  78. //var h = nowTime;//系统时间
  79. var h ="nidaye";
  80. if(e=='checked'){//短信被勾选
  81. //alert("短信提醒");
  82. if(b == undefined){
  83. top.Dialog.alert("请选择短信接收人!");
  84. return;
  85. }
  86. var url0 = $.pathname() + '/ws/sendsms/SendSmsService/saveMessage';
  87. var params = {
  88. realName : realName,//发送人真实姓名
  89. smsRecTel : d,//接收电话
  90. smsTime : h,//系统时间
  91. smsContent : g,//短信内容
  92. smsSendId : realName_ID,//发送人Id
  93. smsPeople : b,//接收人员id?还是name?
  94. type:"短信发送"
  95. };
  96. $.ajax({
  97. type : 'post',
  98. url : url0,
  99. data : params,
  100. async:false,
  101. dataType : 'json',
  102. success : function (data){
  103. //alert(JSON.stringify(data));
  104. },
  105. error : function(e){
  106. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  107. }
  108. });
  109. }
  110. if(f=='checked'){
  111. alert("应急app提醒!");
  112. }
  113. diag.innerFrame.contentWindow.top.Dialog.close();//关闭弹框
  114. $.ajax({////修改通知单表的IS_SEEN字段为【下一处理人ID,0 ,处理人ID】
  115. url : $.pathname() + '/ws/sendsms/SendSmsService/updateIs_Seen',
  116. data : { tableName : "ECM_EM_PUBLISH_ALERT_NOTICE" , //表名
  117. fdId : fd_id , //id
  118. nextPeopId : b , //下一处理人ID
  119. userId : realName_ID//处理人ID
  120. },
  121. type : 'post',
  122. dataType : 'json',
  123. async:false,
  124. success : function (data){
  125. },error : function(e){
  126. top.Dialog.alert("系统提示信息!");
  127. }
  128. });
  129. /********** 弹框end **********/
  130. }else{//签发通过,保存下一节点人信息于378表中
  131. if(isPass == "回退"){
  132. var isChecked2 = diag.innerFrame.contentWindow.$("#nAgree").attr("checked");
  133. var a = diag.innerFrame.contentWindow.$("#EXPLAIN_37800").val();//弹框页面的回退说明的值
  134. if(isChecked2 == 'checked' && a == ""){
  135. top.Dialog.alert("请填写回退说明!");
  136. return;
  137. }
  138. }
  139. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  140. var params = {
  141. classid : '365',
  142. objectID : fd_id
  143. };
  144. $.ajax({
  145. url : url,
  146. data : params,
  147. type : 'post',
  148. dataType : 'json',
  149. async : false,
  150. timeout : 1500 ,
  151. success : function(result){
  152. var params1 = {
  153. classid:"378",
  154. PERSON_ID_378: result.WRITER_ID_365,
  155. PERSON_NAME_378: result.WRITER_365,
  156. BUSINESS_ID_378:fd_id,
  157. STATUES_378:"4",
  158. DISPOSE_378:"0"
  159. };
  160. $.ajax({
  161. url : $.pathname() + '/ws/crud/CRUDService/create/',
  162. type : 'post',
  163. timeout : 15000,
  164. data : params1,
  165. dataType : 'json',
  166. async : false,
  167. success : function(data) {
  168. },error:function(e){
  169. top.Dialog.alert("系统错误!1");
  170. }
  171. });
  172. $.ajax({////修改通知单表的IS_SEEN字段为【下一处理人ID,0 ,处理人ID】
  173. url : $.pathname() + '/ws/sendsms/SendSmsService/updateIs_Seen',
  174. data : { tableName : "ECM_EM_PUBLISH_ALERT_NOTICE" , //表名
  175. fdId : fd_id , //id
  176. nextPeopId : result.WRITER_ID_365 , //下一处理人ID
  177. userId : realName_ID//处理人ID
  178. },
  179. type : 'post',
  180. dataType : 'json',
  181. async:false,
  182. success : function (data){
  183. },error : function(e){
  184. top.Dialog.alert("系统提示信息!");
  185. }
  186. });
  187. },error:function(e){
  188. top.Dialog.alert("系统错误!2");
  189. }
  190. });
  191. }
  192. }else{
  193. isPass="同意";
  194. $.ajax({////修改通知单表的IS_SEEN字段为【下一处理人ID,0 ,处理人ID】
  195. url : $.pathname() + '/ws/sendsms/SendSmsService/updateIs_Seen',
  196. data : { tableName : "ECM_EM_PUBLISH_ALERT_NOTICE" , //表名
  197. fdId : fd_id , //id
  198. nextPeopId : $("#WRITER_ID_365").val() , //下一处理人ID
  199. userId : realName_ID//处理人ID
  200. },
  201. type : 'post',
  202. dataType : 'json',
  203. async:false,
  204. success : function (data){
  205. },error : function(e){
  206. top.Dialog.alert("系统提示信息!");
  207. }
  208. });
  209. }
  210. $form1 = $('#editForm1');
  211. $form = $('#editForm');
  212. var is_audit = $("#is_audit").val();
  213. $('#classid').val('365');
  214. if(is_audit == "0"){//is_audit 等于0为审核 等于1为签发
  215. if(isPass == '同意'){//审核通过
  216. if(isCheckAndIssue == 1){//审核并签发
  217. $("#PERSON_ID_378").val(realName_ID);//审核人为系统登录人ID
  218. $("#PERSON_NAME_378").val(realName);//审核人为系统登录人NAME
  219. $("#STATUES_378").val(3);
  220. $("#IS_SEND_365").val(4); //3 设置成待签发
  221. }else{
  222. $("#STATUES_378").val(3);
  223. $("#IS_SEND_365").val(3);
  224. }
  225. var url = $.pathname() + '/ws/human/TreateHumanService/updateTreateHumanDispose';
  226. var params = {
  227. personId_378 : $("#lastWriterID").val(),
  228. businessId_378 : $("#lastBusinessID").val(),
  229. statues_378 : '1'
  230. };
  231. $.request.query(url,params,function(data){
  232. //alert(data);
  233. });
  234. }else{
  235. $("#IS_SEND_365").val(0);//变为未发送状态
  236. $("#STATUES_378").val(2);
  237. var url0 = $.pathname() + '/ws/human/TreateHumanService/updateTreateHumanDisDel';
  238. var params0 = { businessId_378 : $("#lastBusinessID").val() ,STATUES_378 : 2 ,EXPAIN_378 : $("#EXPLAIN_378").val()};
  239. $.request.query(url0,params0,function(data){
  240. });
  241. var url1 = $.pathname() +'/ws/crud/CRUDService/create/';
  242. var $editForm1 = $("#editForm1");
  243. var params1 = $editForm1.serialize();
  244. // alert(JSON.stringify(params1))
  245. $.request.query(url1,params1,function(data){
  246. });
  247. }
  248. }else if(is_audit == "1"){//签发 is_audit 等于0为审核 等于1为签发
  249. if(isPass == "回退"){
  250. $("#IS_SEND_365").val(0);//变为未发送状态
  251. $("#STATUES_378").val(2);
  252. var url0 = $.pathname() + '/ws/human/TreateHumanService/updateTreateHumanDisDel';
  253. var params0 = { businessId_378 : $("#lastBusinessID").val() };
  254. $.request.query(url0,params0,function(data){
  255. //alert(data);
  256. });
  257. diag.innerFrame.contentWindow.top.Dialog.close();//关闭弹框
  258. }else{
  259. $("#STATUES_378").val(4);
  260. $("#IS_SEND_365").val(4); //4 设置成待发布
  261. var url = $.pathname() + '/ws/human/TreateHumanService/updateTreateHumanDispose';
  262. var params = {
  263. personId_378 : $("#lastWriterID").val(),
  264. businessId_378 : $("#lastBusinessID").val(),
  265. statues_378 : '3'
  266. };
  267. $.request.query(url,params,function(data){
  268. //alert(data);
  269. });
  270. //=====================================================================================================
  271. }
  272. }
  273. $("#EARLY_WARNING_AREA_ID_365").val($("#EARLY_WARNING_AREA_NAME_365").val());//预警范围ID
  274. $("#EARLY_WARNING_AREA_NAME_365").val($("#EARLY_WARNING_AREA_NAME_365_show").val());//预警范围NAME
  275. $("#RELEASE_UNIT_365").val($("#WRITE_DEPT_365").val());//发布单位
  276. var valid = $form.validationEngine({returnIsValid: true});
  277. var valid1 = $form1.validationEngine({returnIsValid: true});
  278. $("#DB_TYPE").val("1");
  279. var formValue = $form.serialize();
  280. var formValue1 = $form1.serialize();
  281. if(valid && valid1){
  282. updateAlert(formValue,formValue1,is_audit,isPass,nextManId,fd_id);//is_audit(0代表审核 1代表签发)
  283. }else{
  284. top.Dialog.alert(CHECKREDBOX);
  285. }
  286. };
  287. function updateAlert(formValue,formValue1,is_audit,isPass,nextManId,fd_id){
  288. var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
  289. $.request.add(url,formValue,function(data){
  290. if(is_audit==0 && isPass == '同意'){//审核同意走这里,新增下一节点人信息
  291. url = $.pathname() +'/ws/crud/CRUDService/create/';
  292. if(isCheckAndIssue == 1){
  293. $("#DISPOSE_378").val(1);
  294. formValue1 = $form1.serialize();
  295. }
  296. $.request.add(url,formValue1,function(data){
  297. // if(is_audit==0 && isPass == '同意'){
  298. if(isPass == '同意'){
  299. if(isCheckAndIssue == 1){
  300. var writerId = $("#WRITER_ID_365").val();
  301. var writerName = $("#WRITER_365").val();
  302. $("#PERSON_ID_378").val(writerId);//发布人(这里应该保存该条通知单的填报人id,为了让填报人的代办中有一条待分发的代办)
  303. $("#PERSON_NAME_378").val(writerName);//发布人(这里应该保存该条通知单的填报人NAME)
  304. $("#STATUES_378").val(4);
  305. $("#DISPOSE_378").val(0);
  306. formValue1 = $form1.serialize();
  307. url = $.pathname() +'/ws/crud/CRUDService/create/';
  308. $.request.add(url,formValue1,function(data){
  309. top.Dialog.alert("审核并签发成功!");
  310. if(isWaitDo == 1){
  311. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
  312. }else{
  313. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  314. }
  315. });
  316. }else{
  317. top.Dialog.alert("审核通过!");
  318. if(isWaitDo == 1){
  319. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
  320. }else{
  321. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  322. }
  323. }
  324. }
  325. // $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  326. });
  327. }else{
  328. //回退在前面已经删除过操作节点人了
  329. if(isPass == '回退'){
  330. top.Dialog.alert("回退成功!");
  331. }else{//签发不需要再选择下一节点人
  332. top.Dialog.alert("签发通过!");
  333. }
  334. if(isWaitDo == 1){
  335. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
  336. }else{
  337. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  338. }
  339. }
  340. });
  341. /** 代办右上角红色圈里面数字的改变 **/
  342. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  343. var params="";
  344. if(is_audit=="0"){//审核
  345. if(isPass == '回退'){//退回
  346. params = {
  347. userId : user_id//,//处理人ID(系统登录人)
  348. //netx_id : nextManId//,//下一节点处理人ID
  349. };
  350. }else{//审核通过
  351. params = {userId : user_id,netx_id : nextManId};
  352. }
  353. }else if(is_audit=="1"){//签发
  354. if(isPass == '回退'){//退回
  355. params = {userId : user_id/*,netx_id : b*/};
  356. }else{//签发通过
  357. $.ajax({
  358. url : $.pathname() + '/ws/response/responseService/getWriterIdByFdid',
  359. data : { FD_OBJECTID : fd_id} ,
  360. type : 'post',
  361. dataType : 'text',
  362. timeout : 15000,
  363. async : false,
  364. success : function(relust){
  365. params = {userId : user_id,netx_id : relust};
  366. },error : function (e){
  367. top.Dialog.alert('系统错误!3');
  368. }
  369. });
  370. }
  371. }
  372. $.ajax({
  373. url : $.pathname() + '/ws/xianlutingyun/XianlutingyunService/WarningTask',
  374. data : params,
  375. type : 'post',
  376. dataType : 'text',
  377. timeout : 15000,
  378. // async : false,
  379. success : function(data){
  380. // top.Dialog.alert('发送成功!', null, null, null, -1);
  381. }/*,error : function (e){
  382. top.Dialog.alert('系统错误!4');
  383. }*/
  384. });
  385. }
  386. return {
  387. init : function() {
  388. /********** 弹框start **********/
  389. $("#pass00").bind("click",function(){
  390. $("#MEET_EMERGENCIES_PLAN_36500").val(yuAnId);
  391. if(is_audit == "1"){//签发
  392. isCheckAndIssue = 0;
  393. $(".person").hide();
  394. $("#PERSON_NAME_378").attr("class","");
  395. _this.save(null,fd_id,isCheckAndIssue);
  396. }else{
  397. var level2 = $("#CURRENT_ER_LEVEL_365").val();//响应级别 29 I级 30 II级 31 III级 32 IV级
  398. var pageType = 1;//pageType的值 0为发送页面 1为审核页面
  399. var isPass=0;//同意
  400. dialogDemo(isPass,level2,pageType,null);
  401. }
  402. });
  403. $("#rock00").bind("click",function(){
  404. var level2 = $("#CURRENT_ER_LEVEL_365").val();//响应级别 29 I级 30 II级 31 III级 32 IV级
  405. var pageType = 1;//pageType的值 0为发送页面 1为审核页面
  406. var isPass=1;//回退
  407. dialogDemo(isPass,level2,pageType,null);
  408. });
  409. function dialogDemo(isPass,level2,pageType,isCheckAndIssue){
  410. //var ifmHeight = $(top.document.body).find("#frmright").height();
  411. var diag = new top.Dialog();
  412. if (is_audit == 0){//审核
  413. diag.Title = '审核意见';
  414. }else if(is_audit == 1){//签发
  415. diag.Title = '签发页面';
  416. }
  417. if(isPass==0){//同意
  418. diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningaddUnitTest.jsp?fd_id='+fd_id+'&isPass=0&pageType=1&level2='+level2; //修改对应的路径的编辑界面
  419. }else if(isPass==1){//退回
  420. if(is_audit == 1){
  421. diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningaddUnitTest.jsp?fd_id='+fd_id+'&isPass=1&pageType=1&isBack=1&level2='+level2; //修改对应的路径的编辑界面
  422. }else{
  423. diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningaddUnitTest.jsp?fd_id='+fd_id+'&isPass=1&pageType=1&level2='+level2; //修改对应的路径的编辑界面
  424. }
  425. }
  426. diag.OkButtonText = '提交';
  427. diag.OKEvent = function(){
  428. isCheckAndIssue = 0;
  429. _this.save(diag,fd_id,isCheckAndIssue);
  430. diag.close();
  431. //_this.saveMenuRole(diag,fd_id);
  432. };
  433. diag.Width = 500; //宽度
  434. // diag.Height = 200; //高度
  435. diag.ButtonAlign = 'center';
  436. diag.show();
  437. };
  438. /********** 弹框end **********/
  439. $('#back').bind('click',function(){
  440. if(isWaitDo == 1){
  441. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/waitdo/waitDo.html");
  442. }else{
  443. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
  444. }
  445. });
  446. $('#checkAndIssue').bind('click',function(){
  447. $("#MEET_EMERGENCIES_PLAN_36500").val(yuAnId);
  448. isCheckAndIssue = 1;
  449. _this.save(null,fd_id,isCheckAndIssue);
  450. });
  451. }
  452. };
  453. }();
  454. $(function() {
  455. WarningAddEditAdjust.init();
  456. });