d19cf571171a28b0d0c31003d882f164121fd71c.svn-base 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <el-row>
  3. <el-col :span="leftCol" ref="elw">
  4. <el-card :body-style="{'padding':'0'}">
  5. <export-tree-list-with-check-box-sk
  6. :pid="pid"
  7. :type="type"
  8. :pidNodes="pidNodes"
  9. @treeCheckedDataChange="treeCheckedDataChange"
  10. :height="dxdcAsideHeight"
  11. :width="treeWidth"
  12. ></export-tree-list-with-check-box-sk>
  13. </el-card>
  14. </el-col>
  15. <el-col :span="rightCol">
  16. <el-card :body-style="{'padding-top':'10px'}">
  17. <!-- <el-radio-group v-model="radioTable">
  18. <el-radio :label="1">水毁修复项目暗访情况表</el-radio>
  19. </el-radio-group> -->
  20. <div class="block">
  21. <!-- <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  22. <el-date-picker v-model="sttm" type="date" value-format="yyyy-MM-dd"
  23. placeholder="选择日期" style="width: 150px"></el-date-picker>
  24. <span style="padding-left: 10px;padding-right: 10px;">至</span>
  25. <el-date-picker v-model="ettm" type="date" value-format="yyyy-MM-dd"
  26. placeholder="选择日期" style="width: 150px"></el-date-picker> -->
  27. <el-button type="primary" icon="el-icon-download"
  28. style="float: right;margin:0 5px"
  29. @click="exportExecl">导出</el-button>
  30. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  31. </div>
  32. </el-card>
  33. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  34. <form ref="formMain" id="formMain" target="frameMain" :action="reportSrc" method="post">
  35. <input type="hidden" name="width" v-model="windowWidth">
  36. <input type="hidden" name="height" v-model="windowHeight">
  37. <input type="hidden" name="ids" v-model="ids">
  38. <input type="hidden" name="excelName" v-model="excelName">
  39. <input type="hidden" name="dt" v-model="monthValue">
  40. <input type="hidden" name="sttm" v-model="sttm">
  41. <input type="hidden" name="ettm" v-model="ettm">
  42. <input type="hidden" name="persid" v-model="userId">
  43. </form>
  44. <div style="width: 100%;height: 100%;" v-loading="loading">
  45. <iframe ref="frameMain" id="frameMain" name="frameMain" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  46. </div>
  47. </el-card>
  48. </el-col>
  49. </el-row>
  50. </template>
  51. <script>
  52. import request from '../../utils/gw_ajax_request.js';
  53. import exportTreeListWithCheckBoxSk from './exportTreeListWithCheckBox_sk'
  54. import {dateFormat} from '../../utils/gw_date.js'
  55. export default {
  56. components: {
  57. exportTreeListWithCheckBoxSk:exportTreeListWithCheckBoxSk,
  58. },
  59. data() {
  60. return {
  61. ids:[],
  62. pid:'000',
  63. pidNodes:[],
  64. type:'003',
  65. dxdcMainHeight: window.innerHeight-190,
  66. dxdcAsideHeight: window.innerHeight-180,
  67. windowHeight:window.innerHeight - 200,
  68. windowWidth:window.innerWidth - 350,
  69. reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=sh01_xiufu.raq',
  70. radioTable:1,
  71. loading:false,
  72. leftCol:4,
  73. rightCol:20,
  74. excelName:'水毁修复项目暗访情况表',
  75. monthValue:dateFormat(new Date(), 'yyyy-MM'),
  76. sttm:'',
  77. ettm:'',
  78. treeWidth: 250,
  79. }
  80. },
  81. mounted() {
  82. this.treeWidth = this.$refs.elw.$el.clientWidth;
  83. },
  84. computed: {
  85. userId: function () {
  86. return localStorage.getItem("userid")
  87. ? localStorage.getItem("userid")
  88. : "1098101939614724096";
  89. }
  90. },
  91. methods: {
  92. //树节点选中或取消事件
  93. treeCheckedDataChange(params){
  94. //
  95. // 如果是选中状态,把元素id加入到ids里
  96. if(params.newStatus){
  97. params.newCheckedArray.forEach((element,index) => {
  98. let id = element.id;
  99. if(id != null && id !== undefined && id !=='' ){
  100. this.ids.push(id)
  101. }
  102. });
  103. }else {
  104. // 删除取消的元素id
  105. params.changedItem.forEach((element,index) => {
  106. let id = element.id;
  107. let inx = this.ids.indexOf(id);
  108. if(inx > -1) {
  109. delete this.ids[inx]
  110. }
  111. });
  112. }
  113. // 去重
  114. this.ids = Array.from(new Set(this.ids));
  115. console.log("ids:" + this.ids)
  116. },
  117. // 获取Excel数据
  118. searchExecl(){
  119. this.loading = true;
  120. // 使用form表单post提交,彻底解决参数值过长的问题
  121. this.$refs.formMain.submit();
  122. // 使用_this
  123. let _this = this;
  124. this.$refs.frameMain.onload = function(){
  125. _this.loading = false;
  126. };
  127. },
  128. // 导出Excel数据
  129. exportExecl(){
  130. v = window.frames["frameMain"];
  131. // v.contentWindow.report1_saveAsExcel();
  132. v.report1_saveAsExcel();
  133. },
  134. },
  135. watch:{
  136. monthValue(n,o){
  137. if(n == null){
  138. this.monthValue = "";
  139. }
  140. },
  141. sttm(n,o){
  142. if(n == null){
  143. this.sttm = "";
  144. }
  145. },
  146. ettm(n,o){
  147. if(n == null){
  148. this.ettm = "";
  149. }
  150. }
  151. },
  152. activated() {
  153. this.searchExecl();
  154. }
  155. }
  156. </script>
  157. <style scoped>
  158. </style>