00a2122b61c9de2c3573f2d0eb03e16fb321b90c.svn-base 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. import {dateFormat,getFirstDayOfMonth} from '@util/gw_date.js';
  29. export default {
  30. props: ['ids','newYear'],
  31. data() {
  32. return {
  33. pid:'000',
  34. pidNodes:[],
  35. type:'001',
  36. dxdcMainHeight: window.innerHeight-200,
  37. dxdcAsideHeight: window.innerHeight-180,
  38. windowHeight:window.innerHeight - 200,
  39. windowWidth:window.innerWidth - 350,
  40. reportSrc:'/demo/reportJsp/showReport.jsp?rpx=dc_dfxgxd_01.rpx',
  41. radioTable:1,
  42. loading:true,
  43. leftCol:4,
  44. rightCol:20,
  45. excelName:'附件1 督查人员情况表',
  46. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  47. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  48. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  49. treeWidth: 250,
  50. dcType: '0',
  51. }
  52. },
  53. computed: {
  54. userId: function () {
  55. return localStorage.getItem("userid")
  56. ? localStorage.getItem("userid")
  57. : "1098101939614724096";
  58. }
  59. },
  60. methods: {
  61. // 获取Excel数据
  62. searchExecl(){
  63. this.loading = true;
  64. // 使用form表单post提交,彻底解决参数值过长的问题
  65. this.$refs.formMain.submit();
  66. // 使用_this
  67. let _this = this;
  68. this.$refs.frameMain.onload = function(){
  69. _this.loading = false;
  70. };
  71. },
  72. // 导出Excel数据
  73. exportExecl(){
  74. v = window.frames["frameMain"];
  75. // v.contentWindow.report1_saveAsExcel();
  76. v.report1_saveAsExcel();
  77. },
  78. },
  79. watch:{
  80. findTime(n,o){
  81. if(!n){
  82. this.sttm = "";
  83. this.ettm = "";
  84. }else{
  85. this.sttm = n[0];
  86. this.ettm = n[1];
  87. }
  88. }
  89. },
  90. activated() {
  91. this.searchExecl();
  92. }
  93. }
  94. </script>
  95. <style scoped>
  96. </style>