915777f9440b864085a6aaa00a74bc43e40d83e3.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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" ref="baseinfoForm" :rules="baseinfoRule">
  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">影像
  11. </el-button>
  12. </p>
  13. <el-form-item label="险工险段名称">
  14. <el-input v-model="formObj.sapName" readonly autocomplete="off" style="width:70%;"></el-input>
  15. </el-form-item>
  16. <!--<el-form-item label="所在堤防">-->
  17. <!--<el-input v-model="formObj.diskName" autocomplete="off" style="width:70%;"></el-input>-->
  18. <!--</el-form-item>-->
  19. <!--<el-form-item label="堤防等级">-->
  20. <!--<el-select v-model="formObj.dikeGrad" placeholder="请选择" clearable>-->
  21. <!--<el-option v-for="item in difangdengji" :key="item.value" :label="item.label"-->
  22. <!--:value="item.value"></el-option>-->
  23. <!--</el-select>-->
  24. <!--</el-form-item>-->
  25. <!--<el-form-item label="险工险段长度(m)">-->
  26. <!--<el-input v-model="formObj.sapLen" placeholder="请输入详细地点" autocomplete="off"-->
  27. <!--style="width:70%;"></el-input>-->
  28. <!--</el-form-item>-->
  29. <el-form-item label="险工险段类型">
  30. <el-input type="textarea" rows="6" v-model="formObj.sapType" clearable
  31. placeholder="请输入险工险段类型" style="width:70%;"></el-input>
  32. </el-form-item>
  33. <el-form-item label="起点行政区划">
  34. <div v-if="showLocSelect">
  35. <el-select v-model="provName" placeholder="选择省" @change="provChange" style="width:20%">
  36. <el-option
  37. v-for="item in provList"
  38. :key="item.adCode"
  39. :label="item.adName"
  40. :value="item.adCode">
  41. </el-option>
  42. </el-select>
  43. <el-select v-model="cityName" placeholder="选择市" @change="cityChange" style="width:20%">
  44. <el-option
  45. v-for="item in cityList"
  46. :key="item.adCode"
  47. :label="item.adName"
  48. :value="item.adCode">
  49. </el-option>
  50. </el-select>
  51. <el-select v-model="countryName" placeholder="选择县" @change="countryChange"
  52. style="width:20%">
  53. <el-option
  54. v-for="item in countryList"
  55. :key="item.adCode"
  56. :label="item.adName"
  57. :value="item.adCode">
  58. </el-option>
  59. </el-select>
  60. &#x3000;<span v-if="showLocSelect" @click="showLocSelect = false"
  61. style="color: #009fff;font-size:12px;cursor:pointer">取消</span>
  62. </div>
  63. <div v-else>
  64. <el-input v-model="formObj.adName" readonly autocomplete="off"
  65. style="width:70%;"></el-input>&#x3000;<span @click="showLocSelect = true" v-if="openType"
  66. style="color: #009fff;font-size:12px;cursor:pointer">更改</span>
  67. </div>
  68. </el-form-item>
  69. <el-form-item label="起所在地">
  70. <el-input v-model="formObj.startLoc" autocomplete="off" style="width:70%;"></el-input>
  71. </el-form-item>
  72. <el-form-item label="终所在地">
  73. <el-input v-model="formObj.endLoc" autocomplete="off" style="width:70%;"></el-input>
  74. </el-form-item>
  75. <!--<el-form-item label="所在河岸">-->
  76. <!--<el-input v-model="formObj.riverBank" autocomplete="off" style="width:70%;"></el-input>-->
  77. <!--</el-form-item>-->
  78. <!--<el-form-item label="所在湖泊">-->
  79. <!--<el-input v-model="formObj.lake" autocomplete="off" style="width:70%;"></el-input>-->
  80. <!--</el-form-item>-->
  81. <!--<el-form-item label="所在海岸">-->
  82. <!--<el-input v-model="formObj.coast" autocomplete="off" style="width:70%;"></el-input>-->
  83. <!--</el-form-item>-->
  84. <el-form-item label="信息审核状态">
  85. <el-select v-model="formObj.chkState" placeholder="请选择" clearable>
  86. <el-option v-for="item in checkState" :key="item.value" :label="item.label"
  87. :value="item.value"></el-option>
  88. </el-select>
  89. </el-form-item>
  90. <!--<el-form-item label="管理单位">-->
  91. <!--<el-input v-model="formObj.mampu" autocomplete="off" style="width:70%;"></el-input>-->
  92. <!--</el-form-item>-->
  93. <!--<el-form-item label="管理单位联系人">-->
  94. <!--<el-input v-model="formObj.mampuAttn" autocomplete="off" style="width:70%;"></el-input>-->
  95. <!--</el-form-item>-->
  96. <!--<el-form-item label="管理单位联系人电话">-->
  97. <!--<el-input v-model="formObj.mampuAttnTel" autocomplete="off" style="width:70%;"></el-input>-->
  98. <!--</el-form-item>-->
  99. <el-form-item label="主管单位联系人">
  100. <el-input v-model="formObj.compUnitAttn" autocomplete="off" style="width:70%;"></el-input>
  101. </el-form-item>
  102. <el-form-item label="主管单位联系人电话">
  103. <el-input v-model="formObj.compUnitAttnTel" autocomplete="off" style="width:70%;"></el-input>
  104. </el-form-item>
  105. <el-form-item label="政府防汛责任人">
  106. <el-input v-model="formObj.gvmtFldWho" autocomplete="off" style="width:70%;"></el-input>
  107. </el-form-item>
  108. <el-form-item label="政府防汛责任人电话">
  109. <el-input v-model="formObj.gvmtFldWhoTel" autocomplete="off" style="width:70%;"></el-input>
  110. </el-form-item>
  111. <el-form-item label="经度">
  112. <el-input clearable v-model="formObj.centerX" style="width:70%;"></el-input>
  113. </el-form-item>
  114. <el-form-item label="纬度">
  115. <el-input clearable v-model="formObj.centerY" style="width:70%;"></el-input>
  116. </el-form-item>
  117. <el-form-item label="">
  118. <el-button type="primary" @click="addHandler" v-if="openType">保 存</el-button>
  119. </el-form-item>
  120. </el-form>
  121. </el-main>
  122. </el-container>
  123. <theRecentAppearance v-if="xcztShow" @jqmmDialogClose="jqmmDialog" :jqmmShow="xcztShow" :openType="openType"
  124. :jqmmEngId="currentObjectRgstrId" :dialogTitle="currentObjectName + '近期面貌'"
  125. style="z-index: 9999;"></theRecentAppearance>
  126. <!--影像弹窗-->
  127. <el-dialog :title="currentObjectName + '影像'" :visible.sync="imageShow" append-to-body
  128. :close-on-click-modal="false" width="60%">
  129. <div style="height: 60vh;">
  130. <mapLocation ref="mapRef" v-if="imageShow" :gdX="centerX" :gdY="centerY"></mapLocation>
  131. </div>
  132. </el-dialog>
  133. </div>
  134. </template>
  135. <script>
  136. // import inputWith from "@widget/inuptWith.vue"
  137. import request from "@util/gw_ajax_request.js"
  138. import theRecentAppearance from '../../duChaDuiXiang/theRecentAppearance'
  139. import mapLocation from '../../../views/duChaTianBao/mapLocation'
  140. import {getBaseJiuCuo} from "@api/duChaTianBao.js"
  141. export default {
  142. components: {
  143. theRecentAppearance,
  144. mapLocation
  145. },
  146. props: ['currentObjectRgstrId', 'currentResCode', 'currentObjectId', 'currentObjectName','openType'],
  147. data() {
  148. var checkInput = (rule, value, callback) => {
  149. if (value && value.toString().length > 8) {
  150. return callback(new Error('输入位数过长'));
  151. }
  152. setTimeout(() => {
  153. if (value && isNaN(value)) {
  154. callback(new Error('请输入数字值'));
  155. } else {
  156. callback();
  157. }
  158. }, 500);
  159. };
  160. return {
  161. formObj: {
  162. adCode: "",//起点行政区编码 ,
  163. adName: "",//起点行政区名称 ,
  164. basCode: "",//所属流域机构 ,
  165. centerX: "",//起点经度 ,
  166. centerY: "",//
  167. chkState: "",//信息审核状态 ,
  168. coast: "",//所在海岸 ,
  169. compUnitAttn: "",//主管单位联系人 ,
  170. compUnitAttnTel: "",//主管单位联系人电话 ,
  171. dikeGrad: "",//堤防等级 ,
  172. diskName: "",//所在堤防 ,
  173. endLoc: "",//终点所在地 ,
  174. gdX: "",//起点高德经度 ,
  175. gdY: "",//起点高德纬度 ,
  176. gvmtFldWho: "",//政府防汛责任人 ,
  177. gvmtFldWhoTel: "",//政府防汛责任人电话 ,
  178. lake: "",//所在湖泊 ,
  179. mampu: "",//管理单位 ,
  180. mampuAttn: "",//管理单位联系人 ,
  181. mampuAttnTel: "",//管理单位联系人电话 ,
  182. persId: "",//创建人 ,
  183. riverBank: "",//所在河岸 ,
  184. sapLen: "",//险工险段长度(m) ,
  185. sapName: "",//险工险段名称 ,
  186. sapType: "",//险工险段类型 ,
  187. startLoc: "",//起点所在地 ,
  188. },
  189. dialogFormVisible: false,
  190. formLabelWidth: '160px',
  191. loading: true,
  192. operationType1: '',
  193. currentResCode1: '',
  194. currentObjectId1: '',
  195. value1: '',
  196. difangdengji: [
  197. {
  198. value: "1",
  199. label: "1级"
  200. },
  201. {
  202. value: "2",
  203. label: "2级"
  204. },
  205. {
  206. value: "3",
  207. label: "3级"
  208. },
  209. {
  210. value: "4",
  211. label: "4级"
  212. },
  213. {
  214. value: "5",
  215. label: "5级"
  216. },
  217. {
  218. value: "6",
  219. label: "5级以下"
  220. }
  221. ],
  222. checkState: [
  223. {
  224. label: "是",
  225. value: "1"
  226. },
  227. {
  228. label: "否",
  229. value: "2"
  230. }
  231. ],
  232. provList: [],
  233. cityList: [],
  234. countryList: [],
  235. provName: '',
  236. cityName: '',
  237. countryName: '',
  238. provNames: '',
  239. cityNames: '',
  240. countryNames: '',
  241. curSelectItem: 0,
  242. showLocSelect: false,
  243. locat: {
  244. adName: "",
  245. adCode: ""
  246. },
  247. xcztShow: false,
  248. imageShow: false,
  249. xcztEngId: '',
  250. centerX: 0,
  251. centerY: 0,
  252. baseinfoRule: {
  253. // totCap: [
  254. // {validator: checkInput, trigger: 'blur'}
  255. // ],
  256. // damSizeHig: [
  257. // {validator: checkInput, trigger: 'blur'}
  258. // ]
  259. },
  260. saveLoading: false
  261. }
  262. },
  263. computed: {
  264. recPersId() {
  265. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  266. }
  267. },
  268. mounted() {
  269. this.currentResCode1 = this.currentResCode;
  270. this.currentObjectId1 = this.currentObjectId;
  271. this.getRgstridObj();
  272. this.getAreaList()
  273. },
  274. watch: {
  275. currentObjectRgstrId(n, o) {
  276. this.getRgstridObj();
  277. },
  278. showLocSelect(val) {
  279. if (!val) {
  280. this.formObj.adName = this.locat.adName
  281. this.formObj.adCode = this.locat.adCode
  282. this.provName = ''
  283. this.cityName = ''
  284. this.countryName = ''
  285. }
  286. }
  287. },
  288. methods: {
  289. getRgstridObj() {
  290. var _self = this;
  291. getBaseJiuCuo(_self.currentObjectRgstrId).then(
  292. (res) => {
  293. if (res.data) {
  294. _self.formObj = res.data;
  295. this.locat.adName = res.data.adName
  296. this.locat.adCode = res.data.adCode
  297. this.centerX = res.data.centerX;
  298. this.centerY = res.data.centerY;
  299. // _self.value1 = dateFormat(res.data.compDate, 'yyyy-MM-dd');
  300. } else {
  301. _self.formObj = {};
  302. }
  303. },
  304. (err) => {
  305. }
  306. );
  307. },
  308. addHandler() {
  309. this.$refs.baseinfoForm.validate((valid) => {
  310. if (valid) {
  311. var _self = this;
  312. _self.formObj['persId'] = _self.recPersId;
  313. _self.formObj.objId = _self.currentObjectId1;
  314. //基础信息纠错,经纬度修改粗略校验经度纬度整数部分的范围
  315. this.$confirm('确认保存基础信息?', '提示', {
  316. confirmButtonText: '确定',
  317. cancelButtonText: '取消',
  318. type: 'warning'
  319. }).then(() => {
  320. if (!this.saveLoading) {
  321. this.saveLoading = true
  322. request.post('/bis/insp/waga/sap/rgstr', _self.formObj).then((res) => {
  323. if (res.success) {
  324. _self.$emit("addShuiKuSuccess");
  325. _self.showLocSelect = false
  326. _self.getRgstridObj()
  327. _self.$message.success("修改成功");
  328. } else {
  329. _self.$emit('cancelHandler');
  330. }
  331. this.saveLoading = false
  332. }).catch(err => {
  333. this.saveLoading = false
  334. this.$message.info(err)
  335. });
  336. }
  337. })
  338. } else {
  339. return false
  340. }
  341. })
  342. },
  343. cancelHandler() {
  344. this.$emit('cancelHandler');
  345. },
  346. formatRadio(val) {
  347. if (val == '1') {
  348. return '是'
  349. } else if (val == '0') {
  350. return '否'
  351. } else {
  352. return val
  353. }
  354. },
  355. getAreaList(val) {
  356. let areaParams = {
  357. adName: "",
  358. id: this.dczId,
  359. pageNum: 1,
  360. pageSize: 10000
  361. }
  362. let adCode = ''
  363. if (!val) {
  364. adCode = '000000000000'
  365. } else {
  366. adCode = val
  367. }
  368. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  369. if (res.success) {
  370. if (this.curSelectItem == 1) {
  371. this.cityList = res.data
  372. } else if (this.curSelectItem == 2) {
  373. this.countryList = res.data
  374. } else {
  375. this.provList = res.data
  376. }
  377. }
  378. })
  379. },
  380. provChange(val) {
  381. this.curSelectItem = 1
  382. this.cityName = ''
  383. this.countryName = ''
  384. this.formObj.adCode = val
  385. this.provList.forEach(ele => {
  386. if (ele.adCode == this.provName) {
  387. this.provNames = ele.adName
  388. }
  389. })
  390. this.formObj.adName = this.provNames
  391. this.getAreaList(val)
  392. },
  393. cityChange(val) {
  394. this.curSelectItem = 2
  395. if (val && val != '') {
  396. this.formObj.adCode = val
  397. this.countryName = ''
  398. this.cityList.forEach(ele => {
  399. if (ele.adCode == this.cityName) {
  400. this.cityNames = ele.adName
  401. }
  402. })
  403. this.formObj.adName = this.provNames + this.cityNames
  404. this.getAreaList(val)
  405. }
  406. },
  407. countryChange(val) {
  408. if (val && val != '') {
  409. this.formObj.adCode = val
  410. this.countryList.forEach(ele => {
  411. if (ele.adCode == this.countryName) {
  412. this.countryNames = ele.adName
  413. }
  414. })
  415. this.formObj.adName = this.provNames + this.cityNames + this.countryNames
  416. }
  417. },
  418. // 近期面貌
  419. recentAppearance() {
  420. this.xcztShow = true;
  421. },
  422. jqmmDialog() {
  423. this.xcztShow = false;
  424. },
  425. //影像
  426. imageClick() {
  427. if (!this.centerX && !this.centerY) {
  428. this.$message.warning('暂无经纬度信息!');
  429. return false;
  430. }
  431. this.imageShow = true;
  432. }
  433. },
  434. }
  435. </script>
  436. <style>
  437. #dcdxHeader {
  438. padding: 15px 20px;
  439. }
  440. #dxdcFooter {
  441. text-align: center;
  442. }
  443. #dxdcAside {
  444. border: 1px solid #d5d5ff;
  445. }
  446. .el-dialog__wrapper .el-treeWhite {
  447. /* max-height: 260px !important; */
  448. }
  449. </style>