dec6793a6e48e9943134ab16b4a26a4ccd79eac9.svn-base 5.7 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"/>
  28. <el-option label="督查中" value="1"/>
  29. <el-option label="已督查" value="2"/>
  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%"
  51. height="100%" style="overflow: auto"></iframe>
  52. </div>
  53. </el-main>
  54. </el-card>
  55. </el-col>
  56. </el-row>
  57. </el-container>
  58. </template>
  59. <script>
  60. import request from "../../../utils/gw_ajax_request.js";
  61. import {dateFormat, getFirstDayOfMonth} from '../../../utils/gw_date.js';
  62. import {getTrees} from "@util/gw_formatTree.js"
  63. import {getRyNodeProvincialNogroup} from '@api/reportApi.js'
  64. import {reportHosturl} from '@util/global_variable.js'
  65. export default {
  66. props: ['ids'],
  67. data() {
  68. return {
  69. iframeHeight: window.innerHeight - 300,
  70. // ids: [],
  71. nodeInfos: [],
  72. defaultProps: {
  73. children: 'children',
  74. label: 'pnm'
  75. },
  76. pid: "000",
  77. pidNodes: [],
  78. type: "001",
  79. dxdcMainHeight: window.innerHeight - 300,
  80. dxdcAsideHeight: window.innerHeight - 180,
  81. windowHeight: window.innerHeight - 200,
  82. windowWidth: window.innerWidth - 350,
  83. tableSrc: '',
  84. radioTable: 1,
  85. loading: true,
  86. leftCol: 4,
  87. searchObj: {
  88. "engScal": '2'
  89. },
  90. rightCol: 20,
  91. excelName: "附表2-督查小型水库名称及分布情况表",
  92. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  93. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  94. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  95. treeWidth: 250,
  96. dcType: '2',
  97. gcId: '',
  98. };
  99. },
  100. mounted() {
  101. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjs_04.rpx&tdsourcetag=s_pctim_aiomsg`
  102. this.getLeftTreeData()
  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. }
  141. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjs_04.rpx&tdsourcetag=s_pctim_aiomsg&ids=${this.gcId}`
  142. }
  143. this.loading = false;
  144. });
  145. },
  146. // 获取Excel数据
  147. searchExecl() {
  148. this.loading = true;
  149. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=gcjs_04.rpx&tdsourcetag=s_pctim_aiomsg&ids=${this.gcId}&sttm=${this.sttm}&ettm=${this.ettm}&state=${this.dcType}`
  150. this.loading = false;
  151. },
  152. // 导出Excel数据
  153. exportExecl() {
  154. v = window.frames["frameMain"];
  155. // 调用子页面的js方法
  156. // v.contentWindow.report1_saveAsExcel();
  157. v.report1_saveAsExcel();
  158. }
  159. },
  160. watch: {
  161. findTime(n, o) {
  162. if (!n) {
  163. this.sttm = "";
  164. this.ettm = "";
  165. } else {
  166. this.sttm = n[0];
  167. this.ettm = n[1];
  168. }
  169. },
  170. },
  171. activated() {
  172. this.searchExecl();
  173. }
  174. };
  175. </script>
  176. <style scoped>
  177. </style>