0c63401a8b3b9243d14077f4da6998df4e28c50a.svn-base 29 KB

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