index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="content main">
  3. <organ-tree @organId="currentOrganId" :buildingType="1"></organ-tree>
  4. <div class="content-right">
  5. <div class="search">
  6. <el-input clearable placeholder="输入姓名/手机号" class="search-input" v-trim v-model.trim="mixins_query.name"></el-input>
  7. <el-select v-model="mixins_query.householdType" clearable placeholder="住户类型">
  8. <el-option v-for="(item, index) in householdType" :key="index" :label="item.label" :value="item.status">{{
  9. item.label
  10. }}</el-option>
  11. </el-select>
  12. <el-button
  13. class="search-btn"
  14. type="primary"
  15. @click="mixins_search()"
  16. :disabled="mixins_onQuery"
  17. :loading="mixins_onQuery"
  18. icon="el-icon-search"
  19. >搜索</el-button
  20. >
  21. </div>
  22. <zz-table
  23. :settings="{ showIndex: true, stripe: true }"
  24. :cols="cols"
  25. :loading="mixins_onQuery"
  26. :data="mixins_list"
  27. :pageset="mixins_pageset"
  28. @page-change="pageChange"
  29. >
  30. <template slot-scope="scope" slot="roomNumber">
  31. <div class="table-list" v-for="(item, index) in scope.row.houseList" :key="index">
  32. {{ item.buildingName }}-{{ CheckChinese(item.unitName, '单元') }}-{{ item.roomNumber }}
  33. </div>
  34. </template>
  35. <template slot-scope="scope" slot="householdType">
  36. <div class="table-list" v-for="(item, index) in scope.row.houseList" :key="index">
  37. <template v-if="item.householdType === 1"> 业主 </template>
  38. <template v-else-if="item.householdType === 2"> 亲属 </template>
  39. <template v-else> 租客 </template>
  40. </div>
  41. </template>
  42. <template slot-scope="scope" slot="faceStatus">
  43. <span v-if="scope.row.faceStatus == 1" class="mainText">启用</span>
  44. <span v-else-if="scope.row.faceStatus == 0" class="redText">禁用</span>
  45. </template>
  46. <template slot-scope="scope" slot="appStatus">
  47. <span v-if="scope.row.appStatus == 1" class="mainText">启用</span>
  48. <span v-else-if="scope.row.appStatus == 0" class="redText">禁用</span>
  49. </template>
  50. <template slot-scope="scope" slot="opt">
  51. <div class="opt">
  52. <el-tooltip class="item" effect="light" placement="bottom" content="查看">
  53. <i class="zoniot_font zoniot-icon-xiangqing" @click="lookPage(scope.row)"></i>
  54. </el-tooltip>
  55. </div>
  56. </template>
  57. </zz-table>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import list from '@utils/list.js';
  63. export default {
  64. mixins: [list],
  65. data() {
  66. return {
  67. currentId: '',
  68. cols: [
  69. {
  70. label: '姓名',
  71. prop: 'name'
  72. },
  73. {
  74. label: '手机号',
  75. prop: 'phone'
  76. },
  77. {
  78. label: '身份证号',
  79. prop: 'idNumber'
  80. },
  81. {
  82. label: '社区名称',
  83. prop: 'communityName'
  84. },
  85. {
  86. label: '住户类型',
  87. prop: 'householdType',
  88. slot: 'householdType'
  89. },
  90. {
  91. label: '房屋地址',
  92. prop: 'roomNumber',
  93. slot: 'roomNumber'
  94. },
  95. {
  96. label: '人脸授权',
  97. prop: 'faceStatus',
  98. slot: 'faceStatus'
  99. },
  100. {
  101. label: 'app授权',
  102. prop: 'appStatus',
  103. slot: 'appStatus'
  104. },
  105. {
  106. label: '门禁卡数量',
  107. prop: 'cardNum',
  108. },
  109. {
  110. label: '操作',
  111. slot: 'opt',
  112. width: 130
  113. }
  114. ],
  115. householdType: [
  116. {
  117. status: 1,
  118. label: '业主'
  119. },
  120. {
  121. status: 2,
  122. label: '亲属'
  123. },
  124. {
  125. status: 3,
  126. label: '租客'
  127. }
  128. ],
  129. thisLeftData: {},
  130. mixins_post: 'get'
  131. };
  132. },
  133. methods: {
  134. lookPage(row) {
  135. this.$router.push({
  136. path: '/ownerManagement/details',
  137. query: {
  138. id: row.id
  139. }
  140. });
  141. },
  142. currentOrganId(data) {
  143. this.currentId = data || '';
  144. },
  145. CheckChinese(val, name) {
  146. var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
  147. let newVal = val;
  148. if (!reg.test(val)) {
  149. newVal = val + name;
  150. }
  151. return newVal;
  152. },
  153. checkDateType(time) {
  154. return !!time ? this.$moment(new Date(time)).format('YYYY-MM-DD') : '--';
  155. }
  156. },
  157. watch: {
  158. currentId(newValue, oldValue) {
  159. this.mixins_query.communityId = '';
  160. this.mixins_query.buildingId = '';
  161. this.mixins_query.unitName = '';
  162. this.mixins_query.roomNumber = '';
  163. if (newValue.type) {
  164. let newValueIds = newValue.id.split('-');
  165. if (newValue.type === 'community') {
  166. this.mixins_query.communityId = newValueIds[0];
  167. } else if (newValue.type === 'building') {
  168. this.mixins_query.buildingId = newValueIds[1];
  169. } else if (newValue.type === 'unit') {
  170. this.mixins_query.buildingId = newValueIds[1];
  171. this.mixins_query.unitName = newValueIds[2];
  172. } else if (newValue.type === 'room') {
  173. this.mixins_query.roomNumber = newValueIds[newValueIds.length - 1];
  174. }
  175. }
  176. this.thisLeftData = newValue;
  177. this.mixins_search();
  178. }
  179. },
  180. created() {
  181. this.mixins_dataUrl = '/sc-gate-web/auth/userPage'; // 分页查询接口
  182. this.mixins_query = {};
  183. this.mixins_search('search');
  184. }
  185. };
  186. </script>
  187. <style lang="scss" scoped>
  188. @import '../style.scss';
  189. .table-list {
  190. padding-bottom: 16px;
  191. display: flex;
  192. justify-content: space-between;
  193. &:last-child {
  194. padding: 0;
  195. }
  196. }
  197. </style>