748a82bfdc09a326fa0d8c25d6cde07ec6d93205.svn-base 37 KB

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