194dc76b727a5162bd764e103de8db5fecc01b89.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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","reportSrc","excelName"],
  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. radioTable: 1,
  61. loading: true,
  62. leftCol: 4,
  63. rightCol: 20,
  64. monthValue: dateFormat(new Date(), "yyyy-MM"),
  65. sttm: "",
  66. ettm: "",
  67. treeWidth: 250
  68. };
  69. },
  70. mounted() {},
  71. computed: {
  72. userId: function() {
  73. return localStorage.getItem("userid")
  74. ? localStorage.getItem("userid")
  75. : "1098101939614724096";
  76. }
  77. },
  78. methods: {
  79. // 获取Excel数据
  80. searchExecl() {
  81. this.loading = true;
  82. // 使用form表单post提交,彻底解决参数值过长的问题
  83. this.$refs.formMain.submit();
  84. // 使用_this
  85. let _this = this;
  86. this.$refs.frameMain.onload = function() {
  87. _this.loading = false;
  88. };
  89. },
  90. // 导出Excel数据
  91. exportExecl() {
  92. v = window.frames["frameMain"];
  93. v.report1_saveAsExcel();
  94. }
  95. },
  96. watch: {
  97. monthValue(n, o) {
  98. if (n == null) {
  99. this.monthValue = "";
  100. }
  101. },
  102. sttm(n, o) {
  103. if (n == null) {
  104. this.sttm = "";
  105. }
  106. },
  107. ettm(n, o) {
  108. if (n == null) {
  109. this.ettm = "";
  110. }
  111. }
  112. },
  113. activated() {
  114. this.searchExecl();
  115. }
  116. };
  117. </script>
  118. <style scoped>
  119. </style>