8bab84b1d916a3e4d10fe2e2066357355f566686.svn-base 15 KB

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