88f2761c48cbef6fcdda1ceeac5da7826b414f8c.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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. <p style="margin-top:10px;margin-bottom: 10px"><i class="el-icon-caret-right"></i><span
  7. style="width:120px;padding-left: 10px">基础信息</span><span class="hrs"></span>
  8. <el-button type="warning" style="float: right;" @click="recentAppearance">近期面貌</el-button>
  9. <el-button type="warning" style="float: right; margin-right: 10px;" @click="imageClick">影像
  10. </el-button>
  11. </p>
  12. <el-form label-width="180px" :model="formObj" :rules="rules" ref="formObj">
  13. <el-form-item label="工程项目名称">
  14. <el-input v-model="formObj.prjName" autocomplete="off" style="width:70%;"></el-input>
  15. </el-form-item>
  16. <el-form-item label="所在河流">
  17. <el-input v-model="formObj.rvName" autocomplete="off" style="width:70%;"></el-input>
  18. </el-form-item>
  19. <el-form-item label="行政区划">
  20. <div v-if="showLocSelect">
  21. <el-select v-model="provName" placeholder="选择省" @change="provChange" style="width:20%">
  22. <el-option
  23. v-for="item in provList"
  24. :key="item.adCode"
  25. :label="item.adName"
  26. :value="item.adCode">
  27. </el-option>
  28. </el-select>
  29. <el-select v-model="cityName" placeholder="选择市" @change="cityChange" style="width:20%">
  30. <el-option
  31. v-for="item in cityList"
  32. :key="item.adCode"
  33. :label="item.adName"
  34. :value="item.adCode">
  35. </el-option>
  36. </el-select>
  37. <el-select v-model="countryName" placeholder="选择县" @change="countryChange"
  38. style="width:20%">
  39. <el-option
  40. v-for="item in countryList"
  41. :key="item.adCode"
  42. :label="item.adName"
  43. :value="item.adCode">
  44. </el-option>
  45. </el-select>
  46. &#x3000;<span v-if="showLocSelect" @click="showLocSelect = false"
  47. style="color: #009fff;font-size:12px;cursor:pointer">取消</span>
  48. </div>
  49. <div v-else>
  50. <el-input v-model="formObj.adName" readonly autocomplete="off"
  51. style="width:70%;"></el-input>&#x3000;<span @click="showLocSelect = true"
  52. style="color: #009fff;font-size:12px;cursor:pointer">更改</span>
  53. </div>
  54. </el-form-item>
  55. <el-form-item label="所在位置">
  56. <el-input v-model="formObj.addr" autocomplete="off" style="width:70%;"></el-input>
  57. </el-form-item>
  58. <el-form-item label="规划河长">
  59. <el-input v-model="formObj.rvLong"
  60. clearable
  61. type="text" onkeyup="value=value.replace(/[^.\d]/g,'')" autocomplete="off" style="width:70%;">
  62. <template slot="append">km</template>
  63. </el-input>
  64. </el-form-item>
  65. <el-form-item label="规划总投资">
  66. <el-input v-model="formObj.pgi" autocomplete="off"
  67. clearable
  68. type="text" onkeyup="value=value.replace(/[^.\d]/g,'')" style="width:70%;">
  69. <template slot="append">万元</template>
  70. </el-input>
  71. </el-form-item>
  72. <el-form-item label="小组组长">
  73. <el-input v-model="formObj.groupLeader" autocomplete="off" style="width:70%;"></el-input>
  74. </el-form-item>
  75. <el-form-item label="小组组长电话">
  76. <el-input v-model="formObj.groupLeaderTel" autocomplete="off" style="width:70%;"></el-input>
  77. </el-form-item>
  78. <el-form-item label="经度">
  79. <el-input v-model="formObj.gdX" autocomplete="off" style="width:70%;"></el-input>
  80. </el-form-item>
  81. <el-form-item label="纬度">
  82. <el-input v-model="formObj.gdY" autocomplete="off" style="width:70%;"></el-input>
  83. </el-form-item>
  84. <el-form-item label="">
  85. <el-button type="primary" @click="addHandler('formObj')">保 存</el-button>
  86. </el-form-item>
  87. </el-form>
  88. </el-main>
  89. </el-container>
  90. <theRecentAppearance v-if="xcztShow" @jqmmDialogClose="jqmmDialog" :jqmmShow="xcztShow"
  91. :jqmmEngId="currentObjectRgstrId" :type="'16'" :dialogTitle="currentObjectName + '近期面貌'"
  92. style="z-index: 9999;"></theRecentAppearance>
  93. <!--影像弹窗-->
  94. <el-dialog :title="currentObjectName + '影像'" :visible.sync="imageShow" append-to-body
  95. :close-on-click-modal="false" width="60%">
  96. <div style="height: 60vh;">
  97. <mapLocation ref="mapRef" v-if="imageShow" :gdX="centerX" :gdY="centerY"></mapLocation>
  98. </div>
  99. </el-dialog>
  100. </div>
  101. </template>
  102. <script>
  103. import inputWith from "@widget/inuptWith.vue"
  104. import request from "@util/gw_ajax_request.js"
  105. import theRecentAppearance from './recentAppearance.vue'
  106. import unlimitDatePicker from '@baseWidget/unLimitdatePicker.vue'
  107. import mapLocation from '../mapLocation'
  108. import {
  109. getrgstrIdObject1
  110. } from "@api/duChaTianBao.js"
  111. import {
  112. dateFormat
  113. } from "@util/gw_date.js"
  114. export default {
  115. components: {
  116. inputWith: inputWith,
  117. unlimitDatePicker: unlimitDatePicker,
  118. theRecentAppearance,
  119. mapLocation
  120. },
  121. props: ['currentObjectRgstrId', 'currentResCode', 'currentObjectId', 'currentObjectName'],
  122. data() {
  123. return {
  124. formObj: {
  125. prjId: "",//工程项目ID ,
  126. prjName: "",//工程项目名称 ,
  127. rvName: "",//所在河流 ,
  128. adCode: "",//行政区编码 ,
  129. adName: "",//行政区域描述 ,
  130. addr: "",//所在位置详细描述信息 ,
  131. centerX: "",//PC经度 ,
  132. centerY: "",//PC纬度 ,
  133. gdX: "",//高德经度 ,
  134. gdY: "",//高德纬度 ,
  135. smrmpState: "",//中小河流治理项目抽查情况填报状态(0:未填报;1:填报中;2:已填报) ,
  136. state: "",//督查状态(0:未督查;2:督查中;3:已督查) ,
  137. groupLeader: "",//小组组长 ,
  138. groupLeaderTel: "",//小组组长电话 ,
  139. recPersId: "",//记录人员ID ,
  140. recPers: "",//记录人员名称 ,
  141. recPersTel: "",//记录人员电话 ,
  142. pgi: "",//规划总投资
  143. rvLong: ""//规划河长
  144. },
  145. rules: {
  146. utName: [
  147. {required: true, message: '请输入用水单位名称', trigger: 'blur'},
  148. ],
  149. utType: [
  150. {required: true, message: '请选择单位类型', trigger: 'change'}
  151. ],
  152. },
  153. dialogFormVisible: false,
  154. formLabelWidth: '160px',
  155. loading: true,
  156. operationType1: '',
  157. currentResCode1: '',
  158. currentObjectId1: '',
  159. value1: '',
  160. provList: [],
  161. cityList: [],
  162. countryList: [],
  163. provName: '',
  164. cityName: '',
  165. countryName: '',
  166. provNames: '',
  167. cityNames: '',
  168. countryNames: '',
  169. curSelectItem: 0,
  170. showLocSelect: false,
  171. locat: {
  172. location: "",
  173. admDiv: ""
  174. },
  175. xcztShow: false,
  176. imageShow: false,
  177. xcztEngId: '',
  178. centerX: 0,
  179. centerY: 0,
  180. gcType: [],
  181. saveLoading: false
  182. }
  183. },
  184. computed: {
  185. recPersId() {
  186. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  187. }
  188. },
  189. mounted() {
  190. this.currentResCode1 = this.currentResCode;
  191. this.currentObjectId1 = this.currentObjectId;
  192. this.getRgstridObj();
  193. this.getAreaList()
  194. },
  195. watch: {
  196. currentObjectRgstrId(n, o) {
  197. this.getRgstridObj();
  198. },
  199. showLocSelect(val) {
  200. if (!val) {
  201. this.provName = ''
  202. this.cityName = ''
  203. this.countryName = ''
  204. }
  205. }
  206. },
  207. methods: {
  208. getRgstridObj() {
  209. var _self = this;
  210. request.get(`/bis/insp/samrmp/rgstr/${_self.currentObjectRgstrId}`).then(res => {
  211. _self.formObj = res.data;
  212. this.centerX = _self.formObj.gdX;
  213. this.centerY = _self.formObj.gdY;
  214. })
  215. },
  216. addHandler(formName) {
  217. this.$refs[formName].validate((valid) => {
  218. if (valid) {
  219. var _self = this;
  220. _self.formObj['persId'] = _self.recPersId;
  221. _self.formObj['rgstrId'] = _self.currentObjectRgstrId;
  222. _self.formObj.objId = _self.currentObjectId1;
  223. console.log(_self.formObj);
  224. if (this.formObj.gdX || this.formObj.gdY) {
  225. //基础信息纠错,经纬度修改粗略校验经度纬度整数部分的范围
  226. if (this.formObj.gdX < 74 || this.formObj.gdX > 136) {
  227. this.$message.error('经度的整数范围应在74-136之间,请重新填写!');
  228. this.formObj.gdX = '';
  229. return;
  230. }
  231. if (this.formObj.gdY < 4 || this.formObj.gdY > 54) {
  232. this.$message.error('纬度的整数范围应在4-54之间,请重新填写!');
  233. this.formObj.gdY = '';
  234. return;
  235. }
  236. }
  237. try {
  238. this.$confirm('确认保存基础信息?', '提示', {
  239. confirmButtonText: '确定',
  240. cancelButtonText: '取消',
  241. type: 'warning'
  242. }).then(() => {
  243. if (!this.saveLoading) {
  244. this.saveLoading = true
  245. request.post('/bis/insp/samrmp/rgstr', _self.formObj).then((res) => {
  246. if (res.success) {
  247. _self.$emit("addQuShuiKouSuccess");
  248. _self.showLocSelect = false
  249. _self.getRgstridObj()
  250. _self.$message.success("修改成功");
  251. } else {
  252. _self.$emit('cancelHandler');
  253. }
  254. this.saveLoading = false
  255. }).catch(err => {
  256. this.saveLoading = false
  257. this.$message.info(err)
  258. });
  259. }
  260. })
  261. } catch (e) {
  262. }
  263. } else {
  264. console.log('error submit!!');
  265. return false;
  266. }
  267. });
  268. },
  269. cancelHandler() {
  270. this.$emit('cancelHandler');
  271. },
  272. getAreaList(val) {
  273. let areaParams = {
  274. adName: "",
  275. id: this.dczId,
  276. pageNum: 1,
  277. pageSize: 10000
  278. }
  279. let adCode = ''
  280. if (!val) {
  281. adCode = '000000000000'
  282. } else {
  283. adCode = val
  284. }
  285. this.formObj.adCode = adCode;
  286. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  287. if (res.success) {
  288. if (this.curSelectItem == 1) {
  289. this.cityList = res.data
  290. } else if (this.curSelectItem == 2) {
  291. this.countryList = res.data
  292. } else {
  293. this.provList = res.data
  294. }
  295. }
  296. })
  297. },
  298. provChange(val) {
  299. this.curSelectItem = 1
  300. this.cityName = ''
  301. this.countryName = ''
  302. // this.formObj.admDiv = val
  303. this.provList.forEach(ele => {
  304. if (ele.adCode == this.provName) {
  305. this.provNames = ele.adName
  306. }
  307. })
  308. this.formObj.adName = this.provNames
  309. this.getAreaList(val)
  310. },
  311. cityChange(val) {
  312. this.curSelectItem = 2
  313. if (val && val != '') {
  314. // this.formObj.admDiv = val
  315. this.countryName = ''
  316. this.cityList.forEach(ele => {
  317. if (ele.adCode == this.cityName) {
  318. this.cityNames = ele.adName
  319. }
  320. })
  321. this.formObj.adName = this.provNames + this.cityNames
  322. this.getAreaList(val)
  323. }
  324. },
  325. countryChange(val) {
  326. if (val && val != '') {
  327. // this.formObj.admDiv = val
  328. this.countryList.forEach(ele => {
  329. if (ele.adCode == this.countryName) {
  330. this.countryNames = ele.adName
  331. }
  332. })
  333. this.formObj.adName = this.provNames + this.cityNames + this.countryNames
  334. this.getAreaList(val)
  335. }
  336. },
  337. // 近期面貌
  338. recentAppearance() {
  339. this.xcztShow = true;
  340. },
  341. jqmmDialog() {
  342. this.xcztShow = false;
  343. },
  344. //影像
  345. imageClick() {
  346. if (!this.centerX && !this.centerY) {
  347. this.$message.warning('暂无经纬度信息!');
  348. return false;
  349. }
  350. this.imageShow = true;
  351. }
  352. },
  353. }
  354. </script>
  355. <style>
  356. #dcdxHeader {
  357. padding: 15px 20px;
  358. }
  359. #dxdcFooter {
  360. text-align: center;
  361. }
  362. #dxdcAside {
  363. border: 1px solid #d5d5ff;
  364. }
  365. .el-dialog__wrapper .el-treeWhite {
  366. /* max-height: 260px !important; */
  367. }
  368. </style>