Brak opisu

dailyPaperModal.html 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <style type="text/css">
  6. body{
  7. padding: 20px;
  8. }
  9. </style>
  10. </head>
  11. <body>
  12. <div id="main">
  13. <div>
  14. <div style="font-family: SimHei;display: flex;align-items: center;text-align: left;font-size: 16pt;font-weight: 700;"><span style="font-size: 20px;">◆</span>&emsp;网上舆情</div>
  15. <div id="yq"> </div>
  16. </div>
  17. <div>
  18. <div style="font-family: SimHei;display: flex;align-items: center;text-align: left;font-size: 16pt;font-weight: 700;"><span style="font-size: 20px;">◆</span>&emsp;交办舆情回复情况</div>
  19. <div id="jb"> </div>
  20. </div>
  21. <div style="text-align: center;font-size: 16px;margin-top: 35px;display: flex;justify-content: center;">
  22. <a id="printId">打印</a>
  23. &emsp;
  24. <a id="printDow">下载</a>
  25. </div>
  26. </div>
  27. <script src="../Script/Common/huayi.load.js"></script>
  28. <script src="../Script/Common/huayi.config.js"></script>
  29. <script src="../js/plugins/html2pdf/FileSaver.js"></script>
  30. <script src="../js/plugins/html2pdf/jquery.wordexport.js"></script>
  31. <script>
  32. const time = new URL(location.href).searchParams.get('time');
  33. fetch(`${huayi.config.callcenter_url}WorkOrder/DayReport?token=${$.cookie("token")}&stime=${time}`).then((res)=>{
  34. res.json().then(data=>{
  35. let arr1 = []; //网上舆情数据
  36. let arr2 = []; //交办舆情回复情况
  37. function time (time){
  38. if(time){
  39. let date = new Date(time);
  40. let y = date.getFullYear();
  41. let m = date.getMonth()+1 < 10 ? `0${date.getMonth()+1}` : date.getMonth()+1;
  42. let d = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate();
  43. return `${y}年${m}月${d}日`
  44. }else{
  45. return ''
  46. }
  47. }
  48. for(let v of data.ordertable){
  49. arr1.push(
  50. `
  51. <div style="margin-bottom:10pt;font-family: SimHei; font-size: 16pt; text-align: center;font-weight: 700;">${v.F_ComTitle}</div>
  52. <div style="font-family: 仿宋_GB2312;font-size: 16pt;text-indent: 24px;">( ${time(v.F_LimitTime)} ${v.F_Event} ) 作者“${v.F_CusName}”称,${v.F_ComContent} ( ${v.F_WorkOrderId}舆情提示函已转${v.maindeptname}核实处理 )。</div>
  53. `
  54. )
  55. }
  56. for(let v of data.bltable){
  57. arr2.push(
  58. `
  59. <div style="margin-bottom:10pt;font-family: SimHei; font-size: 16pt; text-align: center;font-weight: 700; ">关于${v.F_WorkOrderId}舆情提示函的回复</div>
  60. <div style="font-family: 仿宋_GB2312;font-size: 16pt;text-indent: 24px;">${v.F_Situation}</div>
  61. `
  62. )
  63. }
  64. for(let v of arr1){
  65. let div = document.createElement('div');
  66. div.innerHTML = v;
  67. div.style.marginBottom = '30px'
  68. document.getElementById('yq').append(div);
  69. }
  70. for(let v of arr2){
  71. let div = document.createElement('div');
  72. div.innerHTML = v;
  73. div.style.marginBottom = '30px'
  74. document.getElementById('jb').append(div);
  75. }
  76. })
  77. })
  78. window.onload = ()=>{
  79. document.getElementById('printId').onclick = (el)=>{
  80. document.getElementById('printId').style.display = 'none'
  81. document.getElementById('printDow').style.display = 'none'
  82. print();
  83. setTimeout(()=>{
  84. document.getElementById('printId').style.display = 'block'
  85. document.getElementById('printDow').style.display = 'block'
  86. },0)
  87. }
  88. document.getElementById('printDow').onclick = ()=>{
  89. document.getElementById('printId').style.display = 'none'
  90. document.getElementById('printDow').style.display = 'none'
  91. $("#main").wordExport('舆情日报推送');
  92. setTimeout(()=>{
  93. document.getElementById('printId').style.display = 'block'
  94. document.getElementById('printDow').style.display = 'block'
  95. },100)
  96. }
  97. }
  98. </script>
  99. </body>
  100. </html>