b70b9083efa0b90fcb2402b684927ff46906cca6.svn-base 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <el-container>
  3. <el-aside width="20%">
  4. <el-tree
  5. ref="trees"
  6. :data="nodeInfos"
  7. :props="defaultProps"
  8. node-key="id"
  9. @node-click="handleNodeClick">
  10. </el-tree>
  11. </el-aside>
  12. <el-row style="width:80%">
  13. <el-col :span="24">
  14. <el-card :body-style="{'padding-top':'10px'}">
  15. <div class="block">
  16. <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  17. <el-date-picker
  18. v-model="findTime"
  19. type="daterange"
  20. value-format="yyyy-MM-dd"
  21. range-separator="至"
  22. start-placeholder="开始日期"
  23. end-placeholder="结束日期">
  24. </el-date-picker>
  25. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查状态</span>
  26. <el-select v-model="dcType" clearable placeholder="督查状态">
  27. <el-option label="未督查" value="0"></el-option>
  28. <el-option label="督查中" value="1"></el-option>
  29. <el-option label="已督查" value="2"></el-option>
  30. </el-select>
  31. <!-- <el-button
  32. type="primary"
  33. icon="el-icon-download"
  34. style="float: right;margin:0 5px"
  35. @click="exportExecl"
  36. >导出
  37. </el-button> -->
  38. <el-button
  39. type="primary"
  40. icon="el-icon-search"
  41. style="float: right;margin:0 5px"
  42. @click="searchExecl"
  43. >查询
  44. </el-button>
  45. </div>
  46. </el-card>
  47. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  48. <el-main id="dxdcListMain" style="padding:5px 20px;">
  49. <div :style="{'width': '100%','height': iframeHeight + 'px'}">
  50. <iframe ref="frameMain" id="frameMain" name="frameMain" :src="tableSrc" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  51. </div>
  52. </el-main>
  53. </el-card>
  54. </el-col>
  55. </el-row>
  56. </el-container>
  57. </template>
  58. <script>
  59. import request from "../../../utils/gw_ajax_request.js";
  60. import {dateFormat, getFirstDayOfMonth} from '../../../utils/gw_date.js';
  61. import {getTrees} from "@util/gw_formatTree.js"
  62. import {getRyNodeProvincialNogroup} from '@api/reportApi.js'
  63. import {reportHosturl} from '@util/global_variable.js'
  64. export default {
  65. props: ['ids'],
  66. data() {
  67. return {
  68. iframeHeight: window.innerHeight - 300,
  69. // ids: [],
  70. nodeInfos: [],
  71. defaultProps: {
  72. children: 'children',
  73. label: 'pnm'
  74. },
  75. pid: "000",
  76. pidNodes: [],
  77. type: "001",
  78. dxdcMainHeight: window.innerHeight - 300,
  79. dxdcAsideHeight: window.innerHeight - 180,
  80. windowHeight: window.innerHeight - 200,
  81. windowWidth: window.innerWidth - 350,
  82. tableSrc: '',
  83. radioTable: 1,
  84. loading: true,
  85. leftCol: 4,
  86. rightCol: 20,
  87. excelName: "附表2-督查小型水库名称及分布情况表",
  88. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  89. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  90. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  91. treeWidth: 250,
  92. dcType: '2',
  93. searchObj:{
  94. "engScal": '2'
  95. },
  96. gcId: '',
  97. };
  98. },
  99. mounted() {
  100. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjswtqd.rpx`
  101. this.getLeftTreeData()
  102. console.log(this.dxdcMainHeight,'3213123131232131')
  103. },
  104. computed: {
  105. userId: function () {
  106. return localStorage.getItem("userid")
  107. ? localStorage.getItem("userid")
  108. : "1098101939614724096";
  109. }
  110. },
  111. methods: {
  112. getLeftTreeData(){
  113. let params = {
  114. userId: this.userId,
  115. orgType: '004',
  116. }
  117. request.get(`/dc/organization/base/getAllNode`,{params:params}).then(res=>{
  118. if(res.success){
  119. this.nodeInfos = getTrees(res.data)
  120. }
  121. })
  122. },
  123. handleNodeClick(data,node){
  124. let paramObj = {
  125. type: "empwt",
  126. presId: this.userId,
  127. plnaId: data.id
  128. }
  129. Object.assign(this.searchObj,paramObj)
  130. this.loading = true;
  131. request
  132. .post(`/dc/insp/rsvrRgstr/list/tree`, this.searchObj)
  133. .then(res => {
  134. if (res.success) {
  135. if(res.data){
  136. this.gcId = ''
  137. res.data.forEach(element => {
  138. this.gcId += element['id']+','
  139. });
  140. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjswtqd.rpx&ids=${this.gcId}`
  141. }else{
  142. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjswtqd.rpx&ids=${this.gcId}`
  143. }
  144. }
  145. this.loading = false;
  146. });
  147. },
  148. // 获取Excel数据
  149. searchExecl() {
  150. this.loading = true;
  151. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjswtqd.rpx&ids=${this.gcId}&sttm=${this.sttm}&ettm=${this.ettm}&state=${this.dcType}`
  152. this.loading = false;
  153. },
  154. // 导出Excel数据
  155. exportExecl() {
  156. v = window.frames["frameMain"];
  157. // 调用子页面的js方法
  158. // v.contentWindow.report1_saveAsExcel();
  159. v.report1_saveAsExcel();
  160. }
  161. },
  162. watch: {
  163. findTime(n, o) {
  164. if (!n) {
  165. this.sttm = "";
  166. this.ettm = "";
  167. } else {
  168. this.sttm = n[0];
  169. this.ettm = n[1];
  170. }
  171. },
  172. },
  173. activated() {
  174. this.searchExecl();
  175. }
  176. };
  177. </script>
  178. <style scoped>
  179. </style>