f63d33c21b1bf1923a2e1602379f02f4e94e8b90.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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">导出</el-button>
  18. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px"
  19. @click="searchExecl">查询</el-button>
  20. </div>
  21. </el-card>
  22. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  23. <form ref="formMain3" id="formMain3" target="frameMain3" :action="reportSrc" method="post">
  24. <input type="hidden" name="width" v-model="windowWidth">
  25. <input type="hidden" name="height" v-model="windowHeight">
  26. <input type="hidden" name="ids" v-model="ids">
  27. <input type="hidden" name="excelName" v-model="excelName">
  28. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  29. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  30. <input type="hidden" name="state" v-model="dcType">
  31. <input type="hidden" name="year" v-model="newYear">
  32. </form>
  33. <div style="width: 100%;height: 100%;" v-loading="loading">
  34. <iframe ref="frameMain3" id="frameMain3" name="frameMain3" src="" frameborder="0" width="100%"
  35. height="100%" style="overflow: auto"></iframe>
  36. </div>
  37. </el-card>
  38. </el-col>
  39. </el-row>
  40. </template>
  41. <script>
  42. import { dateFormat, getFirstDayOfMonth } from '@util/gw_date.js';
  43. export default {
  44. components: {
  45. // exportTreeListWithCheckBoxSk:exportTreeListWithCheckBoxSk,
  46. },
  47. props: ['ids', 'newYear'],
  48. data() {
  49. return {
  50. // ids:[],
  51. pid: '000',
  52. pidNodes: [],
  53. type: '001',
  54. dxdcMainHeight: window.innerHeight - 220,
  55. dxdcAsideHeight: window.innerHeight - 180,
  56. windowHeight: window.innerHeight - 160,
  57. windowWidth: window.innerWidth - 350,
  58. // reportSrc:'/JsReport/reportFiles/reportjsp/showReport_hzz.jsp?raq=sk03_qktj.raq',
  59. reportSrc: '/demo/reportJsp/showReport.jsp?rpx=/fujian/sk03.rpx',
  60. radioTable: 1,
  61. loading: false,
  62. leftCol: 4,
  63. rightCol: 20,
  64. excelName: '附表3-未排除重大安全隐患水库清单',
  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. },
  79. methods: {
  80. // 获取Excel数据
  81. searchExecl() {
  82. this.loading = true;
  83. // 使用form表单post提交,彻底解决参数值过长的问题
  84. this.$refs.formMain3.submit();
  85. // 使用_this
  86. let _this = this;
  87. this.$refs.frameMain3.onload = function () {
  88. _this.loading = false;
  89. };
  90. },
  91. // 导出Excel数据
  92. exportExecl() {
  93. v = window.frames["frameMain3"];
  94. // v.contentWindow.report1_saveAsExcel();
  95. v.report1_saveAsExcel();
  96. },
  97. },
  98. watch: {
  99. findTime(n, o) {
  100. if (!n) {
  101. this.sttm = "";
  102. this.ettm = "";
  103. } else {
  104. this.sttm = n[0];
  105. this.ettm = n[1];
  106. }
  107. }
  108. },
  109. activated() {
  110. this.searchExecl();
  111. }
  112. }
  113. </script>
  114. <style scoped>
  115. </style>