334bf32c4aa4a4732711e8bb0ddbd00eec163fdd.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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="25%" :height="asideHeight">
  6. <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
  7. <el-card class="box-card">
  8. <div slot="header" class="clearfix">
  9. <span>工程信息</span>
  10. </div>
  11. <el-row>
  12. <el-input
  13. clearable
  14. placeholder="输入关键字进行过滤"
  15. v-model="filterText">
  16. </el-input>
  17. </el-row>
  18. <el-tree
  19. class="filter_tree"
  20. :data="treeDataLists"
  21. :props="defaultProps"
  22. :filter-node-method="filterNode"
  23. node-key="id"
  24. :expand-on-click-node="false"
  25. @node-click = 'treeNodeClickHandler'
  26. ref="tree2">
  27. </el-tree>
  28. </el-card>
  29. </div>
  30. </el-aside>
  31. <el-main id="dxdcListMainsk" style="width: 75%;padding:0px 10px;">
  32. <div class="flex_wrapper">
  33. <!-- 工程问题清单 -->
  34. <project-problem villType="11" :currentRow="currentRow" :unitProblemInfo="unitProblemInfo" ref="ydb"></project-problem>
  35. </div>
  36. </el-main>
  37. </el-container>
  38. </div>
  39. </template>
  40. <script>
  41. import request from "../../../utils/gw_ajax_request.js";
  42. import { dateFormat } from "../../../utils/gw_date.js";
  43. import projectProblem from "../shuiTuBaoChi/projectProblemYuDiBa.vue";
  44. import {deleteDcdxByObjid} from "../../../api/duChaTianBao.js";
  45. export default {
  46. components: {
  47. projectProblem: projectProblem
  48. },
  49. props: [],
  50. data() {
  51. return {
  52. asideHeight: window.innerHeight - 156,
  53. tableHeight: window.innerHeight - 256,
  54. treeDataLists: [],
  55. defaultProps: {
  56. children: 'children',
  57. label: 'name'
  58. },
  59. // defaultExpanded:[],//树默认展开节点数组
  60. searchObj:{
  61. "engScal": '2'
  62. },
  63. project: {
  64. nm: "",
  65. ptype: "",
  66. stwktm: "",
  67. plantm: "",
  68. estapp: ""
  69. },
  70. currentRow: {},
  71. pageIndex: 1,
  72. pageSize: 20,
  73. total: 0,
  74. dialogType: "添加",
  75. correct_Dialog: false,
  76. showProblemDialog: false,
  77. title: '淤地坝情况检查填报',
  78. showGongChengTianBaoPl: false,
  79. waterShedList: [],
  80. unitList: [],
  81. biaoduan:{
  82. nm: '',
  83. adCode: '',
  84. orgId: '',
  85. lgtd: '',
  86. lttd: ''
  87. },
  88. unit:{
  89. nm: '',
  90. nature: '',
  91. government: ''
  92. },
  93. natureList: [
  94. {name: '项目法人(建设单位)',value: '1'},
  95. {name: '勘察设计单位',value: '2'},
  96. {name: '监理单位',value: '3'},
  97. {name: '施工单位',value: '4'},
  98. {name: '金属结构及机电设备安装单位',value: '5'},
  99. {name: '安全监测单位',value: '6'},
  100. {name: '质量检测单位',value: '7'}
  101. ],
  102. modeList: [
  103. {name: '直管',value: '1'},
  104. {name: '代建',value: '2'}
  105. ],
  106. biaoduan_Dialog: false,
  107. unit_Dialog: false,
  108. isClicked: true,
  109. showProblemDialog: false,
  110. unitProblemInfo: {
  111. nature: '1'
  112. },
  113. jqmmShow: false,
  114. imageShow: false,
  115. jqmmEngId: '',
  116. slgcjsName: '',
  117. centerX: 0,
  118. centerY: 0,
  119. filterText: '',
  120. provList: [],
  121. cityList: [],
  122. countryList: [],
  123. provName: '',
  124. cityName: '',
  125. countryName: '',
  126. provNames: '',
  127. cityNames: '',
  128. countryNames: '',
  129. curSelectItem: 0,
  130. showLocSelect: false,
  131. objId:'',
  132. rules1: {
  133. sdName: [
  134. {
  135. required: true,
  136. message: "工程名称不能为空",
  137. trigger: "blur"
  138. },
  139. {
  140. min: 1,
  141. max: 100,
  142. message: "不超过100字符",
  143. trigger: "blur"
  144. }
  145. ],
  146. sdType: [
  147. {
  148. min: 1,
  149. max: 100,
  150. message: "不超过100字符",
  151. trigger: "blur"
  152. }
  153. ],
  154. sdLoc: [
  155. {
  156. min: 1,
  157. max: 512,
  158. message: "不超过512字符",
  159. trigger: "blur"
  160. }
  161. ],
  162. sdTypeStr: [
  163. {
  164. min: 1,
  165. max: 100,
  166. message: "不超过100字符",
  167. trigger: "blur"
  168. }
  169. ],
  170. totCap: [
  171. {pattern:/^\d{1,7}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前7后2位'}
  172. ],
  173. flcoCap: [
  174. {pattern:/^\d{1,7}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前7后2位'}
  175. ],
  176. sdrCap: [
  177. {pattern:/^\d{1,7}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前7后2位'}
  178. ],
  179. warpCap: [
  180. {pattern:/^\d{1,7}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前7后2位'}
  181. ],
  182. conArea: [
  183. {pattern:/^\d{1,7}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前7后2位'}
  184. ],
  185. flcoYear: [
  186. {
  187. min: 1,
  188. max: 100,
  189. message: "不超过100字符",
  190. trigger: "blur"
  191. }
  192. ],
  193. damSizeHig: [
  194. {pattern:/^\d{1,4}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前4后2位'}
  195. ],
  196. damTopLen: [
  197. {pattern:/^\d{1,5}(\.\d{1,2})?$/, message: '必须为数字且不超小数点前5后2位'}
  198. ],
  199. centerX: [
  200. {pattern:/^\d{1,9}(\.\d{1,8})?$/, message: '必须为数字且不超小数点前9后8位'}
  201. ],
  202. centerY: [
  203. {pattern:/^\d{1,8}(\.\d{1,8})?$/, message: '必须为数字且不超小数点前8后8位'}
  204. ],
  205. },
  206. supervision: [
  207. {
  208. value: "1",
  209. label: "是"
  210. },
  211. {
  212. value: "0",
  213. label: "否"
  214. }
  215. ],
  216. };
  217. },
  218. computed: {
  219. persId() {
  220. return localStorage.getItem("userid")
  221. ? localStorage.getItem("userid")
  222. : "1098101939614724096";
  223. }
  224. },
  225. mounted() {
  226. this.getAreaList();
  227. this.getTreeData();
  228. },
  229. methods: {
  230. filterNode(value, data) {
  231. if (!value) return true;
  232. return data.pnm.indexOf(value) !== -1;
  233. },
  234. //获取左侧树数据
  235. getTreeData:function(){
  236. let _self = this;
  237. request.get(`/bis/insp/BisInspConfigOrgAd/getAdByPersId/${this.persId}/11`).then((res)=>{
  238. _self.treeDataLists = res.data;
  239. });
  240. },
  241. //树节点点击事件
  242. treeNodeClickHandler:function(data,node,tree){
  243. this.currentRow = data;
  244. },
  245. // 工程信息纠错
  246. toCorrect(row,node) {
  247. this.currentRow = row;
  248. this.objId = row.objId;
  249. request.get(`/att/sd/base/crrct/${row.code}/${this.persId}`).then(res => {
  250. if (res.success) {
  251. this.project = res.data;
  252. this.slgcjsName = this.project.sdName;
  253. this.jqmmEngId = this.currentRow.id;
  254. this.centerX = this.project.centerX;
  255. this.centerY = this.project.centerY;
  256. }
  257. });
  258. this.correct_Dialog = true;
  259. },
  260. saveCorrect() {
  261. this.$refs.projectFrom.validate(valid => {
  262. if (valid) {
  263. // if(this.project.centerY && this.project.centerX){
  264. // if(this.project.centerY < 4 || this.project.centerY > 54){
  265. // this.$message.error('纬度的整数范围应在4-54之间,请重新填写!');
  266. // this.project.centerY = '';
  267. // return;
  268. // }
  269. // if(this.project.centerX < 74 || this.project.centerX > 136){
  270. // this.$message.error('经度的整数范围应在74-136之间,请重新填写!');
  271. // this.project.centerX = '';
  272. // return;
  273. // }
  274. // }
  275. this.project.persId = this.persId;
  276. this.project.objId = this.objId;
  277. delete this.project.adFullName;
  278. request.post(`/att/sd/base/crrct`, this.project).then(res => {
  279. if (res.success) {
  280. this.$message.success("修改成功");
  281. this.correct_Dialog = false;
  282. this.showLocSelect = false;
  283. // this.getDataList();
  284. } else {
  285. this.$message.error(res.message);
  286. }
  287. })
  288. .catch(error => {
  289. this.$message.error(res.message);
  290. });
  291. }
  292. });
  293. },
  294. addRegister(){
  295. let paramObj = {
  296. "code": this.currentRow.code,
  297. "objId": this.currentRow.objId,
  298. "nodeId": this.currentRow.nodeId,
  299. "recPersId": this.persId,
  300. "id": this.currentRow.id
  301. }
  302. request.post(`/bis/insp/key/register/add`, paramObj).then(res => {
  303. if (res.success && res.data) {
  304. this.currentRow.id = res.data.id
  305. } else {
  306. this.$message.error(res.message);
  307. }
  308. })
  309. .catch(error => {
  310. this.$message.error(res.message);
  311. });
  312. },
  313. formatDate(row, column) {
  314. if (row.uptm) {
  315. return dateFormat(row.uptm, "yyyy-MM-dd");
  316. }
  317. },
  318. pageIndexChange(val) {
  319. this.pageIndex = val;
  320. this.getDataList();
  321. },
  322. handleSizeChange(val) {
  323. this.pageSize = val;
  324. this.getDataList();
  325. },
  326. batchImport(){
  327. this.showGongChengTianBaoPl = true
  328. },
  329. closePlDialog(){
  330. this.showGongChengTianBaoPl = false
  331. },
  332. // 获取省份列表
  333. getprovList(adCode){
  334. request.get('/dc/ad/base/getAdData',{params:{'adCode': adCode}}).then(res=>{
  335. if(res.success){
  336. this.provList = res.data
  337. }else{
  338. this.$message.info(res.message)
  339. }
  340. })
  341. },
  342. // 近期面貌
  343. recentAppearance(){
  344. this.jqmmShow = true;
  345. // this.jqmmShow += 1;
  346. },
  347. jqmmDialog(){
  348. this.jqmmShow = false;
  349. },
  350. // 影像
  351. imageClick(){
  352. if(!this.centerX && !this.centerY){
  353. this.$message.warning('暂无经纬度信息!');
  354. return false;
  355. }
  356. this.imageShow = true;
  357. },
  358. provChange(val){
  359. this.curSelectItem = 1
  360. this.cityName = ''
  361. this.countryName = ''
  362. // this.formObj.admDiv = val
  363. this.provList.forEach(ele=>{
  364. if(ele.adCode == this.provName){
  365. this.provNames = ele.adName
  366. }
  367. })
  368. // this.formObj.location = this.provNames
  369. this.getAreaList(val)
  370. },
  371. cityChange(val){
  372. this.curSelectItem = 2
  373. if(val && val != ''){
  374. // this.formObj.admDiv = val
  375. this.countryName = ''
  376. this.cityList.forEach(ele=>{
  377. if(ele.adCode == this.cityName){
  378. this.cityNames = ele.adName
  379. }
  380. })
  381. // this.formObj.location = this.provNames + this.cityNames
  382. this.getAreaList(val)
  383. }
  384. },
  385. countryChange(val){
  386. if(val && val != ''){
  387. // this.formObj.admDiv = val
  388. this.countryList.forEach(ele=>{
  389. if(ele.adCode == this.countryName){
  390. this.countryNames = ele.adName
  391. }
  392. })
  393. // this.formObj.location = this.provNames + this.cityNames + this.countryNames
  394. this.getAreaList(val)
  395. }
  396. },
  397. getAreaList(val){
  398. let adCode = ''
  399. if(!val){
  400. adCode = '000000000000'
  401. }else{
  402. adCode = val
  403. }
  404. this.project.adCode = adCode;
  405. request.get('/dc/ad/base/getAdData',{params:{'adCode':adCode}}).then(res=>{
  406. if(res.success){
  407. if(this.curSelectItem == 1){
  408. this.cityList = res.data
  409. }else if(this.curSelectItem == 2){
  410. this.countryList = res.data
  411. }else{
  412. this.provList = res.data
  413. }
  414. console.log(this.provList);
  415. request.post(`/att/bas/base/list`,{}).then(res =>{
  416. if(res.success){
  417. this.gcType = res.data;
  418. }
  419. })
  420. }
  421. })
  422. },
  423. delete_biaoDuan(row,node){
  424. this.$confirm('确认删除当前工程吗?', '提示', {
  425. confirmButtonText: '确定',
  426. cancelButtonText: '取消',
  427. type: 'warning'
  428. }).then(() => {
  429. deleteDcdxByObjid(row.objId,11).then(
  430. res => {
  431. if(res.success){
  432. this.$message({
  433. type: 'success',
  434. message: '删除成功!'
  435. });
  436. const parent = node.parent;
  437. const children = parent.data.children || parent.data;
  438. const index = children.findIndex(d => d.id === row.id);
  439. children.splice(index, 1);
  440. };
  441. }
  442. );
  443. }).catch(() => {
  444. });
  445. }
  446. },
  447. watch:{
  448. filterText(val) {
  449. this.$refs.tree2.filter(val);
  450. },
  451. showLocSelect(val){
  452. if(!val){
  453. this.provName = ''
  454. this.cityName = ''
  455. this.countryName = ''
  456. }
  457. }
  458. },
  459. filters: {
  460. pType(val) {
  461. if (val != "0" && !val) {
  462. return "";
  463. }
  464. if (val == "0") {
  465. return "重大农业节水工程";
  466. } else if (val == "1") {
  467. return "重大引调水工程";
  468. } else if (val == "2") {
  469. return "重点水源工程";
  470. } else if (val == "3") {
  471. return "江河湖泊治理骨干工程";
  472. } else if (val == "4") {
  473. return "新建大型灌区工程";
  474. } else if (val == "5") {
  475. return "非水利部下达投资计划";
  476. } else if (val == "6") {
  477. return "全部由地方投资";
  478. } else if (val == "7") {
  479. return "其他项目";
  480. } else {
  481. return "未知项目";
  482. }
  483. },
  484. nature(val) {
  485. if (val != "0" && !val) {
  486. return "";
  487. }
  488. if (val == "1") {
  489. return "项目法人(建设单位)";
  490. } else if (val == "2") {
  491. return "勘察设计单位";
  492. } else if (val == "3") {
  493. return "监理单位";
  494. } else if (val == "4") {
  495. return "施工单位";
  496. } else if (val == "5") {
  497. return "金属结构及机电设备安装单位";
  498. } else if (val == "6") {
  499. return "安全监测单位";
  500. } else if (val == "7") {
  501. return "质量检测单位";
  502. } else {
  503. return "其它";
  504. }
  505. },
  506. government(val) {
  507. if (val != "0" && !val) {
  508. return "";
  509. }
  510. if (val == "1") {
  511. return "直管";
  512. } else if (val == "2") {
  513. return "代建";
  514. }
  515. },
  516. sdType(val){
  517. switch(val){
  518. case '1':
  519. return '中型坝'
  520. case '2':
  521. return '骨干坝'
  522. }
  523. }
  524. }
  525. };
  526. </script>
  527. <style lang="scss">
  528. #dcdxHeader {
  529. padding: 15px 20px;
  530. }
  531. #dxdcFooter {
  532. text-align: center;
  533. }
  534. #dxdcAside {
  535. border: 1px solid #d5d5ff;
  536. }
  537. .el-table .warning-row {
  538. background: oldlace;
  539. }
  540. .el-table .success-row {
  541. background: #f0f9eb;
  542. }
  543. .left_tree .custom-tree-node {
  544. flex: 1;
  545. display: flex;
  546. align-items: center;
  547. justify-content: space-between;
  548. font-size: 14px;
  549. padding-right: 8px;
  550. }
  551. /*.fec_form .el-input,.fec_form textarea.el-textarea__inner {*/
  552. /*width: 30vw;*/
  553. /*}*/
  554. .form {
  555. height: 50vh;
  556. overflow: auto;
  557. }
  558. </style>