5f1581815277a615dfa4757d42ee6fdcb2b7b280.svn-base 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * 功能:
  3. *
  4. *
  5. * @author
  6. * @date 2015/09/14
  7. */
  8. EventAddEdit = function() {
  9. /**定义变量**/
  10. var _this = this;
  11. /**私有方法**/
  12. /***新增信息***/
  13. _this.save = function(){
  14. $('#DAILY_STATE_361').val('1');
  15. $form = $('#editForm');
  16. var valid = $form.validationEngine({returnIsValid: true});
  17. if(!valid){
  18. top.Dialog.alert(CHECKREDBOX);
  19. }
  20. if(valid){
  21. $("body").eq(0).showLoading();
  22. var formValue = $form.serialize();
  23. var url = $.pathname() + '/ws/crud/CRUDService/create/';
  24. if(fd_id!=undefined&&fd_id!=""){
  25. url = $.pathname() +"/ws/crud/CRUDService/update/";
  26. }
  27. $.request.add(url,formValue,function(data){
  28. $("body").eq(0).hideLoading();
  29. top.Dialog.alert(data.Msg.info);
  30. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/event/EventManager.jsp");
  31. });
  32. }
  33. };
  34. return {
  35. init : function() {
  36. $('#save').bind('click',function(){
  37. _this.save();
  38. });
  39. $('#cancel').bind('click',function(){
  40. /*$("#editForm")[0].reset();
  41. $("#editForm select").resetValue();
  42. $("#editForm .selectTree").resetValue();*/
  43. if(fd_id.length>0) {
  44. //修改取消
  45. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/event/EventAddEdit.jsp?fd_id="+fd_id);
  46. } else {
  47. //新增取消
  48. $("#editForm")[0].reset();
  49. $("#editForm select").resetValue();
  50. $("#editForm .selectTree").resetValue();
  51. }
  52. });
  53. $('#back').bind('click',function(){
  54. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/event/EventManager.jsp");
  55. });
  56. }
  57. };
  58. }();
  59. $(function() {
  60. EventAddEdit.init();
  61. });