dangerarearesidentrecordlist.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <!--
  2. * @Title:
  3. * @Description: 危险区登记人员清单
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view>
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <uni-collapse @change="searchAreaStatus">
  18. <uni-collapse-item :show-animation="true" :open="true">
  19. <template v-slot:title>
  20. <view class="view-flex-block-center" style="height: 40px;width: 100%;">
  21. <view class="view-flex-inline-center">
  22. <text v-if="showSearch" style="color: coral;">点击收起查询区</text>
  23. <text v-else style="color: coral;">点击展开查询区</text>
  24. </view>
  25. </view>
  26. </template>
  27. </uni-collapse-item>
  28. </uni-collapse>
  29. <view v-if="showSearch" class="search-block">
  30. <view style="padding-left: 10px;padding-right: 10px;margin-top: 10px;">
  31. <view v-if="permission.admin">
  32. <uni-data-select v-model="cityRegionValue" :localdata="cityRegionData" @change="cityRegionChange"
  33. placeholder="请选择盟市"></uni-data-select>
  34. </view>
  35. <view v-if="permission.admin || permission.orgAdmin" style="margin-top: 10px;">
  36. <uni-data-select v-model="districtRegionValue" :localdata="districtRegionData"
  37. @change="districtRegionChange" placeholder="请选择区旗县"></uni-data-select>
  38. </view>
  39. <view v-if="permission.admin || permission.orgAdmin || permission.qiAdmin" style="margin-top: 10px;">
  40. <uni-data-select v-model="townRegionValue" :localdata="townRegionData" @change="townRegionChange"
  41. placeholder="请选择乡镇"></uni-data-select>
  42. </view>
  43. <view style="margin-top: 10px;">
  44. <uni-data-select v-model="countryRegionValue" :localdata="countryRegionData"
  45. @change="countryRegionChange" placeholder="请选择村"></uni-data-select>
  46. </view>
  47. <view style="margin-top: 10px;">
  48. <uni-data-select v-model="dangerAreaValue" :localdata="dangerAreaData" @change="dangerAreaChange"
  49. placeholder="请选择危险区"></uni-data-select>
  50. </view>
  51. </view>
  52. <view class="rtu-code" style="margin-top: 10px;">
  53. <uni-easyinput :styles="inputStyles" @input="personNameValInput" prefixIcon="search"
  54. v-model="personNameVal" placeholder="请录入户主名称">
  55. </uni-easyinput>
  56. </view>
  57. <view class="submit-btn">
  58. <button type="default" @click="search">查 询</button>
  59. </view>
  60. </view>
  61. <view class="container">
  62. <uni-list>
  63. <uni-list-item v-for="item in list" :key="item.id">
  64. <template v-slot:body>
  65. <view class="list-item-block">
  66. <view class="line">
  67. <text class="text">户主姓名:</text>
  68. <text class="content">{{item.personName}}</text>
  69. </view>
  70. <view class="line">
  71. <text class="text">手机号:</text>
  72. <text class="content">{{item.personId}}</text>
  73. </view>
  74. <view class="line">
  75. <text class="text">危险区:</text>
  76. <text class="content">{{item.dangerAreaName}}</text>
  77. </view>
  78. <view class="line">
  79. <text class="text">行政区:</text>
  80. <text class="content">{{item.fullAadName}}</text>
  81. </view>
  82. <view class="line">
  83. <text class="text">住址经纬度:</text>
  84. <text class="content">{{item.longitude}},{{item.latitude}}</text>
  85. </view>
  86. <view class="line">
  87. <text class="text">住址:</text>
  88. <text class="content">{{item.address}}</text>
  89. </view>
  90. <view class="item-button-group" style="padding-right: 10px;">
  91. <view class="item-button mid-size" @click="onResetLocationClick(item)">
  92. <view class="items-line">
  93. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  94. <text class="button-text">定位补录</text>
  95. </view>
  96. </view>
  97. <view class="item-button mid-size" @click="onOpenFamilyListClick(item)">
  98. <view class="items-line">
  99. <uni-icons class="input-uni-icon" type="staff" size="18" color="coral" />
  100. <text class="button-text">家庭成员表</text>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. </uni-list-item>
  107. </uni-list>
  108. <uni-group>
  109. <view class="pagination-block">
  110. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  111. @change="pageChange" />
  112. </view>
  113. </uni-group>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. role
  120. } from "@/api/role.js";
  121. import http from '@/http/api.js';
  122. export default {
  123. components: {},
  124. data() {
  125. return {
  126. title: '登记人员清单',
  127. permission: {
  128. 'admin': false,
  129. 'orgAdmin': false,
  130. 'qiAdmin': false,
  131. 'companyAdmin': false,
  132. 'companyServciePerson': false,
  133. 'yjServicePerson': false
  134. },
  135. showSearch: true,
  136. cityRegionValue: '',
  137. cityRegionData: [],
  138. districtRegionValue: '',
  139. districtRegionData: [],
  140. townRegionValue: '',
  141. townRegionData: [],
  142. countryRegionValue: '',
  143. countryRegionData: [],
  144. dangerAreaValue: '',
  145. dangerAreaData: [],
  146. pageSize: 10,
  147. pageCurrent: 1,
  148. total: 0,
  149. list: [],
  150. query: {},
  151. personNameVal: '',
  152. inputStyles: {
  153. color: '#808080',
  154. borderColor: '#d3d3d3'
  155. },
  156. triggered: false
  157. }
  158. },
  159. computed: {
  160. },
  161. onLoad(option) {
  162. if (this.userInfo.role_name === role.admin) {
  163. this.permission.admin = true;
  164. } else if (this.userInfo.role_name === role.orgAdmin) {
  165. this.permission.orgAdmin = true;
  166. } else if (this.userInfo.role_name === role.qiAdmin) {
  167. this.permission.qiAdmin = true;
  168. } else if (this.userInfo.role_name === role.companyAdmin) {
  169. this.permission.companyAdmin = true;
  170. } else if (this.userInfo.role_name === role.companyServciePerson) {
  171. this.permission.companyServciePerson = true;
  172. } else if (this.userInfo.role_name === role.yjServicePerson) {
  173. this.permission.yjServicePerson = true;
  174. }
  175. // if (this.subSystem == 1) {
  176. // this.title = "管理工作台";
  177. // this.getRegionTree();
  178. // } else if (this.subSystem == 2) {
  179. // this.title = "实时监测预警";
  180. // this.getCityRegion({});
  181. // this.$nextTick(() => {
  182. // this.getYjPage({});
  183. // })
  184. // }
  185. this.query = {};
  186. this.query['isHouseholder'] = 1;
  187. if (this.permission.admin) {
  188. this.getCityRegion({});
  189. } else if (this.permission.orgAdmin) {
  190. this.getDistrictRegion({});
  191. } else if (this.permission.qiAdmin || this.permission.yjServicePerson) {
  192. this.getTownRegion({});
  193. }
  194. this.getPage();
  195. },
  196. onShow() {
  197. },
  198. methods: {
  199. toBack() {
  200. uni.navigateBack({
  201. delta: 1
  202. })
  203. },
  204. pageChange(e) {
  205. this.pageCurrent = e.current;
  206. let params = {};
  207. if (this.dangerAreaValue != '' && this.dangerAreaValue.length > 0) {
  208. params['dangerAreaPid'] = this.dangerAreaValue;
  209. }
  210. if (this.personNameVal != '' && this.personNameVal.length > 0) {
  211. params['personName'] = this.personNameVal;
  212. }
  213. this.getPage(params)
  214. },
  215. searchAreaStatus(e) {
  216. if (e.length > 0) {
  217. this.showSearch = true;
  218. } else {
  219. this.showSearch = false;
  220. }
  221. },
  222. cityRegionChange(e) {
  223. this.cityRegionValue = e;
  224. this.districtRegionData = [];
  225. this.districtRegionValue = '';
  226. this.townRegionData = [];
  227. this.townRegionValue = '';
  228. this.countryRegionData = [];
  229. this.countryRegionValue = '';
  230. this.dangerAreaData = [];
  231. this.dangerAreaValue = '';
  232. let p = {
  233. 'parentCode': this.cityRegionValue
  234. }
  235. this.getDistrictRegion(p);
  236. this.pageCurrent = 1;
  237. this.list = [];
  238. this.query['dangerAreaCode'] = this.cityRegionValue;
  239. this.getPage({});
  240. },
  241. districtRegionChange(e) {
  242. if (e == undefined || e == null || e == '') {
  243. this.districtRegionValue = '';
  244. this.townRegionData = [];
  245. this.townRegionValue = '';
  246. this.countryRegionData = [];
  247. this.countryRegionValue = '';
  248. this.dangerAreaData = [];
  249. this.dangerAreaValue = '';
  250. this.pageCurrent = 1;
  251. this.list = [];
  252. if (this.permission.admin) {
  253. this.query['dangerAreaCode'] = this.cityRegionValue;
  254. } else {
  255. this.query = {};
  256. }
  257. this.getPage({});
  258. } else {
  259. this.districtRegionValue = e;
  260. this.townRegionData = [];
  261. this.townRegionValue = '';
  262. this.countryRegionData = [];
  263. this.countryRegionValue = '';
  264. this.dangerAreaData = [];
  265. this.dangerAreaValue = '';
  266. let p = {
  267. 'parentCode': this.districtRegionValue
  268. }
  269. this.getTownRegion(p);
  270. this.pageCurrent = 1;
  271. this.list = [];
  272. this.query['dangerAreaCode'] = this.districtRegionValue;
  273. this.getPage({});
  274. }
  275. },
  276. townRegionChange(e) {
  277. if (e == undefined || e == null || e == '') {
  278. this.townRegionValue = '';
  279. this.countryRegionData = [];
  280. this.countryRegionValue = '';
  281. this.dangerAreaData = [];
  282. this.dangerAreaValue = '';
  283. this.pageCurrent = 1;
  284. this.list = [];
  285. if (this.permission.admin || this.permission.orgAdmin) {
  286. this.query['dangerAreaCode'] = this.districtRegionValue;
  287. } else {
  288. this.query = {};
  289. }
  290. this.getPage({});
  291. } else {
  292. this.townRegionValue = e;
  293. this.countryRegionData = [];
  294. this.countryRegionValue = '';
  295. this.dangerAreaData = [];
  296. this.dangerAreaValue = '';
  297. let p = {
  298. 'parentCode': this.townRegionValue
  299. }
  300. this.getCountryRegion(p);
  301. this.pageCurrent = 1;
  302. this.list = [];
  303. this.query['dangerAreaCode'] = this.townRegionValue;
  304. this.getPage({});
  305. }
  306. },
  307. countryRegionChange(e) {
  308. if (e == undefined || e == null || e == '') {
  309. this.countryRegionValue = '';
  310. this.dangerAreaValue = '';
  311. this.dangerAreaData = [];
  312. this.dangerAreaValue = '';
  313. this.pageCurrent = 1;
  314. this.list = [];
  315. this.query['dangerAreaCode'] = this.townRegionValue;
  316. this.getPage({});
  317. } else {
  318. this.countryRegionValue = e;
  319. this.dangerAreaValue = '';
  320. this.dangerAreaData = [];
  321. this.dangerAreaValue = '';
  322. this.getDangerAreaList({
  323. 'adcd': this.countryRegionValue
  324. })
  325. this.pageCurrent = 1;
  326. this.list = [];
  327. this.query['dangerAreaCode'] = this.countryRegionValue;
  328. this.getPage({});
  329. }
  330. },
  331. dangerAreaChange(e) {
  332. if (e == undefined || e == null || e == '') {
  333. this.dangerAreaValue = '';
  334. this.pageCurrent = 1;
  335. this.list = [];
  336. this.getPage({});
  337. } else {
  338. this.dangerAreaValue = e;
  339. this.pageCurrent = 1;
  340. this.list = [];
  341. this.getPage({
  342. dangerAreaPid: this.dangerAreaValue
  343. });
  344. }
  345. },
  346. getCityRegion(params = {}) {
  347. let that = this;
  348. http.request({
  349. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  350. method: 'GET',
  351. data: params,
  352. }).then(res => {
  353. that.cityRegionData = res.data.map(item => {
  354. return {
  355. value: item.adcd,
  356. text: item.adnm,
  357. }
  358. })
  359. }).catch(err => {
  360. console.log(err)
  361. })
  362. },
  363. getDistrictRegion(params = {}) {
  364. let that = this;
  365. http.request({
  366. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  367. method: 'GET',
  368. data: params,
  369. }).then(res => {
  370. that.districtRegionData = res.data.map(item => {
  371. return {
  372. value: item.adcd,
  373. text: item.adnm,
  374. }
  375. })
  376. }).catch(err => {
  377. console.log(err)
  378. })
  379. },
  380. getTownRegion(params = {}) {
  381. let that = this;
  382. http.request({
  383. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  384. method: 'GET',
  385. data: params,
  386. }).then(res => {
  387. that.townRegionData = res.data.map(item => {
  388. return {
  389. value: item.adcd,
  390. text: item.adnm,
  391. }
  392. })
  393. }).catch(err => {
  394. console.log(err)
  395. })
  396. },
  397. getCountryRegion(params = {}) {
  398. let that = this;
  399. http.request({
  400. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  401. method: 'GET',
  402. data: params,
  403. }).then(res => {
  404. that.countryRegionData = res.data.map(item => {
  405. return {
  406. value: item.adcd,
  407. text: item.adnm,
  408. }
  409. })
  410. }).catch(err => {
  411. console.log(err)
  412. })
  413. },
  414. getDangerAreaList(params = {}) {
  415. let postData = Object.assign(params, this.query);
  416. let that = this;
  417. http.request({
  418. url: '/galaxy-business/map/dangerarea/select',
  419. method: 'GET',
  420. data: postData,
  421. }).then(res => {
  422. that.dangerAreaData = res.data.map(item => {
  423. return {
  424. value: item.dangerAreaPid,
  425. text: item.dangerAreaName,
  426. }
  427. })
  428. }).catch(err => {
  429. console.log(err)
  430. })
  431. },
  432. personNameValInput(e) {
  433. if (e == null || e == '' || e.length == 0) {
  434. this.personNameVal = '';
  435. this.pageCurrent = 1;
  436. let params = {};
  437. if (this.dangerAreaValue != '' && this.dangerAreaValue.length > 0) {
  438. params['dangerAreaPid'] = this.dangerAreaValue;
  439. }
  440. this.getPage(params);
  441. }
  442. },
  443. search() {
  444. this.pageCurrent = 1;
  445. let params = {};
  446. if (this.dangerAreaValue != '' && this.dangerAreaValue.length > 0) {
  447. params['dangerAreaPid'] = this.dangerAreaValue;
  448. }
  449. if (this.personNameVal != '' && this.personNameVal.length > 0) {
  450. params['personName'] = this.personNameVal;
  451. }
  452. this.getPage(params);
  453. },
  454. onResetLocationClick(item) {
  455. var url = '/pages/yjxt/resident/dangerarearesidentlocation?type=2&id=' + item.id + '&lng=' + item
  456. .longitude +
  457. '&lat=' + item.latitude + '&add=' + item.address;
  458. uni.navigateTo({
  459. url: url
  460. })
  461. },
  462. onOpenFamilyListClick(item) {
  463. var url = '/pages/yjxt/resident/dangerarearesidentfamilylist?personId=' + item.personId;
  464. uni.navigateTo({
  465. url: url
  466. })
  467. },
  468. getPage(params = {}) {
  469. const current = this.pageCurrent;
  470. const size = this.pageSize;
  471. let postData = Object.assign(params, this.query);
  472. http.request({
  473. url: '/galaxy-business/yj/resident/page',
  474. method: 'GET',
  475. params: {
  476. current,
  477. size,
  478. },
  479. data: postData,
  480. }).then(res => {
  481. if (res.data.records != null) {
  482. // that.list = res.data.records.map(item => {
  483. // let id = item.personId.replace(/^(\d{6})\d+(\d{4})$/, '$1******$2')
  484. // return {
  485. // ...item,
  486. // 'pId': id
  487. // }
  488. // })
  489. this.list = res.data.records;
  490. }
  491. this.total = res.data.total;
  492. }).catch(err => {
  493. console.log(err)
  494. }).finally(() => {
  495. })
  496. },
  497. }
  498. }
  499. </script>
  500. <style lang="scss" scoped>
  501. </style>