46683884dd16ec881f7fee0833bf1426d415ad08.svn-base 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. *
  3. * @author
  4. * @date 2015/09/14
  5. */
  6. /***保存信息***/
  7. function saveAlertReport(validaFormId){
  8. var filetest = hasFile();
  9. if(!filetest){
  10. top.Dialog.alert("附件不能为空!");
  11. return;
  12. }
  13. $("#fileDiv").val();
  14. var valid=$(validaFormId).validationEngine({returnIsValid: true});
  15. if(!valid){
  16. top.Dialog.alert(CHECKREDBOX);
  17. }
  18. $form=$('#editForm');
  19. if(valid){
  20. //$("#OPER_TIME_398").val((allGetServerTime()).Format("yyyy-MM-dd hh:mm:ss"));
  21. var params = {classid : "360"};
  22. var formValue = $('#editForm').serialize();
  23. //myFileToSave($('#editForm'),null,null);
  24. var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
  25. $("body").eq(0).showLoading();
  26. $.request.add(url,formValue,function(data){
  27. $("body").eq(0).hideLoading();
  28. top.Dialog.alert(data.Msg.info);
  29. var url = "/nwyj/page/business/em/report/operation/Operation.jsp";
  30. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  31. });
  32. /*var url = $.pathname() + '/ws/uploadForm/FileUpDownService/fileUpLoad';
  33. if(fd_id!=undefined&&fd_id!=""){
  34. url = $.pathname() +"/ws/uploadForm/FileUpDownService/editlocation";
  35. }*/
  36. //myFileToSave($form,null,null,url);
  37. }
  38. }
  39. function myFileToSave($form,listGrid,msg,url){
  40. $("body").eq(0).showLoading();
  41. //表单异步提交处理
  42. $form.ajaxSubmit({
  43. type: 'post',
  44. url:url,
  45. //表单提交成功后的回调
  46. success: function(responseText, statusText, xhr, $form){
  47. $("body").eq(0).hideLoading();
  48. responseText = eval('('+responseText+')');
  49. closeProgress();
  50. if(msg!=undefined){
  51. if(responseText.info == 'success')
  52. top.Dialog.alert(msg+'成功!');//弹出提示
  53. else
  54. top.Dialog.alert(msg+'失败!');//弹出提示
  55. }else{
  56. if(responseText.info == 'success')
  57. top.Dialog.alert('保存成功!');//弹出提示
  58. else
  59. top.Dialog.alert('保存失败!');//弹出提示
  60. }
  61. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/report/operation/Operation.jsp");
  62. }
  63. });
  64. }
  65. function update() {
  66. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/report/operation/OperationAddEdit.jsp?fd_id=");
  67. };
  68. //返回主页面
  69. function goBack() {
  70. //获取iframe中的元素值
  71. var iframe =parent.document.getElementsByName("frmright")[0];
  72. iframe.src = "/nwyj/page/business/em/report/operation/Operation.jsp";
  73. }