4fc70a680a7539b2a4a8ca0ba0cde8063fc52ae5.svn-base 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. style="width: 220px"
  9. v-model="findTime"
  10. type="daterange"
  11. value-format="yyyy-MM-dd"
  12. range-separator="至"
  13. start-placeholder="开始日期"
  14. end-placeholder="结束日期">
  15. </el-date-picker>
  16. <span class="demonstration" style="margin-right: 5px">问题上报时间</span>
  17. <el-date-picker
  18. style="width: 220px"
  19. v-model="findPblmTime"
  20. type="daterange"
  21. value-format="yyyy-MM-dd"
  22. range-separator="至"
  23. start-placeholder="开始日期"
  24. end-placeholder="结束日期">
  25. </el-date-picker>
  26. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查状态</span>
  27. <el-select v-model="dcType" clearable placeholder="督查状态" style="width: 90px">
  28. <el-option label="未督查" value="0"></el-option>
  29. <el-option label="督查中" value="1"></el-option>
  30. <el-option label="已督查" value="2"></el-option>
  31. </el-select>
  32. <el-button type="primary" icon="el-icon-download"
  33. style="float: right;margin:0 5px"
  34. @click="exportExecl">导出</el-button>
  35. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  36. </div>
  37. </el-card>
  38. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  39. <form ref="formMain2" id="formMain2" target="frameMain2" :action="reportSrc" method="post">
  40. <input type="hidden" name="width" v-model="windowWidth">
  41. <input type="hidden" name="height" v-model="windowHeight">
  42. <input type="hidden" name="ids" v-model="ids">
  43. <input type="hidden" name="excelName" v-model="excelName">
  44. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  45. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  46. <input type="hidden" id="pblm_sttm" name="pblm_sttm" v-model="pblmSttm">
  47. <input type="hidden" id="pblm_ettm" name="pblm_ettm" v-model="pblmEntm">
  48. <input type="hidden" name="state" v-model="dcType">
  49. </form>
  50. <div style="width: 100%;height: 100%;" v-loading="loading">
  51. <iframe ref="frameMain2" id="frameMain2" name="frameMain2" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  52. </div>
  53. </el-card>
  54. </el-col>
  55. </el-row>
  56. </template>
  57. <script>
  58. import {dateFormat,getFirstDayOfMonth} from '@util/gw_date.js';
  59. export default {
  60. props: ['ids','newYear'],
  61. data() {
  62. return {
  63. dxdcMainHeight: window.innerHeight-200,
  64. dxdcAsideHeight: window.innerHeight-180,
  65. windowHeight:window.innerHeight - 200,
  66. windowWidth:window.innerWidth - 350,
  67. reportSrc:'/demo/reportJsp/showReport.jsp?rpx=zhejiang/dc_ry_wtmx.rpx',
  68. loading:true,
  69. leftCol:4,
  70. rightCol:20,
  71. excelName:'问题明细统计表',
  72. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  73. findPblmTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  74. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  75. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  76. pblmSttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  77. pblmEntm: dateFormat(new Date(), 'yyyy-MM-dd'),
  78. treeWidth: 250,
  79. dcType: '0',
  80. }
  81. },
  82. computed: {
  83. userId: function () {
  84. return localStorage.getItem("userid")
  85. ? localStorage.getItem("userid")
  86. : "1098101939614724096";
  87. }
  88. },
  89. methods: {
  90. // 获取Excel数据
  91. searchExecl(){
  92. this.loading = true;
  93. // 使用form表单post提交,彻底解决参数值过长的问题
  94. this.$refs.formMain2.submit();
  95. // 使用_this
  96. let _this = this;
  97. this.$refs.frameMain2.onload = function(){
  98. _this.loading = false;
  99. };
  100. },
  101. // 导出Excel数据
  102. exportExecl(){
  103. v = window.frames["frameMain2"];
  104. // v.contentWindow.report1_saveAsExcel();
  105. v.report1_saveAsExcel();
  106. },
  107. },
  108. watch:{
  109. findTime(n,o){
  110. if(!n){
  111. this.sttm = "";
  112. this.ettm = "";
  113. }else{
  114. this.sttm = n[0];
  115. this.ettm = n[1];
  116. }
  117. },
  118. findPblmTime(n,o){
  119. if(!n){
  120. this.pblmSttm = "";
  121. this.pblmEntm = "";
  122. }else{
  123. this.pblmSttm = n[0];
  124. this.pblmEntm = n[1];
  125. }
  126. },
  127. },
  128. activated() {
  129. this.searchExecl();
  130. }
  131. }
  132. </script>
  133. <style scoped>
  134. </style>