ef22421db5a128261b427dfb63be88f0a3e00c03.svn-base 6.4 KB

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