ProcessReportResult.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div>
  3. <div
  4. v-if="processReportResult.processResult != undefined"
  5. class="form-group"
  6. >
  7. <textarea
  8. v-if="isTextAreaShowProcessResult"
  9. class="processResult-textarea"
  10. rows="10"
  11. style="width:100%"
  12. :value="processReportResult.processResult.result"
  13. />
  14. <div v-else>
  15. <h5
  16. class="control-label"
  17. style="white-space: pre-line;"
  18. >
  19. 1.{{ processReportResult.processResult.result }}
  20. </h5>
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <div
  25. v-if="processReportResult.processResult != undefined && pdfOnly != true"
  26. class="form-group"
  27. >
  28. <a
  29. v-if="processReportResult.processResult.modelData&&processReportResult.processResult.modelData.data"
  30. target="_blank"
  31. role="button"
  32. class="btn btn-info"
  33. >
  34. Excel报表
  35. </a>
  36. </div>
  37. <template
  38. v-for="(reportResult, index) in processReportResult.reportResults"
  39. :key="'reportResult' + index"
  40. >
  41. <div
  42. v-if="processReportResult.reportResults != undefined"
  43. id="pr.id"
  44. class="form-group"
  45. >
  46. <h3 class="control-label">
  47. {{ index + 1 + (processReportResult.processResult == undefined ? 0 : 1) }}.{{ reportResult.reportName }}
  48. </h3>
  49. <div>
  50. <button
  51. v-if="reportResult.isSuccess && pdfOnly != true"
  52. class="btn btn-success"
  53. @click="reportDownload(reportResult.excelDownLoadUrl, reportResult.reportDefinitionType)"
  54. >
  55. Excel报表
  56. </button>
  57. <button
  58. v-if="reportResult.isSuccess && excelOnly != true"
  59. class="btn btn-success"
  60. @click="reportDownload(reportResult.pdfDownLoadUrl, reportResult.reportDefinitionType)"
  61. >
  62. PDF报表
  63. </button>
  64. <span
  65. v-else
  66. class="control-label label-danger"
  67. >生成失败</span>
  68. </div>
  69. </div>
  70. </template>
  71. </div>
  72. <!--<ProcessReportArchive :processReportResult="processReportResult"></ProcessReportArchive>-->
  73. </div>
  74. </template>
  75. <script>
  76. import Common from '../../common/Common.js';
  77. // import ProcessReportArchive from './ProcessReportArchive.vue';
  78. import DownloadService from '../../common/DownloadService.js';
  79. export default {
  80. name: 'ProcessReportResult',
  81. components: {
  82. // ProcessReportArchive,
  83. },
  84. props: {
  85. 'processReportResult': {
  86. type: Object,
  87. default: null,
  88. }, 'pdfOnly': {
  89. type: Boolean,
  90. default: false,
  91. }, 'excelOnly': {
  92. type: Boolean,
  93. default: false,
  94. },
  95. },
  96. data: function () {
  97. return {
  98. };
  99. },
  100. computed: {
  101. // 是否文本区域显示流程结果
  102. isTextAreaShowProcessResult: function () {
  103. var result = this.processReportResult.processResult.result;
  104. if (result != undefined && result.length > 100) {
  105. return true;
  106. } else {
  107. return false;
  108. }
  109. },
  110. },
  111. mounted: function () {
  112. },
  113. methods: {
  114. /**
  115. * 下载报表
  116. * @param {Object} fileName
  117. * @author GuoZhiBo 20200410
  118. */
  119. reportDownload: function (fileName, reportDefinitionType) {
  120. if (reportDefinitionType == 'UReport2') {
  121. window.open(Common.getRootPath() + fileName);
  122. } else {
  123. DownloadService.reportDownload(fileName);
  124. }
  125. },
  126. },
  127. };
  128. </script>