1adc501138ff2bb36be8c2fa5c6292f690f89ffc.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <el-row>
  3. <el-col :span="24">
  4. <el-card :body-style="{'padding-top':'10px'}">
  5. <div class="block">
  6. <el-button
  7. type="primary"
  8. icon="el-icon-download"
  9. style="float: right;margin:0 5px"
  10. @click="exportExecl"
  11. >导出</el-button>
  12. <el-button
  13. type="primary"
  14. icon="el-icon-search"
  15. style="float: right;margin:0 5px"
  16. @click="searchExecl"
  17. >查询</el-button>
  18. </div>
  19. </el-card>
  20. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  21. <form ref="formMain" id="formMain" target="frameMain" :action="reportSrc" method="post">
  22. <input type="hidden" name="width" v-model="windowWidth" />
  23. <input type="hidden" name="height" v-model="windowHeight" />
  24. <input type="hidden" name="ids" v-model="ids" />
  25. <input type="hidden" name="excelName" v-model="excelName" />
  26. <input type="hidden" name="dt" v-model="monthValue" />
  27. <input type="hidden" name="sttm" v-model="sttm" />
  28. <input type="hidden" name="ettm" v-model="ettm" />
  29. </form>
  30. <div style="width: 100%;height: 100%;" v-loading="loading">
  31. <iframe
  32. ref="frameMain"
  33. id="frameMain"
  34. name="frameMain"
  35. src
  36. frameborder="0"
  37. width="100%"
  38. height="100%"
  39. style="overflow: auto"
  40. ></iframe>
  41. </div>
  42. </el-card>
  43. </el-col>
  44. </el-row>
  45. </template>
  46. <script>
  47. import request from "@util/gw_ajax_request.js";
  48. import { dateFormat } from "@util/gw_date.js";
  49. export default {
  50. components: {},
  51. props: ["ids"],
  52. data() {
  53. return {
  54. pid: "000",
  55. pidNodes: [],
  56. type: "006",
  57. dxdcMainHeight: window.innerHeight - 200,
  58. dxdcAsideHeight: window.innerHeight - 180,
  59. windowHeight: window.innerHeight - 200,
  60. windowWidth: window.innerWidth - 350,
  61. reportSrc:
  62. "/demo/reportJsp/showReport.jsp?rpx=FFCS",
  63. radioTable: 1,
  64. loading: true,
  65. leftCol: 4,
  66. rightCol: 20,
  67. excelName: "非法采砂问题核查汇总表",
  68. monthValue: dateFormat(new Date(), "yyyy-MM"),
  69. sttm: "",
  70. ettm: "",
  71. treeWidth: 250
  72. };
  73. },
  74. mounted() {},
  75. computed: {
  76. userId: function() {
  77. return localStorage.getItem("userid")
  78. ? localStorage.getItem("userid")
  79. : "1098101939614724096";
  80. }
  81. },
  82. methods: {
  83. // 获取Excel数据
  84. searchExecl() {
  85. this.loading = true;
  86. // 使用form表单post提交,彻底解决参数值过长的问题
  87. this.$refs.formMain.submit();
  88. // 使用_this
  89. let _this = this;
  90. this.$refs.frameMain.onload = function() {
  91. _this.loading = false;
  92. };
  93. },
  94. // 导出Excel数据
  95. exportExecl() {
  96. v = window.frames["frameMain"];
  97. v.report1_saveAsExcel();
  98. }
  99. },
  100. watch: {
  101. monthValue(n, o) {
  102. if (n == null) {
  103. this.monthValue = "";
  104. }
  105. },
  106. sttm(n, o) {
  107. if (n == null) {
  108. this.sttm = "";
  109. }
  110. },
  111. ettm(n, o) {
  112. if (n == null) {
  113. this.ettm = "";
  114. }
  115. }
  116. },
  117. activated() {
  118. this.searchExecl();
  119. }
  120. };
  121. </script>
  122. <style scoped>
  123. </style>