c82e188e2ac8fd38c6d77b6e6f42dd0f4ea4c24c.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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%;" placeholder="经度的整数范围应在74-136之间"></el-input>
  73. </el-form-item>
  74. <el-form-item label="纬度">
  75. <el-input clearable v-model="formObj.centerY" autocomplete="off" style="width:70%;"placeholder="纬度的整数范围应在4-54之间"></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. "centerX": "",
  135. "centerY": "",
  136. "type": ""
  137. },
  138. rules: {
  139. name: [
  140. { required: true, message: '请输入项目名称', trigger: 'blur' }
  141. ],
  142. type: [
  143. { required: true, message: '请选择检查分类', trigger: 'change' }
  144. ]
  145. },
  146. dialogFormVisible: false,
  147. formLabelWidth: '160px',
  148. loading: true,
  149. operationType1: '',
  150. currentResCode1: '',
  151. currentObjectId1: '',
  152. value1: '',
  153. provList: [],
  154. cityList: [],
  155. countryList: [],
  156. provName: '',
  157. cityName: '',
  158. countryName: '',
  159. provNames: '',
  160. cityNames: '',
  161. countryNames: '',
  162. curSelectItem: 0,
  163. showLocSelect: false,
  164. locat: {
  165. location: "",
  166. admDiv: ""
  167. },
  168. xcztShow: false,
  169. imageShow: false,
  170. xcztEngId:'',
  171. centerX: 0,
  172. centerY: 0,
  173. gcType:[]
  174. }
  175. },
  176. computed: {
  177. recPersId() {
  178. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  179. }
  180. },
  181. mounted() {
  182. this.currentResCode1 = this.currentResCode;
  183. this.currentObjectId1 = this.currentObjectId;
  184. this.getRgstridObj();
  185. this.getAreaList()
  186. },
  187. watch: {
  188. currentObjectRgstrId(n, o) {
  189. this.getRgstridObj();
  190. },
  191. showLocSelect(val){
  192. if(!val){
  193. // this.formObj.location = this.locat.location
  194. // this.formObj.admDiv = this.locat.admDiv
  195. this.provName = ''
  196. this.cityName = ''
  197. this.countryName = ''
  198. }
  199. }
  200. },
  201. methods: {
  202. getRgstridObj() {
  203. var _self = this;
  204. request.get(`/att/fsc/base/${_self.currentObjectId1}`).then(res =>{
  205. _self.formObj = res.data;
  206. // _self.formObj.intm = dateFormat(res.data.intm, 'yyyy-MM-dd');
  207. this.centerX = res.data.centerX;
  208. this.centerY = res.data.centerY;
  209. })
  210. },
  211. addHandler(formName) {
  212. this.$refs[formName].validate((valid) => {
  213. if (valid) {
  214. var _self = this;
  215. _self.formObj['persId'] = _self.recPersId;
  216. _self.formObj['rgstrId'] = _self.currentObjectRgstrId;
  217. _self.formObj.objId = _self.currentObjectId1;
  218. console.log(_self.formObj);
  219. if(this.formObj.centerX || this.formObj.centerY){
  220. //基础信息纠错,经纬度修改粗略校验经度纬度整数部分的范围
  221. if(this.formObj.centerX < 74 || this.formObj.centerX > 136){
  222. this.$message.error('经度的整数范围应在74-136之间,请重新填写!');
  223. this.formObj.centerX = '';
  224. return;
  225. }
  226. if(this.formObj.centerY < 4 || this.formObj.centerY > 54){
  227. this.$message.error('纬度的整数范围应在4-54之间,请重新填写!');
  228. this.formObj.centerY = '';
  229. return;
  230. }
  231. }
  232. try {
  233. this.$confirm('确认保存基础信息?', '提示', {
  234. confirmButtonText: '确定',
  235. cancelButtonText: '取消',
  236. type: 'warning'
  237. }).then(() => {
  238. delete _self.formObj.adName;
  239. delete _self.formObj.basName;
  240. request.post('/att/fsc/base', _self.formObj).then((res) => {
  241. if (res.success) {
  242. _self.$emit("addTeDingFeiJianSuccess");
  243. _self.showLocSelect = false
  244. _self.getRgstridObj()
  245. _self.$message.success("修改成功");
  246. } else {
  247. _self.$emit('cancelHandler');
  248. }
  249. });
  250. })
  251. } catch (e) {
  252. }
  253. } else {
  254. console.log('error submit!!');
  255. return false;
  256. }
  257. });
  258. },
  259. cancelHandler() {
  260. this.$emit('cancelHandler');
  261. },
  262. formatRadio(val) {
  263. if (val == '1') {
  264. return '是'
  265. } else if (val == '0') {
  266. return '否'
  267. } else {
  268. return val
  269. }
  270. },
  271. getAreaList(val){
  272. let areaParams = {
  273. adName: "",
  274. id: this.dczId,
  275. pageNum: 1,
  276. pageSize: 10000
  277. }
  278. let adCode = ''
  279. if(!val){
  280. adCode = '000000000000'
  281. }else{
  282. adCode = val
  283. }
  284. this.formObj.adCode = adCode;
  285. request.get('/dc/ad/base/getAdData',{params:{'adCode':adCode}}).then(res=>{
  286. if(res.success){
  287. if(this.curSelectItem == 1){
  288. this.cityList = res.data
  289. }else if(this.curSelectItem == 2){
  290. this.countryList = res.data
  291. }else{
  292. this.provList = res.data
  293. }
  294. request.post(`/att/bas/base/list`,{}).then(res =>{
  295. if(res.success){
  296. this.gcType = res.data;
  297. }
  298. })
  299. }
  300. })
  301. },
  302. provChange(val){
  303. this.curSelectItem = 1
  304. this.cityName = ''
  305. this.countryName = ''
  306. // this.formObj.admDiv = val
  307. this.provList.forEach(ele=>{
  308. if(ele.adCode == this.provName){
  309. this.provNames = ele.adName
  310. }
  311. })
  312. // this.formObj.location = this.provNames
  313. this.getAreaList(val)
  314. },
  315. cityChange(val){
  316. this.curSelectItem = 2
  317. if(val && val != ''){
  318. // this.formObj.admDiv = val
  319. this.countryName = ''
  320. this.cityList.forEach(ele=>{
  321. if(ele.adCode == this.cityName){
  322. this.cityNames = ele.adName
  323. }
  324. })
  325. // this.formObj.location = this.provNames + this.cityNames
  326. this.getAreaList(val)
  327. }
  328. },
  329. countryChange(val){
  330. if(val && val != ''){
  331. // this.formObj.admDiv = val
  332. this.countryList.forEach(ele=>{
  333. if(ele.adCode == this.countryName){
  334. this.countryNames = ele.adName
  335. }
  336. })
  337. // this.formObj.location = this.provNames + this.cityNames + this.countryNames
  338. this.getAreaList(val)
  339. }
  340. },
  341. // 近期面貌
  342. recentAppearance(){
  343. this.xcztShow = true;
  344. },
  345. jqmmDialog(){
  346. this.xcztShow = false;
  347. },
  348. //影像
  349. imageClick(){
  350. if(!this.centerX && !this.centerY){
  351. this.$message.warning('暂无经纬度信息!');
  352. return false;
  353. }
  354. this.imageShow = true;
  355. }
  356. },
  357. }
  358. </script>
  359. <style>
  360. #dcdxHeader {
  361. padding: 15px 20px;
  362. }
  363. #dxdcFooter {
  364. text-align: center;
  365. }
  366. #dxdcAside {
  367. border: 1px solid #d5d5ff;
  368. }
  369. .el-dialog__wrapper .el-treeWhite {
  370. /* max-height: 260px !important; */
  371. }
  372. </style>