d3972ac2037804b1569ca4baa6e85e1f2b61cbec.svn-base 14 KB

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