820ad31640da563a2ffbfb04100404a7d8b62d99.svn-base 12 KB

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