bca00bc1c99f76c4b78f9695d33f8b3447155f44.svn-base 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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="persName" clearable style="width: 150px;margin-left:10px;margin-right:15px"></el-input>
  6. <p>机构名称</p>
  7. <el-input v-model="orgName" clearable style="width: 150px;margin-left:10px;margin-right:15px"></el-input>
  8. <el-button type="primary" icon="el-icon-search" style="margin-left:5px;" plain @click="searchExecl">查询</el-button>
  9. <span style="margin-left:15px;" v-show="!show">(<b style="color:red;">注意:Excel文件导入操作会覆盖本页所有数据,请谨慎操作。</b>)</span>
  10. </el-header>
  11. <el-main id="dcjhMain">
  12. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="false">
  13. <iframe ref="myIframe" id="frameMainDcry" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  14. </div>
  15. </el-main>
  16. </el-container>
  17. </template>
  18. <script>
  19. import request from '../../../utils/gw_ajax_request.js';
  20. import {dateFormat} from '../../../utils/gw_date.js'
  21. export default {
  22. props: ['show','persNameStr','orgNmStr','pageStr','heightStr','widthStr','dxdcMainHeightStr'],
  23. components: {
  24. },
  25. data() {
  26. return {
  27. loading:true,
  28. reportSrc:'/demo/reportJsp/showInput.jsp?sht=renyuan_baseInfo_line.sht',
  29. excelName:'督查人员基础信息表',
  30. dxdcMainHeight: window.innerHeight - 130,
  31. windowHeight:window.innerHeight - 130,
  32. windowWidth:window.innerWidth - 10,
  33. vShow:true,
  34. persName: '',
  35. orgName: '',
  36. page: 1,
  37. }
  38. },
  39. computed:{
  40. userId:function(){
  41. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  42. },
  43. },
  44. watch:{
  45. },
  46. mounted(){
  47. if(this.show != undefined){
  48. this.vShow = this.show;
  49. }
  50. if(this.persNameStr != undefined){
  51. this.persName = this.persNameStr;
  52. }
  53. if(this.orgNmStr != undefined){
  54. this.orgName = this.orgNmStr;
  55. }
  56. if(this.pageStr != undefined){
  57. this.page = this.pageStr;
  58. }
  59. if(this.heightStr != undefined){
  60. this.windowHeight = this.heightStr;
  61. }
  62. if(this.widthStr != undefined){
  63. this.windowWidth = this.widthStr;
  64. }
  65. if(this.dxdcMainHeightStr != undefined){
  66. this.dxdcMainHeight = this.dxdcMainHeightStr;
  67. }
  68. this.searchExecl();
  69. },
  70. methods:{
  71. // 获取Excel数据
  72. searchExecl(){
  73. this.loading = true;
  74. let _this = this;
  75. let iframe = document.getElementById("frameMainDcry");
  76. let src = this.reportSrc;
  77. let _persName = this.persName == '' ? 'all' : this.persName;
  78. let _orgName = this.orgName == '' ? 'all' : this.orgName;
  79. let _page = this.page;
  80. iframe.src= src
  81. + "&width=" + this.windowWidth
  82. + "&height=" + this.windowHeight
  83. + "&excelName=" + this.excelName
  84. + "&persName=" + _persName
  85. + "&orgName=" + _orgName
  86. + "&page=" + _page
  87. if (iframe.attachEvent){
  88. iframe.attachEvent("onload", function(){
  89. _this.loading = false;
  90. });
  91. } else {
  92. iframe.onload = function(){
  93. _this.loading = false;
  94. };
  95. }
  96. },
  97. // 导出Excel数据
  98. exportExecl(){
  99. v = window.frames["frameMainDcry"];
  100. v.contentWindow.report1_saveAsExcel();
  101. },
  102. },
  103. activated() {
  104. }
  105. }
  106. </script>
  107. <style>
  108. #dcjhMain {
  109. overflow: hidden;
  110. padding:0;
  111. }
  112. </style>