e8f4fbe9b1b96724017f2300fb871588c6fa78e5.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <div>
  3. <el-container>
  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="水库名称" required >
  13. <el-input v-model="formObj.rsvrNm" autocomplete="off" style="width:70%;"></el-input>
  14. </el-form-item>
  15. <el-form-item label="行政区划">
  16. <div v-if="showLocSelect">
  17. <el-select v-model="provName" placeholder="选择省" @change="provChange" style="width:20%">
  18. <el-option
  19. v-for="item in provList"
  20. :key="item.adCode"
  21. :label="item.adName"
  22. :value="item.adCode">
  23. </el-option>
  24. </el-select>
  25. <el-select v-model="cityName" placeholder="选择市" @change="cityChange" style="width:20%">
  26. <el-option
  27. v-for="item in cityList"
  28. :key="item.adCode"
  29. :label="item.adName"
  30. :value="item.adCode">
  31. </el-option>
  32. </el-select>
  33. <el-select v-model="countryName" placeholder="选择县" @change="countryChange" style="width:20%">
  34. <el-option
  35. v-for="item in countryList"
  36. :key="item.adCode"
  37. :label="item.adName"
  38. :value="item.adCode">
  39. </el-option>
  40. </el-select>
  41. &#x3000;<span v-if="showLocSelect" @click="showLocSelect = false"
  42. style="color: #009fff;font-size:12px;cursor:pointer">取消</span>
  43. </div>
  44. <div v-else>
  45. <el-input v-model="formObj.hystSite" readonly autocomplete="off"
  46. style="width:70%;"></el-input>&#x3000;<span @click="showLocSelect = true" v-if="openType"
  47. style="color: #009fff;font-size:12px;cursor:pointer">更改</span>
  48. </div>
  49. </el-form-item>
  50. <el-form-item label="所在地点" required >
  51. <el-input v-model="formObj.hystSite" autocomplete="off" style="width:70%;" readonly="readonly"></el-input>
  52. </el-form-item>
  53. <el-form-item label="修建时间" required >
  54. <el-date-picker v-model="formObj.resCreateTime" type="date" placeholder="选择日期">
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item label="工程规模" required>
  58. <el-select v-model="formObj.engScal" placeholder="请选择">
  59. <el-option v-for="item in xskEngscale" :key="item.value" :label="item.label" :value="item.value"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="总库容(万m³)">
  63. <el-input v-model="formObj.totCap" autocomplete="off" style="width:70%;"></el-input>
  64. </el-form-item>
  65. <el-form-item label="注册登记号">
  66. <el-input v-model="formObj.damRegCode" autocomplete="off" style="width:70%;"></el-input>
  67. </el-form-item>
  68. <el-form-item label="经度">
  69. <el-input v-model="formObj.gdX" autocomplete="off" style="width:70%;"></el-input>
  70. </el-form-item>
  71. <el-form-item label="纬度">
  72. <el-input v-model="formObj.gdY" autocomplete="off" style="width:70%;"></el-input>
  73. </el-form-item>
  74. <el-form-item label="" style="text-align: center">
  75. <!-- <el-button @click="cancelHandler">取 消</el-button> -->
  76. <el-button type="primary" @click="addHandler" v-if="openType">保 存</el-button>
  77. </el-form-item>
  78. </el-form>
  79. </el-main>
  80. </el-container>
  81. <theRecentAppearance v-if="xcztShow" @jqmmDialogClose="jqmmDialog" :jqmmShow="xcztShow" :openType="openType"
  82. :jqmmEngId="currentObjectRgstrId" :dialogTitle="currentObjectName + '近期面貌'"
  83. style="z-index: 9999;"></theRecentAppearance>
  84. <!--影像弹窗-->
  85. <el-dialog :title="currentObjectName + '影像'" :visible.sync="imageShow" append-to-body :close-on-click-modal="false"
  86. width="60%">
  87. <div style="height: 60vh;">
  88. <mapLocation ref="mapRef" v-if="imageShow" :gdX="formObj.gdX" :gdY="formObj.gdY"></mapLocation>
  89. </div>
  90. </el-dialog>
  91. </div>
  92. </template>
  93. <script>
  94. import inputWith from "@widget/inuptWith.vue"
  95. import request from "@util/gw_ajax_request.js"
  96. import theRecentAppearance from '../../duChaDuiXiang/theRecentAppearance'
  97. import unlimitDatePicker from '@baseWidget/unLimitdatePicker.vue'
  98. import mapLocation from '../mapLocation'
  99. import {
  100. getrgstrIdObject_xsksd_state
  101. } from "@api/duChaTianBao.js"
  102. import {
  103. dateFormat
  104. } from "@util/gw_date.js"
  105. export default {
  106. components: {
  107. inputWith: inputWith,
  108. unlimitDatePicker: unlimitDatePicker,
  109. theRecentAppearance,
  110. mapLocation
  111. },
  112. props: ['id','currentObjectRgstrId', 'currentResCode', 'currentObjectId', 'currentObjectName','openType'],
  113. data() {
  114. return {
  115. xskEngscale:[
  116. {
  117. value: "4",
  118. label: "小(1)型"
  119. },
  120. {
  121. value: "5",
  122. label: "小(2)型"
  123. }
  124. ],
  125. formObj: {
  126. adCode:"",
  127. adName:"",
  128. rsvrNm:"",
  129. resCreateTime:"",
  130. engScal:"",
  131. hystSite:"",
  132. totCap:"",
  133. damRegCode:"",
  134. centerX:"",
  135. centerY:""
  136. },
  137. dialogFormVisible: false,
  138. formLabelWidth: '160px',
  139. loading: true,
  140. operationType1: '',
  141. currentResCode1: '',
  142. currentObjectId1: '',
  143. value1: '',
  144. provList: [],
  145. cityList: [],
  146. countryList: [],
  147. provName: '',
  148. cityName: '',
  149. countryName: '',
  150. provNames: '',
  151. cityNames: '',
  152. countryNames: '',
  153. curSelectItem: 0,
  154. showLocSelect: false,
  155. locat: {
  156. location: "",
  157. admDiv: ""
  158. },
  159. xcztShow: false,
  160. imageShow: false,
  161. xcztEngId: '',
  162. centerX: 0,
  163. centerY: 0
  164. }
  165. },
  166. computed: {
  167. recPersId() {
  168. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  169. }
  170. },
  171. mounted() {
  172. this.currentResCode1 = this.currentResCode;
  173. this.currentObjectId1 = this.currentObjectId;
  174. this.getRgstridObj();
  175. this.getAreaList()
  176. },
  177. watch: {
  178. id(n, o) {
  179. this.getRgstridObj();
  180. },
  181. showLocSelect(val) {
  182. if (!val) {
  183. this.formObj.rvLoc = this.locat.location
  184. this.formObj.admDiv = this.locat.admDiv
  185. this.provName = ''
  186. this.cityName = ''
  187. this.countryName = ''
  188. }
  189. }
  190. },
  191. methods: {
  192. getRgstridObj() {
  193. var _self = this;
  194. getrgstrIdObject_xsksd_state(_self.currentObjectRgstrId).then(
  195. (res) => {
  196. if (res.data) {
  197. _self.formObj = res.data;
  198. } else {
  199. _self.formObj = {};
  200. }
  201. },
  202. (err) => {
  203. }
  204. );
  205. },
  206. addHandler() {
  207. var _self = this;
  208. _self.formObj['persId'] = _self.recPersId;
  209. _self.formObj.objId = _self.currentObjectId1;
  210. _self.formObj.adCode = _self.countryName;
  211. try {
  212. this.$confirm('确认保存基础信息?', '提示', {
  213. confirmButtonText: '确定',
  214. cancelButtonText: '取消',
  215. type: 'warning'
  216. }).then(() => {
  217. request.post('/bis/insp/rsvrsd/', _self.formObj).then((res) => {
  218. if (res.success) {
  219. _self.$emit("addShuiKuSuccess");
  220. _self.showLocSelect = false
  221. _self.getRgstridObj()
  222. _self.$message.success("修改成功");
  223. } else {
  224. _self.$emit('cancelHandler');
  225. }
  226. });
  227. })
  228. } catch (e) {
  229. }
  230. },
  231. cancelHandler() {
  232. this.$emit('cancelHandler');
  233. },
  234. formatRadio(val) {
  235. if (val == '1') {
  236. return '是'
  237. } else if (val == '0') {
  238. return '否'
  239. } else {
  240. return val
  241. }
  242. },
  243. getAreaList(val) {
  244. let areaParams = {
  245. adName: "",
  246. id: this.dczId,
  247. pageNum: 1,
  248. pageSize: 10000
  249. }
  250. let adCode = ''
  251. if (!val) {
  252. adCode = '000000000000'
  253. } else {
  254. adCode = val
  255. }
  256. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  257. if (res.success) {
  258. if (this.curSelectItem == 1) {
  259. this.cityList = res.data
  260. } else if (this.curSelectItem == 2) {
  261. this.countryList = res.data
  262. } else {
  263. this.provList = res.data
  264. }
  265. }
  266. })
  267. },
  268. provChange(val) {
  269. this.curSelectItem = 1
  270. this.cityName = ''
  271. this.countryName = ''
  272. this.formObj.admDiv = val
  273. this.provList.forEach(ele => {
  274. if (ele.adCode == this.provName) {
  275. this.provNames = ele.adName
  276. }
  277. })
  278. this.formObj.adName = this.provNames
  279. this.formObj.hystSite = this.formObj.adName;
  280. this.getAreaList(val)
  281. },
  282. RsvrTypeChange(val) {
  283. },
  284. cityChange(val) {
  285. this.curSelectItem = 2
  286. if (val && val != '') {
  287. this.formObj.admDiv = val
  288. this.countryName = ''
  289. this.cityList.forEach(ele => {
  290. if (ele.adCode == this.cityName) {
  291. this.cityNames = ele.adName
  292. }
  293. })
  294. this.formObj.adName = this.provNames + this.cityNames
  295. this.formObj.hystSite = this.formObj.adName;
  296. this.getAreaList(val)
  297. }
  298. },
  299. countryChange(val) {
  300. if (val && val != '') {
  301. this.formObj.admDiv = val
  302. this.countryList.forEach(ele => {
  303. if (ele.adCode == this.countryName) {
  304. this.countryNames = ele.adName
  305. }
  306. })
  307. this.formObj.adName = this.provNames + this.cityNames + this.countryNames
  308. this.formObj.adCode = val
  309. this.formObj.hystSite = this.formObj.adName;
  310. }
  311. },
  312. // 近期面貌
  313. recentAppearance() {
  314. this.xcztShow = true;
  315. },
  316. jqmmDialog() {
  317. this.xcztShow = false;
  318. },
  319. //影像
  320. imageClick() {
  321. if (!this.formObj.gdX && !this.formObj.gdY) {
  322. this.$message.warning('暂无经纬度信息!');
  323. return false;
  324. }
  325. this.imageShow = true;
  326. }
  327. },
  328. }
  329. </script>
  330. <style>
  331. #dcdxHeader {
  332. padding: 15px 20px;
  333. }
  334. #dxdcFooter {
  335. text-align: center;
  336. }
  337. #dxdcAside {
  338. border: 1px solid #d5d5ff;
  339. }
  340. .el-dialog__wrapper .el-treeWhite {
  341. /* max-height: 260px !important; */
  342. }
  343. </style>