/** * 功能: * * * @author * @date 2015/09/14 */ EventAddEdit = function() { /**定义变量**/ var _this = this; /**私有方法**/ /***新增信息***/ _this.save = function(){ $('#DAILY_STATE_361').val('1'); $form = $('#editForm'); var valid = $form.validationEngine({returnIsValid: true}); if(!valid){ top.Dialog.alert(CHECKREDBOX); } if(valid){ $("body").eq(0).showLoading(); var formValue = $form.serialize(); var url = $.pathname() + '/ws/crud/CRUDService/create/'; if(fd_id!=undefined&&fd_id!=""){ url = $.pathname() +"/ws/crud/CRUDService/update/"; } $.request.add(url,formValue,function(data){ $("body").eq(0).hideLoading(); top.Dialog.alert(data.Msg.info); $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/event/EventManager.jsp"); }); } }; return { init : function() { $('#save').bind('click',function(){ _this.save(); }); $('#cancel').bind('click',function(){ /*$("#editForm")[0].reset(); $("#editForm select").resetValue(); $("#editForm .selectTree").resetValue();*/ if(fd_id.length>0) { //修改取消 $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/event/EventAddEdit.jsp?fd_id="+fd_id); } else { //新增取消 $("#editForm")[0].reset(); $("#editForm select").resetValue(); $("#editForm .selectTree").resetValue(); } }); $('#back').bind('click',function(){ $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/event/EventManager.jsp"); }); } }; }(); $(function() { EventAddEdit.init(); });