8d9f25ab0e4a54d65b1499ec0cc0ce0f4f7a06f9.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <el-row>
  3. <el-col :span="24">
  4. <el-card :body-style="{'padding-top':'10px'}">
  5. <div class="block">
  6. <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  7. <el-date-picker
  8. v-model="findTime"
  9. type="daterange"
  10. value-format="yyyy-MM-dd"
  11. range-separator="至"
  12. start-placeholder="开始日期"
  13. end-placeholder="结束日期">
  14. </el-date-picker>
  15. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查状态</span>
  16. <el-select v-model="dcType" clearable placeholder="督查状态">
  17. <el-option label="未督查" value="0"></el-option>
  18. <el-option label="督查中" value="1"></el-option>
  19. <el-option label="已督查" value="2"></el-option>
  20. </el-select>
  21. <el-button type="primary" icon="el-icon-download"
  22. style="float: right;margin:0 5px"
  23. @click="exportExecl">导出</el-button>
  24. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  25. </div>
  26. </el-card>
  27. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  28. <form ref="formMainFb7_2" id="formMainFb7_2" target="frameMainFb7_2" :action="reportSrc" method="post">
  29. <input type="hidden" name="width" v-model="windowWidth">
  30. <input type="hidden" name="height" v-model="windowHeight">
  31. <input type="hidden" name="ids" v-model="ids">
  32. <input type="hidden" name="excelName" v-model="excelName">
  33. <input type="hidden" id="sttm_sk6" name="sttm" v-model="sttm">
  34. <input type="hidden" id="ettm_sk6" name="ettm" v-model="ettm">
  35. <input type="hidden" name="state" v-model="dcType">
  36. </form>
  37. <div style="width: 100%;height: 100%;" v-loading="loading">
  38. <iframe ref="frameMainFb7_2" id="frameMainFb7_2" name="frameMainFb7_2" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  39. </div>
  40. </el-card>
  41. </el-col>
  42. </el-row>
  43. </template>
  44. <script>
  45. import {dateFormat,getFirstDayOfMonth} from '../../utils/gw_date.js';
  46. export default {
  47. props: ['ids'],
  48. data() {
  49. return {
  50. pid:'000',
  51. pidNodes:[],
  52. type:'001',
  53. dxdcMainHeight: window.innerHeight-215,
  54. dxdcAsideHeight: window.innerHeight-180,
  55. windowHeight:window.innerHeight - 160,
  56. windowWidth:window.innerWidth - 350,
  57. reportSrc:'/JsReport/reportFiles/reportjsp/showReport_pages.jsp?raq=/fujian/fj_xsk_wfhxy07-2.raq',
  58. radioTable:1,
  59. loading:false,
  60. leftCol:4,
  61. rightCol:20,
  62. excelName:'附表7-2存在重大安全隐患水库问题汇总表',
  63. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  64. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  65. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  66. treeWidth: 250,
  67. dcType: '2',
  68. }
  69. },
  70. computed: {
  71. userId: function () {
  72. return localStorage.getItem("userid")
  73. ? localStorage.getItem("userid")
  74. : "1098101939614724096";
  75. }
  76. },
  77. methods: {
  78. // 获取Excel数据
  79. searchExecl(){
  80. this.loading = true;
  81. // 使用form表单post提交,彻底解决参数值过长的问题
  82. this.$refs.formMainFb7_2.submit();
  83. // 使用_this
  84. let _this = this;
  85. this.$refs.frameMainFb7_2.onload = function(){
  86. _this.loading = false;
  87. };
  88. },
  89. // 导出Excel数据
  90. exportExecl(){
  91. v = window.frames["frameMainFb7_2"];
  92. // v.contentWindow.report1_saveAsExcel();
  93. v.report1_saveAsExcel();
  94. },
  95. },
  96. watch: {
  97. findTime(n,o){
  98. if(!n){
  99. this.sttm = "";
  100. this.ettm = "";
  101. }else{
  102. this.sttm = n[0];
  103. this.ettm = n[1];
  104. }
  105. }
  106. },
  107. activated() {
  108. this.searchExecl();
  109. }
  110. }
  111. </script>
  112. <style scoped>
  113. </style>