9aa8a4bbb796f8a23dff407efef29e2b4c5cc98f.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 :id="formId" :target="iframeId" :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" name="sttm" v-model="sttm">
  34. <input type="hidden" name="ettm" v-model="ettm">
  35. <input type="hidden" name="state" v-model="dcType">
  36. <input type="hidden" name="year" v-model="newYear">
  37. </form>
  38. <div style="width: 100%;height: 100%;" v-loading="loading">
  39. <iframe :id="iframeId" :name="iframeId" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  40. </div>
  41. </el-card>
  42. </el-col>
  43. </el-row>
  44. </template>
  45. <script>
  46. import {dateFormat,getFirstDayOfMonth} from '../../../utils/gw_date.js';
  47. export default {
  48. components: {
  49. // exportTreeListWithCheckBoxSk:exportTreeListWithCheckBoxSk,
  50. },
  51. props: ['ids','newYear'],
  52. data() {
  53. return {
  54. // ids:[],
  55. pid:'000',
  56. pidNodes:[],
  57. type:'006',
  58. dxdcMainHeight: window.innerHeight-220,
  59. dxdcAsideHeight: window.innerHeight-180,
  60. windowHeight:window.innerHeight - 200,
  61. windowWidth:window.innerWidth - 350,
  62. // reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=sz03_qktj.raq',
  63. reportSrc:'/JsReport/reportFiles/reportjsp/showReport_pages.jsp?raq=sz03_qktj.raq',
  64. radioTable:1,
  65. loading:true,
  66. leftCol:4,
  67. rightCol:20,
  68. excelName:'附表3-检查水闸情况统计表',
  69. formId:'formMain3',
  70. iframeId:'frameMain3',
  71. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  72. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  73. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  74. treeWidth: 250,
  75. dcType: '0',
  76. }
  77. },
  78. computed: {
  79. userId: function () {
  80. return localStorage.getItem("userid")
  81. ? localStorage.getItem("userid")
  82. : "1098101939614724096";
  83. }
  84. },
  85. methods: {
  86. //树节点选中或取消事件
  87. treeCheckedDataChange(params){
  88. //
  89. // 如果是选中状态,把元素id加入到ids里
  90. if(params.newStatus){
  91. params.newCheckedArray.forEach((element,index) => {
  92. let id = element.id;
  93. if(id != null && id !== undefined && id !=='' ){
  94. this.ids.push(id)
  95. }
  96. });
  97. }else {
  98. // 删除取消的元素id
  99. params.changedItem.forEach((element,index) => {
  100. let id = element.id;
  101. let inx = this.ids.indexOf(id);
  102. if(inx > -1) {
  103. delete this.ids[inx]
  104. }
  105. });
  106. }
  107. // 去重
  108. this.ids = Array.from(new Set(this.ids));
  109. console.log("ids:" + this.ids)
  110. },
  111. // 获取Excel数据
  112. searchExecl(){
  113. this.loading = true;
  114. // 使用form表单post提交,彻底解决参数值过长的问题
  115. document.getElementById(this.formId).submit();
  116. // 使用_this
  117. let _this = this;
  118. document.getElementById(this.iframeId).onload = function(){
  119. _this.loading = false;
  120. };
  121. },
  122. // 导出Excel数据
  123. exportExecl(){
  124. let v = window.frames[`${this.iframeId}`];
  125. v.report1_saveAsExcel();
  126. },
  127. },
  128. watch:{
  129. findTime(n,o){
  130. if(!n){
  131. this.sttm = "";
  132. this.ettm = "";
  133. }else{
  134. this.sttm = n[0];
  135. this.ettm = n[1];
  136. }
  137. }
  138. },
  139. activated() {
  140. this.searchExecl();
  141. }
  142. }
  143. </script>
  144. <style scoped>
  145. </style>