7137dfbfaf89b751457600df24467d5ce07a00a5.svn-base 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <el-row>
  3. <el-col :span="24">
  4. <el-card :body-style="{'padding-top':'10px'}">
  5. <div class="block">
  6. <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  7. <el-date-picker v-model="findTime" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
  8. start-placeholder="开始日期" end-placeholder="结束日期">
  9. </el-date-picker>
  10. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查状态</span>
  11. <el-select v-model="dcType" clearable placeholder="督查状态">
  12. <el-option label="未督查" value="0"></el-option>
  13. <el-option label="督查中" value="1"></el-option>
  14. <el-option label="已督查" value="2"></el-option>
  15. </el-select>
  16. <el-button type="primary" icon="el-icon-download" style="float: right;margin:0 5px"
  17. @click="exportExecl">导出
  18. </el-button>
  19. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px"
  20. @click="searchExecl">查询
  21. </el-button>
  22. </div>
  23. </el-card>
  24. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  25. <form ref="formMain4" id="formMain4" target="frameMain4" :action="reportSrc" method="post">
  26. <input type="hidden" name="width" v-model="windowWidth">
  27. <input type="hidden" name="height" v-model="windowHeight">
  28. <input type="hidden" name="ids" v-model="ids">
  29. <input type="hidden" name="excelName" v-model="excelName">
  30. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  31. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  32. <input type="hidden" name="state" v-model="dcType">
  33. <input type="hidden" name="year" v-model="newYear">
  34. <input type="hidden" id="persId" name="persId" v-model="userId">
  35. <input type="hidden" id="orgId" name="orgId" v-model="orgId">
  36. <input type="hidden" id="orgName" name="orgName" v-model="orgName">
  37. </form>
  38. <div style="width: 100%;height: 100%;" v-loading="loading">
  39. <iframe ref="frameMain4" id="frameMain4" name="frameMain4" src="" frameborder="0" width="100%"
  40. height="100%" style="overflow: auto"></iframe>
  41. </div>
  42. </el-card>
  43. </el-col>
  44. </el-row>
  45. </template>
  46. <script>
  47. import { dateFormat, getFirstDayOfMonth } from '@util/gw_date.js';
  48. export default {
  49. props: ['ids', 'newYear'],
  50. data() {
  51. return {
  52. pid: '000',
  53. pidNodes: [],
  54. type: '001',
  55. dxdcMainHeight: window.innerHeight - 230,
  56. dxdcAsideHeight: window.innerHeight - 180,
  57. windowHeight: window.innerHeight - 200,
  58. windowWidth: window.innerWidth - 350,
  59. reportSrc: '/demo/reportJsp/showReport.jsp?rpx=dc_sksdz_04.rpx',
  60. radioTable: 1,
  61. loading: true,
  62. leftCol: 4,
  63. rightCol: 20,
  64. excelName: '附表4-汛限水位执行违规问题统计表',
  65. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  66. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  67. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  68. treeWidth: 250,
  69. dcType: '0',
  70. }
  71. },
  72. computed: {
  73. userId: function () {
  74. return localStorage.getItem("userid")
  75. ? localStorage.getItem("userid")
  76. : "1098101939614724096";
  77. },
  78. orgId: function () {
  79. return localStorage.getItem("orgId")
  80. ? localStorage.getItem("orgId")
  81. : "";
  82. },
  83. orgName: function () {
  84. return localStorage.getItem("orgNm")
  85. ? localStorage.getItem("orgNm")
  86. : "";
  87. }
  88. },
  89. methods: {
  90. // 获取Excel数据
  91. searchExecl() {
  92. this.loading = true;
  93. // 使用form表单post提交,彻底解决参数值过长的问题
  94. this.$refs.formMain4.submit();
  95. // 使用_this
  96. let _this = this;
  97. this.$refs.frameMain4.onload = function () {
  98. _this.loading = false;
  99. };
  100. },
  101. // 导出Excel数据
  102. exportExecl() {
  103. v = window.frames["frameMain4"];
  104. // v.contentWindow.report1_saveAsExcel();
  105. v.report1_saveAsExcel();
  106. },
  107. },
  108. watch: {
  109. findTime(n, o) {
  110. if (!n) {
  111. this.sttm = "";
  112. this.ettm = "";
  113. } else {
  114. this.sttm = n[0];
  115. this.ettm = n[1];
  116. }
  117. }
  118. },
  119. activated() {
  120. this.searchExecl();
  121. }
  122. }
  123. </script>
  124. <style scoped>
  125. </style>