f08c6ff0e30b408a4e145f327d4c3b2f9ea89ce9.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.depName" 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="单位地址">
  51. <el-input v-model="formObj.loc" autocomplete="off" style="width:70%;"></el-input>
  52. </el-form-item>
  53. <el-form-item label="单位负责人">
  54. <el-input v-model="formObj.utLead" autocomplete="off" style="width:70%;"></el-input>
  55. </el-form-item>
  56. <el-form-item label="负责人电话">
  57. <el-input v-model="formObj.principalTel" autocomplete="off" style="width:70%;"></el-input>
  58. </el-form-item>
  59. <el-form-item label="联系人">
  60. <el-input v-model="formObj.depPers" autocomplete="off" style="width:70%;"></el-input>
  61. </el-form-item>
  62. <el-form-item label="联系电话">
  63. <el-input v-model="formObj.depPersTel" autocomplete="off" style="width:70%;"></el-input>
  64. </el-form-item>
  65. <el-form-item label="备注">
  66. <el-input v-model="formObj.note" autocomplete="off" style="width:70%;"></el-input>
  67. </el-form-item>
  68. <el-form-item label="经度">
  69. <el-input v-model="formObj.centerX" autocomplete="off" style="width:70%;"></el-input>
  70. </el-form-item>
  71. <el-form-item label="纬度">
  72. <el-input v-model="formObj.centerY" 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="centerX" :gdY="centerY"></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_hhgl_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. formObj: {
  116. adCode:"",
  117. adName:"",
  118. depName:"",
  119. loc:"",
  120. utLead:"",
  121. principalTel:"",
  122. depPers:"",
  123. depPersTel:"",
  124. note:"",
  125. centerX:"",
  126. centerY:""
  127. },
  128. dialogFormVisible: false,
  129. formLabelWidth: '160px',
  130. loading: true,
  131. operationType1: '',
  132. currentResCode1: '',
  133. currentObjectId1: '',
  134. value1: '',
  135. provList: [],
  136. cityList: [],
  137. countryList: [],
  138. provName: '',
  139. cityName: '',
  140. countryName: '',
  141. provNames: '',
  142. cityNames: '',
  143. countryNames: '',
  144. curSelectItem: 0,
  145. showLocSelect: false,
  146. locat: {
  147. location: "",
  148. admDiv: ""
  149. },
  150. xcztShow: false,
  151. imageShow: false,
  152. xcztEngId: '',
  153. centerX: 0,
  154. centerY: 0
  155. }
  156. },
  157. computed: {
  158. recPersId() {
  159. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  160. }
  161. },
  162. mounted() {
  163. this.currentResCode1 = this.currentResCode;
  164. this.currentObjectId1 = this.currentObjectId;
  165. this.getRgstridObj();
  166. this.getAreaList()
  167. },
  168. watch: {
  169. id(n, o) {
  170. this.getRgstridObj();
  171. },
  172. showLocSelect(val) {
  173. if (!val) {
  174. this.formObj.rvLoc = this.locat.location
  175. this.formObj.admDiv = this.locat.admDiv
  176. this.provName = ''
  177. this.cityName = ''
  178. this.countryName = ''
  179. }
  180. }
  181. },
  182. methods: {
  183. getRgstridObj() {
  184. var _self = this;
  185. getrgstrIdObject_hhgl_state(_self.currentObjectRgstrId).then(
  186. (res) => {
  187. if (res.data) {
  188. _self.formObj = res.data;
  189. } else {
  190. _self.formObj = {};
  191. }
  192. },
  193. (err) => {
  194. }
  195. );
  196. },
  197. addHandler() {
  198. var _self = this;
  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/rvgm', _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.centerX && !this.centerY) {
  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>