9910b51a9c256507ba3fe1effeee8adf4fe20fff.svn-base 35 KB

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