8f629ee8e9ef8af04ac03dcac1aea02a31fc4741.svn-base 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <el-row>
  3. <el-col :span="leftCol" ref="elw">
  4. <el-card :body-style="{'padding':'0'}">
  5. <export-tree-list-fs
  6. :pid="pid"
  7. :type="type"
  8. :pidNodes="pidNodes"
  9. :level="level"
  10. :height="dxdcAsideHeight"
  11. :width="treeWidth"
  12. @provTreeSelectChange="provTreeSelectChange"
  13. ></export-tree-list-fs>
  14. </el-card>
  15. </el-col>
  16. <el-col :span="rightCol">
  17. <el-card :body-style="{'padding-top':'10px'}">
  18. <div class="block">
  19. <el-button type="primary" icon="el-icon-download"
  20. style="float: right;margin:0 5px"
  21. @click="exportExecl">导出</el-button>
  22. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  23. </div>
  24. </el-card>
  25. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  26. <form ref="formMain3" id="formMain3" target="frameMain3" :action="reportSrc" method="post">
  27. <input type="hidden" name="width" v-model="windowWidth">
  28. <input type="hidden" name="height" v-model="windowHeight">
  29. <input type="hidden" name="excelName" v-model="excelName">
  30. <input type="hidden" name="id" v-model="id" id="id">
  31. <input type="hidden" name="adcode" v-model="adcode" id="adcode">
  32. <input type="hidden" name="objId" ref="objId" id="objId">
  33. </form>
  34. <div style="width: 100%;height: 100%;" v-loading="loading">
  35. <iframe ref="frameMain3" id="frameMain3" name="frameMain3" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  36. </div>
  37. </el-card>
  38. </el-col>
  39. </el-row>
  40. </template>
  41. <script>
  42. import request from '@util/gw_ajax_request.js';
  43. import exportTreeListFs from '../exportTreeList_fs'
  44. import {dateFormat} from '@util/gw_date.js'
  45. import globalVariable from '@api/globalVariable';
  46. export default {
  47. components: {
  48. exportTreeListFs:exportTreeListFs,
  49. },
  50. data() {
  51. return {
  52. ids:[],
  53. id:'',
  54. pid:'000',
  55. pidNodes:[],
  56. type:'001',
  57. level:'3',
  58. dxdcMainHeight: window.innerHeight-180,
  59. dxdcAsideHeight: window.innerHeight-130,
  60. windowHeight:window.innerHeight - 160,
  61. windowWidth:window.innerWidth - 250,
  62. reportSrc:'/demo/reportJsp/showReport.jsp?rpx=fj_dz_matter',
  63. // reportSrc:'http://localhost:6868/demo/reportJsp/preview.jsp?rpx=%2Ffj_sk_matter.rpx&rpxHome=C%3A%2FUsers%2Fa%2FDesktop&dfxHome=',
  64. radioTable:1,
  65. loading:false,
  66. leftCol:4,
  67. rightCol:20,
  68. excelName:'小型水库(含电站水库)督查检查报告',
  69. monthValue:dateFormat(new Date(), 'yyyy-MM'),
  70. findTime: [],
  71. sttm:'',
  72. ettm:'',
  73. treeWidth: 250,
  74. dcType: '',
  75. adcode:'',
  76. objId:'',
  77. }
  78. },
  79. mounted() {
  80. this.treeWidth = this.$refs.elw.$el.clientWidth;
  81. },
  82. computed: {
  83. userId: function () {
  84. return localStorage.getItem("userid")
  85. ? localStorage.getItem("userid")
  86. : "1098101939614724096";
  87. }
  88. },
  89. methods: {
  90. openMessage(){
  91. const h = this.$createElement;
  92. this.$notify({
  93. title: '提示',
  94. message: h('i', { style: 'color: teal'}, '点击县才会生成报告')
  95. });
  96. },
  97. provTreeSelectChange(data){
  98. //
  99. this.id = data.pid;
  100. document.getElementById("id").value = data.pid;
  101. this.adcode = data.id;
  102. document.getElementById("adcode").value = data.id;
  103. this.searchExecl();
  104. },
  105. // 获取Excel数据
  106. searchExecl(){
  107. let _this = this;
  108. console.log(_this.adcode)
  109. if((_this.adcode != '' && _this.adcode.length != 12) || (_this.adcode.substr(0,1)=='0')){
  110. this.openMessage();
  111. return;
  112. }
  113. this.loading = true;
  114. // 使用form表单post提交,彻底解决参数值过长的问题
  115. this.$refs.formMain3.submit();
  116. // 使用_this
  117. // let _this = this;
  118. this.$refs.frameMain3.onload = function(){
  119. _this.loading = false;
  120. };
  121. },
  122. // 导出Excel数据
  123. exportExecl(){
  124. v = window.frames["frameMain3"];
  125. // v.contentWindow.report1_saveAsExcel();
  126. v.report1_saveAsExcel();
  127. },
  128. },
  129. watch:{
  130. },
  131. activated() {
  132. this.searchExecl();
  133. }
  134. }
  135. </script>
  136. <style scoped>
  137. </style>