reportManageDetailTqtd.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. <div id = "reportDiv" style = "margin : 20px; text-align : left;"></div>
  12. <div id = "reportFujian" style = "margin : 20px; text-align : right;">
  13. <a style = "color : red;" onclick = "downLoadFujian()">附件下载</a>
  14. </div>
  15. </div>
  16. <div class="layui-form-item box-button display" style="justify-content: flex-end;-webkit-justify-content: flex-end;">
  17. <div class="layui-input-block" id="goBack" onclick="goBack()">
  18. <button class="layui-btn">返回</button>
  19. </div>
  20. </div>
  21. <script>
  22. var pageId = getQueryString("pageId");
  23. var reportId = getQueryString("reportId"); //报告id
  24. var fileName = chineseUrlDecodeURI(getQueryString("fileName")); //报告名称
  25. var type = getQueryString("type"); //报告类型00:excel 01:word
  26. var typeId = getQueryString("typeId"); //报告类型id
  27. var reportType = getQueryString("reportType"); //报告类型
  28. var cols = null;
  29. $("#reportTable").hide();
  30. $("#reportTitle").html(fileName);
  31. $.request({
  32. action : 'ReportManageAction/reportInfDetail',
  33. data : {
  34. reportId : reportId
  35. },
  36. success : function(data) {
  37. var resJSON = eval('(' + data.data.data + ')');
  38. var reportDataJson = resJSON.dataMap;
  39. var reportDesc = resJSON.descStr;
  40. for(var key in reportDataJson){
  41. var replaceStr = "${" + key + "}";
  42. if (key == "totalCountTwice") {
  43. reportDesc = reportDesc.replace(/\${totalCountTwice}/g, reportDataJson[key]);
  44. }else if (key == "shejiNum") {
  45. reportDesc = reportDesc.replace(/\${shejiNum}/g, reportDataJson[key]);
  46. } else {
  47. reportDesc = reportDesc.replace(replaceStr, reportDataJson[key]);
  48. }
  49. }
  50. $("#reportDiv").html(reportDesc);
  51. var excelList = resJSON.excelList;
  52. // 周报
  53. if (reportType == "TQTDZB") {
  54. var tableHtml = '<table class="layui-table">';
  55. for (var i = 0; i < excelList.length; i ++) {
  56. tableHtml += '<tr>';
  57. var childList = excelList[i];
  58. for (var j = 0; j < childList.length; j ++) {
  59. tableHtml += '<td>' + childList[j] + '</td>';
  60. }
  61. tableHtml += '</tr>';
  62. }
  63. tableHtml += '</table>';
  64. $("#reportDiv").append(tableHtml);
  65. }
  66. // 日报
  67. if (reportType == "TQTDRB") {
  68. reportTable(excelList, typeId);
  69. }
  70. // 不是月报
  71. if (reportType != "TQTDYB") {
  72. $("#reportFujian").hide();
  73. }
  74. },
  75. error : function(data2) {
  76. $.ErrorAlert(data2.MINErrorMessage);
  77. }
  78. });
  79. function reportTable(excelList, typeId, isEdit) {
  80. var html = '<table class="layui-table" id = "tableId">';
  81. for (var i = 0; i < excelList.length; i ++) {
  82. html += '<tr>';
  83. var excelChildList = excelList[i];
  84. for (var j = 0; j < excelChildList.length; j ++) {
  85. // 合计列增加穿透
  86. if ((j == excelChildList.length - 1)) {
  87. // 台区停电次数
  88. if (i == 2) {
  89. html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd0()" title = "查看详情">' + excelChildList[j] + '</td>';
  90. } else if (i == 3) {
  91. html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd4()" title = "查看详情">' + excelChildList[j] + '</td>';
  92. // 2个月停电3次及以上台区
  93. } else if (i == 6) {
  94. html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd1()" title = "查看详情">' + excelChildList[j] + '</td>';
  95. // 2个月停电3次及以上台区且昨日停电
  96. } else if (i == 7) {
  97. html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd2()" title = "查看详情">' + excelChildList[j] + '</td>';
  98. } else if (i == 8) {
  99. html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd3()" title = "查看详情">' + excelChildList[j] + '</td>';
  100. } else if (i == 9) {
  101. html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd5()" title = "查看详情">' + excelChildList[j] + '</td>';
  102. } else {
  103. html += '<td>' + excelChildList[j] + '</td>';
  104. }
  105. } else {
  106. html += '<td>' + excelChildList[j] + '</td>';
  107. }
  108. }
  109. html += '</tr>';
  110. }
  111. html += '</table>';
  112. $("#reportDiv").append(html);
  113. }
  114. // 台区次数穿透
  115. function tqtd0(){
  116. var openPageId = pageId + "-01";
  117. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD01", '', pageId, null);
  118. }
  119. // 2个月停电3次及以上台区穿透
  120. function tqtd1(){
  121. var openPageId = pageId + "-02";
  122. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD02", '', pageId, null);
  123. }
  124. // month个月停电count次及以上台区且昨日停电穿透
  125. function tqtd2(){
  126. var openPageId = pageId + "-03";
  127. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD03", '', pageId, null);
  128. }
  129. // 2个月停电2次台区且昨日停电穿透
  130. function tqtd3(){
  131. var openPageId = pageId + "-04";
  132. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD04", '', pageId, null);
  133. }
  134. function tqtd4(){
  135. var openPageId = pageId + "-05";
  136. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD05", '', pageId, null);
  137. }
  138. // 2个月停电1次台区且昨日停电穿透
  139. function tqtd5(){
  140. var openPageId = pageId + "-06";
  141. openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD06", '', pageId, null);
  142. }
  143. function downLoadFujian() {
  144. var data = {reportId : reportId};
  145. exportExcel("../../TQTDReportAction/reportInfFujian",data);
  146. }
  147. function goBack() {
  148. deleteTabPageParent(pageId);
  149. }
  150. </script>
  151. </body>
  152. </html>