501fc54a2cf62b74615f6855ef6159bcdcd19ead.svn-base 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <el-row>
  3. <el-col :span="24">
  4. <el-card :body-style="{'padding-top':'10px'}">
  5. <div class="block">
  6. <el-button type="primary" icon="el-icon-download"
  7. style="float: right;margin:0 5px"
  8. @click="exportExecl">导出</el-button>
  9. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  10. </div>
  11. </el-card>
  12. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  13. <form ref="formMain" id="formMain" target="frameMain" :action="reportSrc" method="post">
  14. <input type="hidden" name="width" v-model="windowWidth">
  15. <input type="hidden" name="height" v-model="windowHeight">
  16. <input type="hidden" name="ids" v-model="ids">
  17. <input type="hidden" name="excelName" v-model="excelName">
  18. <input type="hidden" name="year" v-model="newYear">
  19. </form>
  20. <div style="width: 100%;height: 100%;" v-loading="loading">
  21. <iframe ref="frameMain" id="frameMain" name="frameMain" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  22. </div>
  23. </el-card>
  24. </el-col>
  25. </el-row>
  26. </template>
  27. <script>
  28. export default {
  29. props: ['ids','newYear'],
  30. data() {
  31. return {
  32. pid:'000',
  33. pidNodes:[],
  34. type:'006',
  35. dxdcMainHeight: window.innerHeight-200,
  36. dxdcAsideHeight: window.innerHeight-180,
  37. windowHeight:window.innerHeight - 200,
  38. windowWidth:window.innerWidth - 350,
  39. reportSrc:'/JsReport/reportFiles/reportjsp/showReport_pages.jsp?raq=sz01_pers1.raq',
  40. radioTable:1,
  41. loading:true,
  42. leftCol:4,
  43. rightCol:20,
  44. excelName:'附表1-督查人员情况表',
  45. treeWidth: 250,
  46. }
  47. },
  48. computed: {
  49. userId: function () {
  50. return localStorage.getItem("userid")
  51. ? localStorage.getItem("userid")
  52. : "1098101939614724096";
  53. }
  54. },
  55. methods: {
  56. // 获取Excel数据
  57. searchExecl(){
  58. this.loading = true;
  59. // 使用form表单post提交,彻底解决参数值过长的问题
  60. this.$refs.formMain.submit();
  61. // 使用_this
  62. let _this = this;
  63. this.$refs.frameMain.onload = function(){
  64. _this.loading = false;
  65. };
  66. },
  67. // 导出Excel数据
  68. exportExecl(){
  69. v = window.frames["frameMain"];
  70. // v.contentWindow.report1_saveAsExcel();
  71. v.report1_saveAsExcel();
  72. },
  73. },
  74. activated() {
  75. this.searchExecl();
  76. }
  77. }
  78. </script>
  79. <style scoped>
  80. </style>