3c4761a441d814ac05b31858a93da460cdcc9c2d.svn-base 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /**
  2. * @class 修改交接班日志
  3. * 功能:修改交接班日志
  4. */
  5. $(function(){
  6. //修改表单信息,获取记录
  7. if((window.location.href).indexOf('?')>-1){
  8. var fd_id = (window.location.href).split('?')[1];
  9. $('#fileListLegend').css("display","block");
  10. $('#fileList').css("display","block");
  11. var url = $.pathname() + "/ws/crud/CRUDService/getDataById/";
  12. var params = {
  13. classid : '361',
  14. objectID : fd_id
  15. };
  16. $.ajax({
  17. url : url,
  18. type : 'post',
  19. timeout : 60000,
  20. data : params,
  21. dataType : 'json',
  22. success : function(data){
  23. $('#fillForm').ajaxWrite({data:data});
  24. var name = data.list[0].value;
  25. $('#fillForm input[name="classid"]').val('361');
  26. $("#AcceptUserTree").attr("selectedValue",name);
  27. },
  28. error : function(e){
  29. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  30. }
  31. });
  32. }
  33. });
  34. //查询部门,生成单选下拉框数据
  35. $(function(){
  36. var url = $.pathname() + '/ws/alert/AlertTransferService/queryDept';
  37. $.ajax({
  38. url : url,
  39. type : 'post',
  40. dataType : 'text',
  41. timeout : 60000,
  42. success : function(data){
  43. $("#DEPT_OBJECT_361").data("data",JSON.parse(data));
  44. $("#DEPT_OBJECT_361").render();
  45. },
  46. error : function(){
  47. $.messager.alert('部门获取失败');
  48. }
  49. });
  50. });
  51. //返回主页面
  52. function goBack() {
  53. //获取iframe中的元素值
  54. var iframe =parent.document.getElementsByName("frmright")[0];
  55. iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily.jsp";
  56. }
  57. //修改交接班日志
  58. function updateTransferDaily(){
  59. $("#DEPT_361").val($("#DEPT_OBJECT_361").attr("relText"));
  60. $form = $('#fillForm');
  61. //$("#classid").val("361");
  62. var params = "classid=361&"+$form.serialize();
  63. var url = $.pathname() + '/ws/crud/CRUDService/update';
  64. $.ajax({
  65. url : url,
  66. type : 'post',
  67. data : params,
  68. dataType : 'text',
  69. timeout : 60000,
  70. success : function(data){
  71. goBack();
  72. $.messager.alert("保存成功",null,null,null,1);
  73. },
  74. error : function(){
  75. $.messager.alert('操作失败');
  76. }
  77. });
  78. }
  79. //发布交接班日志
  80. function releaseTransferDaily(){
  81. $("#DEPT_361").val($("#DEPT_OBJECT_361").attr("relText"));
  82. $("#DAILY_STATE_361").val("发布");
  83. $form = $('#fillForm');
  84. var params = "classid=361&"+$form.serialize();
  85. var url = $.pathname() + '/ws/crud/CRUDService/update';
  86. $.ajax({
  87. url : url,
  88. type : 'post',
  89. data : params,
  90. dataType : 'text',
  91. timeout : 60000,
  92. success : function(data){
  93. goBack();
  94. $.messager.alert("发布成功",null,null,null,1);
  95. },
  96. error : function(){
  97. $.messager.alert('发布失败');
  98. }
  99. });
  100. }
  101. //表单验证(修改调用)
  102. function updateValidateForm(containerId) {
  103. var valid = $(containerId).validationEngine({returnIsValid: true});
  104. if(valid == true){
  105. updateTransferDaily();
  106. }else{
  107. top.Dialog.alert('不符合填写要求,请重新填写');
  108. }
  109. }
  110. //表单验证(发布调用)
  111. function releaseValidateForm(containerId) {
  112. var valid = $(containerId).validationEngine({returnIsValid: true});
  113. if(valid == true){
  114. releaseTransferDaily();
  115. }else{
  116. top.Dialog.alert('不符合填写要求,请重新填写');
  117. }
  118. }
  119. //表单重置
  120. function resetForm(){
  121. $("#fillForm")[0].reset();
  122. $("#fillForm .selectTree").resetValue();
  123. }