authen.vue 6.6 KB

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