73b35acd7d0dc7d2192ebcc4d993705b783ebcf8.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <div>
  3. <el-container>
  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">
  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">影像</el-button>
  11. </p>
  12. <el-form-item label="项目名称" required >
  13. <el-input v-model="formObj.name" autocomplete="off" style="width:70%;"></el-input>
  14. </el-form-item>
  15. <el-form-item label="项目编号" required >
  16. <el-input v-model="formObj.prjCode" autocomplete="off" style="width:70%;"></el-input>
  17. </el-form-item>
  18. <el-form-item label="项目类型" required >
  19. <el-input v-model="formObj.prjType" autocomplete="off" style="width:70%;"></el-input>
  20. </el-form-item>
  21. <el-form-item label="行政区划" required>
  22. <div v-if="showLocSelect">
  23. <el-select v-model="provName" placeholder="选择省" @change="provChange" style="width:20%">
  24. <el-option
  25. v-for="item in provList"
  26. :key="item.adCode"
  27. :label="item.adName"
  28. :value="item.adCode">
  29. </el-option>
  30. </el-select>
  31. <el-select v-model="cityName" placeholder="选择市" @change="cityChange" style="width:20%">
  32. <el-option
  33. v-for="item in cityList"
  34. :key="item.adCode"
  35. :label="item.adName"
  36. :value="item.adCode">
  37. </el-option>
  38. </el-select>
  39. <el-select v-model="countryName" placeholder="选择县" @change="countryChange" style="width:20%">
  40. <el-option
  41. v-for="item in countryList"
  42. :key="item.adCode"
  43. :label="item.adName"
  44. :value="item.adCode">
  45. </el-option>
  46. </el-select>
  47. &#x3000;<span v-if="showLocSelect" @click="showLocSelect = false"
  48. style="color: #009fff;font-size:12px;cursor:pointer">取消</span>
  49. </div>
  50. <div v-else>
  51. <el-input v-model="formObj.adName" readonly autocomplete="off"
  52. style="width:70%;"></el-input>&#x3000;<span @click="showLocSelect = true" v-if="openType"
  53. style="color: #009fff;font-size:12px;cursor:pointer">更改</span>
  54. </div>
  55. </el-form-item>
  56. <el-form-item label="工程地址">
  57. <el-input v-model="formObj.location" autocomplete="off" style="width:70%;"></el-input>
  58. </el-form-item>
  59. <el-form-item label="经度">
  60. <el-input v-model="formObj.gdX" autocomplete="off" style="width:70%;"></el-input>
  61. </el-form-item>
  62. <el-form-item label="纬度">
  63. <el-input v-model="formObj.gdY" autocomplete="off" style="width:70%;"></el-input>
  64. </el-form-item>
  65. <el-form-item label="" style="text-align: center">
  66. <!-- <el-button @click="cancelHandler">取 消</el-button> -->
  67. <el-button type="primary" @click="addHandler" v-if="openType">保 存</el-button>
  68. </el-form-item>
  69. </el-form>
  70. </el-main>
  71. </el-container>
  72. <theRecentAppearance v-if="xcztShow" @jqmmDialogClose="jqmmDialog" :jqmmShow="xcztShow" :openType="openType"
  73. :jqmmEngId="currentObjectRgstrId" :dialogTitle="currentObjectName + '近期面貌'"
  74. style="z-index: 9999;"></theRecentAppearance>
  75. <!--影像弹窗-->
  76. <el-dialog :title="currentObjectName + '影像'" :visible.sync="imageShow" append-to-body :close-on-click-modal="false"
  77. width="60%">
  78. <div style="height: 60vh;">
  79. <mapLocation ref="mapRef" v-if="imageShow" :gdX="formObj.gdX" :gdY="formObj.gdY"></mapLocation>
  80. </div>
  81. </el-dialog>
  82. </div>
  83. </template>
  84. <script>
  85. import inputWith from "@widget/inuptWith.vue"
  86. import request from "@util/gw_ajax_request.js"
  87. import theRecentAppearance from '../../duChaDuiXiang/theRecentAppearance'
  88. import unlimitDatePicker from '@baseWidget/unLimitdatePicker.vue'
  89. import mapLocation from '../mapLocation'
  90. import {
  91. getrgstrIdObject_stbczdgc_state
  92. } from "@api/duChaTianBao.js"
  93. import {
  94. dateFormat
  95. } from "@util/gw_date.js"
  96. export default {
  97. components: {
  98. inputWith: inputWith,
  99. unlimitDatePicker: unlimitDatePicker,
  100. theRecentAppearance,
  101. mapLocation
  102. },
  103. props: ['id','currentObjectRgstrId', 'currentResCode', 'currentObjectId', 'currentObjectName','openType'],
  104. data() {
  105. return {
  106. formObj: {
  107. adCode:"",
  108. adName:"",
  109. name:"",
  110. prjCode:"",
  111. prjType:"",
  112. location:"",
  113. gdX:"",
  114. gdY:""
  115. },
  116. dialogFormVisible: false,
  117. formLabelWidth: '160px',
  118. loading: true,
  119. operationType1: '',
  120. currentResCode1: '',
  121. currentObjectId1: '',
  122. value1: '',
  123. provList: [],
  124. cityList: [],
  125. countryList: [],
  126. provName: '',
  127. cityName: '',
  128. countryName: '',
  129. provNames: '',
  130. cityNames: '',
  131. countryNames: '',
  132. curSelectItem: 0,
  133. showLocSelect: false,
  134. locat: {
  135. location: "",
  136. admDiv: ""
  137. },
  138. xcztShow: false,
  139. imageShow: false,
  140. xcztEngId: '',
  141. centerX: 0,
  142. centerY: 0
  143. }
  144. },
  145. computed: {
  146. recPersId() {
  147. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  148. }
  149. },
  150. mounted() {
  151. this.currentResCode1 = this.currentResCode;
  152. this.currentObjectId1 = this.currentObjectId;
  153. this.getRgstridObj();
  154. this.getAreaList()
  155. },
  156. watch: {
  157. id(n, o) {
  158. this.getRgstridObj();
  159. },
  160. showLocSelect(val) {
  161. if (!val) {
  162. this.formObj.rvLoc = this.locat.location
  163. this.formObj.admDiv = this.locat.admDiv
  164. this.provName = ''
  165. this.cityName = ''
  166. this.countryName = ''
  167. }
  168. }
  169. },
  170. methods: {
  171. getRgstridObj() {
  172. var _self = this;
  173. getrgstrIdObject_stbczdgc_state(_self.currentObjectRgstrId).then(
  174. (res) => {
  175. if (res.data) {
  176. _self.formObj = res.data;
  177. } else {
  178. _self.formObj = {};
  179. }
  180. },
  181. (err) => {
  182. }
  183. );
  184. },
  185. addHandler() {
  186. var _self = this;
  187. _self.formObj['persId'] = _self.recPersId;
  188. _self.formObj.objId = _self.currentObjectId1;
  189. _self.formObj.adCode = _self.countryName;
  190. try {
  191. this.$confirm('确认保存基础信息?', '提示', {
  192. confirmButtonText: '确定',
  193. cancelButtonText: '取消',
  194. type: 'warning'
  195. }).then(() => {
  196. request.post('/bis/insp/prdqh', _self.formObj).then((res) => {
  197. if (res.success) {
  198. _self.$emit("addShuiKuSuccess");
  199. _self.showLocSelect = false
  200. _self.getRgstridObj()
  201. _self.$message.success("修改成功");
  202. } else {
  203. _self.$emit('cancelHandler');
  204. }
  205. });
  206. })
  207. } catch (e) {
  208. }
  209. },
  210. cancelHandler() {
  211. this.$emit('cancelHandler');
  212. },
  213. formatRadio(val) {
  214. if (val == '1') {
  215. return '是'
  216. } else if (val == '0') {
  217. return '否'
  218. } else {
  219. return val
  220. }
  221. },
  222. getAreaList(val) {
  223. let areaParams = {
  224. adName: "",
  225. id: this.dczId,
  226. pageNum: 1,
  227. pageSize: 10000
  228. }
  229. let adCode = ''
  230. if (!val) {
  231. adCode = '000000000000'
  232. } else {
  233. adCode = val
  234. }
  235. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  236. if (res.success) {
  237. if (this.curSelectItem == 1) {
  238. this.cityList = res.data
  239. } else if (this.curSelectItem == 2) {
  240. this.countryList = res.data
  241. } else {
  242. this.provList = res.data
  243. }
  244. }
  245. })
  246. },
  247. provChange(val) {
  248. this.curSelectItem = 1
  249. this.cityName = ''
  250. this.countryName = ''
  251. this.formObj.admDiv = val
  252. this.provList.forEach(ele => {
  253. if (ele.adCode == this.provName) {
  254. this.provNames = ele.adName
  255. }
  256. })
  257. this.formObj.adName = this.provNames
  258. this.getAreaList(val)
  259. },
  260. RsvrTypeChange(val) {
  261. },
  262. cityChange(val) {
  263. this.curSelectItem = 2
  264. if (val && val != '') {
  265. this.formObj.admDiv = val
  266. this.countryName = ''
  267. this.cityList.forEach(ele => {
  268. if (ele.adCode == this.cityName) {
  269. this.cityNames = ele.adName
  270. }
  271. })
  272. this.formObj.adName = this.provNames + this.cityNames
  273. this.getAreaList(val)
  274. }
  275. },
  276. countryChange(val) {
  277. if (val && val != '') {
  278. this.formObj.admDiv = val
  279. this.countryList.forEach(ele => {
  280. if (ele.adCode == this.countryName) {
  281. this.countryNames = ele.adName
  282. }
  283. })
  284. this.formObj.adName = this.provNames + this.cityNames + this.countryNames
  285. this.formObj.adCode = val
  286. }
  287. },
  288. // 近期面貌
  289. recentAppearance() {
  290. this.xcztShow = true;
  291. },
  292. jqmmDialog() {
  293. this.xcztShow = false;
  294. },
  295. //影像
  296. imageClick() {
  297. if (!this.formObj.gdX && !this.formObj.gdY) {
  298. this.$message.warning('暂无经纬度信息!');
  299. return false;
  300. }
  301. this.imageShow = true;
  302. }
  303. },
  304. }
  305. </script>
  306. <style>
  307. #dcdxHeader {
  308. padding: 15px 20px;
  309. }
  310. #dxdcFooter {
  311. text-align: center;
  312. }
  313. #dxdcAside {
  314. border: 1px solid #d5d5ff;
  315. }
  316. .el-dialog__wrapper .el-treeWhite {
  317. /* max-height: 260px !important; */
  318. }
  319. </style>