ca4ce5ed6f5c63ad724dc349d2f2cc5375740aca.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. <!-- 稽察发现问题责任追究清单 -->
  43. <div v-if="item.value === 'jcfxwtzrjqd'" style="padding: 10px;">
  44. <el-button @click="downloadFileWt" type="primary" icon="el-icon-download" style="margin-top: 10px;">下载</el-button>
  45. <div style="margin-top:2%;height:60vh;width: 100%;text-align: center;">
  46. <img src="../../../assets/jcwt.png" alt="稽察问题图片" style="width: 30%;"/>
  47. </div>
  48. </div>
  49. <!-- 稽察组人员名单 -->
  50. <div v-else-if="item.value === 'jczrymd'" style="padding: 10px;">
  51. <el-button @click="downloadFileMd" type="primary" icon="el-icon-download" style="margin-top: 10px;">下载</el-button>
  52. <div style="margin-top:2%;height:60vh;width: 100%;text-align: center;">
  53. <img src="../../../assets/jcmd.png" alt="稽察组人员名单图片" style="width: 30%;"/>
  54. </div>
  55. </div>
  56. <!-- 其他tab保持原有内容 -->
  57. <div v-if="showReport&&item.value !== 'jczrymd'&&item.value !== 'jcfxwtzrjqd'" style="width:100%;padding:0px 0px;" :style="{'height' : tableHeight + 'px'}">
  58. <p v-if="showLastTab"
  59. style="font-weight: bolder;color: #868686;font-size: larger;line-height: 100px;text-align: center">
  60. 请通过左侧树点击指定工程,查看报表</p>
  61. <iframe v-if="!showLastTab && item.value === activeName" id="iframeEle"
  62. :src="tableSrc + '&rgstrId=' + rgstrId + '&names=' + name + '&bgType=' + bgType + '&currentRlcode='+currentRlcode+ '&isStage='+(bgType=='0'?'0':'1')+ '&width=1920&height=592'"
  63. frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  64. </div>
  65. <!-- <component :is="'summary'" :tableSrc="tableSrc" :pcid="pcid" :year="year"></component> -->
  66. </el-tab-pane>
  67. </el-tabs>
  68. </el-main>
  69. </el-container>
  70. </template>
  71. <script>
  72. import summary from './summary'
  73. import request from "@util/gw_ajax_request"
  74. import {reportHosturl} from '@util/global_variable.js'
  75. import { exportModel } from '@util/gw_exportModel';
  76. export default {
  77. data() {
  78. return {
  79. treeHeight: window.innerHeight - 110,
  80. tableHeight: window.innerHeight - 180,
  81. activeName: 'summary',
  82. showReport: false,
  83. tabList: [
  84. {label: '问题统计表(按专业)', value: 'summary'},
  85. {label: '问题统计表(按责任主体)', value: 'membership'},
  86. // {label: '2018-2019年度中央及省级水利投资建设项目稽察问题汇总表', value: 'problemSummary'},
  87. {label: '稽察发现问题清单', value: 'seriousProblemReport'},
  88. {label: '稽察发现问题责任追究统计表', value: 'jcfxwtzrjjtjb'},
  89. {label: '稽察发现问题责任追究清单', value: 'jcfxwtzrjqd'},
  90. {label: '稽察组人员名单', value: 'jczrymd'},
  91. ],
  92. addForm: {
  93. year: '',
  94. batch: '',
  95. persId: localStorage.getItem("userid")
  96. },
  97. yearList: [],
  98. pcList: [],
  99. pcid: '',
  100. year: '',
  101. treeDataLists: [],
  102. defaultProps: {
  103. children: 'children',
  104. label: 'pnm'
  105. },
  106. rgstrId: '',
  107. name: '',
  108. tableSrc: `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zy`,
  109. currentRlcode: localStorage.getItem('currentRlcode'),
  110. bgType:'0',
  111. bgTypeList: [],
  112. }
  113. },
  114. //监听属性 类似于data概念
  115. computed: {
  116. persId() {
  117. return localStorage.getItem("userid")
  118. ? localStorage.getItem("userid")
  119. : "1098101939614724096";
  120. },
  121. showLastTab() {
  122. return this.activeName == 'seriousProblemReport' && !this.rgstrId
  123. },
  124. // tableSrc(){
  125. // return `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zy`
  126. // }
  127. },
  128. components: {
  129. summary,
  130. },
  131. mounted() {
  132. this.$nextTick(() => {
  133. this.getTreeData();
  134. })
  135. this.getBgTypeList();
  136. },
  137. methods: {
  138. downloadFileWt(){
  139. this.downloadFile('https://27.156.118.74:19901/upload/2026//5//28//787a6a8d8bde410f8077a04a350e39b9.xlsx', '稽察发现问题责任追究清单.xlsx');
  140. },
  141. downloadFileMd(){
  142. this.downloadFile('https://27.156.118.74:19901/upload/2026\\5\\28\\13b644e133644930a27c945209c3675b.xlsx', '稽察组人员名单.xlsx');
  143. },
  144. downloadFile(url, fileName) {
  145. fetch(url, { responseType: 'blob' })
  146. .then(response => response.blob())
  147. .then(blob => {
  148. const link = document.createElement('a');
  149. link.href = URL.createObjectURL(blob);
  150. link.download = fileName;
  151. document.body.appendChild(link);
  152. link.click();
  153. document.body.removeChild(link);
  154. URL.revokeObjectURL(link.href);
  155. })
  156. .catch(error => {
  157. console.error('下载失败:', error);
  158. this.$message.error('下载失败,请稍后重试');
  159. });
  160. },
  161. search() {
  162. let iframe = document.getElementById('iframeEle')
  163. let src = this.tableSrc
  164. iframe.src = src
  165. + '&year=' + this.addForm.year
  166. + '&pcid=' + this.addForm.batch
  167. + '&bgType=' + this.bgType
  168. + '&currentRlcode=' + this.currentRlcode
  169. + '&isStage=' + (this.bgType === '0' ? '0' : '1')
  170. + '&width=1920&height=592'
  171. },
  172. //获取左侧树数据
  173. getTreeData() {
  174. let _self = this;
  175. request.post(`/tac/insp/year/batch/obj/getObjTreeListV2`, {
  176. "persId": _self.persId
  177. }).then(res => {
  178. _self.showReport = true
  179. _self.treeDataLists = res.data.children;
  180. console.log(_self.treeDataLists)
  181. let batchList = _self.treeDataLists[0].children
  182. let rgstrId = []
  183. let projectList = []
  184. batchList[0].children.forEach(ele => {
  185. ele.children.forEach(element => {
  186. projectList = projectList.concat(element.children)
  187. })
  188. })
  189. projectList.forEach(ele => {
  190. rgstrId.push(ele.id)
  191. })
  192. this.rgstrId = rgstrId.join(',')
  193. this.name = batchList[0].pnm
  194. console.log(rgstrId)
  195. setTimeout(() => {
  196. this.$refs.tree2.filter('初始化');
  197. }, 1000)
  198. })
  199. },
  200. getBgTypeList() {
  201. request.post(`/tac/province/plan/process/list`, {}).then(res => {
  202. if (res.success) {
  203. this.bgTypeList = res.data;
  204. let expertOpinion = {
  205. nowStep: '专家现场意见稿',
  206. nowId: '0'
  207. }
  208. this.bgTypeList.unshift(expertOpinion);//方法将把它的参数插入 arrayObject 的头部
  209. }
  210. })
  211. },
  212. //树节点点击事件
  213. treeNodeClickHandler(data, node, tree) {
  214. let rgstrId = []
  215. let projectList = []
  216. if (this.activeName == 'seriousProblemReport') {
  217. if (node.level == 5) {
  218. this.rgstrId = data.id
  219. this.name = data.pnm
  220. } else {
  221. this.rgstrId = ''
  222. this.name = ''
  223. }
  224. } else {
  225. if(node.level == 1){
  226. data.children.forEach(ele => {
  227. ele.children.forEach(element => {
  228. element.children.forEach(element1 => {
  229. projectList = projectList.concat(element1.children)
  230. })
  231. })
  232. })
  233. projectList.forEach(ele => {
  234. rgstrId.push(ele.id)
  235. })
  236. this.rgstrId = rgstrId.join(',')
  237. this.name = data.pnm
  238. }else if (node.level == 2) {
  239. data.children.forEach(ele => {
  240. ele.children.forEach(element => {
  241. projectList = projectList.concat(element.children)
  242. })
  243. })
  244. projectList.forEach(ele => {
  245. rgstrId.push(ele.id)
  246. })
  247. this.rgstrId = rgstrId.join(',')
  248. this.name = data.pnm
  249. } else if (node.level == 3) {
  250. data.children.forEach(ele => {
  251. projectList = projectList.concat(ele.children)
  252. })
  253. projectList.forEach(ele => {
  254. rgstrId.push(ele.id)
  255. })
  256. this.rgstrId = rgstrId.join(',')
  257. this.name = data.pnm
  258. } else if (node.level == 4) {
  259. projectList = projectList.concat(data.children)
  260. projectList.forEach(ele => {
  261. rgstrId.push(ele.id)
  262. })
  263. this.rgstrId = rgstrId.join(',')
  264. this.name = data.pnm
  265. } else {
  266. this.rgstrId = ''
  267. this.name = ''
  268. }
  269. }
  270. },
  271. filterNode(value, data, node) {
  272. if (!value) return true;
  273. if (this.activeName == 'seriousProblemReport') {
  274. return node.level < 6;
  275. } else {
  276. return node.level < 5;
  277. }
  278. },
  279. changeYear() {
  280. },
  281. handleClick() {
  282. }
  283. },
  284. watch: {
  285. activeName(val) {
  286. if (val == 'summary') {
  287. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zy`
  288. } else if (val == 'membership') {
  289. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_zrzt`
  290. } else if (val == 'problemSummary') {
  291. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_wttj_huizong`
  292. } else if (val == 'seriousProblemReport') {
  293. this.rgstrId = ''
  294. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_fxwtqd`
  295. } else if (val == 'jcfxwtzrjjtjb') {
  296. this.rgstrId = ''
  297. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport-suoding.jsp?rpx=fjjc_fxwt_zrjj.rpx`
  298. }
  299. this.$refs.tree2.filter(val);
  300. }
  301. }
  302. }
  303. </script>
  304. <style lang="scss">
  305. .report_tree {
  306. margin-top: 20px;
  307. }
  308. </style>