reportManageUpdateDdy.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. <script src="../../js/report.js"></script>
  8. </head>
  9. <body class="content">
  10. <div class="shadow-content" style="margin:1.5rem; text-align: center;">
  11. <p id = "reportTitle" style="margin:15px; font-size : 20px" contenteditable = "true"></p>
  12. <table id="reportTable" class="layui-table"></table>
  13. </div>
  14. <div class="layui-form-item box-button" style="margin-top:50px">
  15. <div class="layui-input-block">
  16. <button class="layui-btn" onclick = "saveReport()">保存</button>
  17. </div>
  18. </div>
  19. <script>
  20. var pageId = getQueryString("pageId");
  21. var reportId = getQueryString("reportId"); //报告id
  22. var fileName = chineseUrlDecodeURI(getQueryString("fileName")); //报告名称
  23. var dayInterval = chineseUrlDecodeURI(getQueryString("dayInterval")); //日区间
  24. var type = getQueryString("type"); //报告类型00:excel 01:word
  25. var typeId = getQueryString("typeId"); //报告类型id
  26. var cols = null;
  27. // excel
  28. if ("00" == type) {
  29. $("#reportTitle").html(fileName);
  30. $.request({
  31. action : 'ReportManageAction/reportInfDetail',
  32. data : {
  33. reportId : reportId
  34. },
  35. success : function(data) {
  36. var reportDataJsonStr = data.data.data;
  37. var excelList = eval('(' + reportDataJsonStr + ')');
  38. reportTable(excelList, typeId,true,true);
  39. },
  40. error : function(data2) {
  41. $.ErrorAlert(data2.MINErrorMessage);
  42. }
  43. });
  44. // word
  45. } else {
  46. }
  47. function saveReport() {
  48. // excel
  49. if ("00" == type) {
  50. var excelList = getTableToArray("reportTable");
  51. $.request({
  52. action : 'ReportManageAction/reportInfUpdate',
  53. data : {
  54. reportId : reportId,
  55. excelList : JSON.stringify(excelList),
  56. reportName : $("#reportTitle").html()
  57. },
  58. success : function(data) {
  59. $.SuccAlert("保存成功!");
  60. setTimeout(function(){
  61. deleteTabPageParent(pageId);
  62. }, 1500)
  63. },
  64. error : function(data2) {
  65. $.ErrorAlert(data2.MINErrorMessage);
  66. }
  67. });
  68. }
  69. }
  70. </script>
  71. </body>
  72. </html>