265c1947ef08ca3c0bc36b2b9968e458f7759198.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. var corpId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  3. var dbtypesc=[];
  4. var dbtypeaj=[];
  5. function createSpecialTable(){
  6. $("#specialReport").empty();
  7. $(".dateSel").hide();
  8. // $("body").eq(0).showLoading();
  9. $.ajax({
  10. url : $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getSpecialReport",
  11. type : 'post',
  12. async : false,
  13. data : {"comp_id":corpId,"role_id":role_id},
  14. dataType : 'json',
  15. success : function(data){
  16. if(data.length==0){
  17. $("#specialReport").append("<span class='spantip'>没有要填写的报表数据</span>");
  18. $("body").eq(0).hideLoading();
  19. return;
  20. }
  21. var div = $("<div style='width : 99.2%'><div id='sr_div'></div></div>");
  22. $("#specialReport").append(div);
  23. for (var i = 0; i < data.length; i++) {
  24. var table = $("<table class='table' id='table"+i+"'></table>");
  25. var th = $("<thead></thead>");
  26. var id = data[i].id;
  27. //表头
  28. th.append($("<tr><td class='cententCenter' colspan='4'><div class='TitleHeads blue_color'>"+data[i].name+"</div></td></tr>"));
  29. th.append($("<tr><td class='cententCenter td_head' style='width:14.5%'>填报角色</td><td class='cententCenter td_head' style='width:50%'>报表类型</td><td class='cententCenter td_head' style='width:20%'>填报时间</td><td class='cententCenter td_head' style='width:14.7%'>操作</td></tr>"));
  30. table.append(th);
  31. div.append(table);
  32. //报表类型
  33. var report_data = data[i].report_info;
  34. for(var j=0;j<report_data.length;j++){
  35. var obj = report_data[j];
  36. var num = obj.num;
  37. var role_id = obj.role_id;
  38. var role_name = obj.role_name;
  39. var tr = $("<tr class='"+role_id+"'></tr>");
  40. if($("#table"+i+" ."+role_id).hasClass(role_id)){
  41. $("#table"+i+" ."+role_id).find("td").eq(0).attr("rowspan",num);
  42. }else{
  43. var td = $("<td rowspan='"+num+"' class='cententCenter td_border1' >"+role_name+"</td>");
  44. tr.append(td);
  45. }
  46. var td2 = $("<td class='cententCenter td_border1'>"+obj.report_name+"</td>");
  47. var td3 = $("<td class='cententCenter td_border1'>当天任意时间点</td>");
  48. var td4 = $("<td class='cententCenter td_border1'></td>");
  49. var tb_input = $("<span class='input1'>填报</span>");
  50. tb_input.data("data-id",id);
  51. tb_input.data("data-type",obj.report_type);
  52. tb_input.data("data-role",role_id);
  53. tb_input.data("data-scheduleName",data[i].name);
  54. tb_input.data("data_early_warning",data[i].alertwarning);
  55. if(role_id=="R002105430211"){
  56. dbtypesc.push(obj.report_type);
  57. }else{
  58. dbtypeaj.push(obj.report_type);
  59. }
  60. tb_input.on("click",sr_click);
  61. td4.append(tb_input);
  62. tr.append(td2).append(td3).append(td4);
  63. table.append(tr);
  64. }
  65. // div.append(table);
  66. }
  67. $("body").eq(0).hideLoading();
  68. },
  69. error : function(e) {
  70. $.messager.alert('查询行失败!', '访问服务失败!', 'error');
  71. }
  72. });
  73. }
  74. /**
  75. * 点击新增报表的填报事件
  76. */
  77. function sr_click(){
  78. var $self = $(this);
  79. var task_id = $self.data("data-id");
  80. var report_type = $self.data("data-type");
  81. var role_id = $self.data("data-role");
  82. var dbtype = [];
  83. if(role_id=="R002105430211"){
  84. dbtype = dbtypesc;
  85. }else{
  86. dbtype = dbtypeaj;
  87. }
  88. var scheduleName =$self.data("data-scheduleName");
  89. var affair = $self.data("data_early_warning").split("-")[0];
  90. if(report_type=="115"){
  91. top.document.getElementById("frmright").setAttribute("src", "/nwyj/scripts/business/em/response/report/specialReport_AddEdit.html?"+report_type+"?"+task_id+"?"+dbtype+"?"+affair+"?"+scheduleName);
  92. }else{
  93. top.document.getElementById("frmright").setAttribute("src", "/nwyj/scripts/business/em/response/report/specialReport_Write.html?"+report_type+"?"+task_id+"?"+dbtype+"?"+affair+"?"+scheduleName);
  94. }
  95. }