/** * 功能:修改解除的应急预警通知单 * * * @author HXB * @date 2015/09/23 */ WarningRelieve = function() { /**定义变量**/ var _this = this; var is_skip = 0; /***保存信息***/ _this.save = function(){ $form = $('#editForm'); var valid = $form.validationEngine({returnIsValid: true});//表单验证 if($("#EARLY_WARNING_AREA_NAME_365").val()==""){ top.Dialog.alert("请选择预警范围!"); return ; } if(valid ){//修改 $('#classid').val(365); //数据ID情况 showProgressBar("正在提交中..."); var formValue = $form.serialize(); url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation"; fileToSave($form,null,null,url); }else{ top.Dialog.alert("请检查标红输入框!"); } }; //页面发送按钮gel _this.is_Send = function(){ is_skip = 1; $form = $('#editForm'); var valid = $form.validationEngine({returnIsValid: true});//表单验证 if($("#EARLY_WARNING_AREA_NAME_365").val()==""){ top.Dialog.alert("请选择预警范围!"); return ; } if(valid ){//修改 $('#classid').val(365); //数据ID情况 showProgressBar("正在提交中..."); var formValue = $form.serialize(); url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation"; fileToSave($form,null,null,url); }else{ top.Dialog.alert("请检查标红输入框!"); } }; //页面发布按钮 _this.is_Issue = function(){ is_skip = 2; $form = $('#editForm'); var valid = $form.validationEngine({returnIsValid: true});//表单验证 if($("#EARLY_WARNING_AREA_NAME_365").val()==""){ top.Dialog.alert("请选择预警范围!"); return ; } if(valid ){//修改 $('#classid').val(365); if(hasFile()){ var params = { classid : "365", FD_OBJECTID365 :$("#IS_LAST_ID_365").val(), IS_SEND_365 : "6" }; $.ajax({ url : $.pathname() + '/ws/crud/CRUDService/update/', type : 'post', timeout : 15000, data : params, dataType : 'json', success : function(data) { }, error : function(e) { $.messager.alert('系统提示信息', '访问服务失败!', 'error'); } }); $("#IS_SEND_365").val(6); $("#RELEASE_UNIT_365").val($("#WRITE_DEPT_365").attr("relValue")); }else{ top.Dialog.alert("附件不能为空!请选择并上传附件"); return; } //数据ID情况 showProgressBar("正在提交中..."); var formValue = $form.serialize(); url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation"; fileToSave($form,null,null,url); }else{ top.Dialog.alert("请检查标红输入框!"); } }; function fileToSave($form,listGrid,msg,url){ $("#EARLY_WARNING_AREA_ID_365").val($("#EARLY_WARNING_AREA_NAME_365").val()); $("#EARLY_WARNING_AREA_NAME_365").val($("#EARLY_WARNING_AREA_NAME_365_show").val());//预警范围 showProgressBar("正在提交中..."); //表单异步提交处理 $form.ajaxSubmit({ type: 'post', url:url, //表单提交成功后的回调 success: function(responseText, statusText, xhr, $form){ responseText = eval('('+responseText+')'); closeProgress(); top.Dialog.alert('保存成功!');//弹出提示 if(is_skip == 1){ $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/RelieveSendWarning.jsp?fd_id="+responseText.ObjectID); }else{ $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp"); } } }); } return { init : function() { $('#save').bind('click',function(){ _this.save(); }); $('#back').bind('click',function(){ $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp"); }); $("#is_Send").bind('click',function(){ $form = $('#editForm'); var valid = $form.validationEngine({returnIsValid: true});//表单验证 if($("#EARLY_WARNING_AREA_NAME_365").val()==""){ top.Dialog.alert("请选择预警范围(预警范围)!"); return ; } if(!valid){ top.Dialog.alert("请检查标红输入框!"); return ; } top.Dialog.confirm("是否要发送?|预警",function(){//点击确定fileDiv _this.is_Send(); },function(){//点击取消 $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp"); }); }); $("#is_Issue").bind('click',function(){ $form = $('#editForm'); var valid = $form.validationEngine({returnIsValid: true});//表单验证 if($("#EARLY_WARNING_AREA_NAME_365").val()==""){ top.Dialog.alert("请选择预警范围(预警范围)!"); return; } if(!valid){ top.Dialog.alert("请检查标红输入框!"); return; } top.Dialog.confirm("是否要发布?|预警",function(){//点击确定 _this.is_Issue(); },function(){//点击取消 }); }); } }; }(); $(function() { WarningRelieve.init(); });