a08d2d552f7423dce05f20c93c342f9d863011f6.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /**
  2. * 功能:修改解除的应急预警通知单
  3. *
  4. *
  5. * @author HXB
  6. * @date 2015/09/23
  7. */
  8. WarningRelieve = function() {
  9. /**定义变量**/
  10. var _this = this;
  11. var is_skip = 0;
  12. /***保存信息***/
  13. _this.save = function(){
  14. $form = $('#editForm');
  15. var valid = $form.validationEngine({returnIsValid: true});//表单验证
  16. if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
  17. top.Dialog.alert("请选择预警范围!");
  18. return ;
  19. }
  20. if(valid ){//修改
  21. $('#classid').val(365);
  22. //数据ID情况
  23. showProgressBar("正在提交中...");
  24. var formValue = $form.serialize();
  25. url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation";
  26. fileToSave($form,null,null,url);
  27. }else{
  28. top.Dialog.alert("请检查标红输入框!");
  29. }
  30. };
  31. //页面发送按钮gel
  32. _this.is_Send = function(){
  33. is_skip = 1;
  34. $form = $('#editForm');
  35. var valid = $form.validationEngine({returnIsValid: true});//表单验证
  36. if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
  37. top.Dialog.alert("请选择预警范围!");
  38. return ;
  39. }
  40. if(valid ){//修改
  41. $('#classid').val(365);
  42. //数据ID情况
  43. showProgressBar("正在提交中...");
  44. var formValue = $form.serialize();
  45. url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation";
  46. fileToSave($form,null,null,url);
  47. }else{
  48. top.Dialog.alert("请检查标红输入框!");
  49. }
  50. };
  51. //页面发布按钮
  52. _this.is_Issue = function(){
  53. is_skip = 2;
  54. $form = $('#editForm');
  55. var valid = $form.validationEngine({returnIsValid: true});//表单验证
  56. if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
  57. top.Dialog.alert("请选择预警范围!");
  58. return ;
  59. }
  60. if(valid ){//修改
  61. $('#classid').val(365);
  62. if(hasFile()){
  63. var params = {
  64. classid : "365",
  65. FD_OBJECTID365 :$("#IS_LAST_ID_365").val(),
  66. IS_SEND_365 : "6"
  67. };
  68. $.ajax({
  69. url : $.pathname() + '/ws/crud/CRUDService/update/',
  70. type : 'post',
  71. timeout : 15000,
  72. data : params,
  73. dataType : 'json',
  74. success : function(data) {
  75. },
  76. error : function(e) {
  77. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  78. }
  79. });
  80. $("#IS_SEND_365").val(6);
  81. $("#RELEASE_UNIT_365").val($("#WRITE_DEPT_365").attr("relValue"));
  82. }else{
  83. top.Dialog.alert("附件不能为空!请选择并上传附件");
  84. return;
  85. }
  86. //数据ID情况
  87. showProgressBar("正在提交中...");
  88. var formValue = $form.serialize();
  89. url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation";
  90. fileToSave($form,null,null,url);
  91. }else{
  92. top.Dialog.alert("请检查标红输入框!");
  93. }
  94. };
  95. function fileToSave($form,listGrid,msg,url){
  96. $("#EARLY_WARNING_AREA_ID_365").val($("#EARLY_WARNING_AREA_NAME_365").val());
  97. $("#EARLY_WARNING_AREA_NAME_365").val($("#EARLY_WARNING_AREA_NAME_365_show").val());//预警范围
  98. showProgressBar("正在提交中...");
  99. //表单异步提交处理
  100. $form.ajaxSubmit({
  101. type: 'post',
  102. url:url,
  103. //表单提交成功后的回调
  104. success: function(responseText, statusText, xhr, $form){
  105. responseText = eval('('+responseText+')');
  106. closeProgress();
  107. top.Dialog.alert('保存成功!');//弹出提示
  108. if(is_skip == 1){
  109. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/RelieveSendWarning.jsp?fd_id="+responseText.ObjectID);
  110. }else{
  111. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
  112. }
  113. }
  114. });
  115. }
  116. return {
  117. init : function() {
  118. $('#save').bind('click',function(){
  119. _this.save();
  120. });
  121. $('#back').bind('click',function(){
  122. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
  123. });
  124. $("#is_Send").bind('click',function(){
  125. $form = $('#editForm');
  126. var valid = $form.validationEngine({returnIsValid: true});//表单验证
  127. if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
  128. top.Dialog.alert("请选择预警范围(预警范围)!");
  129. return ;
  130. }
  131. if(!valid){
  132. top.Dialog.alert("请检查标红输入框!");
  133. return ;
  134. }
  135. top.Dialog.confirm("是否要发送?|预警",function(){//点击确定fileDiv
  136. _this.is_Send();
  137. },function(){//点击取消
  138. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
  139. });
  140. });
  141. $("#is_Issue").bind('click',function(){
  142. $form = $('#editForm');
  143. var valid = $form.validationEngine({returnIsValid: true});//表单验证
  144. if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
  145. top.Dialog.alert("请选择预警范围(预警范围)!");
  146. return;
  147. }
  148. if(!valid){
  149. top.Dialog.alert("请检查标红输入框!");
  150. return;
  151. }
  152. top.Dialog.confirm("是否要发布?|预警",function(){//点击确定
  153. _this.is_Issue();
  154. },function(){//点击取消
  155. });
  156. });
  157. }
  158. };
  159. }();
  160. $(function() {
  161. WarningRelieve.init();
  162. });