e0c2bb7c83ad6a4cd0b244241f9635f2b503819f.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div>
  3. <el-container style="height:520px;">
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  5. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">信息填报</p>
  6. <el-form :model="formObj" :label-width="formLabelWidth">
  7. <p style="margin-top:10px;margin-bottom: 10px;overflow: hidden;"><i class="el-icon-caret-right"></i><span
  8. style="width:120px;padding-left: 10px">基础信息</span><span class="hrs"></span>
  9. <el-button type="warning" style="float: right;" @click="recentAppearance">近期面貌</el-button>
  10. <el-button type="warning" style="float: right; margin-right: 10px;" @click="imageClick">影像</el-button>
  11. </p>
  12. <el-form-item label="水库名称">
  13. <el-input v-model="formObj.rsvrNm" readonly autocomplete="off" style="width:70%;"></el-input>
  14. </el-form-item>
  15. <el-form-item label="管理机构">
  16. <el-input v-model="formObj.rsvrAdmName" autocomplete="off" style="width:70%;"></el-input>
  17. </el-form-item>
  18. <el-form-item label="行政区划">
  19. <div v-if="showLocSelect">
  20. <el-select v-model="provName" placeholder="选择省" @change="provChange" style="width:20%">
  21. <el-option
  22. v-for="item in provList"
  23. :key="item.adCode"
  24. :label="item.adName"
  25. :value="item.adCode">
  26. </el-option>
  27. </el-select>
  28. <el-select v-model="cityName" placeholder="选择市" @change="cityChange" style="width:20%">
  29. <el-option
  30. v-for="item in cityList"
  31. :key="item.adCode"
  32. :label="item.adName"
  33. :value="item.adCode">
  34. </el-option>
  35. </el-select>
  36. <el-select v-model="countryName" placeholder="选择县" @change="countryChange" style="width:20%">
  37. <el-option
  38. v-for="item in countryList"
  39. :key="item.adCode"
  40. :label="item.adName"
  41. :value="item.adCode">
  42. </el-option>
  43. </el-select>
  44. &#x3000;<span v-if="showLocSelect" @click="showLocSelect = false" style="color: #009fff;font-size:12px;cursor:pointer">取消</span>
  45. </div>
  46. <div v-else>
  47. <el-input v-model="formObj.location" readonly autocomplete="off" style="width:70%;"></el-input>&#x3000;<span @click="showLocSelect = true" style="color: #009fff;font-size:12px;cursor:pointer">更改</span>
  48. </div>
  49. </el-form-item>
  50. <el-form-item label="所在地点">
  51. <el-input v-model="formObj.hystSite" placeholder="请输入详细地点" autocomplete="off" style="width:70%;"></el-input>
  52. </el-form-item>
  53. <el-form-item label="建成时间">
  54. <el-date-picker v-model="formObj.compDateStr" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item label="注册登记号">
  58. <el-input v-model="formObj.damRegCode" autocomplete="off" style="width:70%;"></el-input>
  59. </el-form-item>
  60. <el-form-item label="工程规模" prop="engScal">
  61. <el-select v-model="formObj.engScal" placeholder="请选择">
  62. <el-option v-for="item in gongchengguimo" :key="item.value" :label="item.label" :value="item.value"></el-option>
  63. </el-select>
  64. </el-form-item>
  65. <!--<el-form-item label="功能类型">-->
  66. <!--<el-input v-model="formObj.rsClass" autocomplete="off" style="width:70%;"></el-input>-->
  67. <!--</el-form-item>-->
  68. <el-form-item label="主坝坝型" prop="rsType">
  69. <el-select v-model="formObj.damType" placeholder="请选择">
  70. <el-option v-for="item in zhubaleixing" :key="item.value" :label="item.label" :value="item.value"></el-option>
  71. </el-select>
  72. <!-- <el-input v-model="changeSupervision.inspPblmsName" :disabled="true" clearable></el-input> -->
  73. </el-form-item>
  74. <el-form-item label="总库容(万m³)" prop="totCap">
  75. <el-input v-model="formObj.totCap" autocomplete="off" style="width:70%;"></el-input>
  76. </el-form-item>
  77. <el-form-item label="主坝最大坝高(m)" prop="damSizeHig">
  78. <el-input v-model="formObj.damMaxHigh" autocomplete="off" style="width:70%;"></el-input>
  79. </el-form-item>
  80. <el-form-item label="正常蓄水位" prop="normz">
  81. <el-input v-model="formObj.normz" autocomplete="off" style="width:70%;"></el-input>
  82. </el-form-item>
  83. <el-form-item label="汛限水位" prop="fsltdz">
  84. <el-input v-model="formObj.fsltdz" autocomplete="off" style="width:70%;"></el-input>
  85. </el-form-item>
  86. <el-form-item label="经度">
  87. <el-input clearable v-model="formObj.centerXGd" autocomplete="off" style="width:70%;"></el-input>
  88. </el-form-item>
  89. <el-form-item label="纬度">
  90. <el-input clearable v-model="formObj.centerYGd" autocomplete="off" style="width:70%;"></el-input>
  91. </el-form-item>
  92. <el-form-item label="">
  93. <!-- <el-button @click="cancelHandler">取 消</el-button> -->
  94. <el-button type="primary" @click="addHandler">保 存</el-button>
  95. </el-form-item>
  96. </el-form>
  97. </el-main>
  98. </el-container>
  99. <theRecentAppearance v-if="xcztShow" @jqmmDialogClose="jqmmDialog" :jqmmShow="xcztShow"
  100. :jqmmEngId="currentObjectRgstrId" :dialogTitle="currentObjectName + '近期面貌'"
  101. style="z-index: 9999;"></theRecentAppearance>
  102. <!--影像弹窗-->
  103. <el-dialog :title="currentObjectName + '影像'" :visible.sync="imageShow" append-to-body :close-on-click-modal="false"
  104. width="60%">
  105. <div style="height: 60vh;">
  106. <mapLocation ref="mapRef" v-if="imageShow" :gdX="centerX" :gdY="centerY"></mapLocation>
  107. </div>
  108. </el-dialog>
  109. </div>
  110. </template>
  111. <script>
  112. import inputWith from "@widget/inuptWith.vue"
  113. import request from "@util/gw_ajax_request.js"
  114. import theRecentAppearance from '../../duChaDuiXiang/theRecentAppearance'
  115. import unlimitDatePicker from '@baseWidget/unLimitdatePicker.vue'
  116. import mapLocation from '../mapLocation'
  117. import {
  118. getRsvrRgstr
  119. } from "@api/duChaTianBao.js"
  120. import {
  121. dateFormat
  122. } from "@util/gw_date.js"
  123. export default {
  124. components: {
  125. inputWith: inputWith,
  126. unlimitDatePicker: unlimitDatePicker,
  127. theRecentAppearance,
  128. mapLocation
  129. },
  130. props: ['currentObjectRgstrId', 'currentResCode', 'currentObjectId', 'currentObjectName'],
  131. data() {
  132. return {
  133. formObj: {
  134. "rsName": '',
  135. "rsAdmName": "",
  136. "rsLoc": "",
  137. "intm": "",
  138. "engScal": "",
  139. "totCap": "",
  140. "damMaxHigh": "",
  141. "damTypeStr": "",
  142. "damType": "",
  143. // "rsType":'',
  144. "regCode": "",
  145. "rsvrLong": "",
  146. "rsvrLat": "",
  147. "compDate": "",
  148. "compDateStr": "",
  149. "location": "",
  150. "admDiv": "",
  151. "normz":"",
  152. "fsltdz":"",
  153. "centerXGd":"",
  154. "centerYGd":""
  155. },
  156. dialogFormVisible: false,
  157. formLabelWidth: '160px',
  158. loading: true,
  159. operationType1: '',
  160. currentResCode1: '',
  161. currentObjectId1: '',
  162. value1: '',
  163. gongchengguimo: [
  164. // {
  165. // value: "1",
  166. // label: "大(1)型"
  167. // },
  168. // {
  169. // value: "2",
  170. // label: "大(2)型"
  171. // },
  172. // {
  173. // value: "3",
  174. // label: "中型"
  175. // },
  176. {
  177. value: "4",
  178. label: "小(1)型"
  179. },
  180. {
  181. value: "5",
  182. label: "小(2)型"
  183. },
  184. // {
  185. // value: "9",
  186. // label: "其他"
  187. // },
  188. ],
  189. zhubaleixing: [
  190. {
  191. value: "1",
  192. label: "混凝土坝"
  193. },
  194. {
  195. value: "2",
  196. label: "碾压混凝土坝"
  197. },
  198. {
  199. value: "3",
  200. label: "浆砌石坝"
  201. },
  202. {
  203. value: "4",
  204. label: "土坝"
  205. },
  206. {
  207. value: "5",
  208. label: "堆石坝"
  209. },
  210. {
  211. value: "6",
  212. label: "挡水坝"
  213. },
  214. {
  215. value: "7",
  216. label: "其他"
  217. },
  218. ],
  219. provList: [],
  220. cityList: [],
  221. countryList: [],
  222. provName: '',
  223. cityName: '',
  224. countryName: '',
  225. provNames: '',
  226. cityNames: '',
  227. countryNames: '',
  228. curSelectItem: 0,
  229. showLocSelect: false,
  230. locat: {
  231. location: "",
  232. admDiv: ""
  233. },
  234. xcztShow: false,
  235. imageShow: false,
  236. xcztEngId: '',
  237. centerX: 0,
  238. centerY: 0
  239. }
  240. },
  241. computed: {
  242. recPersId() {
  243. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  244. }
  245. },
  246. mounted() {
  247. this.currentResCode1 = this.currentResCode;
  248. this.currentObjectId1 = this.currentObjectId;
  249. this.getRgstridObj();
  250. this.getAreaList()
  251. },
  252. watch: {
  253. currentObjectRgstrId(n, o) {
  254. this.getRgstridObj();
  255. },
  256. showLocSelect(val) {
  257. if (!val) {
  258. this.formObj.location = this.locat.location
  259. this.formObj.admDiv = this.locat.admDiv
  260. this.provName = ''
  261. this.cityName = ''
  262. this.countryName = ''
  263. }
  264. }
  265. },
  266. methods: {
  267. getRgstridObj() {
  268. var _self = this;
  269. getRsvrRgstr(_self.currentObjectRgstrId).then(
  270. (res) => {
  271. if (res.data) {
  272. _self.formObj = res.data;
  273. this.locat.location = res.data.location
  274. this.locat.admDiv = res.data.admDiv
  275. this.centerX = res.data.centerX;
  276. this.centerY = res.data.centerY;
  277. // _self.value1 = dateFormat(res.data.compDate, 'yyyy-MM-dd');
  278. } else {
  279. _self.formObj = {};
  280. }
  281. },
  282. (err) => {
  283. }
  284. );
  285. },
  286. addHandler() {
  287. var _self = this;
  288. // _self.formObj.compDate = _self.value1;
  289. // _self.formObj['compDateStr'] = dateFormat(_self.value1, 'yyyy-MM-dd');
  290. _self.formObj['persId'] = _self.recPersId;
  291. _self.formObj.objId = _self.currentObjectId1;
  292. // _self.formObj.compDateDesc = _self.formObj.compDateStr==''?null:_self.formObj.compDateStr;
  293. console.log(_self.formObj);
  294. //基础信息纠错,经纬度修改粗略校验经度纬度整数部分的范围
  295. // if (this.formObj.centerYGd < 4 || this.formObj.centerYGd > 54) {
  296. // this.$message.error('纬度的整数范围应在4-54之间,请重新填写!');
  297. // this.formObj.centerYGd = '';
  298. // return;
  299. // }
  300. // if (this.formObj.centerXGd < 74 || this.formObj.centerXGd > 136) {
  301. // this.$message.error('经度的整数范围应在74-136之间,请重新填写!');
  302. // this.formObj.centerXGd = '';
  303. // return;
  304. // }
  305. try {
  306. this.$confirm('确认保存基础信息?', '提示', {
  307. confirmButtonText: '确定',
  308. cancelButtonText: '取消',
  309. type: 'warning'
  310. }).then(() => {
  311. request.post('/dc/att/rsBase/update', _self.formObj).then((res) => {
  312. if (res.success) {
  313. _self.$emit("addShuiKuSuccess");
  314. _self.showLocSelect = false
  315. _self.getRgstridObj()
  316. _self.$message.success("修改成功");
  317. } else {
  318. _self.$emit('cancelHandler');
  319. }
  320. });
  321. })
  322. } catch (e) {
  323. }
  324. },
  325. cancelHandler() {
  326. this.$emit('cancelHandler');
  327. },
  328. formatRadio(val) {
  329. if (val == '1') {
  330. return '是'
  331. } else if (val == '0') {
  332. return '否'
  333. } else {
  334. return val
  335. }
  336. },
  337. // formatEngScal(val) {
  338. // switch (val) {
  339. // case '1':
  340. // val = '大(1)型';
  341. // break;
  342. // case '2':
  343. // val = '大(2)型';
  344. // break;
  345. // case '3':
  346. // val = '中型';
  347. // break;
  348. // case '4':
  349. // val = '小(1)型';
  350. // break;
  351. // case '5':
  352. // val = '小(2)型';
  353. // break;
  354. // case '9':
  355. // val = '其他';
  356. // break;
  357. // }
  358. // return val;
  359. // },
  360. // formatdamType(val) {
  361. // switch (val) {
  362. // case '1':
  363. // val = '混凝土坝';
  364. // break;
  365. // case '2':
  366. // val = '碾压混凝土坝';
  367. // break;
  368. // case '3':
  369. // val = '浆砌石坝';
  370. // break;
  371. // case '4':
  372. // val = '土坝';
  373. // break;
  374. // case '5':
  375. // val = '堆石坝';
  376. // break;
  377. // case '6':
  378. // val = '挡水坝';
  379. // break;
  380. // case '7':
  381. // val = '其它';
  382. // break;
  383. // }
  384. // return val;
  385. // },
  386. getAreaList(val) {
  387. let areaParams = {
  388. adName: "",
  389. id: this.dczId,
  390. pageNum: 1,
  391. pageSize: 10000
  392. }
  393. let adCode = ''
  394. if (!val) {
  395. adCode = '000000000000'
  396. } else {
  397. adCode = val
  398. }
  399. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  400. if (res.success) {
  401. if (this.curSelectItem == 1) {
  402. this.cityList = res.data
  403. } else if (this.curSelectItem == 2) {
  404. this.countryList = res.data
  405. } else {
  406. this.provList = res.data
  407. }
  408. }
  409. })
  410. },
  411. provChange(val) {
  412. this.curSelectItem = 1
  413. this.cityName = ''
  414. this.countryName = ''
  415. this.formObj.admDiv = val
  416. this.provList.forEach(ele => {
  417. if (ele.adCode == this.provName) {
  418. this.provNames = ele.adName
  419. }
  420. })
  421. this.formObj.location = this.provNames
  422. this.getAreaList(val)
  423. },
  424. cityChange(val) {
  425. this.curSelectItem = 2
  426. if (val && val != '') {
  427. this.formObj.admDiv = val
  428. this.countryName = ''
  429. this.cityList.forEach(ele => {
  430. if (ele.adCode == this.cityName) {
  431. this.cityNames = ele.adName
  432. }
  433. })
  434. this.formObj.location = this.provNames + this.cityNames
  435. this.getAreaList(val)
  436. }
  437. },
  438. countryChange(val) {
  439. if (val && val != '') {
  440. this.formObj.admDiv = val
  441. this.countryList.forEach(ele => {
  442. if (ele.adCode == this.countryName) {
  443. this.countryNames = ele.adName
  444. }
  445. })
  446. this.formObj.location = this.provNames + this.cityNames + this.countryNames
  447. }
  448. },
  449. // 近期面貌
  450. recentAppearance() {
  451. this.xcztShow = true;
  452. },
  453. jqmmDialog() {
  454. this.xcztShow = false;
  455. },
  456. //影像
  457. imageClick() {
  458. if (!this.centerX && !this.centerY) {
  459. this.$message.warning('暂无经纬度信息!');
  460. return false;
  461. }
  462. this.imageShow = true;
  463. }
  464. },
  465. }
  466. </script>
  467. <style>
  468. #dcdxHeader {
  469. padding: 15px 20px;
  470. }
  471. #dxdcFooter {
  472. text-align: center;
  473. }
  474. #dxdcAside {
  475. border: 1px solid #d5d5ff;
  476. }
  477. .el-dialog__wrapper .el-treeWhite {
  478. /* max-height: 260px !important; */
  479. }
  480. </style>