48b2f224b067d02e6a78b12401a07ffde6e6c434.svn-base 11 KB

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