d00aa3bcb8eb63359694ef60b486947376d64006.svn-base 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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: '125', //督查组id
  85. defaultExpandedKeys: ['350000000000'],
  86. adCode: '',
  87. reportSrc: '/pageofficePath/dc/pageoffice/fjpjcsu/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. // //debugger
  138. let _this = this;
  139. if( _this.Id == ''&&_this.Id==null){
  140. return;
  141. }
  142. document.getElementById("rgstrId").value = _this.Id;
  143. this.firstToShow = false;
  144. this.loading = true;
  145. // 使用form表单post提交,彻底解决参数值过长的问题
  146. this.$refs.formMain8.submit();
  147. // 使用_this
  148. this.$refs.frameMain8.onload = function(){
  149. _this.loading = false;
  150. };
  151. },
  152. //获取工程列表信息
  153. getDataList() {
  154. const params = {
  155. id:this.plnaId
  156. }
  157. request.post(`/bis/insp/fjpjcsu/findPageOfficeList`,params).then(res => {
  158. if (res.success) {
  159. if(res.data){
  160. for (let i in res.data) {
  161. delete res.data[i].children;
  162. }
  163. }
  164. this.treeData = res.data;
  165. }
  166. });
  167. },
  168. // 点击督查组
  169. getGroupData() {
  170. let params = {
  171. userId: this.persId,
  172. orgType: '125'
  173. };
  174. request.get(`/dc/organization/base/getAllNode`, {params: params}).then(res => {
  175. if (res.success) {
  176. let data = res.data;
  177. data = getTrees(data);
  178. this.groupTreeData = data;
  179. if (data[0] && data[0].id != '004') {
  180. this.plnaId = this.groupTreeData[0].id
  181. }
  182. this.getDataList();
  183. } else {
  184. this.$message.warning(res.message)
  185. }
  186. })
  187. },
  188. groupHandleNodeClick(data) {
  189. this.plnaId = data.id;
  190. this.getDataList()
  191. }
  192. }
  193. };
  194. </script>
  195. <style lang="scss">
  196. .el-table .warning-row {
  197. background: oldlace;
  198. }
  199. .el-table .success-row {
  200. background: #f0f9eb;
  201. }
  202. .left_tree .custom-tree-node {
  203. flex: 1;
  204. display: flex;
  205. align-items: center;
  206. justify-content: space-between;
  207. font-size: 14px;
  208. padding-right: 8px;
  209. }
  210. </style>