e23aa6b55d64f0a63ad73069a86da680ad0db305.svn-base 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside :height="asideHeight" style="padding-right: 10px;width: 300px;">
  5. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  6. <el-card class="box-card" style="min-height: 99%;" id="headerBtn">
  7. <div slot="header" class="clearfix">
  8. <div style="width: 100%;text-align: center;">
  9. <el-button size="mini" :class="tabType==1 ? 'c_active' : 'c_normal'" @click="tabChange('1')">当前数据</el-button>
  10. <!-- <el-button size="mini" :class="tabType==2 ? 'c_active' : 'c_normal'" @click="tabChange('2')">历史数据</el-button>-->
  11. <el-button size="mini" :class="tabType==0 ? 'c_active' : 'c_normal'" @click="tabChange('0')">全部数据</el-button>
  12. </div>
  13. <span style="line-height: 30px;">督查组</span>
  14. </div>
  15. <el-tree :data="groupTreeData" :props="defaultProps" :expand-on-click-node="false" @node-click="groupHandleNodeClick">
  16. </el-tree>
  17. </el-card>
  18. </div>
  19. </el-aside>
  20. <el-aside style="width: calc(50% - 300px);" :height="asideHeight">
  21. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  22. <el-card class="box-card" style="min-height: 99%">
  23. <div slot="header" class="clearfix">
  24. <span>工程信息</span>
  25. </div>
  26. <el-tree :data="treeData" :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick">
  27. <span class="custom-tree-node" slot-scope="{ node, data }">
  28. <span>{{ node.label }}</span>
  29. <span>
  30. <!-- <el-button-->
  31. <!-- type="text"-->
  32. <!-- size="mini"-->
  33. <!-- v-if="node.level == 1"-->
  34. <!-- @click="() => updateState(data,node)">-->
  35. <!-- 提交-->
  36. <!-- </el-button>-->
  37. <el-button
  38. type="text"
  39. size="mini"
  40. v-if="node.level == 1"
  41. @click="() => downloadDuty(data,node)">
  42. 下载追究责任意见表
  43. </el-button>
  44. <el-button
  45. type="text"
  46. size="mini"
  47. v-if="node.level == 1"
  48. @click="() => toCorrect(data,node)">
  49. 纠错
  50. </el-button>
  51. <el-button
  52. type="text"
  53. size="mini"
  54. v-if="node.level == 1"
  55. @click="() => toAddUnitOne(data,node)">
  56. 添加标段
  57. </el-button>
  58. <el-button
  59. type="text"
  60. size="mini"
  61. v-if="node.level == 2"
  62. @click="() => toEditUnitOne(data,node)">
  63. 编辑
  64. </el-button>
  65. <el-button
  66. type="text"
  67. size="mini"
  68. v-if="node.level == 2"
  69. @click="() => toAddUnitTwo(data,node)">
  70. 添加责任单位
  71. </el-button>
  72. <el-button
  73. type="text"
  74. size="mini"
  75. v-if="node.level == 3"
  76. @click="() => toSign(data,node)">
  77. 签字
  78. </el-button>
  79. <el-button
  80. type="text"
  81. size="mini"
  82. v-if="node.level == 3"
  83. @click="() => toZzyzg(data,node)">
  84. 追责与整改
  85. </el-button>
  86. <el-button
  87. type="text"
  88. size="mini"
  89. v-if="node.level == 3"
  90. @click="() => toEditUnitTwo(data,node)">
  91. 编辑
  92. </el-button>
  93. <el-button
  94. type="text"
  95. size="mini"
  96. v-if="node.level == 3"
  97. @click="() => delete_unitTwo(data,node)">
  98. 删除
  99. </el-button>
  100. <el-button
  101. type="text"
  102. size="mini"
  103. v-if="node.level == 3"
  104. @click="() => downDataTable(data,node)">
  105. 检查表下载
  106. </el-button>
  107. </span>
  108. </span>
  109. </el-tree>
  110. </el-card>
  111. </div>
  112. </el-aside>
  113. <el-main id="dxdcListMainsk" style="width: calc(100% - 700px);height:100%;padding:0px 0px 0px 10px;">
  114. <div class="flex_wrapper" :style="{'height': asideHeight-9 + 'px'}">
  115. <!-- 工程问题清单 -->
  116. <project-problem :currentRow="currentRow" :showAddBtn="showAddBtn" :tabType="tabType" :levelId="levelId"></project-problem>
  117. </div>
  118. </el-main>
  119. </el-container>
  120. <!-- 工程纠错 -->
  121. <el-dialog :title="'基本信息纠错'" :visible.sync="correct_Dialog" v-if="correct_Dialog" @close="closeDialogP">
  122. <jichuxinxi
  123. :currentResCode="currentResCode"
  124. :currentObjectId="currentObjectId"
  125. @close="closeDialogP"
  126. :currentObjectRgstrId="currentObjectRgstrId"
  127. :currentObjectName="currentObjectName"
  128. :openType="openType">
  129. </jichuxinxi>
  130. </el-dialog>
  131. <el-dialog :title="'签字'" :visible.sync="sign_Dialog" v-if="sign_Dialog" @close="closeDialogSign">
  132. <signature
  133. :currentObjectRgstrId="currentObjectRgstrId"
  134. :labelList="signatureLabelList"
  135. :openType="openType">
  136. </signature>
  137. </el-dialog>
  138. <el-dialog :title="'追责与整改'" :visible.sync="zzyzg_Dialog" v-if="zzyzg_Dialog" @close="closeDialogZg">
  139. <zzyzg
  140. :currentObjectRgstrId="currentObjectRgstrId"
  141. :zgName="zgName"
  142. :zgNature="zgNature"
  143. @close="closeDialogZg"
  144. :openType="openType">
  145. </zzyzg>
  146. </el-dialog>
  147. <!-- 添加/编辑一级管理单位 -->
  148. <el-dialog :title="dialogType + '标段'" :visible.sync="unitOne_Dialog">
  149. <el-form label-width="120px">
  150. <el-form-item label="标段名称" required>
  151. <el-input v-model="unitOne.nm" clearable></el-input>
  152. </el-form-item>
  153. <el-form-item label="经度">
  154. <el-input v-model="unitOne.centerX" clearable></el-input>
  155. </el-form-item>
  156. <el-form-item label="纬度">
  157. <el-input v-model="unitOne.centerY" clearable></el-input>
  158. </el-form-item>
  159. </el-form>
  160. <div slot="footer" class="dialog-footer">
  161. <el-button @click="unitOne_Dialog = false">取 消</el-button>
  162. <el-button type="primary" @click="addUnitOne">确 定</el-button>
  163. </div>
  164. </el-dialog>
  165. <!-- 添加/编辑责任单位单位 -->
  166. <el-dialog :title="dialogType + '责任单位'" :visible.sync="unitTwo_Dialog">
  167. <el-form label-width="120px">
  168. <el-form-item label="责任单位" required>
  169. <el-input v-model="unitTwo.nm" clearable></el-input>
  170. </el-form-item>
  171. <el-form-item label="单位性质" required>
  172. <el-select v-model="unitTwo.nature" clearable placeholder="单位性质">
  173. <el-option label="项目法人(建设单位)" value="1"></el-option>
  174. <el-option label="施工单位" value="2"></el-option>
  175. <el-option label="监理单位" value="3"></el-option>
  176. <el-option label="勘测设计单位" value="4"></el-option>
  177. </el-select>
  178. </el-form-item>
  179. </el-form>
  180. <div slot="footer" class="dialog-footer">
  181. <el-button @click="unitTwo_Dialog = false">取 消</el-button>
  182. <el-button type="primary" @click="add_unitTwo">确 定</el-button>
  183. </div>
  184. </el-dialog>
  185. </div>
  186. </template>
  187. <script>
  188. import request from "../../utils/gw_ajax_request.js";
  189. import { dateFormat } from "../../utils/gw_date.js";
  190. import { getTrees } from "@util/gw_formatTree.js";
  191. import jichuxinxi from './slxmaqscxj/jichuxinxi';
  192. import zzyzg from './slxmaqscxj/zzyzg';
  193. import signature from './slxmaqscxj/signature';
  194. import provTreeList from "../../widgets/provTreeList.vue";
  195. import projectProblem from "./project/slxmaqxjProblem.vue";
  196. import {exportModel} from "@util/gw_exportModel";
  197. export default {
  198. components: {
  199. jichuxinxi:jichuxinxi,
  200. zzyzg:zzyzg,
  201. signature:signature,
  202. provTreeList: provTreeList,
  203. projectProblem: projectProblem,
  204. },
  205. props: [],
  206. data() {
  207. return {
  208. asideHeight: window.innerHeight - 106,
  209. tableHeight: window.innerHeight - 256,
  210. treeData: [],
  211. defaultProps: {
  212. children: 'children',
  213. label: 'pnm'
  214. },
  215. currentResCode:"",
  216. currentObjectId:"",
  217. currentObjectRgstrId:"",
  218. zgName:"",
  219. zgNature:"",
  220. currentObjectName:"",
  221. openType:true,
  222. signatureLabelList:['督查人员','被检查单位负责人'],
  223. searchObj:{},
  224. project: {
  225. nm: "",
  226. ptype: "",
  227. stwktm: "",
  228. buidTimeYear: "",
  229. estapp: ""
  230. },
  231. unitOne: {
  232. nm: "",
  233. centerX:"",
  234. centerY:""
  235. },
  236. currentRow: {},
  237. pageIndex: 1,
  238. pageSize: 20,
  239. total: 0,
  240. dialogType: "添加",
  241. unitOne_Dialog: false,
  242. correct_Dialog: false,
  243. sign_Dialog: false,
  244. zzyzg_Dialog:false,
  245. showProblemDialog: false,
  246. typeOfProject: '78',
  247. title: '水利项目安全生产巡检填报',
  248. isClicked: true,
  249. showGongChengTianBaoPl: false,
  250. //
  251. unitTwoList: [],
  252. unitThreeList: [],
  253. unitTwo: {
  254. nm: "",
  255. nature:""
  256. },
  257. unitThree: {
  258. nm: "",
  259. pid: ""
  260. },
  261. unitTwo_Dialog: false,
  262. unitThree_Dialog: false,
  263. showProblemDialog: false,
  264. unitProblemInfo: {
  265. codes: ''
  266. },
  267. unitLevel: '一级管理单位', //一级管理单位 二级管理单位 三级管理单位
  268. currentUnitTwoRow: {},
  269. isClicked: true,
  270. currentUnitOneRow: {},
  271. currentUnitThreeRow: {},
  272. jqmmShow: false,
  273. imageShow: false,
  274. jqmmEngId: '',
  275. slgcyxName: '',
  276. centerX: 0,
  277. centerY: 0,
  278. //
  279. groupTreeData: [],
  280. plnaId: '078', //督查组id
  281. showAddBtn: false,
  282. levelId:"",
  283. tabType:"0"
  284. };
  285. },
  286. computed: {
  287. persId() {
  288. return localStorage.getItem("userid")
  289. ? localStorage.getItem("userid")
  290. : "1098101939614724096";
  291. }
  292. },
  293. mounted() {
  294. this.getGroupData();
  295. },
  296. activated() {
  297. this.getDataList();
  298. },
  299. watch: {
  300. },
  301. methods: {
  302. async downloadDuty(row){
  303. let url = "/pdcApi/bis/insp/wtprj/responsibility/investigation/"+row.id;
  304. let type = "get";
  305. let exportName = row.pnm+"-追究责任意见表.pdf"
  306. let result = await exportModel(type, url, exportName, row);
  307. },
  308. async downDataTable(row) {
  309. let url = "/pdcApi//bis/insp/wtprj/unit/checkList/export/"+row.id;
  310. let type = "get";
  311. let exportName = row.pnm+"-水利项目安全生产巡检.pdf"
  312. let result = await exportModel(type, url, exportName, row);
  313. },
  314. closeDialogZg(){
  315. this.zzyzg_Dialog = false;
  316. },
  317. closeDialogSign(){
  318. this.sign_Dialog = false;
  319. },
  320. closeDialogP(){
  321. this.correct_Dialog = false;
  322. },
  323. tabChange(tabType){
  324. this.tabType = tabType;
  325. this.getGroupData();
  326. },
  327. //获取工程列表信息
  328. getDataList() {
  329. let paramObj = {
  330. //type: "empwtrun",
  331. presId: this.persId,
  332. pageSize: this.pageSize,
  333. pageNum: this.pageIndex,
  334. plnaId: this.plnaId,
  335. tabType:this.tabType
  336. }
  337. Object.assign(this.searchObj,paramObj)
  338. request.post(`/bis/insp/wtprj/tree`, this.searchObj).then(res => {
  339. if (res.success) {
  340. this.treeData = res.data;
  341. if (this.treeData.length) {
  342. this.currentRow = this.treeData[0];
  343. // this.addRegister()
  344. }
  345. }
  346. });
  347. },
  348. toSign(row) {
  349. this.currentObjectRgstrId = row.id;
  350. this.sign_Dialog = true;
  351. },
  352. toZzyzg(row){
  353. var _self = this;
  354. request.get(`/bis/insp/wtprj/unit/${row.id}`).then((res) => {
  355. if(res.success){
  356. _self.currentObjectRgstrId = row.id;
  357. _self.zgName = row.pnm;
  358. _self.zgNature = res.data.nature;
  359. _self.zzyzg_Dialog = true;
  360. }else{
  361. this.$message.error(res.message)
  362. }
  363. });
  364. },
  365. updateState(row){
  366. var _self = this;
  367. this.$confirm('请确认提交该信息?', '提示', {
  368. confirmButtonText: '确定',
  369. cancelButtonText: '取消',
  370. type: 'warning'
  371. }).then(() => {
  372. let formObj = {
  373. "id":row.id,
  374. "state":"2"
  375. }
  376. request.post('/bis/insp/wtprj', formObj).then((res) => {
  377. if (res.success) {
  378. _self.$message.success("提交成功");
  379. } else {
  380. _self.cancelHandler();
  381. }
  382. });
  383. }).catch(() => {
  384. });
  385. },
  386. // 工程信息纠错
  387. toCorrect(row) {
  388. this.currentRow = row;
  389. this.currentResCode = this.currentRow.code;
  390. this.currentObjectId = this.currentRow.objId;
  391. this.currentObjectRgstrId = this.currentRow.id;
  392. this.currentObjectName = this.currentRow.pnm;
  393. this.openType = true;
  394. this.correct_Dialog = true;
  395. },
  396. saveCorrect() {
  397. this.project.persId = this.persId;
  398. request.post(`/bis/insp/empwtprj/base/update`, this.project).then(res => {
  399. if (res.success) {
  400. this.$message.success("修改成功");
  401. this.correct_Dialog = false;
  402. this.getDataList();
  403. } else {
  404. this.$message.error(res.message);
  405. }
  406. })
  407. .catch(error => {
  408. this.$message.error(res.message);
  409. });
  410. },
  411. // 添加标段
  412. toAddUnitOne(row,node) {
  413. this.dialogType = "添加";
  414. this.currentRow = row
  415. this.unitOne = {
  416. nm: "",
  417. centerX:"",
  418. centerY:""
  419. };
  420. this.unitOne.rgstrId = row.id;
  421. this.unitOne.objId = row.objId;
  422. this.unitOne.adCode = row.adCode;
  423. this.unitOne_Dialog = true;
  424. },
  425. toEditUnitOne(row){
  426. this.dialogType = '编辑'
  427. this.currentUnitOneRow = row
  428. request.get(`/bis/insp/wtprj/section/${row.id}`).then((res) => {
  429. if(res.success){
  430. this.unitOne = res.data;
  431. this.unitOne_Dialog = true
  432. }else{
  433. this.$message.error(res.message)
  434. }
  435. });
  436. },
  437. addUnitOne() {
  438. if(!this.unitOne.nm){
  439. this.$message.warning('请填写标段名称')
  440. return
  441. }
  442. if(this.isClicked){
  443. this.isClicked = false
  444. if(this.dialogType == '添加'){
  445. this.unitOne.persId = this.persId;
  446. request.post(`/bis/insp/wtprj/section`, this.unitOne).then(res => {
  447. if (res.success) {
  448. this.$message.success(this.dialogType + "成功");
  449. //向树节点追加已添加的新单位
  450. const newChild = { id: res.data.id, objId: res.data.objId, pnm: res.data.nm, level:2,children: [] };
  451. if (!this.currentRow.children) {
  452. this.$set(this.currentRow, 'children', []);
  453. }
  454. this.currentRow.children.push(newChild);
  455. this.unitOne_Dialog = false;
  456. setTimeout(()=> {
  457. this.isClicked = true
  458. }, 1000);
  459. } else {
  460. this.$message.error(res.message);
  461. }
  462. })
  463. .catch(error => {
  464. this.$message.error(res.message);
  465. });
  466. }else{
  467. request.post(`/bis/insp/wtprj/section`, this.unitOne).then(res => {
  468. if (res.success) {
  469. this.$message.success(this.dialogType + "成功");
  470. //编辑成功后改变树节点显示的标段名称
  471. this.currentUnitOneRow.pnm = res.data.nm
  472. this.unitOne_Dialog = false;
  473. setTimeout(()=> {
  474. this.isClicked = true
  475. }, 1000);
  476. } else {
  477. this.$message.error(res.message);
  478. }
  479. })
  480. .catch(error => {
  481. this.$message.error(res.message);
  482. });
  483. }
  484. }
  485. },
  486. formatDate(row, column) {
  487. if (row.uptm) {
  488. return dateFormat(row.uptm, "yyyy-MM-dd");
  489. }
  490. },
  491. batchImport(){
  492. this.showGongChengTianBaoPl = true
  493. },
  494. closePlDialog(){
  495. this.showGongChengTianBaoPl = false
  496. },
  497. //树节点点击事件
  498. handleNodeClick(data,node) {
  499. this.currentRow = data;
  500. this.levelId = node.level;
  501. if(node.level == 3){
  502. this.showAddBtn=true;
  503. this.currentRow.objId = node.parent.parent.data.objId;
  504. this.currentRow.secId = node.parent.data.id;
  505. this.currentRow.regId = data.id;
  506. request.get(`/bis/insp/wtprj/unit/${data.id}`).then((res) => {
  507. if(res.success){
  508. this.currentRow.nature = res.data.nature;
  509. }else{
  510. this.$message.error(res.message)
  511. }
  512. });
  513. }else{
  514. this.showAddBtn=false;
  515. if(node.level == 1){
  516. this.currentRow.objId = data.objId;
  517. this.currentRow.secId = "";
  518. this.currentRow.regId = ""
  519. }
  520. if(node.level == 2){
  521. this.currentRow.objId = node.parent.objId;
  522. this.currentRow.secId = data.id;
  523. this.currentRow.regId = "";
  524. }
  525. }
  526. },
  527. // 添加责任单位
  528. toAddUnitTwo(row) {
  529. this.dialogType = "添加";
  530. this.currentUnitOneRow = row
  531. this.unitTwo = {
  532. nm: "",
  533. nature:""
  534. };
  535. this.unitTwo.secId = row.id;
  536. this.unitTwo_Dialog = true;
  537. },
  538. toEditUnitTwo(row) {
  539. this.dialogType = "编辑";
  540. this.currentUnitTwoRow = row
  541. request.get(`/bis/insp/wtprj/unit/${row.id}`).then((res) => {
  542. if(res.success){
  543. this.unitTwo = res.data;
  544. this.unitTwo_Dialog = true
  545. }else{
  546. this.$message.error(res.message)
  547. }
  548. });
  549. },
  550. add_unitTwo() {
  551. if(!this.unitTwo.nm){
  552. this.$message.warning('请填写责任单位')
  553. return
  554. }
  555. if(!this.unitTwo.nature){
  556. this.$message.warning('请选择单位性质')
  557. return
  558. }
  559. if(this.isClicked){
  560. this.isClicked = false
  561. if (this.dialogType == "添加") {
  562. this.unitTwo.persId = this.persId;
  563. request
  564. .post(`/bis/insp/wtprj/unit`, this.unitTwo)
  565. .then(res => {
  566. if (res.success) {
  567. this.$message.success(this.dialogType + "成功");
  568. //向树节点追加已添加的新标段
  569. const newChild = { id: res.data.id, objId: res.data.objId, pnm: res.data.nm,level:3,children: [] };
  570. if (!this.currentUnitOneRow.children) {
  571. this.$set(this.currentUnitOneRow, 'children', []);
  572. }
  573. this.currentUnitOneRow.children.push(newChild);
  574. this.unitTwo_Dialog = false;
  575. setTimeout(()=> {
  576. this.isClicked = true
  577. }, 1000);
  578. } else {
  579. this.$message.error(res.message);
  580. }
  581. })
  582. .catch(error => {
  583. this.$message.error(res.message);
  584. });
  585. } else {
  586. request
  587. .post(`/bis/insp/wtprj/unit`, this.unitTwo)
  588. .then(res => {
  589. if (res.success) {
  590. this.$message.success(this.dialogType + "成功");
  591. //编辑成功后改变树节点显示的标段名称
  592. this.currentUnitTwoRow.pnm = res.data.nm
  593. this.unitTwo_Dialog = false;
  594. setTimeout(()=> {
  595. this.isClicked = true
  596. }, 1000);
  597. } else {
  598. this.$message.error(res.message);
  599. }
  600. })
  601. .catch(error => {
  602. this.$message.error(res.message);
  603. });
  604. }
  605. }
  606. },
  607. delete_unitTwo(row,node) {
  608. this.$confirm("确认删除当前责任单位吗?", "提示", {
  609. confirmButtonText: "确定",
  610. cancelButtonText: "取消",
  611. type: "warning"
  612. })
  613. .then(() => {
  614. request.post(`/bis/insp/wtprj/unit/delete/${row.id}`).then(res => {
  615. if (res.success) {
  616. this.$message.success("删除成功");
  617. const parent = node.parent;
  618. const children = parent.data.children || parent.data;
  619. const index = children.findIndex(d => d.id === row.id);
  620. children.splice(index, 1);
  621. } else {
  622. this.$message.error(res.message);
  623. }
  624. });
  625. })
  626. .catch(() => {});
  627. },
  628. // 添加三级管理单位
  629. toAddUnitThree(row,node) {
  630. this.dialogType = "添加";
  631. this.currentRow = node.parent.parent.parent.data
  632. this.currentUnitTwoRow = row
  633. this.unitThree = {
  634. nm: "",
  635. pid: this.currentUnitTwoRow.id
  636. };
  637. this.unitThree_Dialog = true;
  638. },
  639. toEditUnitThree(row) {
  640. this.dialogType = "编辑";
  641. this.currentUnitThreeRow = row
  642. request.get(`/bis/insp/mampu/info/${row.id}`).then((res) => {
  643. if(res.success){
  644. this.unitThree = res.data;
  645. this.unitThree_Dialog = true
  646. }else{
  647. this.$message.error(res.message)
  648. }
  649. });
  650. },
  651. add_unitThree() {
  652. if(!this.unitThree.nm){
  653. this.$message.warning('请填写三级单位名称')
  654. return
  655. }
  656. if(this.isClicked){
  657. this.isClicked = false
  658. if (this.dialogType == "添加") {
  659. this.unitThree.lev = "3";
  660. this.unitThree.regId = this.currentRow.id;
  661. this.unitThree.pid = this.currentUnitTwoRow.id;
  662. this.unitThree.persId = this.persId;
  663. request
  664. .post(`/bis/insp/mampu/info/add`, this.unitThree)
  665. .then(res => {
  666. if (res.success) {
  667. this.$message.success(this.dialogType + "成功");
  668. //向树节点追加已添加的新单位
  669. const newChild = { id: res.data.id, objId: res.data.objId, pnm: res.data.nm, children: [] };
  670. if (!this.currentUnitTwoRow.children) {
  671. this.$set(this.currentUnitTwoRow, 'children', []);
  672. }
  673. this.currentUnitTwoRow.children.push(newChild);
  674. this.unitThree_Dialog = false;
  675. setTimeout(()=> {
  676. this.isClicked = true
  677. }, 1000);
  678. } else {
  679. this.$message.error(res.message);
  680. }
  681. })
  682. .catch(error => {
  683. this.$message.error(res.message);
  684. });
  685. } else {
  686. request
  687. .post(`/bis/insp/mampu/info/update`, this.unitThree)
  688. .then(res => {
  689. if (res.success) {
  690. this.$message.success(this.dialogType + "成功");
  691. //编辑成功后改变树节点显示的标段名称
  692. this.currentUnitThreeRow.pnm = res.data.nm
  693. this.unitThree_Dialog = false;
  694. setTimeout(()=> {
  695. this.isClicked = true
  696. }, 1000);
  697. } else {
  698. this.$message.error(res.message);
  699. }
  700. })
  701. .catch(error => {
  702. this.$message.error(res.message);
  703. });
  704. }
  705. }
  706. },
  707. delete_unitThree(row,node) {
  708. this.$confirm("确认删除当前单位吗?", "提示", {
  709. confirmButtonText: "确定",
  710. cancelButtonText: "取消",
  711. type: "warning"
  712. }).then(() => {
  713. request.post(`/bis/insp/mampu/info/delete/${row.id}`).then(res => {
  714. if (res.success) {
  715. this.$message.success("删除成功");
  716. const parent = node.parent;
  717. const children = parent.data.children || parent.data;
  718. const index = children.findIndex(d => d.id === row.id);
  719. children.splice(index, 1);
  720. } else {
  721. this.$message.error(res.message);
  722. }
  723. });
  724. })
  725. .catch(() => {});
  726. },
  727. // 近期面貌
  728. recentAppearance(){
  729. this.jqmmShow = true;
  730. // this.jqmmShow += 1;
  731. },
  732. jqmmDialog(){
  733. this.jqmmShow = false;
  734. },
  735. // 影像
  736. imageClick(){
  737. if(!this.centerX && !this.centerY){
  738. this.$message.warning('暂无经纬度信息!');
  739. return false;
  740. }
  741. this.imageShow = true;
  742. },
  743. // 点击督查组
  744. getGroupData(){
  745. let params = {
  746. userId: this.persId,
  747. orgType: '078',
  748. tabType:this.tabType
  749. }
  750. request.get(`/dc/organization/base/getAllNode`,{params:params}).then(res=>{
  751. if(res.success){
  752. let data = res.data;
  753. data = getTrees(data);
  754. this.groupTreeData = data.length>0?data[0].children:[];
  755. if(data[0] && data[0].id){
  756. this.plnaId = this.groupTreeData[0].id
  757. }
  758. this.getDataList();
  759. }else{
  760. this.$message.warning(res.message)
  761. }
  762. })
  763. },
  764. groupHandleNodeClick(data,node){
  765. this.plnaId = data.id
  766. this.getDataList()
  767. }
  768. },
  769. watch:{
  770. },
  771. filters: {
  772. pType(val) {
  773. if (val != "0" && !val) {
  774. return "";
  775. }
  776. if (val == "0") {
  777. return "重大农业节水工程";
  778. } else if (val == "1") {
  779. return "重大引调水工程";
  780. } else if (val == "2") {
  781. return "重点水源工程";
  782. } else if (val == "3") {
  783. return "江河湖泊治理骨干工程";
  784. } else if (val == "4") {
  785. return "新建大型灌区工程";
  786. } else if (val == "5") {
  787. return "非水利部下达投资计划";
  788. } else if (val == "6") {
  789. return "全部由地方投资";
  790. } else if (val == "7") {
  791. return "其他项目";
  792. } else {
  793. return "未知项目";
  794. }
  795. },
  796. nature(val) {
  797. if (val != "0" && !val) {
  798. return "";
  799. }
  800. if (val == "1") {
  801. return "项目法人(建设单位)";
  802. } else if (val == "2") {
  803. return "勘察设计单位";
  804. } else if (val == "3") {
  805. return "监理单位";
  806. } else if (val == "4") {
  807. return "施工单位";
  808. } else if (val == "5") {
  809. return "金属结构及机电设备安装单位";
  810. } else if (val == "6") {
  811. return "安全监测单位";
  812. } else if (val == "7") {
  813. return "质量检测单位";
  814. } else {
  815. return "其它";
  816. }
  817. },
  818. government(val) {
  819. if (val != "0" && !val) {
  820. return "";
  821. }
  822. if (val == "1") {
  823. return "直管";
  824. } else if (val == "2") {
  825. return "代建";
  826. }
  827. }
  828. }
  829. };
  830. </script>
  831. <style lang="scss">
  832. #dcdxHeader {
  833. padding: 15px 20px;
  834. }
  835. #dxdcFooter {
  836. text-align: center;
  837. }
  838. #dxdcAside {
  839. border: 1px solid #d5d5ff;
  840. }
  841. .el-table .warning-row {
  842. background: oldlace;
  843. }
  844. .el-table .success-row {
  845. background: #f0f9eb;
  846. }
  847. .left_tree .custom-tree-node {
  848. flex: 1;
  849. display: flex;
  850. align-items: center;
  851. justify-content: space-between;
  852. font-size: 14px;
  853. padding-right: 8px;
  854. }
  855. .c_active{
  856. background: #3f8eff !important;
  857. color:white !important;
  858. padding: 7px 10px !important;
  859. }
  860. .c_normal{
  861. background: white !important;
  862. padding: 7px 10px !important;
  863. }
  864. #headerBtn div.el-card__header{
  865. padding: 5px 3px !important;
  866. }
  867. </style>