c2186fee70e01245b6496d8a22b4206339d51d76.svn-base 15 KB

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