0f28e691b7fd8bc52a90c794870f6c2ce65429a1.svn-base 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside width="15%" :height="asideHeight" style="padding-right: 10px">
  5. <!--<div class="date_wrapper" style="padding-top : 10px">年度:
  6. <el-select v-model="year" placeholder="请选择" @change="changeYear">
  7. <el-option
  8. v-for="item in yearList"
  9. :key="item.id"
  10. :label="item.year"
  11. :value="item.year">
  12. </el-option>
  13. </el-select>
  14. </div>-->
  15. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  16. <el-card class="box-card" style="min-height: 99%">
  17. <div slot="header" class="clearfix">
  18. <span>督查组</span>
  19. </div>
  20. <el-tree :data="groupTreeData" :props="defaultProps" :expand-on-click-node="false"
  21. @node-click="groupHandleNodeClick">
  22. </el-tree>
  23. </el-card>
  24. </div>
  25. </el-aside>
  26. <el-aside width="25%" :height="asideHeight">
  27. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  28. <el-card class="box-card" style="min-height: 99%">
  29. <div slot="header" class="clearfix">
  30. <span>工程信息</span>
  31. <!-- <el-button style="float: right; padding: 3px 0" type="text" @click="batchImport" v-if="ownPriv('manage')">批量导入</el-button>-->
  32. <!-- 水利工程基础信息批量导入弹窗 -->
  33. <!-- <slgc-tian-bao-pl v-if="showGongChengTianBaoPl" @closePlDialog="closePlDialog"></slgc-tian-bao-pl>-->
  34. </div>
  35. <el-tree :data="treeData" :props="defaultProps" :expand-on-click-node="false" @node-click="provTreeSelectChangeHandler">
  36. <span class="custom-tree-node" slot-scope="{ node, data }">
  37. <span>{{ node.label }}</span>
  38. </span>
  39. </el-tree>
  40. </el-card>
  41. </div>
  42. </el-aside>
  43. <el-aside width="59%" :height="asideHeight" style="padding-left : 10px;">
  44. <!-- <el-col :span="rightCol">-->
  45. <!-- <el-card :body-style="{'padding-top':'0px'}">-->
  46. <!-- <div class="block">-->
  47. <!-- <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>-->
  48. <!-- </div>-->
  49. <!-- </el-card>-->
  50. <el-card :body-style="{'height':asideHeight + 'px','padding':'0'}">
  51. <form ref="formMain8" id="formMain8" target="frameMain8" :action="reportSrc" method="post">
  52. <input id="Id" type="hidden" name="Id">
  53. </form>
  54. <div v-loading="loading" style="width: 100%;height: 100%;display:flex;flex-direction:row;justify-content:center;align-items:center;">
  55. <i v-if="firstToShow" style="font-size:32px;" class="el-icon-warning-outline"></i>
  56. <p v-if="firstToShow" style="font-weight: bolder;color: #868686;font-size: larger;">请通过左侧树点击指定工程,导出报告</p>
  57. <iframe v-show="!firstToShow" ref="frameMain8" id="frameMain8" name="frameMain8" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  58. </div>
  59. </el-card>
  60. <!-- </el-col>-->
  61. </el-aside>
  62. </el-container>
  63. </div>
  64. </template>
  65. <script>
  66. import request from "@util/gw_ajax_request.js";
  67. import {getTrees} from "@util/gw_formatTree.js";
  68. // import {getYearList} from '@api/jcOneMapApi'
  69. export default {
  70. components: {},
  71. props: [],
  72. data() {
  73. return {
  74. // year:'',
  75. firstToShow: true,
  76. // yearList: [],
  77. searchObj: {
  78. "engScal": '1'
  79. },
  80. Id:'',
  81. asideHeight: window.innerHeight - 106,
  82. treeData: [],
  83. groupTreeData: [],
  84. plnaId: '004', //督查组id
  85. defaultExpandedKeys: ['350000000000'],
  86. adCode: '',
  87. reportSrc: '/pageofficePath/dc/pageoffice/gcjs/show',
  88. loading: false,
  89. rightCol:20,
  90. excelName: '2020在建水利工程监督检查报告',
  91. defaultProps: {
  92. children: 'children',
  93. label: 'pnm'
  94. },
  95. pageIndex: 1,
  96. pageSize: 20,
  97. total: 0
  98. };
  99. },
  100. computed: {
  101. persId() {
  102. return localStorage.getItem("userid")
  103. ? localStorage.getItem("userid")
  104. : "1098101939614724096";
  105. },
  106. },
  107. mounted() {
  108. // this.getYearlists();
  109. this.getGroupData();
  110. },
  111. activated() {
  112. this.getDataList();
  113. },
  114. methods: {
  115. // getYearlists(){
  116. // getYearList().then(res=>{
  117. // this.yearList = res.data;
  118. // let lastItemIndex = this.yearList.length - 1;
  119. // this.year = this.yearList[lastItemIndex].year
  120. // })
  121. // },
  122. // changeYear(val) {
  123. // this.newYear = val;
  124. // this.getGroupData();
  125. // },
  126. provTreeSelectChangeHandler: function(data,node) {
  127. console.log("点击工程后获取数据:"+data.id);
  128. this.Id= data.id;
  129. this.searchExecl();
  130. },
  131. // 获取Excel数据
  132. searchExecl(){
  133. let _this = this;
  134. if( _this.Id == ''&&_this.Id==null){
  135. return;
  136. }
  137. document.getElementById("Id").value = _this.Id;
  138. this.firstToShow = false;
  139. this.loading = true;
  140. // 使用form表单post提交,彻底解决参数值过长的问题
  141. this.$refs.formMain8.submit();
  142. // 使用_this
  143. this.$refs.frameMain8.onload = function(){
  144. _this.loading = false;
  145. };
  146. },
  147. //获取工程列表信息
  148. getDataList() {
  149. let paramObj = {
  150. type: 'empwt',
  151. presId: this.persId,
  152. pageSize: this.pageSize,
  153. pageNum: this.pageIndex,
  154. plnaId: this.plnaId
  155. };
  156. Object.assign(this.searchObj, paramObj)
  157. request
  158. .post(`/dc/insp/rsvrRgstr/list/tree`, this.searchObj)
  159. .then(res => {
  160. if (res.success) {
  161. if(res.data){
  162. for (let i in res.data) {
  163. delete res.data[i].children;
  164. }
  165. }
  166. this.treeData = res.data;
  167. console.log(this.treeData, '132131231312313');
  168. if (this.treeData.length) {
  169. this.currentRow = this.treeData[0];
  170. }
  171. }
  172. });
  173. },
  174. // 点击督查组
  175. getGroupData() {
  176. let params = {
  177. userId: this.persId,
  178. orgType: '004'
  179. };
  180. request.get(`/dc/organization/base/getAllNode`, {params: params}).then(res => {
  181. if (res.success) {
  182. let data = res.data;
  183. data = getTrees(data);
  184. this.groupTreeData = data;
  185. if (data[0] && data[0].id != '004') {
  186. this.plnaId = this.groupTreeData[0].id
  187. }
  188. this.getDataList();
  189. } else {
  190. this.$message.warning(res.message)
  191. }
  192. })
  193. },
  194. groupHandleNodeClick(data) {
  195. this.plnaId = data.id;
  196. this.getDataList()
  197. }
  198. }
  199. };
  200. </script>
  201. <style lang="scss">
  202. .el-table .warning-row {
  203. background: oldlace;
  204. }
  205. .el-table .success-row {
  206. background: #f0f9eb;
  207. }
  208. .left_tree .custom-tree-node {
  209. flex: 1;
  210. display: flex;
  211. align-items: center;
  212. justify-content: space-between;
  213. font-size: 14px;
  214. padding-right: 8px;
  215. }
  216. </style>