d4707ae3594d3adcff1118349c069aadcafe4dd0.svn-base 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. var su = null;
  2. var fd_id = null;
  3. var re_id = null;
  4. var role_ids = null;
  5. $(function(){
  6. su = new SearchUtil();
  7. fd_id = su.resolveUrl().fd_id;
  8. re_id = su.resolveUrl().RESCUE_ID;
  9. role_ids = su.resolveUrl().role_id;
  10. if(role_ids.indexOf("R002105430335")>-1){//指挥看板操作员权限控制
  11. $("#caozuo").show();
  12. }
  13. if(su.resolveUrl().IS_PLAN=="0"){
  14. $(".describe").addClass("plan_td");
  15. }else{
  16. $(".describe").addClass("reality_td");
  17. };
  18. $("#RESCUE_ID_315").val(su.resolveUrl().RESCUE_ID);
  19. $("#IS_PLAN_315").val(su.resolveUrl().IS_PLAN);
  20. $("#CORRESPONDING_DATE_315").val(su.resolveUrl().CORRESPONDING_DATE);
  21. $("#INPUT_USER_ID_315").val(su.resolveUrl().user_id);
  22. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  23. var data = su.getJsonData(url, { classid : '314', objectID : re_id });
  24. $("#editForm").ajaxWrite({data:data});
  25. $("#PLAY_DELTA_T").html(su.DateDiff(data.PLAY_START_TIME_314, data.PLAY_END_TIME_314));
  26. $("#REALITY_DELTA_T").html(su.DateDiff(data.REALITY_START_TIME_314, data.REALITY_END_TIME_314));
  27. if(su.isLegitimate(fd_id)){
  28. $("#send_mes").html("修改");
  29. $("#del_mes").removeClass("hidden_yes");
  30. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  31. var data = su.getJsonData(url, { classid : '315', objectID : fd_id });
  32. $("#editInfoForm").ajaxWrite({data:data});
  33. $('input[name="classid"]').val('315');
  34. }else{//新增
  35. };
  36. $("#COMP_ID_314_SHOW").html(su.resolveUrl().dept_name);
  37. $("#INPUT_USER_ID_314_SHOW").html(su.resolveUrl().real_name);
  38. });
  39. $(function(){
  40. $("#send_mes").on("click",send_mes);
  41. $("#del_mes").on("click",del_mes);
  42. });
  43. function send_mes(){
  44. $form = $('#editInfoForm');
  45. var constr = $.trim($("#RESCUE_MESSAGE_315").val());
  46. if(!constr){
  47. top.Dialog.alert("备注内容不能为空!");
  48. return ;
  49. };
  50. var formValue = $form.serialize();
  51. var url = $.pathname() + '/ws/crud/CRUDService/create/';
  52. if(su.isLegitimate(fd_id)){
  53. url = $.pathname() +'/ws/crud/CRUDService/update/';
  54. };
  55. $.request.add(url,formValue,function(data){
  56. if(data.Msg.sucsess){
  57. url = '/nwyj/ws/icingZmap/IcingZmapService/loadRefreshResource' ;
  58. su.getJsonData(url,null);
  59. top.Dialog.close();
  60. }else{
  61. top.Dialog.alert(data.Msg.info);
  62. };
  63. });
  64. };
  65. /**
  66. * 重置
  67. */
  68. function reset_mes(){
  69. if(su.isLegitimate(fd_id)){
  70. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  71. var data = su.getJsonData(url, { classid : '314', objectID : fd_id });
  72. $("#RESCUE_COMP_ID_314").val(data.RESCUE_COMP_ID_314);
  73. $("#show_RESCUE_COMP_ID_314").val(data.RESCUE_COMP_ID_314_SHOW);
  74. $("#editForm").ajaxWrite({data:data});
  75. $('input[name="classid"]').val('314');
  76. }else{//新增
  77. $("#RESCUE_COMP_ID_314").val("");
  78. $("#IS_OVER").val("");
  79. $("input:radio[name=IS_OVER_314]").eq(0).attr("checked",true);
  80. $("#CONSTRUCTION_NAME_314").val("");
  81. $("#CONSTRUCTION_COMP_314").val("");
  82. $("#PLAY_START_TIME_314").val("");
  83. $("#PLAY_END_TIME_314").val("");
  84. $("#REALITY_START_TIME_314").val("");
  85. $("#REALITY_END_TIME_314").val("");
  86. };
  87. };
  88. /**
  89. * 删除
  90. */
  91. function del_mes(){
  92. var url = $.pathname() + '/ws/crud/CRUDService/delete/';
  93. var data = su.getJsonData(url, { classid : '315', objectIDs : fd_id });
  94. if(data.Msg.sucsess){
  95. url = '/nwyj/ws/icingZmap/IcingZmapService/loadRefreshResource' ;
  96. su.getJsonData(url,null);
  97. top.Dialog.close();
  98. };
  99. };