f3ccefbdbcb3cfe993e631919d6e7672c95aaecd.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">机井类型</span>
  22. <el-select v-model="wtype" clearable placeholder="督查状态">
  23. <el-option label="市域外保留井" value="1"></el-option>
  24. <el-option label="市域内保留井" value="2"></el-option>
  25. <el-option label="封存抗旱井" value="3"></el-option>
  26. <el-option label="关闭井" value="4"></el-option>
  27. </el-select>
  28. <el-button type="primary" icon="el-icon-download"
  29. style="float: right;margin:0 5px"
  30. @click="exportExecl">导出</el-button>
  31. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  32. </div>
  33. </el-card>
  34. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  35. <form ref="formMain1" id="formMain1" target="frameMain1" :action="reportSrc" method="post">
  36. <input type="hidden" name="width" v-model="windowWidth">
  37. <input type="hidden" name="height" v-model="windowHeight">
  38. <input type="hidden" name="ids" v-model="ids">
  39. <input type="hidden" name="excelName" v-model="excelName">
  40. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  41. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  42. <input type="hidden" name="state" v-model="dcType">
  43. <input type="hidden" name="wtype" v-model="wtype">
  44. <input type="hidden" name="year" v-model="newYear">
  45. </form>
  46. <div style="width: 100%;height: 100%;" v-loading="loading">
  47. <iframe ref="frameMain1" id="frameMain1" name="frameMain1" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  48. </div>
  49. </el-card>
  50. </el-col>
  51. </el-row>
  52. </template>
  53. <script>
  54. import {dateFormat,getFirstDayOfMonth} from '../../utils/gw_date.js';
  55. export default {
  56. props: ['ids','newYear'],
  57. data() {
  58. return {
  59. pid:'000',
  60. pidNodes:[],
  61. type:'070',
  62. dxdcMainHeight: window.innerHeight-200,
  63. dxdcAsideHeight: window.innerHeight-180,
  64. windowHeight:window.innerHeight - 200,
  65. windowWidth:window.innerWidth - 350,
  66. reportSrc:'/JsReport/reportFiles/reportjsp/showReport_pages.jsp?raq=dxsyc_jjxx.raq',
  67. radioTable:1,
  68. loading:true,
  69. leftCol:4,
  70. rightCol:20,
  71. excelName:'附表1-检查机井基本情况表',
  72. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  73. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  74. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  75. treeWidth: 250,
  76. dcType: '0',
  77. wtype:"1",
  78. }
  79. },
  80. computed: {
  81. userId: function () {
  82. return localStorage.getItem("userid")
  83. ? localStorage.getItem("userid")
  84. : "1098101939614724096";
  85. }
  86. },
  87. methods: {
  88. // 获取Excel数据
  89. searchExecl(){
  90. this.loading = true;
  91. // 使用form表单post提交,彻底解决参数值过长的问题
  92. this.$refs.formMain1.submit();
  93. // 使用_this
  94. let _this = this;
  95. this.$refs.frameMain1.onload = function(){
  96. _this.loading = false;
  97. };
  98. },
  99. // 导出Excel数据
  100. exportExecl(){
  101. v = window.frames["frameMain1"];
  102. // v.contentWindow.report1_saveAsExcel();
  103. v.report1_saveAsExcel();
  104. },
  105. },
  106. watch:{
  107. findTime(n,o){
  108. if(!n){
  109. this.sttm = "";
  110. this.ettm = "";
  111. }else{
  112. this.sttm = n[0];
  113. this.ettm = n[1];
  114. }
  115. }
  116. },
  117. activated() {
  118. this.searchExecl();
  119. }
  120. }
  121. </script>
  122. <style scoped>
  123. </style>