e7a896471a9a5e80e7314cd9f2f5229796745fe4.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <!-- -->
  2. <template>
  3. <div>
  4. <el-row>
  5. <el-col :span="leftWidth" style="padding: 0;border-right: 1px solid #dcdfe6;"
  6. :style="{'height': colHeight + 'px'}">
  7. <el-container>
  8. <el-header style="height: 3vh;padding: 0 10px;line-height: 3vh;border-bottom:1px solid #dcdfe6;">
  9. <strong>稽察任务</strong>
  10. </el-header>
  11. <el-main style="padding:10px 0;">
  12. <el-row style="padding: 0 10px;">
  13. <el-input clearable placeholder="点击下列选项或输入关键字搜索" v-model="filterText">
  14. </el-input>
  15. </el-row>
  16. <el-row style="padding: 10px;">
  17. <el-form :inline="true" size="mini" class="demo-form-inline">
  18. <el-row>
  19. <el-col :span="24">
  20. <el-form-item label="年度">
  21. <el-select v-model="year" clearable style="width:100px;">
  22. <el-option :lable="item.year" :value="item.year" :key="item.id"
  23. v-for="item in yearList"></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="批次">
  27. <el-select v-model="batch" clearable style="width:100px;">
  28. <el-option :lable="item.batch" :value="item.batch" :key="item.id"
  29. v-for="item in pcList"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-button type="primary" size="mini" @click="treeSearch">查询</el-button>
  33. </el-col>
  34. </el-row>
  35. </el-form>
  36. </el-row>
  37. <el-row style="overflow-y:auto;padding: 0 10px;" :style="{'height': colHeight - 170 + 'px'}">
  38. <el-tree :highlight-current="true" class="filter_tree" :data="treeDataLists"
  39. :props="defaultProps" :default-expanded-keys="defaultExpanded"
  40. :filter-node-method="filterNode" node-key="id" @node-click='treeNodeClickHandler'
  41. ref="tree2">
  42. <span class="custom-tree-node" slot-scope="{ node }">
  43. <el-tooltip v-if="node.isLeaf" class="item" effect="dark" :content="node.label"
  44. placement="top-start">
  45. <span>{{ node.label }}</span>
  46. </el-tooltip>
  47. <span v-else>{{ node.label }}</span>
  48. </span>
  49. </el-tree>
  50. </el-row>
  51. </el-main>
  52. </el-container>
  53. </el-col>
  54. <el-col :span="rightWidth" style="border-right: 1px solid #dcdfe6;position:relative;"
  55. :style="{'height': colHeight + 'px'}">
  56. <el-container style="flex-direction: column;">
  57. <el-row style="">
  58. <Profession ref="ProfessionRef" :reallMenuLists="reallMenuLists" :currentNodeId="currentNodeId"
  59. :projectName="projectName + stateName"
  60. @professionChildrenTableName="professionChildrenTableNameEvent">
  61. </Profession>
  62. </el-row>
  63. <el-header style="background: #F5F9FC;font-size:large;height: 3.5vh;line-height:3.5vh;padding: 0;text-align:center;">
  64. <strong>{{projectName + stateName + rightTableName}} </strong>
  65. </el-header>
  66. <el-main style="padding:0;overflow:hidden;display: flex;flex-direction: column;">
  67. <div style="text-align: right;" v-if="isHb">
  68. <el-select v-model="tbIf" clearable placeholder="请选择是否填报">
  69. <el-option v-for="(item,index) in tbIfList" :label="item.label" :value="item.value" :key="item.value"></el-option>
  70. </el-select>
  71. <el-button type="primary" @click="showBcqdFn1()">查询</el-button>
  72. <el-button type="primary" style="margin-right: 20px;font-size: 14px" @click="showBcqdFn()">生成必查清单</el-button>
  73. </div>
  74. <component :is="curComponent" :type="professionType" :pertype="pertype" :objId="objId"
  75. :currentNodeId="currentNodeId" :projectName="projectName" :rightTableName="rightTableName"
  76. :backStatus="backStatus" :hasPriv="hasPriv"
  77. :submitStatus="submitStatus" ref="componentRef" pageName="inspectionView"></component>
  78. </el-main>
  79. </el-container>
  80. <div class="open_board">
  81. <i class="el-icon-arrow-left" v-if="isOpen" @click="closeLeft"></i>
  82. <i class="el-icon-arrow-right" v-else @click="openLeft"></i>
  83. </div>
  84. </el-col>
  85. </el-row>
  86. </div>
  87. </template>
  88. <script>
  89. import Profession from './Profession';
  90. import request from '../../utils/gw_ajax_request'
  91. import problemView from './problemView.vue'
  92. import {
  93. getPerType,
  94. } from "../../api/InspectionReport.js";
  95. export default {
  96. //import引入的组件需要注入到对象中才能使用
  97. components: {
  98. Profession,//专业折叠面板组件
  99. problemView
  100. },
  101. data() {
  102. //这里存放数据
  103. return {
  104. stateName: '', //状态名称
  105. leftWidth: 5,
  106. rightWidth: 19,
  107. isOpen: true,
  108. defaultExpanded: [],//树默认展开节点数组
  109. curComponent: "problemView",
  110. professionType: '',//专业类型
  111. rightTableName: '必查清单',
  112. currentNodeId: '',//点击树的节点登记表ID
  113. inspGroupId: '',//点击树的节点组ID
  114. pertype: '',//稽察填报人员类型,用于控制表格上方菜单控制
  115. objId: '',//点击树节点的objId
  116. tableSrc: '',//报表的链接
  117. projectName: '',//点击树的工程名称
  118. colHeight: window.innerHeight - 90,
  119. filterText: '',
  120. year: "",
  121. batch: "",
  122. yearList: [],
  123. pcList: [],
  124. treeDataLists: [],
  125. defaultProps: {
  126. children: 'children',
  127. label: 'pnm'
  128. },
  129. backStatus: false,
  130. reallMenuLists: [],//菜单实际用的数组
  131. menuList: [//配置菜单用的数组
  132. {
  133. pType: '1',
  134. index: '1',
  135. title: '前期与设计',
  136. menuDis: false,
  137. },
  138. {
  139. pType: '2',
  140. index: '2',
  141. title: '建设管理',
  142. menuDis: false,
  143. },
  144. {
  145. pType: '3',
  146. index: '3',
  147. title: '计划下达与执行',
  148. menuDis: false,
  149. },
  150. {
  151. pType: '4',
  152. index: '4',
  153. title: '资金使用与管理',
  154. menuDis: false,
  155. },
  156. {
  157. pType: '5',
  158. index: '5',
  159. title: '工程质量',
  160. menuDis: false,
  161. },
  162. {
  163. pType: '6',
  164. index: '6',
  165. title: '工程安全',
  166. menuDis: false,
  167. },
  168. ],
  169. menuLists: [],
  170. submitStatus: '',
  171. // dailyRecordVisible: false, //操作日志弹窗
  172. isClicked: false,
  173. ynList: [
  174. {label: '是',value: '1'},
  175. {label: '否',value: '0'},
  176. ],
  177. problemType: [
  178. {label: '一般',value: '0'},
  179. {label: '较重',value: '1'},
  180. {label: '严重',value: '2'}
  181. ],
  182. problemViewshow:false,
  183. tbIf:'',
  184. tbIfList:[
  185. {label: '全部',value: ''},
  186. {label: '未填报',value: '0'},
  187. {label: '已填报',value: '1'}
  188. ]
  189. };
  190. },
  191. //监听属性 类似于data概念
  192. computed: {
  193. persId() {
  194. return localStorage.getItem("userid")
  195. ? localStorage.getItem("userid")
  196. : "1098101939614724096";
  197. },
  198. hasPriv() {
  199. return this.ownPriv('manage')
  200. },
  201. isHb(){
  202. if(localStorage.getItem('currentRlcode').substring(0,2)=="42"){
  203. return true;
  204. }else{
  205. return false;
  206. }
  207. }
  208. },
  209. //监控data中的数据变化
  210. watch: {
  211. filterText(val) {
  212. this.$refs.tree2.filter(val);
  213. },
  214. },
  215. //方法集合
  216. methods: {
  217. async getYearPc() {
  218. await request.post(`/tac/insp/year/list`, {}).then(res => {
  219. if (res.success) {
  220. this.$nextTick(() => {
  221. this.yearList = res.data;
  222. })
  223. }
  224. })
  225. request.post(`/tac/insp/batch/list`, {}).then(res => {
  226. if (res.success) {
  227. this.pcList = res.data;
  228. }
  229. })
  230. },
  231. filterNode(value, data) {
  232. if (!value) return true;
  233. return data.pnm.indexOf(value) !== -1;
  234. },
  235. //获取左侧树数据
  236. getTreeData: function () {
  237. let _self = this;
  238. request.post(`/tac/insp/year/batch/obj/getObjTreeListV2`, {
  239. "persId": _self.persId,
  240. "year": _self.year,
  241. "batch": _self.batch
  242. }).then(res => {
  243. _self.treeDataLists = res.data.children;
  244. })
  245. },
  246. findChildren (data) {
  247. if (data.hasOwnProperty('children')) {
  248. if(data.children && data.children.length > 0){
  249. this.findChildren(data.children[0])
  250. } else {
  251. this.currentNodeId = data.id
  252. this.defaultExpanded = [data.pid]
  253. // this.defaultCheckedKeys = [this.currentNodeId]
  254. this.projectName = data.pnm
  255. this.$nextTick(()=>{
  256. this.$refs.tree2.setCurrentKey(this.currentNodeId);
  257. })
  258. }
  259. }else {
  260. this.currentNodeId = data.id
  261. this.defaultExpanded = [data.pid]
  262. // this.defaultCheckedKeys = [this.currentNodeId]
  263. this.projectName = data.pnm
  264. this.$nextTick(()=>{
  265. this.$refs.tree2.setCurrentKey(this.currentNodeId);
  266. })
  267. }
  268. },
  269. //左侧树搜索
  270. treeSearch() {
  271. this.getTreeData();
  272. },
  273. //树节点点击事件
  274. treeNodeClickHandler: function (data, node, tree) {
  275. if (node.childNodes.length == 0) {
  276. console.log(node.parent.data.pid)
  277. let dataState = node.data.state;
  278. this.projectName = data.pnm;
  279. this.currentNodeId = data.id;
  280. this.objId = data.objId;
  281. this.inspGroupId = node.parent.data.pid;
  282. this.reallMenuLists = [];
  283. this.getMenu(dataState);
  284. this.$nextTick(()=>{
  285. this.showBcqdFn1()
  286. })
  287. } else {
  288. return;
  289. }
  290. },
  291. getMenu: function (dataState) {
  292. let _self = this;
  293. let thisType = true;
  294. getPerType(_self.inspGroupId, _self.persId).then((res) => {
  295. console.log(res);
  296. _self.pertype = res.data.pertype;
  297. res.data.forEach(ele => {
  298. if (ele.pertype == '11' || ele.pertype == '12' || ele.pertype == '13' || ele.pertype == '14' || ele.pertype == '15' || ele.pertype == '16') {
  299. _self.reallMenuLists.push(_self.menuLists[Number(ele.pertype) - 11]);
  300. thisType = true;
  301. } else {
  302. _self.reallMenuLists = _self.menuLists;
  303. thisType = false;
  304. return;
  305. }
  306. })
  307. if (thisType) {
  308. _self.reallMenuLists.push(_self.menuLists[6]);
  309. if (_self.menuLists[7]) {
  310. _self.reallMenuLists.push(_self.menuLists[7]);
  311. }
  312. }
  313. console.log(_self.reallMenuLists);
  314. });
  315. },
  316. //中间专业导航后处理
  317. professionChildrenTableNameEvent(item) {
  318. this.professionType = item.type;//专业类型
  319. this.$nextTick(()=>{
  320. this.showBcqdFn1()
  321. })
  322. },
  323. closeLeft() {
  324. this.isOpen = false
  325. this.leftWidth = 0
  326. this.rightWidth = 24
  327. },
  328. openLeft() {
  329. this.isOpen = true
  330. this.leftWidth = 5
  331. this.rightWidth = 19
  332. },
  333. showBcqdFn(){
  334. if(!this.currentNodeId){
  335. this.$message.warning('请先在左侧选择工程!');
  336. return
  337. }
  338. if(!this.professionType){
  339. this.$message.warning('请选择专业类型');
  340. return
  341. }
  342. this.$refs.componentRef.getProblemList(this.tbIf)
  343. },
  344. showBcqdFn1(){
  345. if(!this.currentNodeId){
  346. this.$message.warning('请先在左侧选择工程!');
  347. return
  348. }
  349. if(!this.professionType){
  350. this.$message.warning('请选择专业类型');
  351. return
  352. }
  353. this.$refs.componentRef.getProblemList1(this.tbIf)
  354. }
  355. },
  356. //生命周期 - 创建完成(可以访问当前this实例)
  357. created() {
  358. },
  359. //生命周期 - 挂载完成(可以访问DOM元素)
  360. mounted() {
  361. this.getTreeData();
  362. this.getMenu();
  363. this.menuLists = this.menuList;
  364. this.reallMenuLists = this.menuLists;
  365. },
  366. beforeCreate() { }, //生命周期 - 创建之前
  367. beforeMount() { }, //生命周期 - 挂载之前
  368. beforeUpdate() { }, //生命周期 - 更新之前
  369. updated() { }, //生命周期 - 更新之后
  370. beforeDestroy() { }, //生命周期 - 销毁之前
  371. destroyed() { }, //生命周期 - 销毁完成
  372. activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  373. }
  374. </script>
  375. <style lang="scss">
  376. .filter_tree {
  377. .el-tree-node__label {
  378. color: #666;
  379. font-size: large;
  380. }
  381. }
  382. .filter_tree.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
  383. background-color: #c7e9fe;
  384. }
  385. .assistant_btn {
  386. position: absolute;
  387. bottom: -10px;
  388. right: 20px;
  389. z-index: 999;
  390. }
  391. .open_board {
  392. position: absolute;
  393. bottom: 0;
  394. left: 0;
  395. width: 24px;
  396. height: 30px;
  397. line-height: 30px;
  398. border: solid 1px #ddd;
  399. border-top-right-radius: 5px;
  400. border-bottom-right-radius: 5px;
  401. text-align: center;
  402. background-color: #bbebff;
  403. cursor: pointer;
  404. }
  405. </style>