dangerarearesidentrecordlist.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 class="wrap">
  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. <view class="container">
  18. <uni-section title="查询" type="line">
  19. <view class="search-block">
  20. <view class="rtu-name">
  21. <uni-easyinput :styles="inputStyles" @input="adNameValInput" prefixIcon="search"
  22. v-model="adNameVal" placeholder="请录入行政区名称">
  23. </uni-easyinput>
  24. </view>
  25. <view class="rtu-name">
  26. <uni-easyinput :styles="inputStyles" @input="dangerAreaNameValInput" prefixIcon="search"
  27. v-model="dangerAreaNameVal" placeholder="请录入危险区名称">
  28. </uni-easyinput>
  29. </view>
  30. <view class="rtu-name">
  31. <uni-easyinput :styles="inputStyles" @input="personNameValInput" prefixIcon="search"
  32. v-model="personNameVal" placeholder="请录入户主名称">
  33. </uni-easyinput>
  34. </view>
  35. <view class="submit-btn">
  36. <button type="default" @click="search">查 询</button>
  37. </view>
  38. </view>
  39. </uni-section>
  40. <uni-list>
  41. <uni-list-item v-for="item in list" :key="item.id">
  42. <template v-slot:body>
  43. <view class="list-item-block">
  44. <view class="line">
  45. <text class="text text-ellipsis">行政区:{{item.adName}}</text>
  46. </view>
  47. <view class="line">
  48. <text class="text text-ellipsis">危险区:{{item.dangerAreaName}}</text>
  49. </view>
  50. <view class="line">
  51. <text class="text text-ellipsis">户主姓名:{{item.personName}}</text>
  52. </view>
  53. <view class="line">
  54. <text class="text text-ellipsis">身份证号:{{item.personId}}</text>
  55. </view>
  56. <view class="line">
  57. <text class="text text-ellipsis">住址经纬度:{{item.longitude}},{{item.latitude}}</text>
  58. </view>
  59. <view class="item-button-group" style="padding-right: 10px;">
  60. <view class="item-button mid-size" @click="onAddLocationClick(item)">
  61. <view class="items-line">
  62. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  63. <text class="button-text">定位补录</text>
  64. </view>
  65. </view>
  66. <view class="item-button mid-size" @click="onOpenFamilyListClick(item)">
  67. <view class="items-line">
  68. <uni-icons class="input-uni-icon" type="staff" size="18" color="coral" />
  69. <text class="button-text">家庭成员表</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. </uni-list-item>
  76. </uni-list>
  77. <uni-group>
  78. <view class="pagination-block">
  79. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  80. @change="pageChange" />
  81. </view>
  82. </uni-group>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. role
  89. } from "@/api/role.js";
  90. import http from '@/http/api.js';
  91. export default {
  92. components: {},
  93. onLoad(option) {
  94. this.query = {};
  95. this.query['isHouseholder'] = 1;
  96. },
  97. data() {
  98. return {
  99. title: '登记人员清单',
  100. pageSize: 10,
  101. pageCurrent: 1,
  102. total: 0,
  103. list: [],
  104. query: {},
  105. warnId: '',
  106. adNameVal: '',
  107. dangerAreaNameVal: '',
  108. personNameVal: '',
  109. inputStyles: {
  110. color: '#808080',
  111. borderColor: '#d3d3d3'
  112. },
  113. }
  114. },
  115. computed: {},
  116. onShow() {
  117. this.getPage();
  118. },
  119. methods: {
  120. toBack() {
  121. uni.navigateBack({
  122. delta: 1
  123. })
  124. },
  125. adNameValInput(e) {
  126. if (e == null || e.length == 0) {
  127. this.adNameVal = '';
  128. }
  129. },
  130. dangerAreaNameValInput(e) {
  131. if (e == null || e.length == 0) {
  132. this.dangerAreaNameVal = '';
  133. }
  134. },
  135. personNameValInput(e) {
  136. if (e == null || e.length == 0) {
  137. this.personNameVal = '';
  138. }
  139. },
  140. search() {
  141. this.pageCurrent = 1;
  142. let params = {};
  143. if (this.adNameVal.length > 0) {
  144. params['adName'] = this.adNameVal;
  145. }
  146. if (this.dangerAreaNameVal.length > 0) {
  147. params['dangerAreaName'] = this.dangerAreaNameVal;
  148. }
  149. if (this.personNameVal.length > 0) {
  150. params['personName'] = this.personNameVal;
  151. }
  152. this.getPage(params);
  153. },
  154. onAddLocationClick(item) {
  155. var url = '/pages/yjxt/resident/dangerarearesidentlocation?id=' + item.id + '&lng=' + item.longitude +
  156. '&lat=' + item.latitude;
  157. uni.navigateTo({
  158. url: url
  159. })
  160. },
  161. onOpenFamilyListClick(item) {
  162. var url = '/pages/yjxt/resident/dangerarearesidentfamilylist?personId=' + item.personId;
  163. uni.navigateTo({
  164. url: url
  165. })
  166. },
  167. pageChange(e) {
  168. this.pageCurrent = e.current;
  169. this.getPage()
  170. },
  171. getPage(params = {}) {
  172. const current = this.pageCurrent;
  173. const size = this.pageSize;
  174. let postData = Object.assign(params, this.query);
  175. let that = this;
  176. http.request({
  177. url: '/galaxy-business/yj/resident/page',
  178. method: 'GET',
  179. params: {
  180. current,
  181. size,
  182. },
  183. data: postData,
  184. }).then(res => {
  185. if (res.data.records != null) {
  186. that.list = res.data.records;
  187. }
  188. this.total = res.data.total;
  189. }).catch(err => {
  190. console.log(err)
  191. })
  192. },
  193. }
  194. }
  195. </script>
  196. <style lang="scss" scoped>
  197. </style>