2c9cfd985e64eeda29fe7dcb8a60ff82608c3a14.svn-base 11 KB

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