123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- /**
- * 功能:
- *
- *
- * @author
- * @date 2015/09/21
- */
- WeatherAlertReceiveAddEdit = function() {
- /**定义变量**/
- var _this = this;
- /**私有方法**/
- /***新增信息***/
- _this.save = function(){
- var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo
- .getCorp_names();
- $("#WRITER_UNIT_NAME_369").val(getCorp_names);
- var connectId = $("#CONNECT_ID_369").val();
- if(connectId == undefined){
- $("#CONNECT_ID_369").val("");//关联ID
- }else if(connectId == ""){
- $("#CONNECT_ID_369").val(fd_id);//关联ID
- }
- $form = $('#editForm');
- var valid = $form.validationEngine({returnIsValid: true});
- if(!valid){
- top.Dialog.alert(CHECKREDBOX);
- }
- if(valid){
- var formValue = $form.serialize();
- //var url = $.pathname() +"/ws/uploadForm/FileUpDownService/fileUpLoad";
- var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
- //fileToSave($form,null,null,url);
- //显示loading条
- $("body").eq(0).showLoading();
- $.request.add(url,formValue,function(data){
- //隐藏loading条
- $("body").eq(0).hideLoading();
- top.Dialog.alert("保存成功");
- var url = "/nwyj/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveManager.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- });
- /*$.request.add(url,formValue,function(data){
- //隐藏loading条
- $("body").eq(0).hideLoading();
- top.Dialog.alert(data.Msg.info);
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveManager.jsp');
- });*/
- }
- };
- //解除上次预警
- _this.relieveLastWarning =function() {
- var url =$.pathname()+'/ws/EventService/EventService/changeStatus/';
- var params = {
- objectid : $("#LAST_ID_369").val(),
- classid :$("#classid").val()
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data){
-
- }
- });
- };
- //附件同步上传使用,异步时不使用该方法
- function fileToSave($form,listGrid,msg,url){
- //显示loading条
- $("body").eq(0).showLoading();
- //表单异步提交处理
- $form.ajaxSubmit({
- type: 'post',
- url:url,
- //表单提交成功后的回调
- success: function(responseText, statusText, xhr, $form){
- //隐藏loading
- $("body").eq(0).hideLoading();
- responseText = eval('('+responseText+')');
-
- if(msg!=undefined){
- if(responseText.info == 'success')
- top.Dialog.alert(msg+'成功!');//弹出提示
- else
- top.Dialog.alert(msg+'失败!');//弹出提示
- }else{
- if(responseText.info == 'success')
- top.Dialog.alert('保存成功!');//弹出提示
- else
- top.Dialog.alert('保存失败!');//弹出提示
- }
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveManager.jsp');
- }
- });
- }
- return {
- init : function() {
- //保存
- $('#save').bind('click',function(){
- var pageType1 = "";
- if(pageType == 0){
- pageType1 = "保存";
- }else if(pageType == 1){
- pageType1 = "调整";
- }else if(pageType == 2){
- pageType1 = "解除";
- }
- if($("#LAST_ID_369").val()){
- top.Dialog.confirm("是否确认"+pageType1+"当前预警通知单?", function() {
- _this.relieveLastWarning();
- _this.save();
- });
- }else{
- _this.save();
- }
- });
- //取消
- $('#cancel').bind('click',function(){if(fd_id.length>0){
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveAddEdit.jsp?fd_id='+fd_id);
- }else{
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveAddEdit.jsp?fd_id=');
- }
- });
- //返回
- $('#back').bind('click',function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/monitor/alertReceive/weather/WeatherAlertReceiveManager.jsp');
- });
- }
- };
- }();
- $(function() {
- WeatherAlertReceiveAddEdit.init();
-
- });
|