authen.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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. }
  75. deleteResident(params).then(res=>{
  76. if(res.code==200){
  77. this.$toast("删除成功");
  78. setTimeout(function(){
  79. that.getrefreshData()
  80. },1500)
  81. }
  82. })
  83. },
  84. // 获取租户列表
  85. gettenantList(){
  86. gettenantList().then(res=>{
  87. if(res.code==200){
  88. if(res.data.voList&&res.data.voList.length){
  89. this.voList = res.data.voList.map(v => {
  90. return {
  91. dictLabel: v.companyName,
  92. dictValue: v.tenantId
  93. }
  94. })
  95. }
  96. }else{
  97. this.$toast(res.msg)
  98. }
  99. })
  100. },
  101. init(){
  102. getDictionaryFn('resident_Type').then(res=>{
  103. if(res.code==200){
  104. this.rylxList = res.data.map(v => {
  105. return {
  106. dictLabel: v.dictLabel,
  107. dictValue: v.dictValue
  108. }
  109. })
  110. }
  111. })
  112. },
  113. getShFn(data){
  114. var that=this;
  115. var info=JSON.parse(JSON.stringify(data))
  116. var ite=JSON.parse(JSON.stringify(info.ite))
  117. var params={
  118. staffId:ite.staffId,
  119. userId:ite.userId,
  120. examine:info.sh
  121. }
  122. // params.examine=info.sh;
  123. examineStaff(params).then(res=>{
  124. if(res.code==200){
  125. this.$toast('审核成功')
  126. setTimeout(function(){
  127. that.getrefreshData()
  128. },1200)
  129. }
  130. })
  131. },
  132. getAddFn(){
  133. var type='rzadd';
  134. this.$tab.navigateTo(`/mine/pages/info/authenadd?type=${type}`)
  135. // if(this.list&&this.list.length){
  136. // var id=this.list[0].residentId
  137. // this.$tab.navigateTo(`/mine/pages/info/authenadd?type=${type}&id=${id}`)
  138. // }else{
  139. // this.$tab.navigateTo(`/mine/pages/info/authenadd?type=${type}`)
  140. // }
  141. },
  142. getDetail(e){
  143. this.$tab.navigateTo("/mine/pages/info/authenadd?type=rz&id="+e)
  144. },
  145. getDataFn(){
  146. var params={
  147. pageSize:this.pageSize,
  148. pageNum: this.pageNum,
  149. userId:this.userId
  150. }
  151. // if(this.text){
  152. // params.staffName=this.text
  153. // }
  154. // if(this.sfxx){
  155. // params.staffCategory=this.sfxxid
  156. // }
  157. listAuthentication(params).then(res=>{
  158. if(res.code==200){
  159. if (res.rows.length < this.pageSize) {
  160. this.reachflag = false
  161. this.wtdt = '到底了~';
  162. } else {
  163. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  164. if (num < res.total) {
  165. this.reachflag = true
  166. this.wtdt = ''
  167. } else {
  168. this.reachflag = false
  169. this.wtdt = '到底了~';
  170. }
  171. }
  172. var arr=JSON.parse(JSON.stringify((res.rows)))
  173. arr.forEach(ite=>{
  174. ite.hideflag=true;
  175. if(ite.phoneNumber){
  176. ite.phoneNumbera=this.HideType(ite.phoneNumber)
  177. }
  178. // if(ite.idCard){
  179. // ite.idCarda=this.HideType(ite.idCard)
  180. // }
  181. })
  182. if (this.pageNum == 1) {
  183. this.list = arr;
  184. } else {
  185. this.list = this.list.concat(arr)
  186. }
  187. }else{
  188. this.$toast(res.msg)
  189. }
  190. })
  191. },
  192. getDelFn(data){
  193. var that=this;
  194. var info=JSON.parse(JSON.stringify(data))
  195. var params={
  196. staffId:info.staffId,
  197. userId:info.userId,
  198. tenantId:info.tenantId,
  199. }
  200. residentInfoDel(params).then(res=>{
  201. if(res.code==200){
  202. this.$toast("删除成功");
  203. setTimeout(function(){
  204. that.getrefreshData()
  205. },1500)
  206. }
  207. })
  208. },
  209. HideType(data,flag,type){
  210. const firstPart = data.slice(0, 1);
  211. // 生成中间8位的星号
  212. const middlePart = '*'.repeat(data.length-2);
  213. // 获取后4位
  214. const lastPart = data.slice(data.length-1);
  215. var s= firstPart + middlePart + lastPart;
  216. return s
  217. },
  218. }
  219. }
  220. </script>
  221. <style>
  222. page{background: #F3F3F0;}
  223. </style>
  224. <style lang="scss" scoped>
  225. .car{padding: 12rpx 0 10rpx;}
  226. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  227. .topa{padding: 20rpx 20rpx 32rpx;
  228. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  229. .chekt{width: 150rpx;overflow: hidden;
  230. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  231. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  232. }
  233. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  234. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  235. input{flex: 1;font-size: 26rpx;color: #272727;}
  236. .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
  237. font-size: 26rpx;
  238. color: #FFFFFF;}
  239. }
  240. }
  241. .tablst{background: #F3F3F0;padding:24rpx 16rpx 26rpx 30rpx;overflow: auto;
  242. .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;
  243. &.act{border: 2rpx solid #0256FD;background: #FFFFFF;color: #0256FD;}
  244. }
  245. }
  246. }
  247. .carlists{padding: 0 18rpx;}
  248. </style>