7bb521d41d4b256f9ac233e770b3473fce1fb6ac.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <el-container style="height:100%;">
  3. <el-header style="display:flex;align-items:center;" v-if="vShow">
  4. <p>水利工程名称</p>
  5. <el-input v-model="nm" clearable style="width: 150px;margin-left:10px;margin-right:15px"></el-input>
  6. <p>水利工程类型</p>
  7. <el-select clearable v-model="ptype" placeholder="请选择水利工程类型" style="margin-left:10px;margin-right:15px">
  8. <el-option
  9. v-for="item in ptypeOption"
  10. :key="item.value"
  11. :label="item.label"
  12. :value="item.value"
  13. >
  14. </el-option>
  15. </el-select>
  16. <el-button type="primary" icon="el-icon-search" style="margin-left:5px;" plain @click="searchExecl">查询</el-button>
  17. <!-- <el-button type="primary" icon="el-icon-download" style="margin-left:10px;" plain @click="exportExecl">导出</el-button> -->
  18. <span style="margin-left:15px;">(<b style="color:red;">注意:Excel文件导入操作会覆盖本页所有数据,请谨慎操作。</b>)</span>
  19. </el-header>
  20. <el-main id="dcjhMain">
  21. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
  22. <iframe ref="myIframe" id="frameMainSlgc" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  23. </div>
  24. </el-main>
  25. </el-container>
  26. </template>
  27. <script>
  28. const ptypeOption = [
  29. // {
  30. // value:'all',
  31. // label:'全部'
  32. // },
  33. {
  34. value:'0',
  35. label:'重大农业节水工程'
  36. },{
  37. value:'1',
  38. label:'重大引调水工程'
  39. },{
  40. value:'2',
  41. label:'重点水源工程'
  42. },{
  43. value:'3',
  44. label:'江河湖泊治理骨干工程'
  45. },{
  46. value:'4',
  47. label:'新建大型灌区工程'
  48. },{
  49. value:'5',
  50. label:'非水利部下达投资计划'
  51. },{
  52. value:'6',
  53. label:'全部由地方投资'
  54. },{
  55. value:'7',
  56. label:'其他项目'
  57. }];
  58. import request from '../../../utils/gw_ajax_request.js';
  59. import {dateFormat} from '../../../utils/gw_date.js'
  60. export default {
  61. props: ['show','nmStr','heightStr','widthStr','dxdcMainHeightStr'],
  62. components: {
  63. },
  64. data() {
  65. return {
  66. loading:false,
  67. // reportSrc:'http://localhost:6868/demo/reportJsp/previewInput.jsp?sht=%2Fslgc_baseInfo_line.sht&rpxHome=D%3A%2F1%2Freport%2F%E5%A1%AB%E6%8A%A5%E8%A1%A8%2F%E8%A1%8C%E5%BC%8F%E5%A1%AB%E6%8A%A5%E8%A1%A8%2Fslgc&dfxHome=',
  68. reportSrc:'/demo/reportJsp/showInput.jsp?sht=slgc_baseInfo_line.sht',
  69. excelName:'水利工程基础信息表',
  70. dxdcMainHeight: window.innerHeight - 130,
  71. windowHeight:window.innerHeight - 130,
  72. windowWidth:window.innerWidth - 10,
  73. sttm:'',
  74. ettm:'',
  75. monthValue:'',
  76. nm:'',
  77. ptype:'',
  78. ptypeOption:ptypeOption,
  79. vShow:true,
  80. }
  81. },
  82. computed:{
  83. userId:function(){
  84. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  85. },
  86. },
  87. watch:{
  88. sttm(n,o){
  89. if(n == null){
  90. this.sttm = "";
  91. }
  92. },
  93. ettm(n,o){
  94. if(n == null){
  95. this.ettm = "";
  96. }
  97. },
  98. monthValue(n,o){
  99. if(n == null){
  100. this.monthValue = "";
  101. }
  102. },
  103. },
  104. mounted(){
  105. if(this.show != undefined){
  106. this.vShow = this.show;
  107. }
  108. if(this.nmStr != undefined){
  109. this.nm = this.nmStr;
  110. }
  111. if(this.heightStr != undefined){
  112. this.windowHeight = this.heightStr;
  113. }
  114. if(this.widthStr != undefined){
  115. this.windowWidth = this.widthStr;
  116. }
  117. if(this.dxdcMainHeightStr != undefined){
  118. this.dxdcMainHeight = this.dxdcMainHeightStr;
  119. }
  120. this.searchExecl();
  121. },
  122. methods:{
  123. // 获取Excel数据
  124. searchExecl(){
  125. // this.loading = true;
  126. let _this = this;
  127. let iframe = document.getElementById("frameMainSlgc");
  128. let src = this.reportSrc;
  129. let _ptype = this.ptype;
  130. if(_ptype == null || _ptype == ''){
  131. _ptype = 'all'
  132. }
  133. let _nm = this.nm;
  134. if(_nm == ''){
  135. _nm = 'all'
  136. }
  137. iframe.src= src
  138. + "&width=" + this.windowWidth
  139. + "&height=" + this.windowHeight
  140. + "&excelName=" + this.excelName
  141. + "&sttm=" + this.sttm
  142. + "&ettm=" + this.ettm
  143. + "&nm=" + _nm
  144. + "&ptype=" + _ptype
  145. if (iframe.attachEvent){
  146. iframe.attachEvent("onload", function(){
  147. _this.loading = false;
  148. });
  149. } else {
  150. iframe.onload = function(){
  151. _this.loading = false;
  152. };
  153. }
  154. },
  155. // 导出Excel数据
  156. exportExecl(){
  157. v = window.frames["frameMainSlgc"];
  158. v.contentWindow.report1_saveAsExcel();
  159. },
  160. },
  161. activated() {
  162. }
  163. }
  164. </script>
  165. <style>
  166. #dcjhMain {
  167. /* overflow: hidden; */
  168. padding:0;
  169. }
  170. </style>