4659e3e3296477f4aa104b2343fef61cd3f1047d.svn-base 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <el-row >
  3. <el-col :span="4" ref="elw">
  4. <el-card :body-style="{'padding':'0'}">
  5. <export-tree-list-ry-fs
  6. :pid="pid"
  7. :type="type"
  8. :pidNodes="pidNodes"
  9. :level="level"
  10. :height="dxdcAsideHeight"
  11. @provTreeSelectChange="provTreeSelectChange"
  12. :fsType="fsType"
  13. ></export-tree-list-ry-fs>
  14. </el-card>
  15. </el-col>
  16. <el-col :span="20">
  17. <el-card :body-style="{'padding-top':'10px'}">
  18. <div class="block">
  19. <span class="demonstration">督查类型</span>
  20. <el-select v-model="currentDCType" placeholder="请选择督查对象类别" clearable style="margin-left:10px;margin-right:15px">
  21. <el-option
  22. v-for="item in DCTypeOption"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value">
  26. </el-option>
  27. </el-select>
  28. <el-button type="primary" icon="el-icon-download"
  29. style="float: right;margin:0 5px"
  30. @click="exportExecl">导出</el-button>
  31. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  32. </div>
  33. </el-card>
  34. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  35. <form :id="formId" :target="iframeId" :action="reportSrc" method="post">
  36. <input type="hidden" name="width" v-model="windowWidth">
  37. <input type="hidden" name="height" v-model="windowHeight">
  38. <input type="hidden" id="addvcd" name="addvcd">
  39. <input type="hidden" id="objType" name="objType">
  40. <input type="hidden" name="excelName" v-model="excelName">
  41. </form>
  42. <div style="width: 100%;height: 100%;" v-loading="loading">
  43. <iframe :id="iframeId" :name="iframeId" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  44. </div>
  45. </el-card>
  46. </el-col>
  47. </el-row>
  48. </template>
  49. <script>
  50. const DCTypeOption = [{
  51. value: "12",
  52. label: '取水口取水及监管情况'
  53. }, {
  54. value: "13",
  55. label: '全国重要饮用水水源管理情况'
  56. },{
  57. value: "14",
  58. label: '水量分配及取用水管控情况'
  59. },{
  60. value: "15-1",
  61. label: '节约用水管理情况'
  62. },{
  63. value: "15-2",
  64. label: '节水评价情况'
  65. },{
  66. value: "16-1",
  67. label: '用水单位节约用水情况'
  68. },{
  69. value: "16-2",
  70. label: '节水型单位节约用水情况'
  71. }];
  72. import exportTreeListRyFs from '../exportTreeList_fs'
  73. import request from '@util/gw_ajax_request.js'
  74. import addvSearch from "@widget/addvSearch.vue"
  75. export default {
  76. components:{
  77. exportTreeListRyFs:exportTreeListRyFs,
  78. addvSearch: addvSearch
  79. },
  80. data() {
  81. return {
  82. rootCode:'000000',
  83. rootType:'2',
  84. adName:'',
  85. id:'none',
  86. pid:'000',
  87. type:'002',
  88. pidNodes:[],
  89. level:'1',
  90. addvcd:'000000000000',
  91. dxdcMainHeight: window.innerHeight-155,
  92. dxdcAsideHeight: window.innerHeight-120,
  93. windowHeight:window.innerHeight - 200,
  94. windowWidth:window.innerWidth - 350,
  95. reportSrc:'/demo/reportJsp/showReport.jsp?rpx=dc_szy_09',
  96. loading:false,
  97. excelName:'水资源检查工作情况统计表',
  98. formId:'formMain',
  99. iframeId:'frameMain',
  100. treeWidth: 250,
  101. currentDCType: '',
  102. DCTypeOption:DCTypeOption,
  103. fsType:'szy',
  104. }
  105. },
  106. mounted() {
  107. },
  108. activated(){
  109. this.searchExecl();
  110. },
  111. methods: {
  112. provTreeSelectChange: function(data) {
  113. this.addvcd = data.id;
  114. this.searchExecl()
  115. },
  116. onSearch(){
  117. },
  118. searchExecl(){
  119. if(this.addvcd != '' && this.addvcd.length != 12){
  120. this.openMessage();
  121. return;
  122. }
  123. this.loading = true;
  124. // 使用form表单post提交,彻底解决参数值过长的问题
  125. document.getElementById('addvcd').value = this.addvcd;
  126. if(this.currentDCType == undefined || this.currentDCType == null || this.currentDCType == ''){
  127. document.getElementById('objType').value = 'all';
  128. }else {
  129. document.getElementById('objType').value = this.currentDCType;
  130. }
  131. document.getElementById(this.formId).submit();
  132. // 使用_this
  133. let _this = this;
  134. document.getElementById(this.iframeId).onload = function(){
  135. _this.loading = false;
  136. };
  137. },
  138. // 导出Excel数据
  139. exportExecl(){
  140. let v = window.frames[`${this.iframeId}`];
  141. v.report1_saveAsExcel();
  142. },
  143. openMessage(){
  144. const h = this.$createElement;
  145. this.$notify({
  146. title: '提示',
  147. message: h('i', { style: 'color: teal'}, '点击省份才会生成报告')
  148. });
  149. },
  150. },
  151. computed: {
  152. userId: function () {
  153. return localStorage.getItem("userid")
  154. ? localStorage.getItem("userid")
  155. : "1098101939614724096";
  156. }
  157. },
  158. watch: {
  159. }
  160. }
  161. </script>
  162. <style>
  163. .ducha_form .el-input {
  164. width: 150px !important;
  165. }
  166. </style>