a5d68beec8cc8e162923ac9c28d23ec3d3fe38c8.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <el-container>
  3. <el-aside width="250px" :style="{'height': treeHeight + 'px'}">
  4. <el-tree
  5. :highlight-current="true"
  6. class="filter_tree report_tree"
  7. :data="treeDataLists"
  8. :props="defaultProps"
  9. node-key="id"
  10. :filter-node-method="filterNode"
  11. :expand-on-click-node="false"
  12. :default-expand-all="true"
  13. @node-click='treeNodeClickHandler'
  14. ref="tree2">
  15. <span class="custom-tree-node" slot-scope="{ node }">
  16. <el-tooltip v-if="node.isLeaf" class="item" effect="dark" :content="node.label"
  17. placement="top-start">
  18. <span>{{ node.label }}</span>
  19. </el-tooltip>
  20. <span v-else>{{ node.label }}</span>
  21. </span>
  22. </el-tree>
  23. </el-aside>
  24. <el-main>
  25. <div class="block" style="'padding':'10px 0'">
  26. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">报告状态</span>
  27. <el-select v-model="bgType" placeholder="请选择" @change="search">
  28. <el-option :label="item.nowStep" :value="item.nowId" :key="index"
  29. v-for="(item,index) in bgTypeList"/>
  30. </el-select>
  31. <!-- <el-select v-model="bgType" clearable placeholder="请选择">-->
  32. <!-- <el-option label="专家(交换意见稿)" value="0"></el-option>-->
  33. <!-- <el-option label="交换意见阶段" value="4"></el-option>-->
  34. <!-- <el-option label="成果讨论阶段" value="5"></el-option>-->
  35. <!-- <el-option label="中心修改阶段" value="6"></el-option>-->
  36. <!-- <el-option label="司局修改阶段" value="7"></el-option>-->
  37. <!-- </el-select>-->
  38. </div>
  39. <el-tabs v-model="activeName" @tab-click="handleClick">
  40. <el-tab-pane v-for="(item,index) in tabList" :key="index" :label="item.label" :lazy="true"
  41. :name="item.value">
  42. <div v-if="showReport" style="width:100%;padding:0px 0px;" :style="{'height' : tableHeight + 'px'}">
  43. <p v-if="showLastTab"
  44. style="font-weight: bolder;color: #868686;font-size: larger;line-height: 100px;text-align: center">
  45. 请通过左侧树点击指定工程,查看报表</p>
  46. <iframe v-if="!showLastTab && item.value === activeName" id="iframeEle"
  47. :src="tableSrc + '&rgstrId=' + rgstrId + '&names=' + name + '&bgType=' + bgType + '&currentRlcode='+currentRlcode+ '&isStage='+(bgType=='0'?'0':'1')+ '&width=1920&height=592'"
  48. frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  49. </div>
  50. <!-- <component :is="'summary'" :tableSrc="tableSrc" :pcid="pcid" :year="year"></component> -->
  51. </el-tab-pane>
  52. </el-tabs>
  53. </el-main>
  54. </el-container>
  55. </template>
  56. <script>
  57. import summary from './summary'
  58. import request from "@util/gw_ajax_request"
  59. import {reportHosturl} from '@util/global_variable.js'
  60. export default {
  61. data() {
  62. return {
  63. treeHeight: window.innerHeight - 110,
  64. tableHeight: window.innerHeight - 180,
  65. activeName: 'summary',
  66. showReport: false,
  67. tabList: [
  68. {label: '问题统计表(按专业)', value: 'summary'},
  69. {label: '问题统计表(按责任主体)', value: 'membership'},
  70. // {label: '2018-2019年度中央及省级水利投资建设项目稽察问题汇总表', value: 'problemSummary'},
  71. {label: '稽察发现问题清单', value: 'seriousProblemReport'},
  72. {label: '稽察发现问题责任追究统计表', value: 'jcfxwtzrjjtjb'}
  73. ],
  74. addForm: {
  75. year: '',
  76. batch: '',
  77. persId: localStorage.getItem("userid")
  78. },
  79. yearList: [],
  80. pcList: [],
  81. pcid: '',
  82. year: '',
  83. treeDataLists: [],
  84. defaultProps: {
  85. children: 'children',
  86. label: 'pnm'
  87. },
  88. rgstrId: '',
  89. name: '',
  90. tableSrc: `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zy`,
  91. currentRlcode: localStorage.getItem('currentRlcode'),
  92. bgType:'0',
  93. bgTypeList: [],
  94. }
  95. },
  96. //监听属性 类似于data概念
  97. computed: {
  98. persId() {
  99. return localStorage.getItem("userid")
  100. ? localStorage.getItem("userid")
  101. : "1098101939614724096";
  102. },
  103. showLastTab() {
  104. return this.activeName == 'seriousProblemReport' && !this.rgstrId
  105. },
  106. // tableSrc(){
  107. // return `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zy`
  108. // }
  109. },
  110. components: {
  111. summary,
  112. },
  113. mounted() {
  114. this.$nextTick(() => {
  115. this.getTreeData();
  116. })
  117. this.getBgTypeList();
  118. },
  119. methods: {
  120. search() {
  121. let iframe = document.getElementById('iframeEle')
  122. let src = this.tableSrc
  123. iframe.src = src
  124. + '&year=' + this.addForm.year
  125. + '&pcid=' + this.addForm.batch
  126. + '&bgType=' + this.bgType
  127. + '&currentRlcode=' + this.currentRlcode
  128. + '&isStage=' + (this.bgType === '0' ? '0' : '1')
  129. + '&width=1920&height=592'
  130. },
  131. //获取左侧树数据
  132. getTreeData() {
  133. let _self = this;
  134. request.post(`/tac/insp/year/batch/obj/getObjTreeListV2`, {
  135. "persId": _self.persId
  136. }).then(res => {
  137. _self.showReport = true
  138. _self.treeDataLists = res.data.children;
  139. console.log(_self.treeDataLists)
  140. let batchList = _self.treeDataLists[0].children
  141. let rgstrId = []
  142. let projectList = []
  143. batchList[0].children.forEach(ele => {
  144. ele.children.forEach(element => {
  145. projectList = projectList.concat(element.children)
  146. })
  147. })
  148. projectList.forEach(ele => {
  149. rgstrId.push(ele.id)
  150. })
  151. this.rgstrId = rgstrId.join(',')
  152. this.name = batchList[0].pnm
  153. console.log(rgstrId)
  154. setTimeout(() => {
  155. this.$refs.tree2.filter('初始化');
  156. }, 1000)
  157. })
  158. },
  159. getBgTypeList() {
  160. request.post(`/tac/province/plan/process/list`, {}).then(res => {
  161. if (res.success) {
  162. this.bgTypeList = res.data;
  163. let expertOpinion = {
  164. nowStep: '专家现场意见稿',
  165. nowId: '0'
  166. }
  167. this.bgTypeList.unshift(expertOpinion);//方法将把它的参数插入 arrayObject 的头部
  168. }
  169. })
  170. },
  171. //树节点点击事件
  172. treeNodeClickHandler(data, node, tree) {
  173. let rgstrId = []
  174. let projectList = []
  175. if (this.activeName == 'seriousProblemReport') {
  176. if (node.level == 5) {
  177. this.rgstrId = data.id
  178. this.name = data.pnm
  179. } else {
  180. this.rgstrId = ''
  181. this.name = ''
  182. }
  183. } else {
  184. if(node.level == 1){
  185. data.children.forEach(ele => {
  186. ele.children.forEach(element => {
  187. element.children.forEach(element1 => {
  188. projectList = projectList.concat(element1.children)
  189. })
  190. })
  191. })
  192. projectList.forEach(ele => {
  193. rgstrId.push(ele.id)
  194. })
  195. this.rgstrId = rgstrId.join(',')
  196. this.name = data.pnm
  197. }else if (node.level == 2) {
  198. data.children.forEach(ele => {
  199. ele.children.forEach(element => {
  200. projectList = projectList.concat(element.children)
  201. })
  202. })
  203. projectList.forEach(ele => {
  204. rgstrId.push(ele.id)
  205. })
  206. this.rgstrId = rgstrId.join(',')
  207. this.name = data.pnm
  208. } else if (node.level == 3) {
  209. data.children.forEach(ele => {
  210. projectList = projectList.concat(ele.children)
  211. })
  212. projectList.forEach(ele => {
  213. rgstrId.push(ele.id)
  214. })
  215. this.rgstrId = rgstrId.join(',')
  216. this.name = data.pnm
  217. } else if (node.level == 4) {
  218. projectList = projectList.concat(data.children)
  219. projectList.forEach(ele => {
  220. rgstrId.push(ele.id)
  221. })
  222. this.rgstrId = rgstrId.join(',')
  223. this.name = data.pnm
  224. } else {
  225. this.rgstrId = ''
  226. this.name = ''
  227. }
  228. }
  229. },
  230. filterNode(value, data, node) {
  231. if (!value) return true;
  232. if (this.activeName == 'seriousProblemReport') {
  233. return node.level < 6;
  234. } else {
  235. return node.level < 5;
  236. }
  237. },
  238. changeYear() {
  239. },
  240. handleClick() {
  241. }
  242. },
  243. watch: {
  244. activeName(val) {
  245. if (val == 'summary') {
  246. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zy`
  247. } else if (val == 'membership') {
  248. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zrzt`
  249. } else if (val == 'problemSummary') {
  250. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_huizong`
  251. } else if (val == 'seriousProblemReport') {
  252. this.rgstrId = ''
  253. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_fxwtqd`
  254. } else if (val == 'jcfxwtzrjjtjb') {
  255. this.rgstrId = ''
  256. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_fxwt_zrjj.rpx`
  257. }
  258. this.$refs.tree2.filter(val);
  259. }
  260. }
  261. }
  262. </script>
  263. <style lang="scss">
  264. .report_tree {
  265. margin-top: 20px;
  266. }
  267. </style>