a17f7282a7783c9f33e92fe45c7cafd28a3debec.svn-base 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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
  8. v-model="findTime"
  9. type="daterange"
  10. value-format="yyyy-MM-dd"
  11. range-separator="至"
  12. start-placeholder="开始日期"
  13. end-placeholder="结束日期">
  14. </el-date-picker>
  15. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查状态</span>
  16. <el-select v-model="dcType" clearable placeholder="督查状态" multiple collapse-tags>
  17. <el-option label="未督查" value="0"></el-option>
  18. <el-option label="督查中" value="1"></el-option>
  19. <el-option label="已督查" value="2"></el-option>
  20. </el-select>
  21. <el-button type="primary" icon="el-icon-download"
  22. style="float: right;margin:0 5px"
  23. @click="exportExecl">导出</el-button>
  24. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  25. </div>
  26. </el-card>
  27. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  28. <form ref="formMain8" id="formMain8" target="frameMain8" :action="reportSrc" method="post">
  29. <input type="hidden" name="width" v-model="windowWidth">
  30. <input type="hidden" name="height" v-model="windowHeight">
  31. <input type="hidden" name="ids" v-model="ids">
  32. <input type="hidden" name="excelName" v-model="excelName">
  33. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  34. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  35. <input type="hidden" name="state" v-model="dcType.join(',')">
  36. <input type="hidden" name="year" v-model="newYear">
  37. <input type="hidden" name="adcode" v-model="currentRlcode">
  38. <input type="hidden" name="cwsCode" value="603">
  39. </form>
  40. <div style="width: 100%;height: 100%;" v-loading="loading">
  41. <iframe ref="frameMain8" id="frameMain8" name="frameMain8" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  42. </div>
  43. </el-card>
  44. </el-col>
  45. </el-row>
  46. </template>
  47. <script>
  48. import {dateFormat,getFirstDayOfMonth} from '../../utils/gw_date.js';
  49. export default {
  50. props: ['ids','newYear','table'],
  51. data() {
  52. return {
  53. pid:'000',
  54. pidNodes:[],
  55. type:'111',
  56. dxdcMainHeight: window.innerHeight-200,
  57. dxdcAsideHeight: window.innerHeight-180,
  58. windowHeight:window.innerHeight - 200,
  59. windowWidth:window.innerWidth - 350,
  60. reportSrc:'/demo/reportJsp/showReport.jsp?rpx=shengji/dc_shzhfy_1x1bg&scroll=yes',
  61. radioTable:1,
  62. loading:true,
  63. leftCol:4,
  64. rightCol:20,
  65. excelName:'山洪灾害防御统计报表',
  66. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  67. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  68. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  69. treeWidth: 250,
  70. dcType: ["0","1","2"],
  71. }
  72. },
  73. computed: {
  74. userId: function () {
  75. return localStorage.getItem("userid")
  76. ? localStorage.getItem("userid")
  77. : "1098101939614724096";
  78. },
  79. currentRlcode() {
  80. return localStorage.getItem('currentRlcode') ? localStorage.getItem('currentRlcode') : ''
  81. }
  82. },
  83. mounted() {
  84. this.$nextTick(()=>{
  85. this.searchExecl();
  86. })
  87. },
  88. methods: {
  89. // 获取Excel数据
  90. searchExecl(){
  91. this.loading = true;
  92. // 使用form表单post提交,彻底解决参数值过长的问题
  93. this.$refs.formMain8.submit();
  94. // 使用_this
  95. let _this = this;
  96. this.$refs.frameMain8.onload = function(){
  97. _this.loading = false;
  98. };
  99. },
  100. // 导出Excel数据
  101. exportExecl(){
  102. v = window.frames["frameMain8"];
  103. // v.contentWindow.report1_saveAsExcel();
  104. v.report1_saveAsExcel();
  105. },
  106. },
  107. watch:{
  108. findTime(n,o){
  109. if(!n){
  110. this.sttm = "";
  111. this.ettm = "";
  112. }else{
  113. this.sttm = n[0];
  114. this.ettm = n[1];
  115. }
  116. },
  117. table: {
  118. immediate: true, // immediate选项可以开启首次赋值监听
  119. async handler(newVal, oldVal) {
  120. this.$nextTick(()=>{
  121. this.searchExecl();
  122. })
  123. }
  124. },
  125. ids: {
  126. immediate: true, // immediate选项可以开启首次赋值监听
  127. async handler(newVal, oldVal) {
  128. this.$nextTick(()=>{
  129. this.searchExecl();
  130. })
  131. }
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped>
  137. </style>