reportManageDetailTqtd.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>报告详情</title>
  6. <script src="../../js/min-loader-next.js"></script>
  7. </head>
  8. <body class="content">
  9. <div class="shadow-content" style="margin:1.5rem; text-align: center;">
  10. <p id = "reportTitle" style="margin:15px; font-size : 20px"></p>
  11. <table id="reportTable" class="layui-table"></table>
  12. <div id = "reportDiv" style = "margin : 20px; text-align : left;"></div>
  13. <div id = "reportFujian" style = "margin : 20px; text-align : right;">
  14. <a style = "color : red;" onclick = "downLoadFujian()">附件下载</a>
  15. </div>
  16. </div>
  17. <script>
  18. var pageId = getQueryString("pageId");
  19. var reportId = getQueryString("reportId"); //报告id
  20. var fileName = chineseUrlDecodeURI(getQueryString("fileName")); //报告名称
  21. var type = getQueryString("type"); //报告类型00:excel 01:word
  22. var typeId = getQueryString("typeId"); //报告类型id
  23. var cols = null;
  24. // excel
  25. if ("00" == type) {
  26. $("#reportDiv").hide();
  27. $("#reportFujian").hide();
  28. $("#reportTitle").html(fileName);
  29. $.request({
  30. action : 'ReportManageAction/reportInfDetail',
  31. data : {
  32. reportId : reportId
  33. },
  34. success : function(data) {
  35. var reportDataJsonStr = data.data.data;
  36. var excelList = eval('(' + reportDataJsonStr + ')');
  37. reportTable(excelList, typeId);
  38. },
  39. error : function(data2) {
  40. $.ErrorAlert(data2.MINErrorMessage);
  41. }
  42. });
  43. // word
  44. } else {
  45. $("#reportTable").hide();
  46. $("#reportTitle").html(fileName);
  47. $.request({
  48. action : 'ReportManageAction/reportInfDetail',
  49. data : {
  50. reportId : reportId
  51. },
  52. success : function(data) {
  53. var reportDataJsonStr = data.data.data;
  54. var reportDataJson = eval('(' + reportDataJsonStr + ')');
  55. var reportDesc = "<p>(1)台区停电总体情况${month}月份,台区累计停电${benyueCount}台次,同比${tongbi},环比${huanbi},涉及${shejiNum}个台区,${shejiDesc}</p>"
  56. + "<p>(2)台区停电时长情况${totalCount}个台区累计停电时间${benyueTime}小时,平均停电时长${pingjunHour}小时,同比${tongbiPingjunHour},环比${huanbiPingjunHour}。台区平均停电时间为${areaPingjunDesc}从同比情况看,${tbAreaPingjunDesc}</p>"
  57. + "<p>台区停电时长在${fenduanDesc}停电时长最长的为${zuichangTaiQu},停电${zuichangTaiQuTime}小时,其次是${qiciTaiQu},停电时长${qiciTaiQuTime}小时。</p>"
  58. + "<p>(3)台区重复停电情况两个月内停电2次及以上的台变${totalCountTwice}个,其中${totalCountTwiceDesc}${totalCountTwice}个重复停电台变中,${countMapTwiceDesc}两个月内停电3次及以上的台变${totalCountthiple}个。</p>";
  59. for(var key in reportDataJson){
  60. var replaceStr = "${" + key + "}";
  61. if (key == "totalCountTwice") {
  62. reportDesc = reportDesc.replace(/\${totalCountTwice}/g, reportDataJson[key]);
  63. } else {
  64. reportDesc = reportDesc.replace(replaceStr, reportDataJson[key]);
  65. }
  66. }
  67. $("#reportDiv").html(reportDesc);
  68. },
  69. error : function(data2) {
  70. $.ErrorAlert(data2.MINErrorMessage);
  71. }
  72. });
  73. }
  74. function reportTable(excelList, typeId, isEdit) {
  75. var html = '';
  76. for (var i = 0; i < excelList.length; i ++) {
  77. html += '<tr>';
  78. var excelChildList = excelList[i];
  79. for (var j = 0; j < excelChildList.length; j ++) {
  80. // 合计列增加穿透
  81. if ((j == excelChildList.length - 1)) {
  82. // 台区停电次数
  83. if (i == 2) {
  84. html += '<td style="cursor: pointer" onclick="tqtd0()">' + excelChildList[j] + '</td>';
  85. // 2个月停电3次及以上台区
  86. } else if (i == 5) {
  87. html += '<td style="cursor: pointer" onclick="tqtd1()">' + excelChildList[j] + '</td>';
  88. // 2个月停电3次及以上台区且昨日停电
  89. } else if (i == 6) {
  90. html += '<td style="cursor: pointer" onclick="tqtd2()">' + excelChildList[j] + '</td>';
  91. } else if (i == 7) {
  92. html += '<td style="cursor: pointer" onclick="tqtd3()">' + excelChildList[j] + '</td>';
  93. } else {
  94. html += '<td>' + excelChildList[j] + '</td>';
  95. }
  96. } else {
  97. html += '<td>' + excelChildList[j] + '</td>';
  98. }
  99. }
  100. html += '</tr>';
  101. }
  102. $("#reportTable").html(html);
  103. }
  104. // 台区次数穿透
  105. function tqtd0(){
  106. var openPageId = pageId + "-01";
  107. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD01", '', pageId, null);
  108. }
  109. // 2个月停电3次及以上台区穿透
  110. function tqtd1(){
  111. var openPageId = pageId + "-02";
  112. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD02", '', pageId, null);
  113. }
  114. // month个月停电count次及以上台区且昨日停电穿透
  115. function tqtd2(){
  116. var openPageId = pageId + "-03";
  117. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD03", '', pageId, null);
  118. }
  119. // 2个月停电1次及以上台区且昨日停电穿透
  120. function tqtd3(){
  121. var openPageId = pageId + "-04";
  122. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD04", '', pageId, null);
  123. }
  124. function downLoadFujian() {
  125. var data = {reportId : reportId};
  126. exportExcel("../../TQTDReportAction/reportInfFujian",data);
  127. }
  128. </script>
  129. </body>
  130. </html>