authen.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="car">
  3. <!-- 列表 -->
  4. <view class="carlists">
  5. <box-list :datainfo="list" :rylxList="rylxList" :voList="voList" :wtdt="wtdt" type='authen' @getDetail="getDetail" @getDelFn="getDelFn"></box-list>
  6. <!-- <car-list :datainfo="list" :ygztList="ygztList" :yglbList="yglbList" :wtdt="wtdt" type='rzstaff' @getDetail="getDetail" @getDelFn="getDelFn" @getShFn="getShFn"></car-list> -->
  7. </view>
  8. <block>
  9. <view style="height: 100rpx;"></view>
  10. <view class="rfbtn" @click="getAddFn">添加认证信息</view>
  11. </block>
  12. <loading></loading>
  13. </view>
  14. </template>
  15. <script>
  16. import config from '@/config'
  17. const baseUrl = config.baseUrl
  18. import boxList from "@/mine/components/box/list.vue"
  19. import {gettenantList} from "@/api/login.js"
  20. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  21. import {residentInfoDel,listAuthentication,deleteResident} from "@/api/work/people.js"
  22. import {getDictionaryFn} from "@/api/system/user.js"
  23. export default{
  24. components:{boxList},
  25. data(){
  26. return{
  27. list:[],
  28. pageSize: 10,
  29. pageNum: 1,
  30. reachflag: true,
  31. wtdt:'',
  32. userId:this.$store.state.user.userId,
  33. rylxList:[],
  34. voList:[],
  35. }
  36. },
  37. onUnload() {
  38. uni.$off('residentInfoList')
  39. },
  40. onLoad: function() {
  41. uni.$on('residentInfoList',(res)=>{
  42. this.getrefreshData()
  43. })
  44. this.init();
  45. this.gettenantList()
  46. this.getDataFn();
  47. },
  48. // 上拉触底加载更多触发事件
  49. onReachBottom() {
  50. if (this.reachflag) {
  51. this.pageNum++
  52. this.getDataFn()
  53. }
  54. },
  55. methods:{
  56. checkPermi, checkRole,
  57. getTabFn(val){
  58. this.tabval=val;
  59. this.getrefreshData()
  60. },
  61. getrefreshData(){
  62. this.pageNum=1;
  63. this.list=[];
  64. this.reachflag=true;
  65. this.getDataFn()
  66. },
  67. getDelFn(data){
  68. var that=this;
  69. var info=JSON.parse(JSON.stringify(data))
  70. var params={
  71. residentId:info.residentId,
  72. userId:info.userId,
  73. tenantId:info.tenantId,
  74. examine:info.examine,
  75. houseId:info.houseId,
  76. }
  77. deleteResident(params).then(res=>{
  78. if(res.code==200){
  79. this.$toast("删除成功");
  80. setTimeout(function(){
  81. that.getrefreshData()
  82. },1500)
  83. }
  84. })
  85. },
  86. // 获取租户列表
  87. gettenantList(){
  88. gettenantList().then(res=>{
  89. if(res.code==200){
  90. if(res.data.voList&&res.data.voList.length){
  91. this.voList = res.data.voList.map(v => {
  92. return {
  93. dictLabel: v.companyName,
  94. dictValue: v.tenantId
  95. }
  96. })
  97. }
  98. }else{
  99. this.$toast(res.msg)
  100. }
  101. })
  102. },
  103. init(){
  104. getDictionaryFn('resident_Type').then(res=>{
  105. if(res.code==200){
  106. this.rylxList = res.data.map(v => {
  107. return {
  108. dictLabel: v.dictLabel,
  109. dictValue: v.dictValue
  110. }
  111. })
  112. }
  113. })
  114. },
  115. getShFn(data){
  116. var that=this;
  117. var info=JSON.parse(JSON.stringify(data))
  118. var ite=JSON.parse(JSON.stringify(info.ite))
  119. var params={
  120. staffId:ite.staffId,
  121. userId:ite.userId,
  122. examine:info.sh
  123. }
  124. // params.examine=info.sh;
  125. examineStaff(params).then(res=>{
  126. if(res.code==200){
  127. this.$toast('审核成功')
  128. setTimeout(function(){
  129. that.getrefreshData()
  130. },1200)
  131. }
  132. })
  133. },
  134. getAddFn(){
  135. var type='rzadd';
  136. this.$tab.navigateTo(`/mine/pages/info/authenadd?type=${type}`)
  137. // if(this.list&&this.list.length){
  138. // var id=this.list[0].residentId
  139. // this.$tab.navigateTo(`/mine/pages/info/authenadd?type=${type}&id=${id}`)
  140. // }else{
  141. // this.$tab.navigateTo(`/mine/pages/info/authenadd?type=${type}`)
  142. // }
  143. },
  144. getDetail(e){
  145. this.$tab.navigateTo("/mine/pages/info/authenadd?type=rz&id="+e)
  146. },
  147. getDataFn(){
  148. var params={
  149. pageSize:this.pageSize,
  150. pageNum: this.pageNum,
  151. userId:this.userId
  152. }
  153. // if(this.text){
  154. // params.staffName=this.text
  155. // }
  156. // if(this.sfxx){
  157. // params.staffCategory=this.sfxxid
  158. // }
  159. listAuthentication(params).then(res=>{
  160. if(res.code==200){
  161. if (res.rows.length < this.pageSize) {
  162. this.reachflag = false
  163. this.wtdt = '到底了~';
  164. } else {
  165. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  166. if (num < res.total) {
  167. this.reachflag = true
  168. this.wtdt = ''
  169. } else {
  170. this.reachflag = false
  171. this.wtdt = '到底了~';
  172. }
  173. }
  174. var arr=JSON.parse(JSON.stringify((res.rows)))
  175. arr.forEach(ite=>{
  176. ite.hideflag=true;
  177. if(ite.phoneNumber){
  178. ite.phoneNumbera=this.HideType(ite.phoneNumber)
  179. }
  180. // if(ite.idCard){
  181. // ite.idCarda=this.HideType(ite.idCard)
  182. // }
  183. })
  184. if (this.pageNum == 1) {
  185. this.list = arr;
  186. } else {
  187. this.list = this.list.concat(arr)
  188. }
  189. }else{
  190. this.$toast(res.msg)
  191. }
  192. })
  193. },
  194. getDelFn(data){
  195. var that=this;
  196. var info=JSON.parse(JSON.stringify(data))
  197. var params={
  198. residentId:info.residentId,
  199. userId:info.userId,
  200. tenantId:info.tenantId,
  201. houseId:info.houseId,
  202. examine:info.examine
  203. }
  204. residentInfoDel(info.residentId).then(res=>{
  205. if(res.code==200){
  206. this.$toast("删除成功");
  207. setTimeout(function(){
  208. that.getrefreshData()
  209. },1500)
  210. }
  211. })
  212. },
  213. HideType(data,flag,type){
  214. const firstPart = data.slice(0, 1);
  215. // 生成中间8位的星号
  216. const middlePart = '*'.repeat(data.length-2);
  217. // 获取后4位
  218. const lastPart = data.slice(data.length-1);
  219. var s= firstPart + middlePart + lastPart;
  220. return s
  221. },
  222. }
  223. }
  224. </script>
  225. <style>
  226. page{background: #F3F3F0;}
  227. </style>
  228. <style lang="scss" scoped>
  229. .car{padding: 12rpx 0 10rpx;}
  230. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  231. .topa{padding: 20rpx 20rpx 32rpx;
  232. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  233. .chekt{width: 150rpx;overflow: hidden;
  234. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  235. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  236. }
  237. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  238. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  239. input{flex: 1;font-size: 26rpx;color: #272727;}
  240. .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
  241. font-size: 26rpx;
  242. color: #FFFFFF;}
  243. }
  244. }
  245. .tablst{background: #F3F3F0;padding:24rpx 16rpx 26rpx 30rpx;overflow: auto;
  246. .tabs{height: 48rpx;background: #DADADA;border-radius: 24rpx;margin-right: 30rpx;font-weight: 500;display: flex;align-items: center;justify-content: center;padding: 0 24rpx;font-size: 26rpx;box-sizing: border-box;flex: 0 0 auto;color: #666666;
  247. &.act{border: 2rpx solid #0256FD;background: #FFFFFF;color: #0256FD;}
  248. }
  249. }
  250. }
  251. .carlists{padding: 0 18rpx;}
  252. </style>