d5c4c8024759d928acb923de06ce8f3ef37f4661.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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_p" :expand-on-click-node="false" @node-click="provTreeSelectChangeHandler">
  36. <span class="custom-tree-node" slot-scope="{ node, data }" style="width: 100%;">
  37. <span style="width: 100%;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;" :title="node.label">{{ node.label }}</span></span>
  38. </el-tree>
  39. </el-card>
  40. </div>
  41. </el-aside>
  42. <el-aside width="59%" :height="asideHeight" style="padding-left : 10px;">
  43. <!-- <el-col :span="rightCol">-->
  44. <!-- <el-card :body-style="{'padding-top':'0px'}">-->
  45. <!-- <div class="block">-->
  46. <!-- <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>-->
  47. <!-- </div>-->
  48. <!-- </el-card>-->
  49. <el-card :body-style="{'height':asideHeight + 'px','padding':'0'}">
  50. <form ref="formMain8" id="formMain8" target="frameMain8" :action="reportSrc" method="get">
  51. <!-- <input id="Id" type="hidden" name="Id">-->
  52. <input id="rgstrId" type="hidden" name="rgstrId">
  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: '104', //督查组id
  85. defaultExpandedKeys: ['350000000000'],
  86. adCode: '',
  87. reportSrc: '/pageofficePath/dc/pageoffice/ststn/show',
  88. loading: false,
  89. rightCol:20,
  90. excelName: '“党建+标准化”示范工地评选成果',
  91. defaultProps: {
  92. children: 'children',
  93. label: 'pnm'
  94. },
  95. defaultProps_p: {
  96. children: 'children',
  97. label: 'nm'
  98. },
  99. pageIndex: 1,
  100. pageSize: 20,
  101. total: 0
  102. };
  103. },
  104. computed: {
  105. persId() {
  106. return localStorage.getItem("userid")
  107. ? localStorage.getItem("userid")
  108. : "1098101939614724096";
  109. },
  110. },
  111. mounted() {
  112. // this.getYearlists();
  113. this.getGroupData();
  114. },
  115. activated() {
  116. this.getDataList();
  117. },
  118. methods: {
  119. // getYearlists(){
  120. // getYearList().then(res=>{
  121. // this.yearList = res.data;
  122. // let lastItemIndex = this.yearList.length - 1;
  123. // this.year = this.yearList[lastItemIndex].year
  124. // })
  125. // },
  126. // changeYear(val) {
  127. // this.newYear = val;
  128. // this.getGroupData();
  129. // },
  130. provTreeSelectChangeHandler: function(data,node) {
  131. console.log("点击工程后获取数据:"+data.id);
  132. this.Id= data.id;
  133. this.searchExecl();
  134. },
  135. // 获取Excel数据
  136. searchExecl(){
  137. let _this = this;
  138. if( _this.Id == ''&&_this.Id==null){
  139. return;
  140. }
  141. document.getElementById("rgstrId").value = _this.Id;
  142. this.firstToShow = false;
  143. this.loading = true;
  144. // 使用form表单post提交,彻底解决参数值过长的问题
  145. this.$refs.formMain8.submit();
  146. // 使用_this
  147. this.$refs.frameMain8.onload = function(){
  148. _this.loading = false;
  149. };
  150. },
  151. //获取工程列表信息
  152. getDataList() {
  153. request.get(`/bis/insp/ststn/findStstnList?id=${this.plnaId}`).then(res => {
  154. if (res.success) {
  155. if(res.data){
  156. for (let i in res.data) {
  157. delete res.data[i].children;
  158. }
  159. }
  160. this.treeData = res.data;
  161. }
  162. });
  163. },
  164. // 点击督查组
  165. getGroupData() {
  166. let params = {
  167. userId: this.persId,
  168. orgType: '104'
  169. };
  170. request.get(`/dc/organization/base/getAllNode`, {params: params}).then(res => {
  171. if (res.success) {
  172. let data = res.data;
  173. data = getTrees(data);
  174. this.groupTreeData = data;
  175. if (data[0] && data[0].id != '004') {
  176. this.plnaId = this.groupTreeData[0].id
  177. }
  178. this.getDataList();
  179. } else {
  180. this.$message.warning(res.message)
  181. }
  182. })
  183. },
  184. groupHandleNodeClick(data) {
  185. this.plnaId = data.id;
  186. this.getDataList()
  187. }
  188. }
  189. };
  190. </script>
  191. <style lang="scss">
  192. .el-table .warning-row {
  193. background: oldlace;
  194. }
  195. .el-table .success-row {
  196. background: #f0f9eb;
  197. }
  198. .left_tree .custom-tree-node {
  199. flex: 1;
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. font-size: 14px;
  204. padding-right: 8px;
  205. }
  206. </style>